PAYPAL REST API Redirect approved transaction to capture URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
This is my first post here 🙂
Unfortunately, after a long research I could not find the answer for my question in the forum.
I am currently integrating the REST API V2 in an e-commerce application and in principle it works fine, but not the way it is supposed to.
According to the documentation I am using the following steps:
1. Create order with user data and purchase details in the backend (nodejs)
2. Upon successful order creation, the front-end receives the approve_url and capture_url
3. The user is redirected to the approve_url and login with its credentials, and in case it is successful, the user is redirected to the predefined return_url (which is defined in the step 1)
4. If the user agrees with the order, the capture_url is called and the corresponding amount is transferred.
Since the data returned by the order is not persistent (url is being redirected), I am saving the order id and the capture_link in the local storage, which I don't think it is correct. Therefore, I have two questions:
1. Upon successful approval of the purchase, is it possible to redirect the user directly to capture?
2. If not, how can I get the order_id details in the return_url?
Thanks in advance,
Victor Tolentino
- Labels:
-
Payments REST APIs
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.