mollie / WooCommerce

Official Mollie extension for WooCommerce
https://wordpress.org/plugins/mollie-payments-for-woocommerce/
Other
129 stars 52 forks source link

orderNeedsPayment check: yes, not processed by Mollie gateway. #244

Closed codeagencybe closed 5 years ago

codeagencybe commented 5 years ago

Hello,

We notice some issues with some payments. Some clients have reported back that they can not finish the payment on the Mollie checkout popup. After that, they return back to shop and the order status is "waiting payment".

It does not happen always, which makes it difficult to troubleshoot, but from the wc logs, I can find back this error exactly for those orders that have issues:

orderNeedsPayment check: yes, not processed by Mollie gateway.

From what I understand, it says Mollie just did not process the payment, but it does not report back why, what reason, ... When I check the order details and transaction ID, I can see that the begin time to end time is exactly 1 hour. So my first idea is that some customers wait too long, but the customers we talked with say it's not true and they tried payment immediately without any delay. So that means that the information coming back from Mollie has some kind of delay reporting back an end time which is always exactly 60 minutes later.

I'm scratching my head to figure out what the heck is going on, but I can not find any clear clue. Does anybody else has anything similar going on? Are there issues known with specific payment methods?

For reference, I'm pasting the full log from 10th September

Thanks in advance!

2018-09-10T21:12:50+00:00 DEBUG mollie_wc_gateway_kbc: Start process_payment for order 12310 2018-09-10T21:12:50+00:00 DEBUG getUserMollieCustomerId: Created a Mollie Customer (cst_Q3rgfQ6zUr) for WordPress user with ID 20 (live). 2018-09-10T21:12:50+00:00 DEBUG mollie_wc_gateway_kbc: Order 12310 webhookUrl: https://.......................shop/wc-api/mollie_wc_gateway_kbc/?order_id=12310&key=wc_order_5b96c1bdace26 2018-09-10T21:12:50+00:00 DEBUG mollie_wc_gateway_kbc: Create payment for order 12310 2018-09-10T21:12:57+00:00 DEBUG mollie_wc_gateway_kbc: Payment tr_HgsHq6Kb6E (live) created for order 12310 2018-09-10T21:12:57+00:00 DEBUG For order 12310 redirect user to Mollie Checkout URL: https://www.kbc.be/olpayment?olpVer=3.0&olpId=S131&langWebSite=N&olpCtx=EZ6lBbd9P9dalRr6gF73RQ98b0UgXvkJxBU6SQAOIqe7DdWPVS32Bqnshwqra222sJ2Ujz%2FRBRQx9%2FzZm5vM7Joo4kNxAmV%2ByZzhAED8Ati6S9gtI%2BtOtYgYrP6muABD9FB%2Be04rTSwapf53wrC0QCIBxtua5UY3dHk8aHMArb75DOl437YUIolZx32smqXVN6qPyFODVT%2F0iMDieEUjTSMSiFB0YHGQmaUP3yObFTa7CouaJvFGMZV8Zypyqnx%2FWWcxwAQBOma%2FL3cQn6Vi%2FEfvkKANBP9BOks2h4fx7%2Fkt8fFY9b7BFV0qLhWOljFxyUS4C17JejvgkV5JAoMnSDwZjvxqpCvG9gHWfrZPJG0NXDE%3D 2018-09-10T21:20:37+00:00 DEBUG mollie_wc_gateway_kbc: Start process_payment for order 12311 2018-09-10T21:20:37+00:00 DEBUG getUserMollieCustomerId: Mollie Customer ID (cst_Q3rgfQ6zUr) found and valid for user 20 on this API key. (live). 2018-09-10T21:20:37+00:00 DEBUG mollie_wc_gateway_kbc: Order 12311 webhookUrl: https://......................shop/wc-api/mollie_wc_gateway_kbc/?order_id=12311&key=wc_order_5b96c3943e73e 2018-09-10T21:20:37+00:00 DEBUG mollie_wc_gateway_kbc: Create payment for order 12311 2018-09-10T21:20:44+00:00 DEBUG mollie_wc_gateway_kbc: Payment tr_KRgJApf5EU (live) created for order 12311 2018-09-10T21:20:44+00:00 DEBUG For order 12311 redirect user to Mollie Checkout URL: https://www.kbc.be/olpayment?olpVer=3.0&olpId=S131&langWebSite=N&olpCtx=085nKJh2WV0Dva6taFCbYjDgRE8TRHKTTOQTXv5%2Fbxt1%2BucVN1OWoUbePQLye5f29oIz3Lgrx3fS8AuLpWtpw8GcsD0lCMoeQuQk%2B7RfSi9QfDV%2F21Bw%2FJfIvL%2BqFBtucZDGuHWWYYtfvuE%2FGwPVrS6UrZ2lVIp32p6EnLyB95MkeaNVnbbGQ023sgnKzqa98adVr6PIQ4aTgyfNw8z7WZVRu%2FQ8nfw0WRJg9esZ6GOV1%2FbdjOvrOTDYAPkOSlouKPC0yimGD36pU%2FtS%2Baxj6S9Tbj6XBibxyUZDClVZN2DTv1BQgutqzr07dHsF0eo52LqQVmxC45hdFYkZ5Jx2OaW9oUsqc%2FpEealoq0QQ9XdayBA%3D 2018-09-10T22:13:09+00:00 DEBUG mollie_wc_gateway_kbc: Mollie payment tr_HgsHq6Kb6E (live) webhook call for order 12310. 2018-09-10T22:13:09+00:00 DEBUG mollie_wc_gateway_kbc: Order 12310 orderNeedsPayment check: yes, not processed by Mollie gateway. 2018-09-10T22:13:09+00:00 DEBUG Mollie_WC_Gateway_Abstract::onWebhookExpired called for order 12310 2018-09-10T22:21:06+00:00 DEBUG mollie_wc_gateway_kbc: Mollie payment tr_KRgJApf5EU (live) webhook call for order 12311. 2018-09-10T22:21:06+00:00 DEBUG mollie_wc_gateway_kbc: Order 12311 orderNeedsPayment check: yes, not processed by Mollie gateway. 2018-09-10T22:21:06+00:00 DEBUG Mollie_WC_Gateway_Abstract::onWebhookExpired called for order 12311

