mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 50 forks source link

Second chance / reminder e-mail is send when payment succeeded #625

Closed mdesplenter closed 1 year ago

mdesplenter commented 1 year ago

Describe the bug Some users still receive a reminder e-mail when they already paid for the order. Checking the logs it seems that the webhook is returning a succes, but there is a second request, is that the one that tells Magento if the e-mail must be sended? Is that a call to Mollie when the user is brought back to the website? The webhook result should be enough for updating the order?

Used versions

To Reproduce Steps to reproduce the behavior:

  1. Users creates an order
  2. Pays in Mollie

Expected behavior Shouldn't receive a reminder e-mail

Actual behavior Receives a reminder e-mail

Log

A succesfull order without a reminder

[2023-03-28T12:14:33.948948+00:00] Mollie.INFO: request: {"amount":{"currency":"EUR","value":"92.95"},"description":"202304175","billingAddress":{"streetAndNumber”:”xxx”,”postalCode”:”xxx”,”city”:”xxx”,”region”:”xxx”,”country”:”NL},”redirectUrl":"https:\/\xxx.nl\/mollie\/checkout\/process\/?order_id=3700&payment_token=TOKENID&utm_nooverride=1","webhookUrl":"https:\/\/xxx.nl\/mollie\/checkout\/webhook\/?isAjax=1&orderId[]=xxx”,”method":"ideal","metadata":{"order_id":"3700","store_id":"1","payment_token”:”TOKEN”},”locale":null,"shippingAddress":{"streetAndNumber”:”xxx","postalCode”:”xxx”,”city”:”xxx”,”region”:”xxx”,”country":"NL"},"issuer":"ideal_RABONL2U"} [] [ [2023-03-28T12:14:34.590541+00:00] Mollie.INFO: response: {"resource":"payment","id":"tr_xxx”,”mode":"live","amount":{"value":"92.95","currency":"EUR"},"settlementAmount":{"value":"92.95","currency":"EUR"},"amountRefunded":null,"amountRemaining":null,"amountChargedBack":null,"description":"202304175","method":"ideal","status":"open","createdAt":"2023-03-28T12:14:34+00:00","paidAt":null,"canceledAt":null,"expiresAt":"2023-03-28T12:30:04+00:00","failedAt":null,"dueDate":null,"billingEmail":null,"profileId":"pfl_xxx”,”sequenceType":"oneoff","redirectUrl":"https:\/\/xxx.nl\/mollie\/checkout\/process\/?order_id=3700&payment_token=TOKEN&utm_nooverride=1","cancelUrl":null,"webhookUrl":"https:\/\/xxx.nl\/mollie\/checkout\/webhook\/?isAjax=1&orderId[]=ORDERID”,”mandateId":null,"subscriptionId":null,"orderId":null,"settlementId":null,"locale":null,"metadata":{"order_id":"3700","store_id":"1","payment_token”:”TOKEN”},”details":null,"restrictPaymentMethodsToCountry":null,"_links":{"self":{"href":"https:\/\/api.mollie.com\/v2\/payments\/tr_xxx”,”type":"application\/hal+json"},"checkout":{"href":"https:\/\/betalen.rabobank.nl\/ideal-betaling\/landingpage?random=RANDOMID&trxid=TRXID”,”type":"text\/html"},"dashboard":{"href":"https:\/\/my.mollie.com\/dashboard\/org_xxx\/payments\/tr_xxx”,”type":"text\/html"},"documentation":{"href":"https:\/\/docs.mollie.com\/reference\/v2\/payments-api\/create-payment","type":"text\/html"}},"_embedded":null,"isCancelable":false,"amountCaptured":null,"applicationFee":null,"routing":null,"authorizedAt":null,"expiredAt":null,"customerId":null,"countryCode":null} [] [] [2023-03-28T12:15:14.137571+00:00] Mollie.INFO: info: Locking: mollie.order.3700 [] [] [2023-03-28T12:15:14.256718+00:00] Mollie.INFO: webhook: {"resource":"payment","id":"tr_xxx”,”mode":"live","amount":{"value":"92.95","currency":"EUR"},"settlementAmount":{"value":"92.95","currency":"EUR"},"amountRefunded":{"value":"0.00","currency":"EUR"},"amountRemaining":{"value":"117.95","currency":"EUR"},"amountChargedBack":null,"description":"202304175","method":"ideal","status":"paid","createdAt":"2023-03-28T12:14:34+00:00","paidAt":"2023-03-28T12:15:13+00:00","canceledAt":null,"expiresAt":null,"failedAt":null,"dueDate":null,"billingEmail":null,"profileId":"pfl_xxx”,”sequenceType":"oneoff","redirectUrl":"https:\/\/xxx.nl\/mollie\/checkout\/process\/?order_id=xxx&payment_token=TOKEN&utm_nooverride=1","cancelUrl":null,"webhookUrl":"https:\/\/xxx.nl\/mollie\/checkout\/webhook\/?isAjax=1&orderId[]=xxx”,”mandateId":null,"subscriptionId":null,"orderId":null,"settlementId":null,"locale":null,"metadata":{"order_id":"3700","store_id":"1","payment_token”:”TOKEN”},”details":{"consumerName”:”xxx”,”consumerAccount”:”NLxxxxxxx,”consumerBic":"RABONL2U"},"restrictPaymentMethodsToCountry":null,"_links":{"self":{"href":"https:\/\/api.mollie.com\/v2\/payments\/tr_xxxx”,”type":"application\/hal+json"},"dashboard":{"href":"https:\/\/my.mollie.com\/dashboard\/org_xxx\/payments\/tr_xxx”,”type":"text\/html"},"documentation":{"href":"https:\/\/docs.mollie.com\/reference\/v2\/payments-api\/get-payment","type":"text\/html"}},"_embedded":null,"isCancelable":null,"amountCaptured":null,"applicationFee":null,"routing":null,"authorizedAt":null,"expiredAt":null,"customerId":null,"countryCode":null} [] [] [2023-03-28T12:15:16.134702+00:00] Mollie.INFO: success: {"success":true,"status":"paid","order_id":"3700","type":"webhook"} [] [] [2023-03-28T12:15:16.627078+00:00] Mollie.INFO: info: Unlocking: mollie.order.3700 [] [] [2023-03-28T12:15:16.627370+00:00] Mollie.INFO: info: Key "mollie.order.3700" unlocked [] [] [2023-03-28T12:15:17.028957+00:00] Mollie.INFO: info: Locking: mollie.order.3700 [] [] [2023-03-28T12:15:17.142543+00:00] Mollie.INFO: success: {"resource":"payment","id":"tr_xxxx”,”mode":"live","amount":{"value":"92.95","currency":"EUR"},"settlementAmount":{"value":"92.95","currency":"EUR"},"amountRefunded":{"value":"0.00","currency":"EUR"},"amountRemaining":{"value":"117.95","currency":"EUR"},"amountChargedBack":null,"description":"202304175","method":"ideal","status":"paid","createdAt":"2023-03-28T12:14:34+00:00","paidAt":"2023-03-28T12:15:13+00:00","canceledAt":null,"expiresAt":null,"failedAt":null,"dueDate":null,"billingEmail":null,"profileId":"pfl_xxx”,”sequenceType":"oneoff","redirectUrl":"https:\/\/xxx.nl\/mollie\/checkout\/process\/?order_id=3700&payment_token=TOKEN&utm_nooverride=1","cancelUrl":null,"webhookUrl":"https:\/\/xxx.nl\/mollie\/checkout\/webhook\/?isAjax=1&orderId[]=xxx”,”mandateId":null,"subscriptionId":null,"orderId":null,"settlementId":null,"locale":null,"metadata":{"order_id":"3700","store_id":"1","payment_token”:”xxx”},”details":{"consumerName”:”xxx","consumerAccount":"NLxxxxxxx”,”consumerBic":"RABONL2U"},"restrictPaymentMethodsToCountry":null,"_links":{"self":{"href":"https:\/\/api.mollie.com\/v2\/payments\/tr_xxx”,”type":"application\/hal+json"},"dashboard":{"href":"https:\/\/my.mollie.com\/dashboard\/org_xxx\/payments\/tr_xxx”,”type":"text\/html"},"documentation":{"href":"https:\/\/docs.mollie.com\/reference\/v2\/payments-api\/get-payment","type":"text\/html"}},"_embedded":null,"isCancelable":null,"amountCaptured":null,"applicationFee":null,"routing":null,"authorizedAt":null,"expiredAt":null,"customerId":null,"countryCode":"NL"} [] [] [2023-03-28T12:15:17.152197+00:00] Mollie.INFO: success: {"success":true,"status":"paid","order_id":"3700","type":"success"} [] [] [2023-03-28T12:15:17.173551+00:00] Mollie.INFO: info: Unlocking: mollie.order.3700 [] [] [2023-03-28T12:15:17.173836+00:00] Mollie.INFO: info: Key "mollie.order.3700" unlocked [] []

A succesfull order, but with a reminder

[2023-03-28T14:31:40.671018+00:00] Mollie.INFO: request: {"amount":{"currency":"EUR","value":"109.00"},"description":"202304177","billingAddress":{"streetAndNumber”:”xxx”,”postalCode”:”xxx”,”city”:”xxx”,”region”:”xxx”,”country":"NL"},"redirectUrl":"https:\/\/xxx.nl\/mollie\/checkout\/process\/?order_id=3702&payment_token=xxxxx&utm_nooverride=1","webhookUrl":"https:\/\/xxx.nl\/mollie\/checkout\/webhook\/?isAjax=1&orderId[]=xxx,”method":"ideal","metadata":{"order_id":"3702","store_id":"1","payment_token”:”TOKEN”},”locale":null,"shippingAddress":{"streetAndNumber”:”xxx”,”postalCode”:”xxx”,”city”:”xxx","region”:”xxx”,”country":"NL"},"issuer":"ideal_INGBNL2A"} [] [] [2023-03-28T14:31:41.371131+00:00] Mollie.INFO: response: {"resource":"payment","id":"tr_xxx”,”mode":"live","amount":{"value":"109.00","currency":"EUR"},"settlementAmount":{"value":"109.00","currency":"EUR"},"amountRefunded":null,"amountRemaining":null,"amountChargedBack":null,"description":"202304177","method":"ideal","status":"open","createdAt":"2023-03-28T14:31:40+00:00","paidAt":null,"canceledAt":null,"expiresAt":"2023-03-28T14:47:10+00:00","failedAt":null,"dueDate":null,"billingEmail":null,"profileId":"pfl_xxx”,”sequenceType":"oneoff","redirectUrl":"https:\/\/xxx.nl\/mollie\/checkout\/process\/?order_id=3702&payment_token=xxx&utm_nooverride=1","cancelUrl":null,"webhookUrl":"https:\/\/xxx.nl\/mollie\/checkout\/webhook\/?isAjax=1&orderId[]=xxx”,”mandateId":null,"subscriptionId":null,"orderId":null,"settlementId":null,"locale":null,"metadata":{"order_id":"3702","store_id":"1","payment_token”:”xxx”},”details":null,"restrictPaymentMethodsToCountry":null,"_links":{"self":{"href":"https:\/\/api.mollie.com\/v2\/payments\/tr_xxx”,”type":"application\/hal+json"},"checkout":{"href":"https:\/\/ideal.ing.nl\/ideal\/static\/detect\/detect_mob?trxid=xxx&random=xxx”,”type":"text\/html"},"dashboard":{"href":"https:\/\/my.mollie.com\/dashboard\/org_xxx\/payments\/tr_xxx”,”type":"text\/html"},"documentation":{"href":"https:\/\/docs.mollie.com\/reference\/v2\/payments-api\/create-payment","type":"text\/html"}},"_embedded":null,"isCancelable":false,"amountCaptured":null,"applicationFee":null,"routing":null,"authorizedAt":null,"expiredAt":null,"customerId":null,"countryCode":null} [] [] [2023-03-28T14:32:09.946047+00:00] Mollie.INFO: info: Locking: mollie.order.3702 [] [] [2023-03-28T14:32:10.046613+00:00] Mollie.INFO: webhook: {"resource":"payment","id":"tr_xxx”,”mode":"live","amount":{"value":"109.00","currency":"EUR"},"settlementAmount":{"value":"109.00","currency":"EUR"},"amountRefunded":{"value":"0.00","currency":"EUR"},"amountRemaining":{"value":"134.00","currency":"EUR"},"amountChargedBack":null,"description":"202304177","method":"ideal","status":"paid","createdAt":"2023-03-28T14:31:40+00:00","paidAt":"2023-03-28T14:32:09+00:00","canceledAt":null,"expiresAt":null,"failedAt":null,"dueDate":null,"billingEmail":null,"profileId":"pfl_xxx”,”sequenceType":"oneoff","redirectUrl":"https:\/\/xxx.nl\/mollie\/checkout\/process\/?order_id=3702&payment_token=xxx&utm_nooverride=1","cancelUrl":null,"webhookUrl":"https:\/\/xxx.nl\/mollie\/checkout\/webhook\/?isAjax=1&orderId[]=xxx”,”mandateId":null,"subscriptionId":null,"orderId":null,"settlementId":null,"locale":null,"metadata":{"order_id":"3702","store_id":"1","payment_token”:”xxx”},”details":{"consumerName”:”xxx”,”consumerAccount":"NLxxx”,”consumerBic":"INGBNL2A"},"restrictPaymentMethodsToCountry":null,"_links":{"self":{"href":"https:\/\/api.mollie.com\/v2\/payments\/tr_xxx”,”type":"application\/hal+json"},"dashboard":{"href":"https:\/\/my.mollie.com\/dashboard\/org_xxx\/payments\/tr_xxx”,”type":"text\/html"},"documentation":{"href":"https:\/\/docs.mollie.com\/reference\/v2\/payments-api\/get-payment","type":"text\/html"}},"_embedded":null,"isCancelable":null,"amountCaptured":null,"applicationFee":null,"routing":null,"authorizedAt":null,"expiredAt":null,"customerId":null,"countryCode":null} [] [] [2023-03-28T14:32:11.995163+00:00] Mollie.INFO: success: {"success":true,"status":"paid","order_id":"3702","type":"webhook"} [] [] [2023-03-28T14:32:12.015391+00:00] Mollie.INFO: info: Unlocking: mollie.order.3702 [] [] [2023-03-28T14:32:12.015630+00:00] Mollie.INFO: info: Key "mollie.order.3702" unlocked [] [] [2023-03-28T16:35:02.581433+00:00] Mollie.INFO: info: Preparing to send the payment reminder for order #202304177 [] [] [2023-03-28T16:35:02.634641+00:00] Mollie.INFO: info: Payment reminder record moved to sent table for order #202304177 [] [] [2023-03-28T16:35:02.645207+00:00] Mollie.INFO: info: Sending second chance email for order #202304177 [] [] [2023-03-28T16:35:03.537938+00:00] Mollie.INFO: info: Second chance email for order #202304177 sent [] []

Additional context We just upgraded the Magento 2.2 website to Magento 2.3.5. First we thought the bug was related to the server time (1 hour difference with Mollie, didn't help. Set the time for the reminder to 2 hours instead of 1, didn't help.

Frank-Magmodules commented 1 year ago

Hello @mdesplenter, we appreciate you raising this issue. 
We will investigate it thoroughly and respond to you promptly.

Frank-Magmodules commented 1 year ago

Hello @mdesplenter, we could not locate any issues related to the matter you raised. Would it be possible for you to share your screen or environment details with us directly so that we can collaborate and investigate this issue more closely? Thank you!

Frank-Magmodules commented 1 year ago

Hello @mdesplenter, it appears that we have not received a response regarding this issue up to this point. We would like to confirm if this issue is still relevant or if it can be closed. Please let us know your thoughts. Thank you.

Frank-Magmodules commented 1 year ago

Hi There @mdesplenter I'm happy to inform you that we have covered this issue in the latest release, 2.26.0, of the plugin. We also added some Cypress tests to avoid issues like this. I will be closing this issue for now. However, please feel free to reopen or comment on the issue if you require further assistance or additional feedback. Thank you for your contribution!