mollie / Magento

Mollie Payments for Magento 1.x
https://www.mollie.com/
BSD 2-Clause "Simplified" License
39 stars 30 forks source link

Invoice not sent after generating through Mollie/Klarna #219

Closed kasper-agg closed 2 years ago

kasper-agg commented 2 years ago

Hi,

Our current setup (OpenMage LTS 19.4.15) has the Mollie plugin 5.6.8 installed with Klarna Pay Later activated. The Mollie base setting is set to Send out emails when invoices are created. Klarna is configured as: "On Authorize and set status Paid before shipment"

This works for all payment methods, except for Klarna payments. Our process relies on the invoice in order to create shipments.

When Klarna authorizes a payment, an invoice is generated, but not sent (email not sent).

Is this intentional or a bug?

kasper-agg commented 2 years ago

We've currently fixed it by adding a module with an observer observing sales_order_save_after, checking for state, status and invoice email sent.

If the email has not been sent (yet), the observer sends the email with first parameter false, meaning do not notify customer:

$notifyCustomer = false;
$invoice->sendEmail($notifyCustomer);

and sets the email sent to "true": $invoice->setEmailSent(1);