Skip to content

Instantly share code, notes, and snippets.

//
// ViewController.swift
// StripeTest
//
// Created by Guillaume Tellier on 15/04/2016.
// Copyright © 2016 Guillaume Tellier. All rights reserved.
//
import UIKit
import Stripe
import Foundation
import Stripe
class StripeUtil {
var stripeTool = StripeTools()
var customerId: String?
let defaultSession = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
var dataTask: NSURLSessionDataTask?
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) {