Skip to content

v1.0.0-alpha.3

Pre-release
Pre-release

Choose a tag to compare

@loevgaard loevgaard released this 06 Aug 09:21
· 21 commits to 1.x since this release
52dd84a

Breaking changes

Unconditionally-required request fields are now required constructor parameters (#2, #3). Every field was verified against the live Quickpay API (not just the docs) before being tightened; all of them were already the first constructor parameters, so positional callers are unaffected:

  • CreatePaymentRequest::$orderId, ::$currency
  • $amount on CreateLinkRequest, CaptureRequest, RefundRequest, AuthorizePaymentRequest — note the API does not fall back to capturing/refunding the remaining balance when amount is omitted; it rejects the operation
  • all five BasketItem fields (qty, itemNo, itemName, itemPrice, vatRate) — the API treats a basket item as all-or-nothing, and a fully-empty item even triggered an HTTP 500 on Quickpay's side
  • PaymentsEndpoint::authorize() now requires its $request (a bodyless authorize can never succeed)

A missing required field now fails at the call site (and in static analysis) instead of surfacing as a ValidationException after a network round-trip. Address and Shipping stay all-optional — verified lenient against the live API. Beware Shipping::$method: when present it must be one of Quickpay's accepted values.

Fixed

  • A Payload with no set fields was serialized as [] (a JSON array), which the API always rejects (body: "is invalid") — e.g. updatePayment($id, new UpdatePaymentRequest()) could never succeed. It is now sent as {}. (#2)
  • updatePayment()'s docblock said PUT; the SDK sends PATCH. (#4)

Improved

  • Docblocks on authorize/capture/refund/cancel now document what the async (202) response actually contains — a snapshot taken when the operation was queued (pending: true, pre-operation state/balance) — and how to confirm the outcome (callback, or poll getById()).
  • Test suite audit: 92 → 103 tests; mutation score MSI 72% → 80%, covered MSI 76% → 82%. New regression guards include the strict-mapping failure path (MappingException), both supported date formats, 202 handling, and the host-pinning guard's edge cases. (#4)
  • README: documents the required-constructor-argument rule and fixes the ValidationException example's order id (3 chars would nowadays fail the API's 4–20 length rule). (#4)

Full changelog: v1.0.0-alpha.2...v1.0.0-alpha.3