Skip to content

Commit

Permalink
Merge pull request #64 from gopaycommunity/hotfix/GPMAIN-7759-bnpl
Browse files Browse the repository at this point in the history
Hotfix/gpmain 7759 bnpl
  • Loading branch information
pmaryska authored Sep 6, 2024
2 parents 2845fe5 + ad606fc commit fd171e3
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# IDE
/nbproject/
.idea
/gopay-php-api.iml

# APP
/vendor/
Expand Down
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>
9 changes: 9 additions & 0 deletions src/Definition/Payment/BnplType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace GoPay\Definition\Payment;

class BnplType
{
const DEFERRED_PAYMENT = 'DEFERRED_PAYMENT';
const PAY_IN_THREE = 'PAY_IN_THREE';
}
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 @@ -5,6 +5,7 @@
require_once 'TestUtils.php';

use GoPay\Definition\Language;
use GoPay\Definition\Payment\BnplType;
use GoPay\Definition\Payment\Currency;
use GoPay\Definition\Payment\PaymentInstrument;
use GoPay\Definition\Payment\BankSwiftCode;
Expand Down Expand Up @@ -34,33 +35,41 @@ 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' => [
# BnplType::DEFERRED_PAYMENT,
# BnplType::PAY_IN_THREE
# ],
# 'default_bnpl_type' => BnplType::DEFERRED_PAYMENT,
# 'default_payment_instrument' => PaymentInstrument::TWISTO
'allowed_swifts' => [BankSwiftCode::RAIFFEISENBANK, BankSwiftCode::CESKA_SPORITELNA],
# 'default_swift' => BankSwiftCode::FIO_BANKA,
# 'default_payment_instrument' => PaymentInstrument::BANK_ACCOUNT,
'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 fd171e3

Please sign in to comment.