Repository navigation
6.2.0
Release 6.2.0 (#375)
This release introduces several enhancements and fixes to the balances and payments functionality, focusing on improved support for sub-account (currency account) operations, more robust query parameter handling, and expanded test coverage. Key changes include the addition of a new endpoint for retrieving top-up instructions, improvements to query parameter serialization, and new/updated tests to ensure correct API contract adherence.
Balances and Currency Account Enhancements:
- Added a
retrieveTopUpInstructionsmethod toBalancesClient, allowing retrieval of bank details and payment reference information required to top up a sub-account (currency account). This includes comprehensive documentation of the response structure. (lib/Checkout/Balances/BalancesClient.php) [1] [2] - Introduced the
balances:top-up-instructionsOAuth scope to support authorization for the new endpoint. (lib/Checkout/OAuthScope.php)
Query Parameter Serialization Improvements:
- Enhanced
AbstractQueryFilter::getEncodedQueryParameters()to only include set parameters, avoid trailing ampersands, and serialize booleans as"true"/"false"(not1/0) to comply with API requirements. (lib/Checkout/Common/AbstractQueryFilter.php) - Extended
BalancesQueryto supportwithCurrencyAccountId(boolean) andbalancesAt(datetime) parameters, with detailed documentation on naming and expected wire format. (lib/Checkout/Balances/BalancesQuery.php)
Payments API Schema Update:
- Added the
amount_allocationsproperty toPaymentSessionSubmitRequest, supporting allocation of payment amounts to sub-entities, with min/max constraints and documentation. (lib/Checkout/Payments/Sessions/PaymentSessionSubmitRequest.php)
Test Coverage and Validation:
- Added and updated unit and integration tests for:
- Serialization of
BalancesQueryparameters, ensuring camelCase keys and correct boolean/date formatting. (test/Checkout/Tests/Balances/BalancesQuerySerializationTest.php) - The new
retrieveTopUpInstructionsendpoint, including both mocked and integration tests that handle expected API error responses gracefully. (test/Checkout/Tests/Balances/BalancesClientTest.php,test/Checkout/Tests/Balances/BalancesIntegrationTest.php) [1] [2] [3] [4] - Serialization of
amount_allocationsin payment session requests. (test/Checkout/Tests/Payments/Sessions/PaymentSessionSubmitRequestSerializationTest.php)
- Serialization of
- Updated test OAuth scopes to include the new
balances:top-up-instructionspermission. (test/Checkout/Tests/SandboxTestFixture.php)
These changes improve the SDK's compliance with the latest API specifications, enhance developer usability, and strengthen contract validation through comprehensive testing.