From 205395c2a7398cacadba770aa35fb7f4874b22a8 Mon Sep 17 00:00:00 2001 From: Bruce Atkinson Date: Sun, 12 Oct 2025 20:33:16 +0200 Subject: [PATCH] [2.7.0] ### Added - Added support for Magento 2.4.8+ and PHP 8.4. - Updated Common Library to version 1.4.0. - Updated branding to use the Payfast by Network logo. - Revised configuration branding to Payfast Aggregation. --- CHANGELOG.md | 19 ++++-- README.md | 8 +-- app/code/Payfast/Payfast/Block/Form.php | 5 +- app/code/Payfast/Payfast/Block/Info.php | 3 - .../Payfast/Payfast/Block/Payment/Info.php | 2 +- .../Payfast/Payfast/Block/Payment/Request.php | 11 ++-- .../Payfast/Controller/AbstractPayfast.php | 2 +- .../Payfast/Controller/Notify/Index.php | 62 ++++++++----------- .../Payfast/Controller/Redirect/Cancel.php | 2 +- .../Payfast/Controller/Redirect/Index.php | 2 +- .../Payfast/Controller/Redirect/Success.php | 2 +- .../Gateway/Config/CanAuthorizeHandler.php | 5 +- .../Gateway/Config/CanCaptureHandler.php | 5 +- .../Gateway/Http/Client/ClientMock.php | 5 +- .../Payfast/Gateway/Http/TransferFactory.php | 3 - .../Gateway/Request/AbstractRequest.php | 4 +- .../Gateway/Request/AuthorizationRequest.php | 5 +- .../Gateway/Request/CaptureRequest.php | 4 +- .../Gateway/Request/MockDataRequest.php | 5 +- .../Payfast/Gateway/Request/VoidRequest.php | 4 +- .../Payfast/Gateway/Response/ItnHandler.php | 3 - .../Validator/ResponseCodeValidator.php | 5 +- app/code/Payfast/Payfast/Helper/Data.php | 6 +- app/code/Payfast/Payfast/Logger/Handler.php | 7 +-- app/code/Payfast/Payfast/Logger/Logger.php | 4 -- .../Payfast/Payfast/Model/AbstractConfig.php | 6 +- app/code/Payfast/Payfast/Model/Cart.php | 8 ++- app/code/Payfast/Payfast/Model/Config.php | 10 +-- app/code/Payfast/Payfast/Model/Info.php | 15 ++--- app/code/Payfast/Payfast/Model/Payfast.php | 7 ++- .../Payfast/Model/PayfastConfigProvider.php | 5 +- .../Observer/SalesOrderBeforeSaveObserver.php | 5 +- app/code/Payfast/Payfast/composer.json | 6 +- .../Payfast/Payfast/etc/adminhtml/system.xml | 16 ++--- app/code/Payfast/Payfast/etc/config.xml | 8 +-- app/code/Payfast/Payfast/etc/di.xml | 8 +-- app/code/Payfast/Payfast/etc/frontend/di.xml | 8 +-- .../Payfast/Payfast/etc/frontend/routes.xml | 8 +-- .../Payfast/Payfast/etc/frontend/sections.xml | 8 +-- app/code/Payfast/Payfast/etc/module.xml | 10 +-- app/code/Payfast/Payfast/etc/payment.xml | 8 +-- app/code/Payfast/Payfast/registration.php | 2 +- .../frontend/layout/checkout_index_index.xml | 8 +-- .../frontend/layout/payfast_notify_index.xml | 8 +-- .../layout/payfast_redirect_index.xml | 8 +-- .../frontend/templates/form/payfast.phtml | 8 +-- .../view/frontend/templates/html/rk.phtml | 8 +-- .../view/frontend/templates/redirect.phtml | 14 ++--- .../frontend/web/css/payfast_checkout.css | 1 + .../Payfast/view/frontend/web/images/logo.svg | 18 ------ .../view/frontend/web/images/payfast-logo.svg | 39 ++++++++++++ .../payment/method-renderer/payfast-method.js | 5 -- .../web/js/view/payment/payfast-payments.js | 4 +- .../web/template/payment/payfast.html | 3 - 54 files changed, 171 insertions(+), 274 deletions(-) delete mode 100644 app/code/Payfast/Payfast/view/frontend/web/images/logo.svg create mode 100644 app/code/Payfast/Payfast/view/frontend/web/images/payfast-logo.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index b57896e..cde810d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,27 @@ # Changelog -## [[2.6.0]](https://github.com/Payfast/mod-magento_2/releases/tag/v2.6.0) +## [[2.7.0]](https://github.com/Payfast/magento-aggregation/releases/tag/v2.7.0) + +### Added + +- Added support for Magento 2.4.8+ and PHP 8.4. +- Updated Common Library to version 1.4.0. +- Updated branding to use the Payfast by Network logo. +- Revised configuration branding to Payfast Aggregation. + +## [[2.6.0]](https://github.com/Payfast/magento-aggregation/releases/tag/v2.6.0) ### Added - Update for Magento 2.4.7+ and PHP 8.2. -## [[2.5.1]](https://github.com/Payfast/mod-magento_2/releases/tag/v2.5.1) +## [[2.5.1]](https://github.com/Payfast/magento-aggregation/releases/tag/v2.5.1) ### Fixed - Dynamic creation of properties error (php 8.2+). -## [[2.5.0]](https://github.com/Payfast/mod-magento_2/releases/tag/v2.5.0) +## [[2.5.0]](https://github.com/Payfast/magento-aggregation/releases/tag/v2.5.0) ### Added @@ -23,7 +32,7 @@ - Bug fixes and code quality improvements. -## [[2.4.1]](https://github.com/Payfast/mod-magento_2/releases/tag/v2.4.1) +## [[2.4.1]](https://github.com/Payfast/magento-aggregation/releases/tag/v2.4.1) ### Added @@ -43,7 +52,7 @@ - Update branding. -## [[2.4.0]](https://github.com/Payfast/mod-magento_2/releases/tag/v2.4.0) +## [[2.4.0]](https://github.com/Payfast/magento-aggregation/releases/tag/v2.4.0) ### Added diff --git a/README.md b/README.md index bf3aab9..d9ed730 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# mod-magento_2 +# magento-aggregation -## Payfast module v2.6.0 for Magento v2.4.7 +## Payfast Aggregation module v2.7.0 for Magento v2.4.8 -This is the Payfast module for Magento 2. Please feel free +This is the Payfast Aggregation module for Magento 2. Please feel free to [contact the Payfast support team](https://payfast.io/contact/) should you require any assistance. ## Installation @@ -14,7 +14,7 @@ to [contact the Payfast support team](https://payfast.io/contact/) should you re 3. You will now need to run the following commands in the given order: ``` -composer require payfast/payfast-common:v1.1.0 +composer require payfast/payfast-common:v1.4.0 php ./bin/magento module:enable Payfast_Payfast php ./bin/magento setup:di:compile php ./bin/magento setup:static-content:deploy diff --git a/app/code/Payfast/Payfast/Block/Form.php b/app/code/Payfast/Payfast/Block/Form.php index 9065f80..c5bc9d8 100644 --- a/app/code/Payfast/Payfast/Block/Form.php +++ b/app/code/Payfast/Payfast/Block/Form.php @@ -1,6 +1,6 @@ _orderFactory = $orderFactory; $this->_checkoutSession = $checkoutSession; parent::__construct($context, $data); - $this->readFactory = $readFactory; - $this->reader = $reader; - $this->_paymentMethod = $paymentMethod; + $this->readFactory = $readFactory; + $this->reader = $reader; + $this->_paymentMethod = $paymentMethod; } /** diff --git a/app/code/Payfast/Payfast/Controller/AbstractPayfast.php b/app/code/Payfast/Payfast/Controller/AbstractPayfast.php index 4fa90f1..473230b 100644 --- a/app/code/Payfast/Payfast/Controller/AbstractPayfast.php +++ b/app/code/Payfast/Payfast/Controller/AbstractPayfast.php @@ -1,6 +1,6 @@ getConfigData('debug'); - $payfastCommon = new PayfastCommon((bool)$debugMode); + $debugMode = $this->getConfigData('debug'); + $paymentRequest = new PaymentRequest((bool)$debugMode); $moduleInfo = [ - 'pfSoftwareName' => 'Magento', - 'pfSoftwareVer' => '2.4.7', + 'pfSoftwareName' => 'Magento', + 'pfSoftwareVer' => '2.4.7', 'pfSoftwareModuleName' => 'Payfast-Magento', - 'pfModuleVer' => '2.6.0' + 'pfModuleVer' => '2.7.0' ]; $this->_logger->debug('Notify: ' . json_encode($this->request->getPostValue())); @@ -65,9 +53,9 @@ public function execute(): ResultInterface $pfHost = $this->paymentMethod->getPayfastHost($serverMode); - $payfastCommon->pflog(' Payfast ITN call received'); + $paymentRequest->pflog(' Payfast ITN call received'); - $payfastCommon->pflog('Server = ' . $pfHost); + $paymentRequest->pflog('Server = ' . $pfHost); //// Notify Payfast that information has been received $resultRaw = $this->resultFactory->create(ResultFactory::TYPE_RAW); @@ -87,58 +75,58 @@ public function execute(): ResultInterface //// Get data sent by Payfast // Posted variables from ITN - $pfData = PayfastCommon::pfGetData(); + $pfData = $paymentRequest->pfGetData(); if (empty($pfData)) { $pfError = true; - $pfErrMsg = PayfastCommon::PF_ERR_BAD_ACCESS; + $pfErrMsg = $paymentRequest::PF_ERR_BAD_ACCESS; } //// Verify security signature if (!$pfError) { - $payfastCommon->pflog('Verify security signature'); + $paymentRequest->pflog('Verify security signature'); // If signature different, log for debugging - if (!$payfastCommon->pfValidSignature( + if (!$paymentRequest->pfValidSignature( $pfData, $pfParamString, $passPhrase )) { $pfError = true; - $pfErrMsg = PayfastCommon::PF_ERR_INVALID_SIGNATURE; + $pfErrMsg = $paymentRequest::PF_ERR_INVALID_SIGNATURE; } } //// Get internal order and verify it hasn't already been processed if (!$pfError) { - $payfastCommon->pflog("Check order hasn't been processed"); + $paymentRequest->pflog("Check order hasn't been processed"); // Load order $orderId = $pfData[Info::M_PAYMENT_ID]; $this->_order = $this->orderFactory->create()->loadByIncrementId($orderId); - $payfastCommon->pflog('order status is : ' . $this->_order->getStatus()); + $paymentRequest->pflog('order status is : ' . $this->_order->getStatus()); // Check order is in "pending payment" state if ($this->_order->getState() !== Order::STATE_PENDING_PAYMENT) { - $pfErrMsg = PayfastCommon::PF_ERR_ORDER_PROCESSED; + $pfErrMsg = $paymentRequest::PF_ERR_ORDER_PROCESSED; } } //// Verify data received if (!$pfError) { - $payfastCommon->pflog('Verify data received'); + $paymentRequest->pflog('Verify data received'); - if (!$payfastCommon->pfValidData($moduleInfo, $pfHost, $pfParamString)) { + if (!$paymentRequest->pfValidData($moduleInfo, $pfHost, $pfParamString)) { $pfError = true; - $pfErrMsg = PayfastCommon::PF_ERR_BAD_ACCESS; + $pfErrMsg = $paymentRequest::PF_ERR_BAD_ACCESS; } } //// Check status and update order if (!$pfError) { - $payfastCommon->pflog('Check status and update order'); + $paymentRequest->pflog('Check status and update order'); // Successful if ($pfData[Info::PAYMENT_STATUS] === 'COMPLETE') { @@ -155,7 +143,7 @@ public function execute(): ResultInterface // If an error occurred if ($pfError) { - $payfastCommon->pflog('Error occurred: ' . $pfErrMsg); + $paymentRequest->pflog('Error occurred: ' . $pfErrMsg); $this->_logger->critical($pre . 'Error occured : ' . $pfErrMsg); return $this->rawResult @@ -278,11 +266,11 @@ protected function saveInvoice(): void */ private function setPaymentAdditionalInformation(array $pfData): void { - $debugMode = $this->getConfigData('debug'); - $payfastCommon = new PayfastCommon((bool)$debugMode); + $debugMode = $this->getConfigData('debug'); + $paymentRequest = new PaymentRequest((bool)$debugMode); - $payfastCommon->pflog(__METHOD__ . ' : bof'); - $payfastCommon->pflog('Order complete'); + $paymentRequest->pflog(__METHOD__ . ' : bof'); + $paymentRequest->pflog('Order complete'); try { // Update order additional payment information diff --git a/app/code/Payfast/Payfast/Controller/Redirect/Cancel.php b/app/code/Payfast/Payfast/Controller/Redirect/Cancel.php index 5e0e7f1..b88343d 100644 --- a/app/code/Payfast/Payfast/Controller/Redirect/Cancel.php +++ b/app/code/Payfast/Payfast/Controller/Redirect/Cancel.php @@ -1,6 +1,6 @@ getOrder(); - $payment = $paymentDO->getPayment(); + $order = $paymentDO->getOrder(); + $payment = $paymentDO->getPayment(); if (!$payment instanceof OrderPaymentInterface) { throw new LogicException('Order payment should be provided.'); diff --git a/app/code/Payfast/Payfast/Gateway/Request/AuthorizationRequest.php b/app/code/Payfast/Payfast/Gateway/Request/AuthorizationRequest.php index e1ee2ed..b45ae48 100644 --- a/app/code/Payfast/Payfast/Gateway/Request/AuthorizationRequest.php +++ b/app/code/Payfast/Payfast/Gateway/Request/AuthorizationRequest.php @@ -3,7 +3,7 @@ namespace Payfast\Payfast\Gateway\Request; /** - * Copyright (c) 2024 Payfast (Pty) Ltd + * Copyright (c) 2025 Payfast (Pty) Ltd */ use Exception; @@ -16,9 +16,6 @@ use Psr\Log\LoggerInterface; use Magento\Framework\App\ProductMetadataInterface; -/** - * AuthorizationRequest class - */ class AuthorizationRequest implements BuilderInterface { diff --git a/app/code/Payfast/Payfast/Gateway/Request/CaptureRequest.php b/app/code/Payfast/Payfast/Gateway/Request/CaptureRequest.php index aeb07f9..46189f8 100644 --- a/app/code/Payfast/Payfast/Gateway/Request/CaptureRequest.php +++ b/app/code/Payfast/Payfast/Gateway/Request/CaptureRequest.php @@ -3,15 +3,15 @@ namespace Payfast\Payfast\Gateway\Request; /** - * Copyright (c) 2024 Payfast (Pty) Ltd + * Copyright (c) 2025 Payfast (Pty) Ltd */ - class CaptureRequest extends AbstractRequest { /** * Builds ENV request * * @param array $options + * * @return array */ public function build(array $options): array diff --git a/app/code/Payfast/Payfast/Gateway/Request/MockDataRequest.php b/app/code/Payfast/Payfast/Gateway/Request/MockDataRequest.php index 2132997..f9f2e66 100644 --- a/app/code/Payfast/Payfast/Gateway/Request/MockDataRequest.php +++ b/app/code/Payfast/Payfast/Gateway/Request/MockDataRequest.php @@ -3,7 +3,7 @@ namespace Payfast\Payfast\Gateway\Request; /** - * Copyright (c) 2024 Payfast (Pty) Ltd + * Copyright (c) 2025 Payfast (Pty) Ltd */ use InvalidArgumentException; @@ -11,9 +11,6 @@ use Magento\Payment\Gateway\Request\BuilderInterface; use Payfast\Payfast\Gateway\Http\Client\ClientMock; -/** - * MockDataRequest class - */ class MockDataRequest implements BuilderInterface { public const FORCE_RESULT = 'FORCE_RESULT'; diff --git a/app/code/Payfast/Payfast/Gateway/Request/VoidRequest.php b/app/code/Payfast/Payfast/Gateway/Request/VoidRequest.php index a4b2043..885e7c0 100644 --- a/app/code/Payfast/Payfast/Gateway/Request/VoidRequest.php +++ b/app/code/Payfast/Payfast/Gateway/Request/VoidRequest.php @@ -3,15 +3,15 @@ namespace Payfast\Payfast\Gateway\Request; /** - * Copyright (c) 2024 Payfast (Pty) Ltd + * Copyright (c) 2025 Payfast (Pty) Ltd */ - class VoidRequest extends AbstractRequest { /** * Builds ENV request * * @param array $options + * * @return array */ public function build(array $options): array diff --git a/app/code/Payfast/Payfast/Gateway/Response/ItnHandler.php b/app/code/Payfast/Payfast/Gateway/Response/ItnHandler.php index d31a3a8..26dad78 100644 --- a/app/code/Payfast/Payfast/Gateway/Response/ItnHandler.php +++ b/app/code/Payfast/Payfast/Gateway/Response/ItnHandler.php @@ -8,9 +8,6 @@ use Magento\Sales\Model\Order\Payment; use UnexpectedValueException; -/** - * ItnHandler class - */ class ItnHandler implements HandlerInterface { public const TXN_ID = 'TXN_ID'; diff --git a/app/code/Payfast/Payfast/Gateway/Validator/ResponseCodeValidator.php b/app/code/Payfast/Payfast/Gateway/Validator/ResponseCodeValidator.php index b4ad209..852af43 100644 --- a/app/code/Payfast/Payfast/Gateway/Validator/ResponseCodeValidator.php +++ b/app/code/Payfast/Payfast/Gateway/Validator/ResponseCodeValidator.php @@ -3,7 +3,7 @@ namespace Payfast\Payfast\Gateway\Validator; /** - * Copyright (c) 2024 Payfast (Pty) Ltd + * Copyright (c) 2025 Payfast (Pty) Ltd */ use InvalidArgumentException; @@ -13,9 +13,6 @@ use Payfast\Payfast\Gateway\Http\Client\ClientMock; use Psr\Log\LoggerInterface; -/** - * ResponseCodeValidator class - */ class ResponseCodeValidator extends AbstractValidator { public const RESULT_CODE = 'RESULT_CODE'; diff --git a/app/code/Payfast/Payfast/Helper/Data.php b/app/code/Payfast/Payfast/Helper/Data.php index 02b8ed4..5a94857 100644 --- a/app/code/Payfast/Payfast/Helper/Data.php +++ b/app/code/Payfast/Payfast/Helper/Data.php @@ -1,6 +1,6 @@ _paymentData = $paymentData; + $this->_paymentData = $paymentData; parent::__construct($context); $this->_logger->debug($pre . 'eof'); @@ -77,7 +77,7 @@ public function shouldAskToCreateBillingAgreement(): bool * * @return MethodInterface[] */ - public function getBillingAgreementMethods(Store|bool|int|string $store = null, Quote $quote = null): array + public function getBillingAgreementMethods(Store|bool|int|string|null $store = null, ?Quote $quote = null): array { $pre = __METHOD__ . ' : '; $this->_logger->debug($pre . 'bof'); diff --git a/app/code/Payfast/Payfast/Logger/Handler.php b/app/code/Payfast/Payfast/Logger/Handler.php index 936f885..a221153 100644 --- a/app/code/Payfast/Payfast/Logger/Handler.php +++ b/app/code/Payfast/Payfast/Logger/Handler.php @@ -3,18 +3,15 @@ namespace Payfast\Payfast\Logger; use Magento\Framework\Logger\Handler\Base; -use Monolog\Logger; +use Psr\Log\LogLevel; -/** - * Handler class - */ class Handler extends Base { /** * Logging level * @var int */ - protected $loggerType = Logger::INFO; + protected $loggerType = LogLevel::INFO; /** * File name diff --git a/app/code/Payfast/Payfast/Logger/Logger.php b/app/code/Payfast/Payfast/Logger/Logger.php index 98dc330..05ba5f0 100644 --- a/app/code/Payfast/Payfast/Logger/Logger.php +++ b/app/code/Payfast/Payfast/Logger/Logger.php @@ -8,9 +8,6 @@ use Payfast\Payfast\Model\ConfigFactory; use Throwable; -/** - * Logger class - */ class Logger extends \Monolog\Logger { /** @@ -76,4 +73,3 @@ protected function isLoggingEnabled(): ?string return $this->config->getValue('debug'); } } - diff --git a/app/code/Payfast/Payfast/Model/AbstractConfig.php b/app/code/Payfast/Payfast/Model/AbstractConfig.php index 58daac8..6b5375c 100644 --- a/app/code/Payfast/Payfast/Model/AbstractConfig.php +++ b/app/code/Payfast/Payfast/Model/AbstractConfig.php @@ -1,6 +1,6 @@ _methodCode; @@ -246,7 +246,7 @@ public function isMethodActive(string $method): bool * @return bool * */ - public function isMethodSupportedForCountry(string $method = null, string $countryCode = null): bool + public function isMethodSupportedForCountry(?string $method = null, ?string $countryCode = null): bool { return true; } diff --git a/app/code/Payfast/Payfast/Model/Cart.php b/app/code/Payfast/Payfast/Model/Cart.php index b402c30..f25c665 100644 --- a/app/code/Payfast/Payfast/Model/Cart.php +++ b/app/code/Payfast/Payfast/Model/Cart.php @@ -1,6 +1,6 @@ _areAmountsValid = false; $referenceAmount = $this->_salesModel->getDataUsingMethod('base_grand_total'); - $itemsSubtotal = $this->_calculateItemsSubtotal(); + $itemsSubtotal = $this->_calculateItemsSubtotal(); $sum = $itemsSubtotal + $this->getTax(); $sum = $this->_applyShippingAndDiscounts($sum, $itemsSubtotal); @@ -122,6 +122,7 @@ private function _calculateItemsSubtotal(): float foreach ($this->getAllItems() as $i) { $itemsSubtotal += $i->getQty() * $i->getAmount(); } + return $itemsSubtotal; } @@ -141,13 +142,14 @@ private function _applyAdjustment(float $sum): float $sum -= $this->getDiscount(); } } + return $sum; } private function _applyDiscount(float $sum, float $itemsSubtotal): float { if (empty($this->_transferFlags[self::AMOUNT_DISCOUNT])) { - $sum -= $this->getDiscount(); + $sum -= $this->getDiscount(); $this->_areAmountsValid = round($this->getDiscount(), 4) < round($itemsSubtotal, 4); } else { $this->_areAmountsValid = $itemsSubtotal > 0.00001; diff --git a/app/code/Payfast/Payfast/Model/Config.php b/app/code/Payfast/Payfast/Model/Config.php index e0ae375..5a2f994 100644 --- a/app/code/Payfast/Payfast/Model/Config.php +++ b/app/code/Payfast/Payfast/Model/Config.php @@ -1,6 +1,6 @@ [ @@ -231,7 +231,7 @@ public function getCountryMethods(string $countryCode = null): array */ public function getPaymentMarkImageUrl(): string { - return $this->_assetRepo->getUrl('Payfast_Payfast::images/logo.svg'); + return $this->_assetRepo->getUrl('Payfast_Payfast::images/payfast-logo.svg'); } /** diff --git a/app/code/Payfast/Payfast/Model/Info.php b/app/code/Payfast/Payfast/Model/Info.php index 4cb81c4..bc4cd02 100644 --- a/app/code/Payfast/Payfast/Model/Info.php +++ b/app/code/Payfast/Payfast/Model/Info.php @@ -1,9 +1,4 @@ _config->isMethodAvailable(); } @@ -207,9 +207,9 @@ public function isAvailable(CartInterface $quote = null): bool /** * This where we compile data posted by the form to payfast * + * @return array * @var Order $order * - * @return array */ public function getStandardCheckoutFormFields(): array { @@ -449,6 +449,7 @@ protected function getOrderTransaction(OrderPaymentInterface $payment): false|Tr ); } catch (InputException $e) { $this->payfastLogger->error($e->getMessage()); + return false; } } diff --git a/app/code/Payfast/Payfast/Model/PayfastConfigProvider.php b/app/code/Payfast/Payfast/Model/PayfastConfigProvider.php index 286152a..7fb00b5 100644 --- a/app/code/Payfast/Payfast/Model/PayfastConfigProvider.php +++ b/app/code/Payfast/Payfast/Model/PayfastConfigProvider.php @@ -1,6 +1,6 @@ - +
- + @@ -25,7 +19,7 @@ - + Magento\Config\Model\Config\Source\Yesno Log request data to payfast.log, should be set to "No" when site is live @@ -59,7 +53,9 @@ - If passphrase set, ensure the identical passphrase is set on your Payfast account + If passphrase set, ensure the identical passphrase is set on your Payfast Aggregation + account + diff --git a/app/code/Payfast/Payfast/etc/config.xml b/app/code/Payfast/Payfast/etc/config.xml index 7eca51b..1e2719d 100644 --- a/app/code/Payfast/Payfast/etc/config.xml +++ b/app/code/Payfast/Payfast/etc/config.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/etc/di.xml b/app/code/Payfast/Payfast/etc/di.xml index 7bfbdb7..9a81fa8 100644 --- a/app/code/Payfast/Payfast/etc/di.xml +++ b/app/code/Payfast/Payfast/etc/di.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/etc/frontend/di.xml b/app/code/Payfast/Payfast/etc/frontend/di.xml index bdd774d..405d413 100644 --- a/app/code/Payfast/Payfast/etc/frontend/di.xml +++ b/app/code/Payfast/Payfast/etc/frontend/di.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/etc/frontend/routes.xml b/app/code/Payfast/Payfast/etc/frontend/routes.xml index 522f55c..ca78b3a 100644 --- a/app/code/Payfast/Payfast/etc/frontend/routes.xml +++ b/app/code/Payfast/Payfast/etc/frontend/routes.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/etc/frontend/sections.xml b/app/code/Payfast/Payfast/etc/frontend/sections.xml index 83e2fa4..54efec0 100644 --- a/app/code/Payfast/Payfast/etc/frontend/sections.xml +++ b/app/code/Payfast/Payfast/etc/frontend/sections.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/etc/module.xml b/app/code/Payfast/Payfast/etc/module.xml index c01d0a0..96441f8 100644 --- a/app/code/Payfast/Payfast/etc/module.xml +++ b/app/code/Payfast/Payfast/etc/module.xml @@ -1,14 +1,8 @@ - + - + diff --git a/app/code/Payfast/Payfast/etc/payment.xml b/app/code/Payfast/Payfast/etc/payment.xml index 0660bf4..b4875bd 100644 --- a/app/code/Payfast/Payfast/etc/payment.xml +++ b/app/code/Payfast/Payfast/etc/payment.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/registration.php b/app/code/Payfast/Payfast/registration.php index 6c83d5e..94152b5 100644 --- a/app/code/Payfast/Payfast/registration.php +++ b/app/code/Payfast/Payfast/registration.php @@ -1,5 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/view/frontend/layout/payfast_notify_index.xml b/app/code/Payfast/Payfast/view/frontend/layout/payfast_notify_index.xml index 15ca0cb..12564b6 100644 --- a/app/code/Payfast/Payfast/view/frontend/layout/payfast_notify_index.xml +++ b/app/code/Payfast/Payfast/view/frontend/layout/payfast_notify_index.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/view/frontend/layout/payfast_redirect_index.xml b/app/code/Payfast/Payfast/view/frontend/layout/payfast_redirect_index.xml index 15ca0cb..12564b6 100644 --- a/app/code/Payfast/Payfast/view/frontend/layout/payfast_redirect_index.xml +++ b/app/code/Payfast/Payfast/view/frontend/layout/payfast_redirect_index.xml @@ -1,11 +1,5 @@ - + diff --git a/app/code/Payfast/Payfast/view/frontend/templates/form/payfast.phtml b/app/code/Payfast/Payfast/view/frontend/templates/form/payfast.phtml index a8a335f..0129adc 100644 --- a/app/code/Payfast/Payfast/view/frontend/templates/form/payfast.phtml +++ b/app/code/Payfast/Payfast/view/frontend/templates/form/payfast.phtml @@ -1,12 +1,12 @@ - + getMethod()->getInstructions()): ?> diff --git a/app/code/Payfast/Payfast/view/frontend/templates/html/rk.phtml b/app/code/Payfast/Payfast/view/frontend/templates/html/rk.phtml index 5fb20ac..c749cec 100644 --- a/app/code/Payfast/Payfast/view/frontend/templates/html/rk.phtml +++ b/app/code/Payfast/Payfast/view/frontend/templates/html/rk.phtml @@ -1,6 +1,6 @@
+ $escaper->escapeUrl($block->getGateUrl()); ?>" method="POST"> getPostData() as $key => $value): ?> - + diff --git a/app/code/Payfast/Payfast/view/frontend/templates/redirect.phtml b/app/code/Payfast/Payfast/view/frontend/templates/redirect.phtml index f6ac16e..146229f 100644 --- a/app/code/Payfast/Payfast/view/frontend/templates/redirect.phtml +++ b/app/code/Payfast/Payfast/view/frontend/templates/redirect.phtml @@ -1,6 +1,6 @@

