Skip to content

Commit 5f74259

Browse files
Merge pull request #254 from buckaroo-it/BTI-719-add-banking-payment-method
BTI-719 Add Banking payment method
2 parents d36fd5c + f188f28 commit 5f74259

8 files changed

Lines changed: 459 additions & 0 deletions

File tree

example/transactions/banking.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
require_once '../bootstrap.php';
4+
5+
use Buckaroo\BuckarooClient;
6+
7+
$buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']);
8+
9+
// PaymentOrder
10+
$response = $buckaroo->method('banking')->paymentOrder([
11+
'amountCredit' => 0.1,
12+
'invoice' => uniqid(),
13+
'description' => 'Banking PaymentOrder Test',
14+
'accountHolderName' => 'John Smith',
15+
'iban' => 'NL44RABO0123456789',
16+
'processingDate' => '12/12/2026',
17+
'bic' => 'PAYMINBBXXX',
18+
'purpose' => 'Testing',
19+
'structuredIssuerType' => 'ISO',
20+
'structuredReference' => 'RF18539007547034',
21+
]);
22+
23+
// InstantPaymentOrder
24+
$instantResponse = $buckaroo->method('banking')->instantPaymentOrder([
25+
'amountCredit' => 0.1,
26+
'invoice' => uniqid(),
27+
'description' => 'Banking Instant PaymentOrder Test',
28+
'accountHolderName' => 'John Smith',
29+
'iban' => 'NL44RABO0123456789',
30+
]);
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
/*
3+
* NOTICE OF LICENSE
4+
*
5+
* This source file is subject to the MIT License
6+
* It is available through the world-wide-web at this URL:
7+
* https://tldrlegal.com/license/mit-license
8+
* If you are unable to obtain it through the world-wide-web, please send an email
9+
* to support@buckaroo.nl so we can send you a copy immediately.
10+
*
11+
* DISCLAIMER
12+
*
13+
* Do not edit or add to this file if you wish to upgrade this module to newer
14+
* versions in the future. If you wish to customize this module for your
15+
* needs please contact support@buckaroo.nl for more information.
16+
*
17+
* @copyright Copyright (c) Buckaroo B.V.
18+
* @license https://tldrlegal.com/license/mit-license
19+
*/
20+
21+
declare(strict_types=1);
22+
23+
namespace Buckaroo\PaymentMethods\Banking;
24+
25+
use Buckaroo\Models\Model;
26+
use Buckaroo\PaymentMethods\Banking\Models\InstantPaymentOrder;
27+
use Buckaroo\PaymentMethods\Banking\Models\PaymentOrder;
28+
use Buckaroo\PaymentMethods\Banking\Models\PaymentOrderPayload;
29+
use Buckaroo\PaymentMethods\Banking\Service\ParameterKeys\PaymentOrderAdapter;
30+
use Buckaroo\PaymentMethods\PayablePaymentMethod;
31+
use Buckaroo\Transaction\Response\TransactionResponse;
32+
33+
class Banking extends PayablePaymentMethod
34+
{
35+
/**
36+
* @var string
37+
*/
38+
protected string $paymentName = 'Banking';
39+
40+
/**
41+
* @return TransactionResponse
42+
*/
43+
public function paymentOrder(?Model $model = null): TransactionResponse
44+
{
45+
$paymentOrderPayload = new PaymentOrderPayload($this->payload);
46+
47+
$this->request->setPayload($paymentOrderPayload);
48+
49+
$this->setServiceList('PaymentOrder', $model ?? new PaymentOrderAdapter(new PaymentOrder($this->payload)));
50+
51+
return $this->postRequest();
52+
}
53+
54+
/**
55+
* @return TransactionResponse
56+
*/
57+
public function instantPaymentOrder(?Model $model = null): TransactionResponse
58+
{
59+
$paymentOrderPayload = new PaymentOrderPayload($this->payload);
60+
61+
$this->request->setPayload($paymentOrderPayload);
62+
63+
$this->setServiceList('InstantPaymentOrder', $model ?? new PaymentOrderAdapter(new InstantPaymentOrder($this->payload)));
64+
65+
return $this->postRequest();
66+
}
67+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/*
3+
* NOTICE OF LICENSE
4+
*
5+
* This source file is subject to the MIT License
6+
* It is available through the world-wide-web at this URL:
7+
* https://tldrlegal.com/license/mit-license
8+
* If you are unable to obtain it through the world-wide-web, please send an email
9+
* to support@buckaroo.nl so we can send you a copy immediately.
10+
*
11+
* DISCLAIMER
12+
*
13+
* Do not edit or add to this file if you wish to upgrade this module to newer
14+
* versions in the future. If you wish to customize this module for your
15+
* needs please contact support@buckaroo.nl for more information.
16+
*
17+
* @copyright Copyright (c) Buckaroo B.V.
18+
* @license https://tldrlegal.com/license/mit-license
19+
*/
20+
21+
namespace Buckaroo\PaymentMethods\Banking\Models;
22+
23+
use Buckaroo\Models\ServiceParameter;
24+
25+
class InstantPaymentOrder extends ServiceParameter
26+
{
27+
/**
28+
* @var string
29+
*/
30+
protected string $accountHolderName;
31+
32+
/**
33+
* @var string
34+
*/
35+
protected string $iban;
36+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/*
3+
* NOTICE OF LICENSE
4+
*
5+
* This source file is subject to the MIT License
6+
* It is available through the world-wide-web at this URL:
7+
* https://tldrlegal.com/license/mit-license
8+
* If you are unable to obtain it through the world-wide-web, please send an email
9+
* to support@buckaroo.nl so we can send you a copy immediately.
10+
*
11+
* DISCLAIMER
12+
*
13+
* Do not edit or add to this file if you wish to upgrade this module to newer
14+
* versions in the future. If you wish to customize this module for your
15+
* needs please contact support@buckaroo.nl for more information.
16+
*
17+
* @copyright Copyright (c) Buckaroo B.V.
18+
* @license https://tldrlegal.com/license/mit-license
19+
*/
20+
21+
namespace Buckaroo\PaymentMethods\Banking\Models;
22+
23+
use Buckaroo\Models\ServiceParameter;
24+
25+
class PaymentOrder extends ServiceParameter
26+
{
27+
/**
28+
* @var string
29+
*/
30+
protected string $accountHolderName;
31+
32+
/**
33+
* @var string
34+
*/
35+
protected string $iban;
36+
37+
/**
38+
* @var string|null
39+
*/
40+
protected ?string $processingDate;
41+
42+
/**
43+
* @var string|null
44+
*/
45+
protected ?string $bic;
46+
47+
/**
48+
* @var string|null
49+
*/
50+
protected ?string $purpose;
51+
52+
/**
53+
* @var string|null
54+
*/
55+
protected ?string $structuredIssuerType;
56+
57+
/**
58+
* @var string|null
59+
*/
60+
protected ?string $structuredReference;
61+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/*
3+
* NOTICE OF LICENSE
4+
*
5+
* This source file is subject to the MIT License
6+
* It is available through the world-wide-web at this URL:
7+
* https://tldrlegal.com/license/mit-license
8+
* If you are unable to obtain it through the world-wide-web, please send an email
9+
* to support@buckaroo.nl so we can send you a copy immediately.
10+
*
11+
* DISCLAIMER
12+
*
13+
* Do not edit or add to this file if you wish to upgrade this module to newer
14+
* versions in the future. If you wish to customize this module for your
15+
* needs please contact support@buckaroo.nl for more information.
16+
*
17+
* @copyright Copyright (c) Buckaroo B.V.
18+
* @license https://tldrlegal.com/license/mit-license
19+
*/
20+
21+
namespace Buckaroo\PaymentMethods\Banking\Models;
22+
23+
use Buckaroo\Models\Payload\Payload;
24+
25+
class PaymentOrderPayload extends Payload
26+
{
27+
/**
28+
* @var float
29+
*/
30+
protected float $amountCredit;
31+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/*
3+
* NOTICE OF LICENSE
4+
*
5+
* This source file is subject to the MIT License
6+
* It is available through the world-wide-web at this URL:
7+
* https://tldrlegal.com/license/mit-license
8+
* If you are unable to obtain it through the world-wide-web, please send an email
9+
* to support@buckaroo.nl so we can send you a copy immediately.
10+
*
11+
* DISCLAIMER
12+
*
13+
* Do not edit or add to this file if you wish to upgrade this module to newer
14+
* versions in the future. If you wish to customize this module for your
15+
* needs please contact support@buckaroo.nl for more information.
16+
*
17+
* @copyright Copyright (c) Buckaroo B.V.
18+
* @license https://tldrlegal.com/license/mit-license
19+
*/
20+
21+
namespace Buckaroo\PaymentMethods\Banking\Service\ParameterKeys;
22+
23+
use Buckaroo\Models\Adapters\ServiceParametersKeysAdapter;
24+
25+
class PaymentOrderAdapter extends ServiceParametersKeysAdapter
26+
{
27+
protected array $keys = [
28+
'accountHolderName' => 'AccountHolderName',
29+
'iban' => 'IBAN',
30+
'processingDate' => 'ProcessingDate',
31+
'bic' => 'BIC',
32+
'purpose' => 'Purpose',
33+
'structuredIssuerType' => 'StructuredIssuerType',
34+
'structuredReference' => 'StructuredReference',
35+
];
36+
}

src/PaymentMethods/PaymentMethodFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Buckaroo\PaymentMethods\Alipay\Alipay;
2727
use Buckaroo\PaymentMethods\ApplePay\ApplePay;
2828
use Buckaroo\PaymentMethods\Bancontact\Bancontact;
29+
use Buckaroo\PaymentMethods\Banking\Banking;
2930
use Buckaroo\PaymentMethods\BankTransfer\BankTransfer;
3031
use Buckaroo\PaymentMethods\Belfius\Belfius;
3132
use Buckaroo\PaymentMethods\Billink\Billink;
@@ -84,6 +85,7 @@ class PaymentMethodFactory
8485
Afterpay::class => ['afterpay'],
8586
AfterpayDigiAccept::class => ['afterpaydigiaccept'],
8687
Bancontact::class => ['bancontact', 'bancontactmrcash'],
88+
Banking::class => ['banking'],
8789
Bizum::class => ['bizum'],
8890
Billink::class => ['billink'],
8991
Blik::class => ['blik'],

0 commit comments

Comments
 (0)