Return URL generates 404 Page Not Found error and ends transaction

Created on 7 January 2015, almost 11 years ago
Updated 18 August 2025, about 2 months ago

Hi,
I have a new site running on the latest version of Commerce Kickstart, and am trying to use these PayPal modules built in to it to allow customers to "check out with PayPal." The button appears in the customer's cart, and when clicked, it sends them to PayPal's site to complete the transaction, and everything appears to work fine, but when they complete the transaction at PayPal and are returned to my site, they get a 404 Page Not Found error, and if they had been logged in, they're now logged out. They're unable to finish the order and their cart is empty. (This is using PayPal's Sandbox - I haven't tried it live yet.)

On my end, the order is saved but the status is "Checkout: Payment".

In the PayPal API request that's logged in Drupal's Recent Log Messages there's a line that says:
[RETURNURL] => https://www.DOMAIN.com/checkout/22/payment/return/(random letters & numbers)

Sure enough, the URL getting the 404 Not Found error is:
https://www.DOMAIN.com/checkout/22/payment/return/(same random letters & numbers as above)?token=EC-(more letters & numbers)&PayerID=(more letters & numbers)

(The stuff in the invalid URL after "payment/return/..." changes with each order number, and always matches the [RETURNURL] for that order.)

There are no other errors in my recent log messages. It looks to me like the RETURNURL is getting sent to PayPal successfully, but for some reason, when the customer comes back, Drupal doesn't know what to do with this URL. Also, it happens whether the customer is anonymous or logged in.

I've scoured the internet looking for an answer, and am out of ideas, but I really need to get this payment working, so any help you could provide would be very much appreciated! Thanks!

πŸ’¬ Support request
Status

Closed: outdated

Version

2.0

Component

PayPal EC

Created by

πŸ‡ΊπŸ‡ΈUnited States Nones

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024