Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rest API: Obtaining Payment ID after redirect back to merchant site

Tags:

rest

paypal

This question is specific to paying with a PayPal account.

So, here's the basic workflow:

  1. I initialize a payment and redirect the user to PayPal's authentication page.
  2. The user logs in and authorizes payment and is redirected back to the merchant site.
  3. The payment is executed by obtaining and passing the paymentId and the payerId along.

In step one, a payment id is returned before redirecting to PayPal's site for user authorization. In step three, I need the payment id from step one in order to successfully execute the payment. Is there a way to obtain the payment ID without storing it in a session? The *payer*Id is passed back as a URL parameter when redirecting back to the merchant site. There is also a token value passed along, but I'm not sure what that is used for. All I know is that it's not the paymentId that I'm looking for.

Any help would be greatly appreciated.

like image 471
w.brian Avatar asked Jan 31 '26 10:01

w.brian


1 Answers

Currently it has to be either session or DB or in similar lines. We suggest you generate a unique id for the transaction and use that to map to your PaymentId that you received in the response.

like image 92
Prasanna_PayPal Avatar answered Feb 02 '26 14:02

Prasanna_PayPal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!