Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
add option to allow global billing countries (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
digibeuk authored and Feijs committed Apr 8, 2019
1 parent 4e0fba4 commit 6257a0f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/WidgetOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static function fromArray(array $data): WidgetOptions
'radius_border' => null,
'show_subtotal_detail' => false,
'require_validate_callback_success' => false,
'allow_global_billing_countries' => false,
];

return new self(array_merge($defaults, array_intersect_key($data, $defaults)));
Expand Down
1 change: 1 addition & 0 deletions tests/Message/AuthorizeRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ public function testGetDataWithOptionsWillReturnCorrectData()
'radius_border' => '5px',
'show_subtotal_detail' => true,
'require_validate_callback_success' => true,
'allow_global_billing_countries' => false,
];

$this->authorizeRequest->initialize(
Expand Down
10 changes: 5 additions & 5 deletions tests/Message/UpdateTransactionRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class UpdateTransactionRequestTest extends RequestTestCase
use ItemDataTestTrait;
use MerchantUrlsDataTestTrait;
use ExpectedAuthorizationHeaderTrait;

const TRANSACTION_REFERENCE = 1234;

/**
Expand Down Expand Up @@ -310,6 +309,7 @@ public function testGetDataWithOptionsWillReturnCorrectData()
'radius_border' => '5px',
'show_subtotal_detail' => true,
'require_validate_callback_success' => true,
'allow_global_billing_countries' => false,
];

$this->updateTransactionRequest->initialize(
Expand Down Expand Up @@ -388,7 +388,7 @@ public function testSendDataWillUpdateManagementCustomerDetailsAndFailUpdatingMe
'POST',
sprintf('%s/checkout/v3/orders/%s', self::BASE_URL, self::TRANSACTION_REFERENCE),
array_merge(['Content-Type' => 'application/json'], $this->getExpectedHeaders()),
\json_encode($inputData)
\json_encode($inputData),
],
[
'PATCH',
Expand All @@ -401,7 +401,7 @@ public function testSendDataWillUpdateManagementCustomerDetailsAndFailUpdatingMe
['Content-Type' => 'application/json'],
$this->getExpectedHeaders()
),
\json_encode($inputData)
\json_encode($inputData),
]
)
->willReturn($response);
Expand Down Expand Up @@ -440,7 +440,7 @@ public function testSendDataWillUpdateOrderManagementMerchantReferences()
'POST',
sprintf('%s/checkout/v3/orders/%s', self::BASE_URL, self::TRANSACTION_REFERENCE),
array_merge(['Content-Type' => 'application/json'], $this->getExpectedHeaders()),
\json_encode($merchantReferencesData)
\json_encode($merchantReferencesData),
],
[
'PATCH',
Expand All @@ -450,7 +450,7 @@ public function testSendDataWillUpdateOrderManagementMerchantReferences()
self::TRANSACTION_REFERENCE
),
array_merge(['Content-Type' => 'application/json'], $this->getExpectedHeaders()),
\json_encode($merchantReferencesData)
\json_encode($merchantReferencesData),
]
)
->willReturn($response);
Expand Down
3 changes: 3 additions & 0 deletions tests/Message/WidgetOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function dataProvider(): array
'radius_border' => '5px',
'show_subtotal_detail' => true,
'require_validate_callback_success' => true,
'allow_global_billing_countries' => false,
],
],
[
Expand All @@ -76,6 +77,7 @@ public function dataProvider(): array
'radius_border' => null,
'show_subtotal_detail' => false,
'require_validate_callback_success' => false,
'allow_global_billing_countries' => false,
],
],
[
Expand All @@ -96,6 +98,7 @@ public function dataProvider(): array
'radius_border' => null,
'show_subtotal_detail' => false,
'require_validate_callback_success' => false,
'allow_global_billing_countries' => false,
],
],
];
Expand Down

0 comments on commit 6257a0f

Please sign in to comment.