schermafbeelding 2018-09-12 om 19 34 11

davdebcom commented 5 years ago

Hi @codeagencybe

I think "orderNeedsPayment check: yes, not processed by Mollie gateway." does not mean what you think it means. It's a log message for the check whether an order needs a payment. So, the check is actually saying, yes, this order needs a payment, because it was not processed/paid previously by a Mollie gateway.

I'll add that clarification to the log message, the "previously" part.

Ok, let's find out what is happening.

Some clients have reported back that they can not finish the payment on the Mollie checkout popup.

There shouldn't be a popup but a full redirect to the Mollie Checkout. Is the popup created by some custom code?

Reading your description it seems people can't make a payment, and the payment expires after sometime. This is when Mollie will call the webhook/website. In the log this is "Mollie_WC_Gateway_Abstract::onWebhookExpired called for order 12310".

there was no know issue on September 10th with KBC, so I am assuming it's not a system failure on KBC's end.

So that means that the information coming back from Mollie has some kind of delay reporting back an end time which is always exactly 60 minutes later.

Yes, that's probably the payment expiring.

Let me know about the popup and we will continue from there.

Kind regards David

codeagencybe commented 5 years ago

Hello David,

So it's nothing about a payment failure at all. OK, that explains better, thanks! 💯

About the popup, sorry I expressed myself wrong with that. You are right, it is a redirect indeed. With popup I mean the window where you select the payment method (that is what I remembered during the sandbox testing)

So the flow is from WooCommerce, customer select payment method (e.g. KBC) and confirm order. Now they redirect to the screen where they finish the transaction and somewhere from that moment something goes wrong.

The few issues we got back, is that it's a specific method. It happens both to KBC, Belfius and Bancontact so I can not narrow it down to 1 specifics. And for some it works, others it don't even for the same payment method.

The problem is I can not replicate it on my end myself. Whenever I do a payment test, it just works. My customer also tried it, same thing also works just fine.

But for some clients it does not work and they are 100% sure they did not wait too long, the process just fails somewhere. And eventually we get the reporting back to WooCommerce shop which is always 1 hour later. I have out of my head 7 orders, 4 different customers and all of them show exactly 1 hour delay reporting transaction_expired

That can be no coincidence.

So how to take it from here? Is there anything else I can give you or sent privately by email?

Here are 2 more copies from WC orders from SAME customer trying to pay. As you can see, for both orders it's exactly 61 minutes delay.

Mollie – KBC/CBC Betaalknop betaling verlopen (tr_HgsHq6Kb6E). toegevoegd op 10/09/2018 om 22:13 Notitie verwijderen Mollie – KBC/CBC Betaalknop betaling gestart (tr_HgsHq6Kb6E). toegevoegd op 10/09/2018 om 21:12 Notitie verwijderen

Mollie – KBC/CBC Betaalknop betaling verlopen (tr_KRgJApf5EU). toegevoegd op 10/09/2018 om 22:21 Notitie verwijderen Mollie – KBC/CBC Betaalknop betaling gestart (tr_KRgJApf5EU). toegevoegd op 10/09/2018 om 21:20 Notitie verwijderen

