From 4f75a83f157aca132b2216639337ba04b308b0fd Mon Sep 17 00:00:00 2001 From: TheCartpenter Date: Mon, 8 Jan 2024 22:43:24 -0500 Subject: [PATCH] Added subscription array and added product name --- .../extension/opencart/catalog/controller/payment/opayo.php | 6 ++++++ upload/extension/opencart/catalog/model/payment/opayo.php | 1 + 2 files changed, 7 insertions(+) diff --git a/upload/extension/opencart/catalog/controller/payment/opayo.php b/upload/extension/opencart/catalog/controller/payment/opayo.php index 46c93541a81..f594afa68cd 100644 --- a/upload/extension/opencart/catalog/controller/payment/opayo.php +++ b/upload/extension/opencart/catalog/controller/payment/opayo.php @@ -358,6 +358,9 @@ public function confirm(): void { $order_subscription = $this->model_checkout_subscription->getSubscriptionByOrderProductId($this->session->data['order_id'], $order_product['order_product_id']); if ($order_subscription && $order_subscription['order_product_id'] == $order_product['order_product_id']) { + $order_subscription['subscription'] = $order_subscription; + $order_subscription['subscription']['name'] = $order_product['name']; + $this->model_extension_opayo_payment_opayo->subscriptionPayment($order_subscription, $payment_data['VendorTxCode']); } } @@ -472,6 +475,9 @@ public function threeDSnotify(): void { $order_subscription = $this->model_checkout_subscription->getSubscriptionByOrderProductId($this->session->data['order_id'], $order_product['order_product_id']); if ($order_subscription && $order_subscription['order_product_id'] == $order_product['order_product_id']) { + $order_subscription['subscription'] = $order_subscription; + $order_subscription['subscription']['name'] = $order_product['name']; + $this->model_extension_opayo_payment_opayo->subscriptionPayment($order_subscription, $payment_data['VendorTxCode']); } } diff --git a/upload/extension/opencart/catalog/model/payment/opayo.php b/upload/extension/opencart/catalog/model/payment/opayo.php index 184888c0553..d97746caeaa 100644 --- a/upload/extension/opencart/catalog/model/payment/opayo.php +++ b/upload/extension/opencart/catalog/model/payment/opayo.php @@ -480,6 +480,7 @@ private function setPaymentData(array $order_info, array $opayo_order_info, floa */ private function calculateSchedule(string $frequency, \DateTime $next_payment, int $cycle) { $next_payment = clone $next_payment; + if ($frequency == 'semi_month') { $day = $next_payment->format('d'); $value = 15 - $day;