Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuCh3n committed Sep 4, 2024
2 parents 4be1046 + 85ed224 commit f394e12
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "buckaroo/sdk",
"description": "Buckaroo payment SDK",
"license": "MIT",
"version": "1.14.0",
"version": "1.14.1",
"type": "library",
"require": {
"php": ">=7.4|^8.0",
Expand Down
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 [email protected] 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 [email protected] 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

0 comments on commit f394e12

Please sign in to comment.