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 7912218 commit ca8cda1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions 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 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 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 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 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 ca8cda1

Please sign in to comment.