【问题标题】:PayPal Integration with IOS swiftPayPal 与 IOS swift 集成
【发布时间】:2017-08-06 02:14:17
【问题描述】:

支付成功后如何获取created_time和id?

我只能得到确认“completedPayment.confirmation”

【问题讨论】:

    标签: ios swift xcode paypal


    【解决方案1】:

    检查这个 PayPal 委托方法

    func payPalPaymentViewController(_ paymentViewController: PayPalPaymentViewController, didComplete completedPayment: PayPalPayment) 
    {
        print("PayPal Payment Success !")
        paymentViewController.dismiss(animated: true, completion: { () -> Void in
            // send completed confirmaion to your server
            print("Here is your proof of payment:\n\n\(completedPayment.confirmation)\n\nSend this to your server for confirmation and fulfillment.")
    
            let dict = completedPayment.confirmation
            print("dict data is ====%@", dict)
    
            let paymentResultDic = completedPayment.confirmation as NSDictionary
            let dicResponse: AnyObject? = paymentResultDic.object(forKey: "response") as AnyObject?
    
            let paycreatetime:String = dicResponse!["create_time"] as! String
            let payauid:String = dicResponse!["id"] as! String
            let paystate:String = dicResponse!["state"] as! String
            let payintent:String = dicResponse!["intent"] as! String
    
            print("id is  --->%@",payauid)
            print("created  time ---%@",paycreatetime)
            print("paystate is ----->%@",paystate)
            print("payintent is ----->%@",payintent)
    
        })
    }
    

    【讨论】:

      猜你喜欢
      • 2020-06-04
      • 2013-02-25
      • 2013-08-18
      • 2016-11-06
      • 2017-02-20
      • 2016-05-23
      • 2015-05-26
      • 2016-01-01
      • 1970-01-01
      相关资源
      最近更新 更多