davdebcom commented 5 years ago

What is the status of those payments in the Mollie Dashboard? tr_HgsHq6Kb6E tr_KRgJApf5EU

codeagencybe commented 5 years ago

I can not see it, I will have to ask my customer if he can look up and report back.

Is there a way so I can check a status via API? I have postman on my computer and I have the API keys from the project.

davdebcom commented 5 years ago

Go to https://api.mollie.com/v2/payments/tr_HgsHq6Kb6E https://api.mollie.com/v2/payments/tr_KRgJApf5EU

Enter API key as username.

codeagencybe commented 5 years ago

{"resource":"payment","id":"tr_HgsHq6Kb6E","mode":"live","createdAt":"2018-09-10T19:12:50+00:00","amount":{"value":"479.16","currency":"EUR"},"description":"Bestelling 12310","method":"kbc","metadata":{"order_id":12310},"status":"expired","expiredAt":"2018-09-10T20:13:04+00:00","profileId":"pfl_4jv4MGGEDa","customerId":"cst_Q3rgfQ6zUr","sequenceType":"oneoff","redirectUrl":"https://xxxxxxxxx.shop/wc-api/mollie_return/?order_id=12310&key=wc_order_5b96c1bdace26","webhookUrl":"https://xxxxxxxxxxx.shop/wc-api/mollie_wc_gateway_kbc/?order_id=12310&key=wc_order_5b96c1bdace26","_links":{"self":{"href":"https://api.mollie.com/v2/payments/tr_HgsHq6Kb6E","type":"application/hal+json"},"customer":{"href":"https://api.mollie.com/v2/customers/cst_Q3rgfQ6zUr","type":"application/hal+json"},"documentation":{"href":"https://docs.mollie.com/reference/v2/payments-api/get-payment","type":"text/html"}}}

{"resource":"payment","id":"tr_KRgJApf5EU","mode":"live","createdAt":"2018-09-10T19:20:37+00:00","amount":{"value":"585.64","currency":"EUR"},"description":"Bestelling 12311","method":"kbc","metadata":{"order_id":12311},"status":"expired","expiredAt":"2018-09-10T20:21:03+00:00","profileId":"pfl_4jv4MGGEDa","customerId":"cst_Q3rgfQ6zUr","sequenceType":"oneoff","redirectUrl":"https://xxxxxxxxxxxxxxxx.shop/wc-api/mollie_return/?order_id=12311&key=wc_order_5b96c3943e73e","webhookUrl":"https://xxxxxxxxxxxxxxxx.shop/wc-api/mollie_wc_gateway_kbc/?order_id=12311&key=wc_order_5b96c3943e73e","_links":{"self":{"href":"https://api.mollie.com/v2/payments/tr_KRgJApf5EU","type":"application/hal+json"},"customer":{"href":"https://api.mollie.com/v2/customers/cst_Q3rgfQ6zUr","type":"application/hal+json"},"documentation":{"href":"https://docs.mollie.com/reference/v2/payments-api/get-payment","type":"text/html"}}}

davdebcom commented 5 years ago

I've asked Mollie to review the logs for these payments. I'll let you know what we find.

davdebcom commented 5 years ago

Discussed this with Mollie. It looks like the customers did go to Mollie form WooCommerce and after that to KBC. So it doesn't seem to be related to this plugin.

Mollie can see in the logs that the customers started the KBC payment, and didn't complete them. It's difficult for them to see why. The only way to find out is to gather more information from your customers. Things like: browser, operating system, did they see any errors, was the interrnet connection stable?

Please email me on mollie@paytium.nl if you have more information or questions.

codeagencybe commented 5 years ago

Hello @davdebcom

I'm opening this issue again as it seems the problem is not solved. Now the issue is happening with Bancontact payment method, and only with bancontact method since beginning of October. I don't if anything changed on Mollie API since, but now we see a lot errors in the WC logs as below.

So basically, the customer initiates the payment first time, but it gives issues and fails. The order is confirmed with status "pending payment" But some customers try again somewhere just some seconds later, and then payment succeeds. So I don't understand why it fails first time, but works second time??

From the logs, I can see now (just recently started since beginning October), this error line is reproducing a lot: Error executing API call (400: Bad Request): The amount is lower than the minimum.

Sidenote: I see this error now also appearing in other clients WC logs. Yet, nobody from other clients reported back issues with Bancontact (yet). But the logs are for sure filled a lot with this error line.

Which does not make any sense. The order amounts I'm seeing in backend are between 50 EUR and 300 EUR, which is absolutely suitable for Bancontact.

Any ideas please and a solution?

davdebcom commented 5 years ago

@codeagencybe Updating to 5.0 should solve this, please let me know if it doesn't.