Skip to content

6.2.0

Choose a tag to compare

@github-actions github-actions released this 10 Sep 13:00
429dd04

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 retrieveTopUpInstructions method to BalancesClient, 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-instructions OAuth 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" (not 1/0) to comply with API requirements. (lib/Checkout/Common/AbstractQueryFilter.php)
  • Extended BalancesQuery to support withCurrencyAccountId (boolean) and balancesAt (datetime) parameters, with detailed documentation on naming and expected wire format. (lib/Checkout/Balances/BalancesQuery.php)

Payments API Schema Update:

  • Added the amount_allocations property to PaymentSessionSubmitRequest, 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 BalancesQuery parameters, ensuring camelCase keys and correct boolean/date formatting. (test/Checkout/Tests/Balances/BalancesQuerySerializationTest.php)
    • The new retrieveTopUpInstructions endpoint, 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_allocations in payment session requests. (test/Checkout/Tests/Payments/Sessions/PaymentSessionSubmitRequestSerializationTest.php)
  • Updated test OAuth scopes to include the new balances:top-up-instructions permission. (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.