简体   繁体   English

反应原生 - 使用 PayPal v2/orders 付款

[英]react native - payment with PayPal v2/orders

I am implementing PayPal in React Native, following the documentation for PayPal Payments v2 API我正在 React Native 中实现 PayPal,遵循PayPal Payments v2 API的文档

Here is the step by step of my checkout:这是我的结帐步骤:

  1. Use https://api.sandbox.paypal.com/v1/oauth2/token to get token.使用https://api.sandbox.paypal.com/v1/oauth2/token获取令牌。
  2. Use https://api.sandbox.paypal.com/v2/checkout/orders to create an order使用https://api.sandbox.paypal.com/v2/checkout/orders创建订单
  3. Use approve link for clients to accept payment使用批准链接让客户接受付款
  4. I set the return_url to be https://www.google.com/ .我将return_url设置为https://www.google.com/ After clients accept the payment, I receive the return_url https://www.google.com/?token=<order_id>&PayerID=<payer_id>客户接受付款后,我会收到return_url https://www.google.com/?token=<order_id>&PayerID=<payer_id>

At this point I'm stuck: how can I use the information order_id and payer_id ?在这一点上我被卡住了:我如何使用信息order_idpayer_id

The next step is to do av2/orders capture of that order_id下一步是对该order_id进行v2/orders 捕获

Assuming success, the response's payments -> capture -> id value is what you should persist in your database for accounting purposes, as this is what will be searchable as the Transaction ID in the paypal.com account.假设成功,响应的支付 -> 捕获 -> id 值是您应该保留在数据库中用于会计目的的值,因为这将作为 paypal.com 帐户中的交易 ID 进行搜索。

(The order_id has no accounting value, and should only be kept around ~1 month for debug purposes.) order_id没有记账价值,为了调试目的,应该只保留大约 1 个月。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM