Skip to content

Commit

Permalink
Add adapter to the bankaccount
Browse files Browse the repository at this point in the history
  • Loading branch information
Shu Chen committed Dec 18, 2024
1 parent 26fae37 commit 172df3d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PaymentMethods/Subscriptions/Models/Subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Buckaroo\Models\Person;
use Buckaroo\Models\Phone;
use Buckaroo\Models\ServiceParameter;
use Buckaroo\PaymentMethods\Subscriptions\Service\ParameterKeys\BankAccountAdapter;
use Buckaroo\PaymentMethods\Subscriptions\Service\ParameterKeys\AddressAdapter;
use Buckaroo\PaymentMethods\Subscriptions\Service\ParameterKeys\CompanyAdapter;

Expand Down Expand Up @@ -85,9 +86,9 @@ class Subscription extends ServiceParameter
*/
protected Debtor $debtor;
/**
* @var BankAccount
* @var BankAccountAdapter
*/
protected BankAccount $bankAccount;
protected BankAccountAdapter $bankAccount;
/**
* @var Email
*/
Expand Down Expand Up @@ -212,7 +213,7 @@ public function bankAccount($bankAccount = null)
{
if (is_array($bankAccount))
{
$this->bankAccount = new BankAccount($bankAccount);
$this->bankAccount = new BankAccountAdapter(new BankAccount($bankAccount));
}

return $this->bankAccount;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?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\Subscriptions\Service\ParameterKeys;

use Buckaroo\Models\Adapters\ServiceParametersKeysAdapter;

class BankAccountAdapter extends ServiceParametersKeysAdapter
{
/**
* @var array|string[]
*/
protected array $keys = [
'iban' => 'CustomerIBAN',
'accountName' => 'CustomerAccountName',
'bic' => 'CustomerBIC'
];
}

0 comments on commit 172df3d

Please sign in to comment.