- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am integrating the Paypal REST api in a Flutter app and am successfully getting the "Approve" url when creating order. When I copy this link and open it in a browser it correctly shows me the details. But when I press 'Continue' for the payment I get redirected to the same 'approve' link again. The order does get authorised, but I am not sure how will I know if the authorisation was successful. I have mentioned the "Reply Url" in the Sandbox App Settings.
This is a sample response I get when I create order. Then the approve link is opened in the browser for further processing but it doesn't redirect back to another url.
{
"id": "xxxxxxxx",
"links": [
{
"href": "<a href="https://api.sandbox.paypal.com/v2/checkout/orders/xxxxxxx" target="_blank">https://api.sandbox.paypal.com/v2/checkout/orders/xxxxxxx</a>",
"rel": "self",
"method": "GET"
},
{
"href": "<a href="https://www.sandbox.paypal.com/checkoutnow?token=xxxxxxxx" target="_blank">https://www.sandbox.paypal.com/checkoutnow?token=xxxxxxxx</a>",
"rel": "approve",
"method": "GET"
},
{
"href": "<a href="https://api.sandbox.paypal.com/v2/checkout/orders/xxxxxxxx" target="_blank">https://api.sandbox.paypal.com/v2/checkout/orders/xxxxxxxx</a>",
"rel": "update",
"method": "PATCH"
},
{
"href": "<a href="https://api.sandbox.paypal.com/v2/checkout/orders/xxxxxxxxxx/capture" target="_blank">https://api.sandbox.paypal.com/v2/checkout/orders/xxxxxxxxxx/capture</a>",
"rel": "capture",
"method": "POST"
}
],
"status": "CREATED"
}
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if you are not using any client JS then you need to include return_url as part of the create order request - that's the only way it will redirect to the URL and one would know if the order was approved by the buyer/payer.
https://developer.paypal.com/docs/api/orders/v2/#definition-application_context
Let me know if you have any more questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are having similar issue. Trying to integrate Flutter using the Rest API's but not sure how to know of the success without a redirect url.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if you are not using any client JS then you need to include return_url as part of the create order request - that's the only way it will redirect to the URL and one would know if the order was approved by the buyer/payer.
https://developer.paypal.com/docs/api/orders/v2/#definition-application_context
Let me know if you have any more questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I having the same problem. I already put the return url and it still keep staying in the payment page after finish loading. This is my request body
paypalRequest.requestBody({
"intent": "CAPTURE",
"purchase_units": [
{
"amount": {
"currency_code": value,
"value": currency_code
}
}
],
"application_context": {
"user_action": "PAY_NOW",
"return_url ": "paypal://xxx.co",
"shipping_preference": "NO_SHIPPING"
},
});
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Platform Partner Fees - Sandbox in Sandbox Environment
- Paypal direct card payment while pressing checkout, white screen appears and keeps loading, in SDKs
- PAYER_ACTION_REQUIRED when creating order using REST API in REST APIs
- I am getting an "Uncaught Error: Expected an order id to be passed" in REST APIs
- Unprocessable Entity when creating order from Billing Agreement in REST APIs