escapeHtml($block->getMessage()); ?>

-escapeHtml($block->getMessage()); ?> +escapeHtml($block->getId()); ?>" action="escapeHtml($block->getFormAction()); ?>" + $escaper->escapeHtml($block->getFormAction()); ?>" method="post"> getFormData() as $item => $value): ?> + $escaper->escapeHtml($item); ?>" value="escapeHtml($value); ?>" size="200">
diff --git a/app/code/Payfast/Payfast/view/frontend/web/css/payfast_checkout.css b/app/code/Payfast/Payfast/view/frontend/web/css/payfast_checkout.css index 8d72ef5..edee8f6 100755 --- a/app/code/Payfast/Payfast/view/frontend/web/css/payfast_checkout.css +++ b/app/code/Payfast/Payfast/view/frontend/web/css/payfast_checkout.css @@ -1,3 +1,4 @@ img.payment-icon { max-width: 30%; + max-height: 50px; } diff --git a/app/code/Payfast/Payfast/view/frontend/web/images/logo.svg b/app/code/Payfast/Payfast/view/frontend/web/images/logo.svg deleted file mode 100644 index 8ba1a09..0000000 --- a/app/code/Payfast/Payfast/view/frontend/web/images/logo.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - diff --git a/app/code/Payfast/Payfast/view/frontend/web/images/payfast-logo.svg b/app/code/Payfast/Payfast/view/frontend/web/images/payfast-logo.svg new file mode 100644 index 0000000..b8149c8 --- /dev/null +++ b/app/code/Payfast/Payfast/view/frontend/web/images/payfast-logo.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/method-renderer/payfast-method.js b/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/method-renderer/payfast-method.js index d2303c3..b28e47a 100644 --- a/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/method-renderer/payfast-method.js +++ b/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/method-renderer/payfast-method.js @@ -1,8 +1,3 @@ -/** - * Copyright (c) 2024 Payfast (Pty) Ltd - * You (being anyone who is not Payfast (Pty) Ltd) may download and use this plugin / code in your own website in conjunction with a registered and active Payfast account. If your Payfast account is terminated for any reason, you may not use this plugin / code or part thereof. - * Except as expressly indicated in this licence, you may not use, copy, modify or distribute this plugin / code or part thereof in any way. - */ define( [ 'jquery', diff --git a/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/payfast-payments.js b/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/payfast-payments.js index ecb282f..475b88d 100644 --- a/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/payfast-payments.js +++ b/app/code/Payfast/Payfast/view/frontend/web/js/view/payment/payfast-payments.js @@ -1,8 +1,6 @@ /*browser:true*/ /*global define*/ -/*Copyright (c) 2024 Payfast (Pty) Ltd -You (being anyone who is not Payfast (Pty) Ltd) may download and use this plugin / code in your own website in conjunction with a registered and active Payfast account. If your Payfast account is terminated for any reason, you may not use this plugin / code or part thereof. - Except as expressly indicated in this licence, you may not use, copy, modify or distribute this plugin / code or part thereof in any way.*/ + define( [ 'uiComponent', diff --git a/app/code/Payfast/Payfast/view/frontend/web/template/payment/payfast.html b/app/code/Payfast/Payfast/view/frontend/web/template/payment/payfast.html index 6060169..81afeaa 100644 --- a/app/code/Payfast/Payfast/view/frontend/web/template/payment/payfast.html +++ b/app/code/Payfast/Payfast/view/frontend/web/template/payment/payfast.html @@ -1,6 +1,3 @@ -