From b7272bbeb6a322a090fd16ab378f033ce2f42155 Mon Sep 17 00:00:00 2001 From: Shaun Scholtz Date: Thu, 5 Feb 2026 14:22:34 +0200 Subject: [PATCH 1/4] Added support for Prestashop v9.0.0 --- README.md | 5 ++- paygate/paygate.php | 36 ++++++++++++++++--- .../views/templates/hook/payment_return.tpl | 21 +++++++++++ 3 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 paygate/views/templates/hook/payment_return.tpl diff --git a/README.md b/README.md index f8ac0e5..f000c1f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PayWeb_PrestaShop -## Paygate PrestaShop Plugin v1.9.0 for PrestaShop v8.2.0 +## Paygate PrestaShop Plugin v1.9.1 for PrestaShop v9.0.0 This is the Paygate PayWeb3 plugin for PrestaShop. Please feel free to contact the Payfast support team at support@payfast.help should you require any assistance. @@ -8,8 +8,7 @@ support@payfast.help should you require any assistance. ## Installation 1. **Download the Latest Release** - - Visit the [releases page](https://github.com/Paygate/PayWeb_PrestaShop/releases) and - download [paygate.zip](https://github.com/Paygate/PayWeb_PrestaShop/releases/download/v1.9.0/paygate.zip). + download [paygate.zip](https://github.com/Armysarge/PayWeb_PrestaShop/releases/download/v1.9.1/paygate.zip). 2. **Install the Plugin** - Access your PrestaShop admin panel. diff --git a/paygate/paygate.php b/paygate/paygate.php index 7eb317b..9929e5b 100644 --- a/paygate/paygate.php +++ b/paygate/paygate.php @@ -70,10 +70,10 @@ public function install(): bool `id_vault` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `id_customer` INT UNSIGNED NOT NULL, `vault_id` VARCHAR(40) NOT NULL, - `first_six` VARCHAR(10) NOT NULL, + `first_six` VARCHAR(10) NOT NULL, `last_four` VARCHAR(10) NOT NULL, `expiry` VARCHAR(10) NOT NULL - ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8; + ) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8; ' ); @@ -184,7 +184,7 @@ public function hookPaymentOptions($params): array if (!window.ApplePaySession) { // Apple Pay is not available, so let's hide the specific input element const applePayElement = document.querySelector('input[value="applepay"]'); - + if (applePayElement) { const parentP = applePayElement.closest('tr'); if (parentP) { @@ -200,7 +200,7 @@ public function hookPaymentOptions($params): array }); - HTML; $paymentOption = new PaymentOption(); @@ -213,6 +213,34 @@ public function hookPaymentOptions($params): array return [$paymentOption]; } + /** + * Hook for payment return page + * + * @param array $params + * @return string + */ + public function hookPaymentReturn($params): string + { + if (!$this->active) { + return ''; + } + + $order = $params['order']; + + if (!Validate::isLoadedObject($order)) { + return ''; + } + + $this->smarty->assign([ + 'shop_name' => $this->context->shop->name, + 'reference' => $order->reference, + 'contact_url' => $this->context->link->getPageLink('contact', true), + 'status' => 'ok', + ]); + + return $this->fetch('module:paygate/views/templates/hook/payment_return.tpl'); + } + /** * @throws PrestaShopDatabaseException * @throws Exception diff --git a/paygate/views/templates/hook/payment_return.tpl b/paygate/views/templates/hook/payment_return.tpl new file mode 100644 index 0000000..aa64cbf --- /dev/null +++ b/paygate/views/templates/hook/payment_return.tpl @@ -0,0 +1,21 @@ +{* +* Copyright (c) 2025 Payfast (Pty) Ltd +* +* Author: App Inlet (Pty) Ltd +* +* Released under the GNU General Public License +*} + +
+

{l s='Your order on %s is complete.' sprintf=[$shop_name] d='Modules.Paygate.Shop'}

+

+ {l s='Your order reference:' d='Modules.Paygate.Shop'} + {$reference} +

+

+ {l s='An email has been sent with this information.' d='Modules.Paygate.Shop'} +
+ {l s='If you have questions, comments or concerns, please contact our' d='Modules.Paygate.Shop'} + {l s='expert customer support team' d='Modules.Paygate.Shop'}. +

