After payment (redirect to the payment page), the cart is not cleared

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
rud99
Posts: 10
Joined: 21 Mar 2022, 10:38

After payment (redirect to the payment page), the cart is not cleared

Post by rud99 » 21 Mar 2022, 10:44

Hello!
After payment (redirect to the payment page), the cart is not cleared.
The order is created in the system, but the basket is not cleared.
This is a part of my method "process" in my provider:

Code: Select all

        if (isset($response->status) && $response->status === CheckoutStatus::Created) {
            $order->setPaymentStatus(\Aimeos\MShop\Order\Item\Base::PAY_PENDING);
            $this->saveOrder($order);

            if (isset($response->links)) {
                $link = collect($response->links)->filter(function ($item) {
                    return isset($item->rel) && $item->rel === 'approve';
                })->first();

                if (!$link || !isset($link->href)) {
                    return back();
                }

                return new \Aimeos\MShop\Common\Helper\Form\Standard($link->href, 'GET');
            }

        }
What could be the problem? Thanks!

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

Re: After payment (redirect to the payment page), the cart is not cleared

Post by aimeos » 21 Mar 2022, 10:49

The basket is cleared using this code:
https://github.com/aimeos/ai-client-htm ... #L333-L337

If you have a custom implementation, you need to use it to clear the basket afterwards.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rud99
Posts: 10
Joined: 21 Mar 2022, 10:38

Re: After payment (redirect to the payment page), the cart is not cleared

Post by rud99 » 22 Mar 2022, 11:37

Thanks, aimeos!
The issue was resolved like this:
After payment, the bank gateway should redirect the customer to the successful checkout page(url). I didn't have this page(url).
I provided the payment gateway this address (https://mysuperpuperaimeostestshop/shop ... y_pay_type) to go after successful payment.

Now the basket is cleared after payment.

Post Reply