如何通过 IOS MSDK2.x 从 paypal 获取付款人 ID?

How to get payer id from paypal via IOS MSDK2.x?

我在将 Paypal IOS MSDK2.x 与 Kount 欺诈检查结合使用时遇到问题。

目前 MSDK2.x 将在委托 return 中进行付款确认

"- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment"


 in this format of PayPalPayment class
{
  "client": {
    "environment": "sandbox",
    "paypal_sdk_version": "2.0.0",
    "platform": "iOS",
    "product_name": "PayPal iOS SDK;"
  },
  "response": {
    "create_time": "2014-02-12T22:29:49Z",
    "id": "PAY-564191241M8701234KL57LXI",
    "intent": "sale",
    "state": "approved"
  },
  "response_type": "payment"
}

不包含信息 "Payer Id"。

要与 Konut 一起工作,Kount 服务器需要 "Payer Id" 在查询中为 provided/updated。这个"Payer Id"如果支付请求是通过网络表单发出的,paypal服务器将return一个URL这种格式

"http://<return_url>?paymentId=PAY-6RV70583SB702805EKEYSZ6Y&token=EC-60U79048BN7719609&PayerID=7E7MGXCWTTKK2"

我的问题是,如果付款请求是从运行 IOS MSDK2.x 的移动设备发送的,有人知道如何获取 "Payer Id" 吗?

非常感谢。

其实我已经解决了这个问题。只是没来得及在这里更新。

执行此操作的步骤是:

  1. 使用支付ID从这里获取安全令牌 “https://api.paypal.com/v1/oauth2/token” 将 "POST" 与您的贝宝私人令牌一起使用。

  2. 使用安全令牌获取付款人 ID。 https://api.paypal.com/v1/payments/payment/$your_payment_id"

您可以使用 curl_setopt 在 PHP 上完成这两个步骤。如果其他人遇到同样的问题,希望这对您有所帮助。

谢谢。