+
From 758fb4b19d9bd48e13ec081f3c2d1c136cf76cc5 Mon Sep 17 00:00:00 2001 From: Shaun Scholtz Date: Thu, 5 Feb 2026 14:24:19 +0200 Subject: [PATCH 2/4] Versioned 1.9.1 --- paygate/paygate.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/paygate/paygate.php b/paygate/paygate.php index 9929e5b..d564a80 100644 --- a/paygate/paygate.php +++ b/paygate/paygate.php @@ -30,7 +30,7 @@ public function __construct() require_once _PS_MODULE_DIR_ . 'paygate/classes/methods.php'; $this->name = 'paygate'; $this->tab = 'payments_gateways'; - $this->version = '1.9.0'; + $this->version = '1.9.1'; $this->author = 'Paygate'; $this->controllers = array('payment', 'validation'); @@ -430,6 +430,8 @@ public function getContent(): string public function renderForm(): string { + $moduleUrl = $this->context->link->getBaseLink() . 'modules/' . $this->name . '/'; + $fields_form = array( 'form' => array( 'legend' => array( @@ -508,57 +510,57 @@ public function renderForm(): string 'query' => array( array( 'id' => 'creditcard', - 'name' => 'Credit CardsCredit Cards', + 'name' => 'Credit CardsCredit Cards', 'val' => 'creditcard', ), array( 'id' => 'banktransfer', - 'name' => 'Bank TransferBank Transfer', + 'name' => 'Bank TransferBank Transfer', 'val' => 'banktransfer', ), array( 'id' => 'zapper', - 'name' => 'ZapperZapper', + 'name' => 'ZapperZapper', 'val' => 'zapper', ), array( 'id' => 'snapscan', - 'name' => 'SnapScanSnapScan', + 'name' => 'SnapScanSnapScan', 'val' => 'snapscan', ), array( 'id' => 'paypal', - 'name' => 'PayPalPayPal', + 'name' => 'PayPalPayPal', 'val' => 'paypal', ), array( 'id' => 'mobicred', - 'name' => 'MobiCredMobiCred', + 'name' => 'MobiCredMobiCred', 'val' => 'mobicred', ), array( 'id' => 'momopay', - 'name' => 'MomoPayMomoPay', + 'name' => 'MomoPayMomoPay', 'val' => 'momopay', ), array( 'id' => 'scantopay', - 'name' => 'ScanToPayScanToPay', + 'name' => 'ScanToPayScanToPay', 'val' => 'scantopay', ), array( 'id' => 'applepay', - 'name' => 'ApplePayApplePay', + 'name' => 'ApplePayApplePay', 'val' => 'applepay', ), array( 'id' => 'rcs', - 'name' => 'RCSRCS', + 'name' => 'RCSRCS', 'val' => 'rcs', ), array( 'id' => 'samsungpay', - 'name' => 'SamsungPaySamsungPay', + 'name' => 'SamsungPaySamsungPay', 'val' => 'samsungpay', ), ), From 9ebb8ba249596c6949651150dcef287b59e3f1a1 Mon Sep 17 00:00:00 2001 From: Shaun Scholtz Date: Thu, 5 Feb 2026 14:25:43 +0200 Subject: [PATCH 3/4] Fixed SVG paths --- paygate/classes/methods.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/paygate/classes/methods.php b/paygate/classes/methods.php index 481e33d..fc2374b 100644 --- a/paygate/classes/methods.php +++ b/paygate/classes/methods.php @@ -13,11 +13,14 @@ class PaygateMethodsList public function getPaygateMethodsList(): array { + $context = Context::getContext(); + $moduleUrl = $context->link->getBaseLink() . 'modules/paygate/'; + return [ 'creditcard' => [ 'name' => 'paygate-paymethod', 'label' => 'Card', - 'img' => '../modules/paygate/assets/images/mastercard-visa.svg', + 'img' => $moduleUrl . 'assets/images/mastercard-visa.svg', 'ptype' => 'CC', 'ptypedetail' => 'Credit Card', 'type' => 'radio', @@ -27,7 +30,7 @@ public function getPaygateMethodsList(): array 'banktransfer' => [ 'name' => 'paygate-paymethod', 'label' => 'Bank Transfer', - 'img' => '../modules/paygate/assets/images/sid.svg', + 'img' => $moduleUrl . 'assets/images/sid.svg', 'ptype' => 'BT', 'ptypedetail' => 'SID', 'type' => 'radio', @@ -36,7 +39,7 @@ public function getPaygateMethodsList(): array 'zapper' => [ 'name' => 'paygate-paymethod', 'label' => 'Zapper', - 'img' => '../modules/paygate/assets/images/zapper.svg', + 'img' => $moduleUrl . 'assets/images/zapper.svg', 'ptype' => 'EW', 'ptypedetail' => 'Zapper', 'type' => 'radio', @@ -44,7 +47,7 @@ public function getPaygateMethodsList(): array 'snapscan' => [ 'name' => 'paygate-paymethod', 'label' => 'SnapScan', - 'img' => '../modules/paygate/assets/images/snapscan.svg', + 'img' => $moduleUrl . 'assets/images/snapscan.svg', 'ptype' => 'EW', 'ptypedetail' => 'SnapScan', 'type' => 'radio', @@ -52,7 +55,7 @@ public function getPaygateMethodsList(): array 'paypal' => [ 'name' => 'paygate-paymethod', 'label' => 'PayPal', - 'img' => '../modules/paygate/assets/images/paypal.svg', + 'img' => $moduleUrl . 'assets/images/paypal.svg', 'ptype' => 'EW', 'ptypedetail' => 'PayPal', 'type' => 'radio', @@ -60,7 +63,7 @@ public function getPaygateMethodsList(): array 'mobicred' => [ 'name' => 'paygate-paymethod', 'label' => 'MobiCred', - 'img' => '../modules/paygate/assets/images/mobicred.svg', + 'img' => $moduleUrl . 'assets/images/mobicred.svg', 'ptype' => 'EW', 'ptypedetail' => 'Mobicred', 'type' => 'radio', @@ -68,7 +71,7 @@ public function getPaygateMethodsList(): array 'momopay' => [ 'name' => 'paygate-paymethod', 'label' => 'MomoPay', - 'img' => '../modules/paygate/assets/images/momopay.svg', + 'img' => $moduleUrl . 'assets/images/momopay.svg', 'ptype' => 'EW', 'ptypedetail' => 'Momopay', 'type' => 'radio', @@ -76,7 +79,7 @@ public function getPaygateMethodsList(): array 'scantopay' => [ 'name' => 'paygate-paymethod', 'label' => 'ScanToPay', - 'img' => '../modules/paygate/assets/images/scan-to-pay.svg', + 'img' => $moduleUrl . 'assets/images/scan-to-pay.svg', 'ptype' => 'EW', 'ptypedetail' => 'MasterPass', 'type' => 'radio', @@ -84,7 +87,7 @@ public function getPaygateMethodsList(): array 'applepay' => [ 'name' => 'paygate-paymethod', 'label' => 'ApplePay', - 'img' => '../modules/paygate/assets/images/apple-pay.svg', + 'img' => $moduleUrl . 'assets/images/apple-pay.svg', 'ptype' => 'CC', 'ptypedetail' => 'Applepay', 'type' => 'radio', @@ -92,7 +95,7 @@ public function getPaygateMethodsList(): array 'rcs' => [ 'name' => 'paygate-paymethod', 'label' => 'RCS', - 'img' => '../modules/paygate/assets/images/rcs.svg', + 'img' => $moduleUrl . 'assets/images/rcs.svg', 'ptype' => 'CC', 'ptypedetail' => 'RCS', 'type' => 'radio', @@ -100,7 +103,7 @@ public function getPaygateMethodsList(): array 'samsungpay' => [ 'name' => 'paygate-paymethod', 'label' => 'SamsungPay', - 'img' => '../modules/paygate/assets/images/samsung-pay.svg', + 'img' => $moduleUrl . 'assets/images/samsung-pay.svg', 'ptype' => 'EW', 'ptypedetail' => 'Samsungpay', 'type' => 'radio', From a61ad632a48047461acea79ca37c8866cf6f2f94 Mon Sep 17 00:00:00 2001 From: Shaun Scholtz Date: Thu, 5 Feb 2026 14:52:56 +0200 Subject: [PATCH 4/4] Minor fix to PayVault --- paygate/paygate.php | 20 ++++++++++++-------- paygate/views/templates/front/payvault.tpl | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/paygate/paygate.php b/paygate/paygate.php index d564a80..e92d8c6 100644 --- a/paygate/paygate.php +++ b/paygate/paygate.php @@ -1129,14 +1129,18 @@ private function _postProcess(): void */ public function hookDisplayCustomerAccount(): false|string { - $this->context->smarty->assign( - 'card', - $this->context->link->getModuleLink('paygate', 'payvault'), - ); - $this->context->smarty->assign( - 'tokenization', - Configuration::get('PAYGATE_PAY_VAULT'), - ); + // Only show if PayVault is enabled + if ((int)Configuration::get('PAYGATE_PAY_VAULT') !== 1) { + return ''; + } + + $this->context->smarty->assign([ + 'card' => [ + 'value' => $this->context->link->getModuleLink('paygate', 'payvault'), + ], + 'tokenization' => (int)Configuration::get('PAYGATE_PAY_VAULT'), + 'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__, + ]); return $this->context->smarty ->fetch('module:paygate/views/templates/front/payvault.tpl'); diff --git a/paygate/views/templates/front/payvault.tpl b/paygate/views/templates/front/payvault.tpl index a0d45d3..fb86310 100755 --- a/paygate/views/templates/front/payvault.tpl +++ b/paygate/views/templates/front/payvault.tpl @@ -5,7 +5,7 @@ * * Released under the GNU General Public License *} - + creditcard My Cards