PayPal Live webscr cart API send buyer back to cancel_return url instead of return url.

wartoshika
Contributor
Contributor

I am running a Shopsystem wich uses the PayPal Cart for the checkout process. 
There are two identical Setups, one talks to the sandbox, the other talks to the live API.

The interesting thing is that the sandox environment does its job correctly when the payment is either completed or aborted (Takes me to the correct destination). On the production environment the "Return to merchant" button always takes me back to the "payment aborted" url. I observed this exact problem in the sanbox a week ago but this problem disappeared.

 

In the production environment, an aborted payment will transfer to cancel_return (OK). A successful payment also transfers to cancel_return instead of return (NOT OK). The transaction was successful and Paypal does send an IPN message about half a minute later to the correct url (OK).

 

I am using these URLs and Payloads:
Sandbox: https://www.sandbox.paypal.com/cgi-bin/webscr

Live: https://www.paypal.com/cgi-bin/webscr

I have anonymised the payload data due to the customers privacy.

 

An example sandbox payload is:

 

business: payment-receiver@address
test_ipn: 1
custom: ShoppingCartId
notify_url: https://notify-ipn-url
return: https://successful-payment-url
cancel_return: https://canceled-payment-url
cmd: _cart
upload: 1
currency_code: EUR
invoice: Invoice-Number
handling_cart: 0.00
item_name_1: ArticleName
quantity_1: 1
amount_1: 12.34
mc_gross: 12.34
first_name: Jon
last_name: Doe
email: customer@email-address

 

 

and the production payload on the other hand:

 

business: payment-receiver@address
test_ipn: 0
custom: ShoppingCartId
notify_url: https://notify-ipn-url
return: https://successful-payment-url
cancel_return: https://canceled-payment-url
cmd: _cart
upload: 1
currency_code: EUR
invoice: Invoice-Number
handling_cart: 0.00
item_name_1: ArticleName
quantity_1: 1
amount_1: 12.34
mc_gross: 12.34
first_name: Jon
last_name: Doe
email: customer@email-address

 

 

Some words to the checkout process:

  1. Fill cart
  2. Select Payment (eg. PayPal)
  3. Press buy button (this is not a PayPal buy button, just a regular formular that sends data to my backend)
  4. Create an order item and redirects the customer to the paypal cart website. The payload is transported via the query string (urlencoded).

A full URL would be:

 

https://www.sandbox.paypal.com/cgi-bin/webscr?business=payment-receiver%40address&test_ipn=1&custom=ShoppingCartId&notify_url=https%3A%2F%2Fnotify-ipn-url&return=https%3A%2F%2Fsuccessful-payment-url&cancel_return=https%3A%2F%2Fcanceled-payment-url&cmd=_cart&upload=1&currency_code=EUR&invoice=Invoice-Number&handling_cart=0.00&item_name_1=ArticleName&quantity_1=1&amount_1=12.34&mc_gross=12.34&first_name=Jon&last_name=Doe&email=customer%40email-address

 

 

I have already read these questions, but they do not provide a solution for my problem:

 

Does any one of you have an idea why there is a different user experiance between sandbox and production?

Thanks in advance for any suggestion.

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

wartoshika
Contributor
Contributor

I was still unable to find a solution or a decent workarround. Since we need a working production environment we decided to implement the checkout v2 API.

 

In my case (PHP Backend) i used the "paypal/paypal-checkout-sdk" dependency.

 

Thanks to all who have tried to investigate this problem.

View solution in original post

Login to Me Too
1 REPLY 1
Solved

wartoshika
Contributor
Contributor

I was still unable to find a solution or a decent workarround. Since we need a working production environment we decided to implement the checkout v2 API.

 

In my case (PHP Backend) i used the "paypal/paypal-checkout-sdk" dependency.

 

Thanks to all who have tried to investigate this problem.

Login to Me Too

Haven't Found your Answer?

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