This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Stripe | |
class StripeUtil { | |
var stripeTool = StripeTools() | |
var customerId: String? | |
let defaultSession = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration()) | |
var dataTask: NSURLSessionDataTask? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// StripeTest | |
// | |
// Created by Guillaume Tellier on 15/04/2016. | |
// Copyright © 2016 Guillaume Tellier. All rights reserved. | |
// | |
import UIKit | |
import Stripe |