1
votes

I'm testing Adaptive Payments of PayPal but I can't understand how I can have some valid data info from PayPal when user is redirect after success payment.

PayPal not return data to this URL ? I am forced to use IPN ? The fact that it is called "ReturnUrl" is in itself a reliable information? I have to make do by sending data via GET?

The only alternative is to use standard button with notify_url and redirect parameters with the PND ?

I'm so confused... :(

1

1 Answers

3
votes
  1. When the user returns the returnUrl endpoint, you make a call for the PaymentDetails API and check the status and proceed.
  2. To handle the corner case where the user might have paid but didn't return to your site, await the IPN message to proceed with your order shipment etc.,
  3. If the user cancels a payment they will be taken the cancelUrl endpoint and you can handle the flow accordingly
  4. In case of errors (like limit exceeded, currency not supported etc.,) the Pay operation will actually throw an error and you will be able to handle this as part of the error / exception catch flow.

Please use the following parameters when making the API call

returnUrl The URL to which the sender’s browser is redirected after approving a payment on paypal.com

cancelUrl The URL to which the sender’s browser is redirected if the sender cancels the approval for a payment on paypal.com.

ipnNotificationUrl The URL to which all IPN messages for this payment are sent

Suggest downloading the SDK and look at the samples that are bundled as part of it.

https://www.x.com/developers/paypal/documentation-tools/paypal-sdk-index