Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirmation email send before payment confirmation with Asynchronous sending #31

Open
dimitriBouteille opened this issue May 22, 2024 · 3 comments · May be fixed by #32
Open

Confirmation email send before payment confirmation with Asynchronous sending #31

dimitriBouteille opened this issue May 22, 2024 · 3 comments · May be fixed by #32

Comments

@dimitriBouteille
Copy link

Describe the bug

When option Asynchronous sending is activated, the order confirmation email is sent before the customer confirms the payment in PayU.

Steps to reproduce the issue

  • Set sales_email/general/async_sending configuration to 1
  • Place order with PayU gateway
  • Wait on the PayU payment page
  • Execute sales_send_order_emails
  • The confirmation email is sent 💥

Expected behavior

The confirmation email should be sent only when the customer confirms the payment.

Setup

  • Module version: 2.0.2
  • Magento version: 2.4.5-p7
@regdos
Copy link
Contributor

regdos commented Jul 4, 2024

Hi,

Expected behavior is wrong because:

  • payments in PayU are asynchronous so AcceptOrderPayment can be called even a few days later than the start of the payment so the payer did not receive order confirmation from the store
  • If payment retry is enabled, there is a payment link in the email so the payer did not receive the payment link
  • If the payer abandons the payment in PayU, he will never receive an e-mail about the order

@dimitriBouteille
Copy link
Author

Hi @regdos

Thanks for your answer.

payments in PayU are asynchronous so AcceptOrderPayment can be called even a few days later than the start of the payment so the payer did not receive order confirmation from the store

I agree with this point but it does not make sense to send the confirmation email while the payment is not validated in Magento.

In addition, in most cases the notification is sent very quickly after the payment, so receive the email 5 minutes after the payment it does not matter.

If payment retry is enabled, there is a payment link in the email so the payer did not receive the payment link

Maybe create new logic for this feature, why use confirmation email ?

If the payer abandons the payment in PayU, he will never receive an e-mail about the order

Indeed. However, if the user voluntarily cancels the payment in payU, it does not seem logical to send the order confirmation email when he has not made the payment. Right ?

@regdos
Copy link
Contributor

regdos commented Jul 5, 2024

Hi @dimitriBouteille

In most cases, the payment will be immediate, but it may happen that for some reasons (bank specifics, failure, fraud analysis, etc.) it may take longer. The payment method bank transfer is always not immediate.
Sending an e-mail confirming the order cannot depend on whether the payment was successful or not.

The purchase has two stages:

  • place an order
  • payment for this placed order

Let's consider the case that a guest makes a purchase. Places an order, proceeds to checkout and pays.
Unfortunately, due to some error, AcceptOrderPayment is not executed.
The buyer does not have an order confirmation, does not know what the status of his order is, and when he wants to contact the store, he does not have a handle for his order.

An e-mail about the order confirmation should be sent when the order is successfully placed and payment begins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants