Adding payment option to cart

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!
User avatar
matish
Posts: 32
Joined: 04 Nov 2025, 11:52

Adding payment option to cart

Post by matish » 01 Jan 2026, 12:39

I am trying to add a payment option to the cart using this link:
https://aimeos.org/docs/latest/frontend ... -services/

But I fail.
Can you check the picture and tell what am I doing wrong.
I am supplying only service.id because I feel like the other attributes are not mandatory.

Picture:
Image

User avatar
matish
Posts: 32
Joined: 04 Nov 2025, 11:52

Re: Adding payment option to cart

Post by matish » 01 Jan 2026, 12:47

Posted data:

Code: Select all

{"data":[{"id":"payment","attributes":{"service.id":"2"}}]}
Post URL:

Code: Select all

https://aimeos.priit.yt.lan/jsonapi/basket?id=default&related=service&relatedid=payment&_token=He0bIHUxa4vlT2z2zpjhvFDddeOsjXVfctCo0bfF
Response HTTP500 with original Aimeos Server saying in the logs:

Code: Select all

Teenuse kehtetud atribuudid 
#0 /home/developer/sites/aimeos_main/vendor/aimeos/ai-controller-frontend/src/Controller/Frontend/Basket/Decorator/

User avatar
matish
Posts: 32
Joined: 04 Nov 2025, 11:52

Re: Adding payment option to cart

Post by matish » 01 Jan 2026, 12:57

Ok, fiddled with the code inside file:

Code: Select all

~/vendor/aimeos/ai-controller-frontend/src/Controller/Frontend/Basket/Standard.php
And came up with errors like these:

Code: Select all

[2026-01-01 12:53:33] local.DEBUG: body: ["<pre>Array
(
    [directdebit.accountowner] =&gt; Configuration for &quot;directdebit.accountowner&quot; is missing
    [directdebit.accountno] =&gt; Configuration for &quot;directdebit.accountno&quot; is missing
    [directdebit.bankcode] =&gt; Configuration for &quot;directdebit.bankcode&quot; is missing
    [directdebit.bankname] =&gt; Configuration for &quot;directdebit.bankname&quot; is missing
)
</pre>"] 
Where can I enter these? I can not see any fields in admin panel for them.
Also how can I make aimeos more informative? Do not want to manually edit files to get actual error causes.

User avatar
matish
Posts: 32
Joined: 04 Nov 2025, 11:52

Re: Adding payment option to cart

Post by matish » 01 Jan 2026, 13:18

I changed payment to "PostPay" and now I managed to set the payment option.
Finally managed to place first order over the API.

But I would like to do it in such a way that I make shipping cost = 0, but actual shipping line item would be added on top of order as separate invoice row line.
Same would apply to payment option.
Is there an easy way to do this?

Post Reply