not found order after payment redirection

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

not found order after payment redirection

Post by Ahmad » 02 Sep 2020, 15:19

i have my custom payment service provider, i successfully send payment request to payment provider but when payment provider redirect customer to payment.url-success i give this error: No order ID available
i check it and find that $session->get( 'aimeos/orderid' ) in the Checkout/Confirm/Order/Standard class return null.
why this happen?

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: not found order after payment redirection

Post by aimeos » 02 Sep 2020, 19:55

Is the session cookie not sent by the browser? Google Chrome has introduced a stricter sameSite cookie handling and that causes problems sometimes like the browser doesn't send the cookie to the site even if it should. You can get around that if you send "Set-cookie" explicitely with "SameSite=None".

This article explains how to use it for PHP and Laravel:
https://dev.to/zubairmohsin33/dealing-w ... aravel-pcb
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

Re: not found order after payment redirection

Post by Ahmad » 02 Sep 2020, 21:46

aimeos wrote: 02 Sep 2020, 19:55 Is the session cookie not sent by the browser? Google Chrome has introduced a stricter sameSite cookie handling and that causes problems sometimes like the browser doesn't send the cookie to the site even if it should. You can get around that if you send "Set-cookie" explicitely with "SameSite=None".

This article explains how to use it for PHP and Laravel:
https://dev.to/zubairmohsin33/dealing-w ... aravel-pcb
i do that but anything was not change, still when customer redirect from gateway to address ".../shop/confirm/payping-payment" get below error and the basket was cleared:

Code: Select all

No order ID available
A non-recoverable error occured
how can i fix it?

Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

Re: not found order after payment redirection

Post by Ahmad » 03 Sep 2020, 05:07

Ahmad wrote: 02 Sep 2020, 21:46
aimeos wrote: 02 Sep 2020, 19:55 Is the session cookie not sent by the browser? Google Chrome has introduced a stricter sameSite cookie handling and that causes problems sometimes like the browser doesn't send the cookie to the site even if it should. You can get around that if you send "Set-cookie" explicitely with "SameSite=None".

This article explains how to use it for PHP and Laravel:
https://dev.to/zubairmohsin33/dealing-w ... aravel-pcb
i do that but anything was not change, still when customer redirect from gateway to address ".../shop/confirm/payping-payment" get below error and the basket was cleared:

Code: Select all

No order ID available
A non-recoverable error occured
how can i fix it?
also when i change session.same_site=None and session.secure=true and then try to add product to basket get this exception error:

Code: Select all

exception: "Symfony\Component\HttpKernel\Exception\HttpException"
file: "C:\xampp\htdocs\shop\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php"
line: 226
message: "CSRF token mismatch."

Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

Re: not found order after payment redirection

Post by Ahmad » 07 Sep 2020, 05:48

i still have problem with clearing basket and session when user redirect back from payment gateway.
i explain that when i set same_site = None in session config of laravel this problem was solve but the add to basket and other actions in the shop failed because of csrf token mismatch error,
@aimeos please give me a solution to solve this problem.

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: not found order after payment redirection

Post by aimeos » 07 Sep 2020, 10:32

You have to whitelist the checkout confirm route:
https://laravel.com/docs/7.x/csrf#csrf-excluding-uris
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

Re: not found order after payment redirection

Post by Ahmad » 08 Sep 2020, 07:45

aimeos wrote: 07 Sep 2020, 10:32 You have to whitelist the checkout confirm route:
https://laravel.com/docs/7.x/csrf#csrf-excluding-uris
i think you don't understand my mean, please pay attention to this:
i change 'same_site' => 'none' in config/session.php file and secure = true, after this change the problem (session of 'aimeos/orderid' and basket session clear after customer redirect back from payment gateway to shop) was solved but in the other functions of shop application i get errors for "CSRF token mismatch." (for example please see error in attached images that is for when i click on add to basket botton)
Attachments
2020-09-08_12-08-32.jpg
2020-09-08_12-08-32.jpg (123.14 KiB) Viewed 3140 times
2020-09-08_12-08-20.jpg
2020-09-08_12-08-20.jpg (67.23 KiB) Viewed 3140 times

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: not found order after payment redirection

Post by aimeos » 08 Sep 2020, 15:20

Maybe you should ask your question in a Laravel forum.
The cookie is available and the token is sent according to your screenshots.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply