0

I am using Magento 2x and trying to integrate a Payment Gateway called Telr.

The issue I am facing with it is, an Order Confirmation Email is being sent the moment the customer is being redirected to Payment Gateway irrespective of the Order being Failed, Cancelled, Successful etc.

I reported the same to the Payment Gateway Company (Telr). But they said this is a flaw from Magento itself.

Then I showed them that they were wrong by using PayPal Express Checkout & Braintree Payment. Both the payment gateway worked fine, as expected, i.e, Order Confirmation Email was only being sent once the Order was SUCCESSFUL, and not immediately after being redirected to Paypayl, as it's happening with Telr. I demoed the same to them with the help of a Test Transaction via screencast.

They are still in DENIAL and saying that they cannot use Paypal's workflow as it will cause a MAJOR SECURITY LOOPHOLE. Please check attached image for screenshot of their response Email.

It would be GREAT HELP, if anybody could confirm whether what Telr is saying is TRUE OR NOT. AFAIK this isn't true.

enter image description here

Thanks.

0

You have 2 options here either do it using Magento settings or do it in your custom module code :

via admin settings:

You can choose to send order email upon invoice creation to do that :

Admin -> Stores -> Configuration -> Sales -> Sales Email -> Order -> Enabled set to NO

and then go to:

Admin -> Stores -> Configuration -> Sales -> Sales Email -> Invoice -> Enabled set to YES

Code changes in your module:

In your payment method model call setCanSendNewEmailFlag() and set it to false.

$order->setCanSendNewEmailFlag(false)

And once user redirected to your controller ( where you will be getting order status i.e success / captured ,failure ) set this method to TRUE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.