Skip to content

10.0.0

Latest

Choose a tag to compare

@imlukedewitt imlukedewitt released this 14 Aug 14:33
f5fb09d

ab-php-sdk 10.0.0 Changelog

Breaking Changes

  • unit_balance now accepts an integer or a string. This affects SubscriptionComponent, CreateSubscriptionComponent, MeteredUsage, and PrepaidUsage. The affected getters and setters lost their scalar type declaration, so the value arrives untyped. On MeteredUsage and PrepaidUsage the constructor no longer raises a TypeError for a numeric string.
  • GetOneTimeTokenRequest::$paymentProfile is now a union. The endpoint can return GetOneTimeTokenPaymentProfile or GetOneTimeTokenBankAccountPaymentProfile, so the property lost its type declaration. The concrete class identifies which variant came back. The credit card class keeps its old name, because the spec file was renamed but the schema title was not.
  • CreditCardPaymentProfile::$cardType is now nullable. The setter signature changed from string to ?string, and a new unsetCardType() method removes the field from the serialized payload.
  • ListSubcriptionGroupPrepaymentItem is renamed to ListSubscriptionGroupPrepaymentItem. We corrected a typo in the schema title, and PHP class names come from the title. The builder class was renamed the same way. The properties are unchanged.

New Features

  • Added updateInvoice and deleteInvoice to InvoicesController. Both act only on ad hoc invoices in draft status.
  • Added support for the subscription_product_change_scheduled webhook event, as EventKey::SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED and WebhookSubscription::SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED. The payload deserializes into the existing SubscriptionProductChange model.
  • Added nine option keys to SubscriptionsController::listSubscriptions(): q, qScope, customerId, collectionMethod, groupStatus, dunningExemption, paymentGateways, currencies, and brandingThemeId.
  • The product filter on listSubscriptions now also accepts a string. It takes a product ID or an exact product name, but not a handle. Existing integer values keep working, so this is not a breaking change in PHP.
  • Added three SubscriptionListInclude values: CURRENT_ACCOUNT_BALANCE_IN_CENTS, CURRENT_BILLING_AMOUNT, and COUPONS.
  • Added five SubscriptionStateFilter values: ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS, ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS, AWAITING_SIGNUP, AWAITING_SIGNUP_DATE, and PREPAID_DUNNING.

Because listSubscriptions takes a single options array, the reordered query parameters in the spec do not change any call site.

New Models

Each model below ships with a matching builder in src/Models/Builders/.

  • UpdateInvoice
  • UpdateInvoiceItem
  • UpdateInvoiceRequest
  • GetOneTimeTokenBankAccountPaymentProfile
  • QScope (enum)
  • GroupStatus (enum)
  • CollectionMethod1 (enum). The 1 suffix avoids a collision with the existing CollectionMethod.

The unit_balance and payment_profile unions did not produce dedicated container classes in PHP. They are untyped properties with union annotations.

Model Enhancements

  • Component, CreateOrUpdateProduct, Product, EBBComponent, MeteredComponent, OnOffComponent, PrepaidUsageComponent, QuantityBasedComponent, UpdateComponent
    • Added unspscCode (?string), with an unset method and a builder method.
  • Customer
    • Added surcharging (?bool).
    • Added brandingThemeId (?int).
  • CustomerAttributes
    • Added surcharging (?bool).
  • CreateCustomer
    • Added surcharging (?bool).
    • Added brandingThemeId (?int).
  • UpdateCustomer
    • Added surcharging (?bool).
    • Added brandingThemeId (?int).
  • ProductFamily
    • Added surcharging (?bool).
  • CreateProductFamily
    • Added surcharging (?bool).
  • CreateSubscription
    • Added brandingThemeId (?int). Write-only. The subscription response does not return it.
  • UpdateSubscription
    • Added brandingThemeId (?int). Write-only. The subscription response does not return it.
  • Invoice
    • Added brandingThemeId (?int).
  • SubscriptionProductChange
    • Added previousProductPricePointId (?int).
    • Added newProductPricePointId (?int).
    • Added effectiveAt (?DateTime).
    • Only the subscription_product_change_scheduled event populates these three fields.

Bug Fixes

  • subscription_product_change_scheduled events no longer fail to deserialize. The payload carries previous_product_price_point_id, new_product_price_point_id, and effective_at. SubscriptionProductChange did not model these fields. It now does, so Event::getEventSpecificData() resolves the payload.

Internal / Non-functional Changes

  • Doc comments reworded across models and controllers after a wording and punctuation pass in the spec (no behavioral impact).
  • Regenerated Markdown reference docs under doc/.

Full Changelog: 9.1.0...10.0.0