Closed ndijkstra closed 6 years ago
About statuses: https://www.mollie.com/nl/docs/status
The doc doesn't explicitly state that the webhook is called, but I am assuming it is. @ndijkstra maybe you can add that to the doc?
Is "Payment received" the only order note that is added? Is that the exact order note? Are you sure that order note is added by the webhook call for charged back (it wasn't aded earlier?)?
Does Mollie have a way to fake webhook calls (with status called_back) already? Or could you set one of my test payments to charged back (I'll give you the ID) so I can use that to test?
What's the content in WooCommerce > System status > Logs > mollie-payments-for-woocommerce...?
Hi,
I will make an internal issue for adding the information to our docs.
When the status is charged_back, the same order note is added when a payment is successful. The order note is created by the second webhook (same time).
Unfortunately we can not set the status to charged_back in testmode. (also created an internal issue for that)
The log tells us the same line as for a paid status (webhook called ...)
Thank you for creating those issues, especially setting the status to charged_back in testmode would be helpful.
The log doesn't have a message like this for that order?
Order $order_id does not need a payment (payment webhook {$payment->id}).
The issue seems to come from the check $this->orderNeedsPayment which triggers handlePayedOrderWebhook. https://github.com/mollie/WooCommerce/blob/master/mollie-payments-for-woocommerce/includes/mollie/wc/gateway/abstract.php#L670
In the base class it only sends the above message to the log. https://github.com/mollie/WooCommerce/blob/master/mollie-payments-for-woocommerce/includes/mollie/wc/gateway/abstract.php#L706
In the extended class Mollie_WC_Gateway_AbstractSepaRecurring it adds that order note. https://github.com/mollie/WooCommerce/blob/master/mollie-payments-for-woocommerce/includes/mollie/wc/gateway/abstractseparecurring.php#L206
I think that order note should never be set, I propose removing it. But actually, why do we need a handlePayedOrderWebhook at all? We should just let the status and onWebhookChargedBack (to be created) handle all situations.
Do you agree? And I would really like to be able to set payments to charged_back before I start work on this, can I wait for that?
@ndijkstra Any news on the option to set status charged_back for test payments?
I've created a solution for this. Because there is no official way to test the webhook call for 'charged_back' status I did a quick workaround to get as close to a good test situation as possible.
Hi @davdebcom
I understand the motives of this (going on hold instead of failed), because Mollie is going to make a second attempt for collection. But what happens if that also fails? The order status must be go on "failed" at some point, so the shop owner knows that there will be no more attempts for collection.
My primary concern is now with Moneybird plugin, the new update which will roll out soon, will have failed order support. In case an order fails, the payment inside the invoice will get deleted (making the corresponding invoice as not-paid). This is great news and what all wc-subscriptions users have been waiting for but the "automation" of accounting is hindered by your above solution.
I understand the motives of this (going on hold instead of failed), because Mollie is going to make a second attempt for collection. But what happens if that also fails? The order status must be go on "failed" at some point, so the shop owner knows that there will be no more attempts for collection.
No, this is a charge back, Mollie will not try again, the status is final. The order status is changed to "On Hold" because shop-owner will need to review such an order and decide what they want to do (contact the customer, change stock etc). The shop-owner can then change the status to "Failed" manually. Again, this is because charged back payments need shop-owner intervention.
This is great news and what all wc-subscriptions users have been waiting for but the "automation" of accounting is hindered by your above solution.
Well, actually I don't think so. The shop-owner reviews the orders with "On Hold" status and decides what should happen. He/she could set the status to Failed, and the MoneyBird workflow would be triggered.
Ahh got it. That is important indeed for physical products sold but not for digital products. But I can live with it. Thanks for the update.
@davdebcom This:
Is no longer working with the latest plugin version 5.0.2. Instead, it goes to to status complete
after chargedback.
Example payment_id: tr_6FnE3bRTtu
Log: 2018-10-22T05:07:00+00:00 DEBUG mollie_wc_gateway_ideal: Mollie payment object tr_6FnE3bRTtu (live) webhook call for order 43660. 2018-10-22T05:07:00+00:00 DEBUG Mollie_WC_Payment_PaymentMollie_WC_Payment_Payment::onWebhookPaid called for payment 43660 2018-10-22T05:07:00+00:00 DEBUG Mollie_WC_Payment_PaymentMollie_WC_Payment_Payment::onWebhookPaid WooCommerce payment_complete() processed and returned to Mollie_WC_Payment_Payment::onWebhookPaid for payment 43660 2018-10-22T05:07:00+00:00 DEBUG Mollie_WC_Payment_PaymentMollie_WC_Payment_Payment::onWebhookPaid processing paid payment via Mollie plugin fully completed for order 43660
When Mollie reports a payment as "charged_back", nothing happens with the order status in WooCommerce. Also an incorrect order note is added (Payment received)