Paypal iOS SDK - 验证付款

时间:2013-05-23 17:03:42

标签: ios paypal

我使用Paypal SDK接受信用卡。 成功付款后,我会收到PayPalPayment对象,该对象包含确认付款:

{
  "proof_of_payment": {
    "rest_api": {
      "state": "approved",
      "payment_id": "API-PAYMENT-ID-1843"
    }
  },
  "payment": {
    "short_description": "Hipster t-shirt",
    "amount": "9.95",
    "currency_code": "USD"
  },
  "client": {
    "platform": "iOS",
    "paypal_sdk_version": "1.0.0",
    "environment": "live",
    "product_name": "PayPal iOS SDK"
  }
}

要验证付款,我需要拨打API电话:

curl https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI \
 -H "Content-Type:application/json" \
 -H "Authorization:Bearer ENxom5Fof1KqAffEsXtxwEDa6E1HTEK__KVdIsaCYF8C"

我需要Authorization:Bearer param,我该如何获得它?

当我尝试在没有它的情况下进行API调用时,我得到空响应。

感谢。

1 个答案:

答案 0 :(得分:2)

这是来自PayPal的Josh。查看PayPal REST API authorization documentation。对于各种语言,还有helper SDKS available

相关问题