2017-03-15 12 views

答えて

2

チェクこの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) 

    }) 
} 
+0

確認のみ "completedPayment.confirmation" を得ることができます。 –