Quote:
Originally Posted by gkarlsson
Is there a hook, that I can use, to enable sending email notifications on credit card capture? I really don't want to have to browse through more code than I need to.
|
Yes, sure. You need to decorate the doPayment() method in \XLite\Controller\Customer\Checkout class and call the \XLite\Core\Mailer::getInstance()->sendOrderCreated($cart); method, before this code:
PHP Code:
if ($cart->isPayed()) {
$paymentStatus = $paymentStatusCode ?: \XLite\Model\Order\Status\Payment::STATUS_PAID;
} elseif ($transaction && $transaction->isFailed()) {
$paymentStatus = \XLite\Model\Order\Status\Payment::STATUS_DECLINED;
} else {
$paymentStatus = \XLite\Model\Order\Status\Payment::STATUS_QUEUED;
\XLite\Core\Mailer::getInstance()->sendOrderCreated($cart);
}
Of course, you should remove this routine from this piece of code:
PHP Code:
} else {
$paymentStatus = \XLite\Model\Order\Status\Payment::STATUS_QUEUED;
\XLite\Core\Mailer::getInstance()->sendOrderCreated($cart);
}
In order to avoid double notifications for offline payment methods.
Please, let me know if it makes sense to you.
Tony.