Issue with Order Status Remaining "Unfinished" When Paying via Gift Cards (Total = 0)

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
Paulus-Ragnarr
Posts: 25
Joined: 15 Oct 2024, 07:02

Issue with Order Status Remaining "Unfinished" When Paying via Gift Cards (Total = 0)

Post by Paulus-Ragnarr » 14 Feb 2025, 05:08

Hi,

I’m encountering an issue with processing orders paid via gift cards. The total amount to be paid is set to `0`, but when attempting to complete the order, the order status remains "unfinished."

We are using the **JSON:API** for this integration. Could you clarify the required use case or steps to ensure the order status updates correctly in this scenario?

Thank you for your assistance!

Code: Select all


Aimeos version: Aimeos Headless 2024.10.*
PHP version: 8.2
Environment: Mac


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

Re: Issue with Order Status Remaining "Unfinished" When Paying via Gift Cards (Total = 0)

Post by aimeos » 17 Feb 2025, 10:40

The payment status depends on the payment service provider that is used in the order and you also need one if the total amount is 0.00. You can also create your own service provider for such scenarios:
https://aimeos.org/docs/latest/provider ... e/payment/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Paulus-Ragnarr
Posts: 25
Joined: 15 Oct 2024, 07:02

Re: Issue with Order Status Remaining "Unfinished" When Paying via Gift Cards (Total = 0)

Post by Paulus-Ragnarr » 19 Feb 2025, 06:10

Hi,

I haven't created a payment service provider for gift card payments, but when an order is fully paid using a gift card (bringing the total to 0), the payment status is set to "authorized." Do I need to create a provider for this scenario? Is there any reference code I can look at?

Additionally, after the order is authorized, all order total values are set to 0.00. Is this expected behavior, or does a payment provider need to handle gift card payments properly?

Example:

Ordered Product Price: $39.00
Paid using Gift Card: $50.00
Screenshot 2025-02-19 at 1.52.32 PM.png
Screenshot 2025-02-19 at 1.52.32 PM.png (86.43 KiB) Viewed 27292 times
Would appreciate any insights on how to handle this correctly. Thanks!

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

Re: Issue with Order Status Remaining "Unfinished" When Paying via Gift Cards (Total = 0)

Post by aimeos » 20 Feb 2025, 12:26

Paulus-Ragnarr wrote: 19 Feb 2025, 06:10 I haven't created a payment service provider for gift card payments, but when an order is fully paid using a gift card (bringing the total to 0), the payment status is set to "authorized." Do I need to create a provider for this scenario? Is there any reference code I can look at?

Additionally, after the order is authorized, all order total values are set to 0.00. Is this expected behavior, or does a payment provider need to handle gift card payments properly?
If the payment status is "authorized" everything is correct and the total values need to be 0.00.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
Paulus-Ragnarr
Posts: 25
Joined: 15 Oct 2024, 07:02

Re: Issue with Order Status Remaining "Unfinished" When Paying via Gift Cards (Total = 0)

Post by Paulus-Ragnarr » 06 Mar 2025, 03:15

Hi, I have a question.

What is the expected result of the order values when an order is paid using a gift card? Is it correct that the order price and cost are set to 0?
Screenshot 2025-03-06 at 11.07.18 AM.png
Screenshot 2025-03-06 at 11.07.18 AM.png (31.11 KiB) Viewed 25856 times

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

Re: Issue with Order Status Remaining "Unfinished" When Paying via Gift Cards (Total = 0)

Post by aimeos » 07 Mar 2025, 11:36

Yes, that's correct and the price+costs are added as rebate.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply