Repository navigation
v2.0.0-beta.1
Pre-release
Pre-release
First beta of the 2.x line. Please try it out and report any issues before the stable 2.0.0.
Changes since v2.0.0-alpha.2:
⚠️ Breaking changes (vs. alpha.2)
- Webhook
action/ resource are now strict enums on every read path, and unknown values fail fast (#9).- Inbound:
WebhookEvent::$action/$resourceTypeareWebhookAction/WebhookResourceName.WebhookParserthrowsMalformedWebhookExceptionif theSMD-ActionorSMD-Resource-Typeheader is missing or unknown. - Read: the response
Webhook::$action/$resourceNameare enums too. An unknown value fails mapping with aMappingException, and the original strings are still available viaResource::$raw. - Note:
webhooks()->getPage()/paginate()now throws if any webhook subscription carries an action or resource the SDK doesn't model yet.
- Inbound:
Added
- The resource ↔ action relationship is encoded on the enum (#9):
WebhookResourceName::actions(): list<WebhookAction>andsupports(WebhookAction): bool.WebhooksEndpoint::create()throws\InvalidArgumentExceptionbefore sending when bothresourceNameandactionare set but aren't a valid pair, instead of getting a 422 from the server. SalesOrdersEndpoint::delete(int $id)(#10). SendsDELETE /sales_orders/{id}and mirrorsWebhooksEndpoint::delete().
WebhookResourceName::Orders->supports(WebhookAction::Delete); // true
$client->salesOrders()->delete(37707008);Upgrading from 1.x
See UPGRADE.md for the full migration guide, which covers every breaking change.
Full Changelog: v2.0.0-alpha.2...v2.0.0-beta.1