Skip to content

Instantly share code, notes, and snippets.

import Foundation
import Stripe
struct StripeTools {
//store stripe secret key
private var stripeSecret = "mysecrettestkey"
//generate token each time you need to get an api call
func generateToken(card: STPCardParams, completion: (token: STPToken?) -> Void) {
import Foundation
import Stripe
class StripeUtil {
var stripeTool = StripeTools()
var customerId: String?
let defaultSession = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
var dataTask: NSURLSessionDataTask?
//
// ViewController.swift
// StripeTest
//
// Created by Guillaume Tellier on 15/04/2016.
// Copyright © 2016 Guillaume Tellier. All rights reserved.
//
import UIKit
import Stripe