Skip to content

Commit

Permalink
Added BNPL payment method
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaryska committed Jul 11, 2024
1 parent 2643a05 commit 37063f1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 25 deletions.
6 changes: 6 additions & 0 deletions gopay-php-api.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="SonarLintModuleSettings">
<option name="uniqueId" value="2d2c7470-064f-4688-a062-16b8bfd62359" />
</component>
</module>
2 changes: 2 additions & 0 deletions src/Definition/Payment/PaymentInstrument.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ class PaymentInstrument
const GPAY = 'GPAY';
const APPLE_PAY = 'APPLE_PAY';
const CLICK_TO_PAY = 'CLICK_TO_PAY';
const TWISTO = 'TWISTO';
const SKIPPAY = 'SKIPPAY';
}
59 changes: 34 additions & 25 deletions tests/integration/CreatePaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,42 @@ protected function setUp(): void
public static function createBasePayment()
{
$basePayment = [
'payer' => [
'allowed_payment_instruments' => [
PaymentInstrument::BANK_ACCOUNT,
PaymentInstrument::PAYMENT_CARD
'payer' => [
'allowed_payment_instruments' => [
PaymentInstrument::BANK_ACCOUNT,
PaymentInstrument::PAYMENT_CARD,
# PaymentInstrument::TWISTO,
# PaymentInstrument::SKIPPAY
],
# 'allowed_bnpl_types' => [
# 'LATER',
# 'THIRDS'
# ],
# 'default_bnpl_type' => 'LATER',
# 'default_payment_instrument' => PaymentInstrument::TWISTO
'allowed_swifts' => [BankSwiftCode::RAIFFEISENBANK, BankSwiftCode::CESKA_SPORITELNA],
# 'default_swift' => BankSwiftCode::FIO_BANKA,
# 'default_payment_instrument' => PaymentInstrument::BANK_ACCOUNT,
# 'default_payment_instrument' => PaymentInstrument::TWISTO,
'contact' => [
'email' => '[email protected]',
],
],
'allowed_swifts' => [BankSwiftCode::RAIFFEISENBANK, BankSwiftCode::CESKA_SPORITELNA],
//'default_swift' => BankSwiftCode::FIO_BANKA,
//'default_payment_instrument' => PaymentInstrument::BANK_ACCOUNT,
'contact' => [
'email' => '[email protected]',
'order_number' => '9876',
'amount' => 2300,
'currency' => Currency::CZECH_CROWNS,
'order_description' => '9876Description',
'lang' => Language::CZECH,
'additional_params' => [
array('name' => 'invoicenumber', 'value' => '2015001003')
],
'items' => [
['name' => 'item01', 'amount' => 2300, 'count' => 1],
],
'callback' => [
'return_url' => 'https://eshop123.cz/return',
'notification_url' => 'https://eshop123.cz/notify'
],
],
'order_number' => '9876',
'amount' => 2300,
'currency' => Currency::CZECH_CROWNS,
'order_description' => '9876Description',
'lang' => Language::CZECH,
'additional_params' => [
array('name' => 'invoicenumber', 'value' => '2015001003')
],
'items' => [
['name' => 'item01', 'amount' => 2300, 'count' => 1],
],
'callback' => [
'return_url' => 'https://eshop123.cz/return',
'notification_url' => 'https://eshop123.cz/notify'
],
];

return $basePayment;
Expand Down

0 comments on commit 37063f1

Please sign in to comment.