From ef9056c6df25dacbfcc56d8fdde920d05e0a7efb Mon Sep 17 00:00:00 2001 From: Kavinda Harshana Date: Thu, 3 Feb 2022 17:01:13 +0530 Subject: [PATCH] fixing email sending issue --- src/extensions/SilverShopSCAPaymentExtension.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/extensions/SilverShopSCAPaymentExtension.php b/src/extensions/SilverShopSCAPaymentExtension.php index e9b30d3..c4d1ce8 100644 --- a/src/extensions/SilverShopSCAPaymentExtension.php +++ b/src/extensions/SilverShopSCAPaymentExtension.php @@ -24,12 +24,15 @@ class SilverShopSCAPaymentExtension extends DataExtension public function onPaymentCaptured($response = null) { $order = $this->Cart(); - $order->Status = 'Paid'; + $order->Placed = DBDatetime::now()->Rfc2822();; - $order->write(); + if ($order && $order->exists()) { OrderProcessor::create($order)->completePayment(); } + + $order->Status = 'Paid'; + $order->write(); } public function getIdentifierToken()