Skip to content

Commit

Permalink
Added the svgIcon() payment gateway method
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Apr 24, 2024
1 parent a550ae6 commit a3bb89c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ composer.lock
build
tests/temp
/.phpunit.result.cache
/.phpunit.cache/test-results
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,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: Added the following methods to the `Payable` interface:
- `getNumber()`
- `getPayableRemoteId()`
Expand Down
1 change: 1 addition & 0 deletions src/Payment/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`
Expand Down
2 changes: 2 additions & 0 deletions src/Payment/Contracts/PaymentGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ interface PaymentGateway
{
public static function getName(): string;

public static function svgIcon(): string;

public function createPaymentRequest(
Payment $payment,
Address $shippingAddress = null,
Expand Down
5 changes: 5 additions & 0 deletions src/Payment/Gateways/NullGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public static function getName(): string
return __('Offline');
}

public static function svgIcon(): string
{
return '<svg viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"/></svg>';
}

public function createPaymentRequest(
Payment $payment,
Address $shippingAddress = null,
Expand Down
5 changes: 5 additions & 0 deletions src/Payment/Tests/Examples/PlasticPayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions src/Payment/Tests/Examples/UnorthodoxGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a3bb89c

Please sign in to comment.