Trigger some actions when 100% sure an order is paid

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!
sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

Trigger some actions when 100% sure an order is paid

Post by sixbynine » 18 Jul 2018, 08:41

I would like to start some actions automatically when I'm 100% sure that an order is paid and done (i.e. creating a pdf invoice and make it available in the personnal account, sending the order details to the delivery team, sending a email containing a coupon code, etc.).

Is there a good pratice in Aimeos for that, I mean i.e. something like the (really nice) basket plug-in event system ? Where/how can I add my custom options for paid orders?

I read about the "Remove unpaid orders" job controller. What do you think would be the best recurrence setting for this job? If it is short (like every 5 minutes), maybe, the best idea would be to remove unpaid order AND also execute my custom options on paid ones? Btw, i'm also wondering if this job will send an e-mail to warn the user that his order has been cancelled.

I'm not really used to managing credit card payments, so I'm also wondering how easy can an order be cancelled when the payment is received and how often a payment status could be "pending" and what happens in those cases.

Thank you very much for your help and your suggestions,

sbn

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

Re: Trigger some actions when 100% sure an order is paid

Post by aimeos » 19 Jul 2018, 10:17

sixbynine wrote:I would like to start some actions automatically when I'm 100% sure that an order is paid and done (i.e. creating a pdf invoice and make it available in the personnal account, sending the order details to the delivery team, sending a email containing a coupon code, etc.).
The best way would be to create a job controller that checks if all entries you require are available in the mshop_order_status table for that orders. For performance reasons, you should limit the query by requiring a payment date only a few days ago.
sixbynine wrote:I read about the "Remove unpaid orders" job controller. What do you think would be the best recurrence setting for this job? If it is short (like every 5 minutes), maybe, the best idea would be to remove unpaid order AND also execute my custom options on paid ones? Btw, i'm also wondering if this job will send an e-mail to warn the user that his order has been cancelled.
Wouldn't recommend that job controller because it should only be executed once a day and it retrieves all orders you don't need. If orders are cancelled, you can configure to send an e-mail to the customers informing them about that.
sixbynine wrote:I'm not really used to managing credit card payments, so I'm also wondering how easy can an order be cancelled when the payment is received and how often a payment status could be "pending" and what happens in those cases.
You have to refund the payment in the backend of your payment service provider. Then, the PSP will usually notify the shop about the payment status change (which can then trigger an e-mail to the customer that the payment has been refunded for that order).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply