Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions example/transactions/banking.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

require_once '../bootstrap.php';

use Buckaroo\BuckarooClient;

$buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']);

// PaymentOrder
$response = $buckaroo->method('banking')->paymentOrder([
'amountCredit' => 0.1,
'invoice' => uniqid(),
'description' => 'Banking PaymentOrder Test',
'accountHolderName' => 'John Smith',
'iban' => 'NL44RABO0123456789',
'processingDate' => '12/12/2026',
'bic' => 'PAYMINBBXXX',
'purpose' => 'Testing',
'structuredIssuerType' => 'ISO',
'structuredReference' => 'RF18539007547034',
]);

// InstantPaymentOrder
$instantResponse = $buckaroo->method('banking')->instantPaymentOrder([
'amountCredit' => 0.1,
'invoice' => uniqid(),
'description' => 'Banking Instant PaymentOrder Test',
'accountHolderName' => 'John Smith',
'iban' => 'NL44RABO0123456789',
]);
67 changes: 67 additions & 0 deletions src/PaymentMethods/Banking/Banking.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
/*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to support@buckaroo.nl so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact support@buckaroo.nl for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

declare(strict_types=1);

namespace Buckaroo\PaymentMethods\Banking;

use Buckaroo\Models\Model;
use Buckaroo\PaymentMethods\Banking\Models\InstantPaymentOrder;
use Buckaroo\PaymentMethods\Banking\Models\PaymentOrder;
use Buckaroo\PaymentMethods\Banking\Models\PaymentOrderPayload;
use Buckaroo\PaymentMethods\Banking\Service\ParameterKeys\PaymentOrderAdapter;
use Buckaroo\PaymentMethods\PayablePaymentMethod;
use Buckaroo\Transaction\Response\TransactionResponse;

class Banking extends PayablePaymentMethod
{
/**
* @var string
*/
protected string $paymentName = 'Banking';

/**
* @return TransactionResponse
*/
public function paymentOrder(?Model $model = null): TransactionResponse
{
$paymentOrderPayload = new PaymentOrderPayload($this->payload);

$this->request->setPayload($paymentOrderPayload);

$this->setServiceList('PaymentOrder', $model ?? new PaymentOrderAdapter(new PaymentOrder($this->payload)));

return $this->postRequest();
}

/**
* @return TransactionResponse
*/
public function instantPaymentOrder(?Model $model = null): TransactionResponse
{
$paymentOrderPayload = new PaymentOrderPayload($this->payload);

$this->request->setPayload($paymentOrderPayload);

$this->setServiceList('InstantPaymentOrder', $model ?? new PaymentOrderAdapter(new InstantPaymentOrder($this->payload)));

return $this->postRequest();
}
}
36 changes: 36 additions & 0 deletions src/PaymentMethods/Banking/Models/InstantPaymentOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to support@buckaroo.nl so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact support@buckaroo.nl for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

namespace Buckaroo\PaymentMethods\Banking\Models;

use Buckaroo\Models\ServiceParameter;

class InstantPaymentOrder extends ServiceParameter
{
/**
* @var string
*/
protected string $accountHolderName;

/**
* @var string
*/
protected string $iban;
}
61 changes: 61 additions & 0 deletions src/PaymentMethods/Banking/Models/PaymentOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to support@buckaroo.nl so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact support@buckaroo.nl for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

namespace Buckaroo\PaymentMethods\Banking\Models;

use Buckaroo\Models\ServiceParameter;

class PaymentOrder extends ServiceParameter
{
/**
* @var string
*/
protected string $accountHolderName;

/**
* @var string
*/
protected string $iban;

/**
* @var string|null
*/
protected ?string $processingDate;

/**
* @var string|null
*/
protected ?string $bic;

/**
* @var string|null
*/
protected ?string $purpose;

/**
* @var string|null
*/
protected ?string $structuredIssuerType;

/**
* @var string|null
*/
protected ?string $structuredReference;
}
31 changes: 31 additions & 0 deletions src/PaymentMethods/Banking/Models/PaymentOrderPayload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to support@buckaroo.nl so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact support@buckaroo.nl for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

namespace Buckaroo\PaymentMethods\Banking\Models;

use Buckaroo\Models\Payload\Payload;

class PaymentOrderPayload extends Payload
{
/**
* @var float
*/
protected float $amountCredit;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to support@buckaroo.nl so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact support@buckaroo.nl for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

namespace Buckaroo\PaymentMethods\Banking\Service\ParameterKeys;

use Buckaroo\Models\Adapters\ServiceParametersKeysAdapter;

class PaymentOrderAdapter extends ServiceParametersKeysAdapter
{
protected array $keys = [
'accountHolderName' => 'AccountHolderName',
'iban' => 'IBAN',
'processingDate' => 'ProcessingDate',
'bic' => 'BIC',
'purpose' => 'Purpose',
'structuredIssuerType' => 'StructuredIssuerType',
'structuredReference' => 'StructuredReference',
];
}
2 changes: 2 additions & 0 deletions src/PaymentMethods/PaymentMethodFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Buckaroo\PaymentMethods\Alipay\Alipay;
use Buckaroo\PaymentMethods\ApplePay\ApplePay;
use Buckaroo\PaymentMethods\Bancontact\Bancontact;
use Buckaroo\PaymentMethods\Banking\Banking;
use Buckaroo\PaymentMethods\BankTransfer\BankTransfer;
use Buckaroo\PaymentMethods\Belfius\Belfius;
use Buckaroo\PaymentMethods\Billink\Billink;
Expand Down Expand Up @@ -84,6 +85,7 @@ class PaymentMethodFactory
Afterpay::class => ['afterpay'],
AfterpayDigiAccept::class => ['afterpaydigiaccept'],
Bancontact::class => ['bancontact', 'bancontactmrcash'],
Banking::class => ['banking'],
Bizum::class => ['bizum'],
Billink::class => ['billink'],
Blik::class => ['blik'],
Expand Down
Loading
Loading