From ca8cda17e3a8fd1001d596aecc6d1c8b4924a3d2 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:18:14 +0300 Subject: [PATCH] Added the `svgIcon()` payment gateway method --- Changelog.md | 1 + Contracts/PaymentGateway.php | 2 ++ Gateways/NullGateway.php | 5 +++++ Tests/Examples/PlasticPayments.php | 5 +++++ Tests/Examples/UnorthodoxGateway.php | 5 +++++ 5 files changed, 18 insertions(+) diff --git a/Changelog.md b/Changelog.md index 36441a5..acd9336 100644 --- a/Changelog.md +++ b/Changelog.md @@ -20,6 +20,7 @@ - `isOffline()` - BC: Added the `getTransactionAmount()` method to the `PaymentResponse` interface - BC: Added the `transactionHandler()` method to the `PaymentGateway` interface (experimental feature) +- BC: Added the `svgIcon()` static method to the `PaymentGateway` interface - BC: Changed the `PaymentMethod` interface into Configurable - Deprecated the `PaymentMethod::getConfiguration()` in favor of `configuration()` - Deprecated the `PaymentResponse::getAmountPaid()` method in favor of `getTransactionAmount()` diff --git a/Contracts/PaymentGateway.php b/Contracts/PaymentGateway.php index 09bd761..e3fe495 100644 --- a/Contracts/PaymentGateway.php +++ b/Contracts/PaymentGateway.php @@ -21,6 +21,8 @@ interface PaymentGateway { public static function getName(): string; + public static function svgIcon(): string; + public function createPaymentRequest( Payment $payment, Address $shippingAddress = null, diff --git a/Gateways/NullGateway.php b/Gateways/NullGateway.php index 08ba045..6ae4ab4 100644 --- a/Gateways/NullGateway.php +++ b/Gateways/NullGateway.php @@ -31,6 +31,11 @@ public static function getName(): string return __('Offline'); } + public static function svgIcon(): string + { + return ''; + } + public function createPaymentRequest( Payment $payment, Address $shippingAddress = null, diff --git a/Tests/Examples/PlasticPayments.php b/Tests/Examples/PlasticPayments.php index b26b880..900e514 100644 --- a/Tests/Examples/PlasticPayments.php +++ b/Tests/Examples/PlasticPayments.php @@ -31,6 +31,11 @@ public static function getName(): string return 'Plastic Payments'; } + public static function svgIcon(): string + { + return ''; + } + public function createPaymentRequest( Payment $payment, Address $shippingAddress = null, diff --git a/Tests/Examples/UnorthodoxGateway.php b/Tests/Examples/UnorthodoxGateway.php index 646281a..6c52851 100644 --- a/Tests/Examples/UnorthodoxGateway.php +++ b/Tests/Examples/UnorthodoxGateway.php @@ -31,6 +31,11 @@ public static function getName(): string return 'Unorthodox Payments'; } + public static function svgIcon(): string + { + return ''; + } + public function createPaymentRequest( Payment $payment, Address $shippingAddress = null,