代码之家  ›  专栏  ›  技术社区  ›  Daniel Tao

如何通过IOSMSDK2.x从paypal获取付款人id?

  •  2
  • Daniel Tao  · 技术社区  · 11 年前

    我在使用Paypal IOS MSDK2.x和Kount欺诈检查时遇到了一个问题。

    目前,MSDK2.x将在代理中返回付款确认

    "- (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"
    }
    

    其中不包括信息“付款人Id”。

    为了与Konut合作,Kount服务器需要在查询中提供/更新“付款人Id”。如果通过web表单进行付款请求,paypal服务器将返回此格式的URL,则可以获得此“付款人Id”

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

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

    非常感谢。

    1 回复  |  直到 11 年前
        1
  •  0
  •   Daniel Tao    10 年前

    事实上我已经解决了这个问题。只是没有时间在这里更新。

    执行此操作的步骤如下:

    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上执行这两个步骤。如果其他人有同样的问题,希望这会有所帮助。

    谢谢

    推荐文章