Is it the right way to send orderID from the client and capture on the server?

aliyome
Contributor
Contributor

I have been working on a REST API v2 upgrade.

Although I read the developer's docs, I could not understand how to migrate my v1 app.

 

I have previously implemented the following using the REST API v1

 

  1. request a transaction to /v1/payments/payment on the client-side
  2. get the paymentID by the onAuthorize callback
  3. send the paymentID to my application server and request /v1/payments/payment/{paymentID}/execute on the server-side to finalize the payment

Now, I'm trying to implement the same process in v2.
I could do it in the following way, but is it the right way to send only the orderID to the server and capture it on the server-side?

 

  1. use the smart button on the client-side to order to PayPal
  2. get the orderID by the onApprove callback
  3. send orderID to my application server and request /v2/checkout/orders/{orderID}/capture on the server-side to finalize the payment

I'm worried because when I look up v2 implementations on the web, all I can find are ways to capture them on the client-side.

 

If anyone knows, please let me know.

Thank you.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.