简体   繁体   中英

react native - payment with PayPal v2/orders

I am implementing PayPal in React Native, following the documentation for 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.
  2. Use https://api.sandbox.paypal.com/v2/checkout/orders to create an order
  3. Use approve link for clients to accept payment
  4. I set the return_url to be https://www.google.com/ . After clients accept the payment, I receive the 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 ?

The next step is to do av2/orders capture of that order_id

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.

(The order_id has no accounting value, and should only be kept around ~1 month for debug purposes.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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