Check to see if new order email was sent
and to send one if not. References GH Issue #85
This commit is contained in:
parent
9d9215c0d4
commit
8ce288db4b
|
@ -112,7 +112,16 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
|
|||
|
||||
if (true === isset($payment) && false === empty($payment)) {
|
||||
$payment->registerCaptureNotification($invoice->getPrice());
|
||||
$order->addPayment($payment)->save();
|
||||
$order->addPayment($payment);
|
||||
|
||||
// If the customer has not already been notified by email
|
||||
// send the notification now that there's a new order.
|
||||
if (!$order->getEmailSent()) {
|
||||
Mage::helper('bitpay')->debugData('[INFO] Order email not sent so I am calling $order->sendNewOrderEmail() now...');
|
||||
$order->sendNewOrderEmail();
|
||||
}
|
||||
|
||||
$order->save();
|
||||
} else {
|
||||
Mage::helper('bitpay')->debugData('[ERROR] Could not create a payment object in the Bitpay IPN controller.');
|
||||
Mage::throwException('Could not create a payment object in the Bitpay IPN controller.');
|
||||
|
|
Loading…
Reference in New Issue