Adding payment option to cart
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!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Adding payment option to cart
You must request the link to the "thank you" page available in the create order response. This will call updateSync() in your payment service provider where you can update the order payment status:
https://aimeos.org/docs/latest/frontend ... nt-gateway
https://aimeos.org/docs/latest/frontend ... nt-gateway
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
Re: Adding payment option to cart
I tried that approach, but it does not seem to work.aimeos wrote: ↑06 Feb 2026, 09:09 You must request the link to the "thank you" page available in the create order response. This will call updateSync() in your payment service provider where you can update the order payment status:
https://aimeos.org/docs/latest/frontend ... nt-gateway
Requests themselves pass just fine, but visiting the link from $response['data']['links']['process']['href'] does not put the order into authorized state. Instead it says that Order ID is not available.
All other cart manipulations work great, meaning that session itself must be there. Maybe are there separate sessions for API and regular frontend?
So I am back to square one with this.
Re: Adding payment option to cart
It needs the session cookie, so make sure you send it with the request.
If you use different domains for API and the checkout/confirm page, the browser may not send the cookie to the server due to domain mismatch.
If you use different domains for API and the checkout/confirm page, the browser may not send the cookie to the server due to domain mismatch.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
Re: Adding payment option to cart
But I have cookies enabled. Without them API requests would fail, especially when adding items to cart.
Maybe there are different cookies between frontend and JSON API? I would like to trigger that updateSync() method via JSON API not via the $response['data']['links']['process']['href'] link, that fails with the error I wrote about two posts above.
Re: Adding payment option to cart
The cookie is the same so it shares the same session but it seems to be missing in your case when you request the $response['data']['links']['process']['href'] link.
There's no JSON API for the checkout/confirm page because most of the payment providers require to redirect to a public page.
There's no JSON API for the checkout/confirm page because most of the payment providers require to redirect to a public page.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
Re: Adding payment option to cart
Thanks for that information. For now I will put a pin on that, since I already moved forward trying to integrate it with Magento.
For now I can say that cookies are being sent. Are they proper or not, I have not investigated, but I do know that the client instance is the same that fires requests toward JSON API. So in theory the session should be there.
Maybe later I will inspect, if someone specifically is interested.
For now I can say that cookies are being sent. Are they proper or not, I have not investigated, but I do know that the client instance is the same that fires requests toward JSON API. So in theory the session should be there.
Maybe later I will inspect, if someone specifically is interested.