Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BA-493 Fix: HouseNumberAdditional to HouseNumberSuffix mapping #187

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
9 changes: 5 additions & 4 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\AddressAdapter;
use Buckaroo\PaymentMethods\Subscriptions\Service\ParameterKeys\CompanyAdapter;

class Subscription extends ServiceParameter
Expand Down Expand Up @@ -96,9 +97,9 @@ class Subscription extends ServiceParameter
*/
protected Phone $phone;
/**
* @var Address
* @var AddressAdapter
*/
protected Address $address;
protected AddressAdapter $address;
/**
* @var Person
*/
Expand Down Expand Up @@ -247,13 +248,13 @@ public function phone($phone = null)

/**
* @param $address
* @return Address
* @return AddressAdapter
*/
public function address($address = null)
{
if (is_array($address))
{
$this->address = new Address($address);
$this->address = new AddressAdapter(new Address($address));
}

return $this->address;
Expand Down
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\Subscriptions\Service\ParameterKeys;

use Buckaroo\Models\Adapters\ServiceParametersKeysAdapter;

class AddressAdapter extends ServiceParametersKeysAdapter
{
protected array $keys = [
'houseNumberAdditional' => 'HouseNumberSuffix',
];
}
1 change: 1 addition & 0 deletions tests/Buckaroo/Payments/SubscriptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function it_creates_a_combined_subscription()
'address' => [
'street' => 'Hoofdstraat',
'houseNumber' => '90',
'houseNumberAdditional' => 'a',
'zipcode' => '8441ER',
'city' => 'Heerenveen',
'country' => 'NL',
Expand Down
Loading