Advertisement
Guest User

seb alipay

a guest
Mar 21st, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.58 KB | None | 0 0
  1.     @IBAction func createAlipaySource(_ sender: UIButton) {
  2.         let sourceParams = STPSourceParams.alipayParams(withAmount: 1000, currency: "usd", returnURL: "PteAppDemo://stripe-redirect")
  3.         STPAPIClient.shared().createSource(with: sourceParams) { (source, error) in
  4.             if let error = error {
  5.                 print(error.localizedDescription)
  6.             } else {
  7.                 if let alipayUrl = source?.redirect?.url {
  8.                     UIApplication.shared.open(alipayUrl, options: [:], completionHandler: nil)
  9.                 }
  10.             }
  11.         }
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement