【问题标题】:Braintree iOS IntegrationBraintree iOS 集成
【发布时间】:2017-07-13 07:06:05
【问题描述】:

我正在尝试在 iOS 中实现支付。我在https://developers.braintreepayments.com/start/hello-client/ios/v4的帮助下尝试了你的沙盒测试

添加卡号“4111111111111111”后,我完全失明了下一步怎么办? 目前,我没有任何服务器。

问题:

1)卡“4111111111111111”的有效期是什么时候?

2) 添加刷卡后,下一步应该如何完成交易?

3) 交易成功需要自己的服务器吗?

谢谢,

【问题讨论】:

    标签: ios iphone swift payment-gateway braintree


    【解决方案1】:

    我在 Swift 中尝试过,它对我来说效果很好。我附上了下面的代码检查并让我知道:

        var braintree: Braintree?
         braintree = Braintree(clientToken: "")
    
    
    
        func userDidCancelPayment() {
            self.dismiss(animated: true, completion: nil)
        }
    
        func drop(_ viewController: BTDropInViewController!, didSucceedWith paymentMethod: BTPaymentMethod!) {
    
            print(paymentMethod.nonce)
    
            // Send payment method nonce to your server
    
            dismiss(animated: true, completion: nil)
            let alert = UIAlertController(title: "Alert", message: "Send payment method nonce to your server Sucessfully", preferredStyle: UIAlertControllerStyle.alert)
            alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil))
            self.present(alert, animated: true, completion: nil)
    
        }
    
     func tappedMyPayButton() 
    {
     let dropInViewController = braintree!.dropInViewController(with: self)
            dropInViewController.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action: #selector(PaymentVController.userDidCancelPayment))
    
            let navigationController = UINavigationController(rootViewController: dropInViewController)
            self.present(navigationController, animated: true, completion: nil)
        }
    
    
    
        func drop(inViewControllerDidCancel viewController: BTDropInViewController!) {
            dismiss(animated: true, completion: nil)
        }  
    

    签证:4242 4242 4242 4242 万事达卡:5555 5555 5555 4444 美国运通:3782 822463 10005 重要提示:在测试模式下使用任何未来的到期日期、卡上的姓名、CVC 和帐单邮编。

    【讨论】:

      猜你喜欢
      • 2016-11-06
      • 2015-05-26
      • 2018-09-30
      • 2016-05-06
      • 2014-12-13
      • 2015-10-08
      • 1970-01-01
      • 1970-01-01
      • 2019-02-19
      相关资源
      最近更新 更多