Adjust inventory/database after payment status is paid

Hi there.

I’m working on a payment system (Mollie). I want the inventory of a product to go down after every order. So I added a workflow to do that, but of course, it only needs to happen when the order is paid. The mollie/payment API sends back this information correctly (payment status changes from open to paid in my database after it is paid successfully).
However, when I add the condition “only when step 1 (create order)’s status is paid", it does not work. It simply doesn’t change the inventory, however without the “only when” condition, it works (so the inventory goes down, but of course I just want that to happen if the order is paid/completed). Am I using the wrong approach here? Or did I make an error? I really hope someone has a clue, because I don’t…

Thomas

How quickly does Mollie update the status of the payment?

First is goes to “open”, as soon as the pay now button is clicked. Then it goes to paid when it’s completed, that happens instantly.

It might be that the create payment part of your workflow triggers and the user starts payment, but the subsequent actions in your workflow continue before the payment is completed.

Perhaps setup a complementary backend workflow to monitor for that status to change to paid and then trigger.

It seems that attempting this while creating an order leaves room for unsuccessful execution of the condition.

What @cmarchan is correct…another thing you may look into is if there are webhooks for Mollie, which can also be used to trigger a backend workflow

1 Like

@boston85719 @cmarchan Thanks for your help. It worked! I had to use the “database trigger event”.

This topic was automatically closed after 70 days. New replies are no longer allowed.