Skip to content

Commit

Permalink
Merge pull request opencart#13477 from TheCartpenter/patch-76
Browse files Browse the repository at this point in the history
Added subscription array and added product name
  • Loading branch information
AJenbo committed Jan 9, 2024
2 parents 3292885 + 4f75a83 commit 53b4afd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}
Expand Down Expand Up @@ -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']);
}
}
Expand Down
1 change: 1 addition & 0 deletions upload/extension/opencart/catalog/model/payment/opayo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 53b4afd

Please sign in to comment.