# Paypal redirect after payment

**URL:** <https://forum.modmore.com/t/paypal-redirect-after-payment/2150>\
**Category:** Commerce\
**Created:** [November 16, 2020, 9:49pm UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150 "2020-11-16T21:49:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![desper](https://forum.modmore.com/user_avatar/forum.modmore.com/desper/32/554_2.png) [@desper](https://forum.modmore.com/u/desper)\
**Post date:** [November 16, 2020, 9:49pm UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150/1 "2020-11-16T21:49:06Z")

</div>

Hello,

The redirect after a finished paypal payment does not work for me. It’s always 404 ([https://www.sandbox.paypal.com/index.php?id=3&transaction=21&token=EC-0KD57450S80575435&PayerID=ZFMT25VSUAJWC](https://www.sandbox.paypal.com/index.php?id=3&transaction=21&token=EC-0KD57450S80575435&PayerID=ZFMT25VSUAJWC))

I am using the paypal Sandbox mode. Commerce is in Test Mode. Paypal Payment Method is in Test Mode as well. Website Payment Preferences; in Paypal Settings; is set to Auto Return “On” (modx cloud domain)

Is this problem Paypal Sandbox related?

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [November 16, 2020, 10:03pm UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150/2 "2020-11-16T22:03:14Z")

</div>

Are you saying that the url it sends you back to, after authorizing the payment, is on [sandbox.paypal.com](http://sandbox.paypal.com) rather than your own domain?

---

<div class="post-metadata">

**Author:** ![desper](https://forum.modmore.com/user_avatar/forum.modmore.com/desper/32/554_2.png) [@desper](https://forum.modmore.com/u/desper)\
**Post date:** [November 16, 2020, 10:43pm UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150/3 "2020-11-16T22:43:57Z")

</div>

Yes exactly

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [November 16, 2020, 11:11pm UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150/4 "2020-11-16T23:11:25Z")

</div>

I’ve never seen that type of behavior before.

Try disabling auto return in the paypal settings - Commerce will already provide the proper return url for each transaction and that paypal function is meant for.different use cases.

If that doesn’t help it would be worthwhile looking at how your site and context(s) are configured, especially if your site is multi context. Commerce uses the site url for the return url.

---

<div class="post-metadata">

**Author:** ![desper](https://forum.modmore.com/user_avatar/forum.modmore.com/desper/32/554_2.png) [@desper](https://forum.modmore.com/u/desper)\
**Post date:** [November 16, 2020, 11:27pm UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150/5 "2020-11-16T23:27:42Z")

</div>

Context setting was the problem. Thank You!

---

<div class="post-metadata">

**Author:** ![tommls](https://forum.modmore.com/letter_avatar_proxy/v4/letter/t/13edae/32.png) [@tommls](https://forum.modmore.com/u/tommls)\
**Post date:** [November 20, 2020, 12:10am UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150/6 "2020-11-20T00:10:14Z")

</div>

I am having the same problem. How do I figure out what/where is the problem?? The site context is the default web context…I think. I have two unused contexts but the whole store is in the web context and so far as I know I do not have any return URL configured in PayPal, I have the PP settings configured the same way as Steve.  
Thank you, Tom  
PP Sandbox credentials installed in the PP gateway.  
P.S. I don’t get a 404, it just never redirects, it just sits on the PP credit card page and I can’t log in with a PP ID either, returning to the merchant site nullifies the PP payment…So my problem is a bit different than Steve’s, Commerce is never redirecting back to the checkout thank you page…HELPPPPPP!!! 🙂 🙂

---

<div class="post-metadata">

**Author:** ![tommls](https://forum.modmore.com/letter_avatar_proxy/v4/letter/t/13edae/32.png) [@tommls](https://forum.modmore.com/u/tommls)\
**Post date:** [November 20, 2020, 12:31am UTC](https://forum.modmore.com/t/paypal-redirect-after-payment/2150/7 "2020-11-20T00:31:28Z")

</div>

If sandbox does not redirect back, how can I know that live PP will redirect back??  
I hope there is an easy fix!! 🙂 🙂  
Thank you, Tom
