Repository navigation
v0.1.0-alpha.31
Pre-release
Pre-release
Added
Order->cancellationReason: nullable string explaining why an order was canceled.payment_failurewhen payment recovery for the unpaid order was exhausted, otherwisenull. Alwaysnullunless the order'sstatusiscanceled, andnullfor orders canceled before the API exposed this field. Compare againstVatly\API\Types\CancellationReason::PAYMENT_FAILURE.cancellationReasonon theOrderCanceledwebhook DTO: a nullable?string, read straight from the delivery'sobject. Additive: it is an optional constructor argument that defaults tonull.orderIdon the refund webhook DTOs:RefundCompleted,RefundFailed, andRefundCancelednow exposeorderId(?string): the credit order Vatly creates from a refund, whosecustomerInvoiceis the credit note. It is hydrated from the signed refund payload like every other field (the id is already present there), so a consumer stamping the credit note can reach it with a singleGetOrderinstead of first re-fetching the refund withGetRefund.nulluntil a credit order has materialized.
Changed
testHelpers->simulateOrderPayment()andtestHelpers->fastForwardSubscriptionRenewal()now return typed resources: the hydratedVatly\API\Resources\OrderandVatly\API\Resources\Subscriptioninstead of a raw?object, matching the200responses. Breaking if you type-hint the old return, or mock these methods with a plain object ornull. Reading properties such as$order->idkeeps working.- Synced
openapi.yamlwith the published spec: adds thesimulate-paymentpath, theSimulateOrderPaymentRequestandEurMoneyschemas,CreateCheckoutRequest.billingAddress,UpdateSubscriptionRequest.prorationCharge, therequires_amount_reviewchargeback status, andreasononWebhookEventandWebhookDelivery. Prices you set on products and plans areEurMoney(EUR only). docs/Checkouts.mdnow documents thebillingAddressprefill.
Fixed
orderRefunds->createFullRefundForOrderId()no longer changes the path of later calls. It left/fullon the shared endpoint, so every laterorderRefundscall on the same client went to the wrong URL: a partial refund was sent to/orders/{id}/refunds/full, and a second full refund to/refunds/full/full.Order::fullRefund()was affected too. Long-lived clients, such as queue workers, are the ones that could hit this.subscriptions->listForCustomerId()andlistForCustomer()now return only that customer's subscriptions. They calledGET /subscriptionswith acustomer_idparameter the API does not support, so the response held every subscription for the API token's storefront and mode. They now callGET /customers/{customerId}/subscriptions. If you worked around this by filtering the result yourself, that filter is no longer needed.docs/Orders.mdnow matches the Order resource and the API: the statuses arecreated,pending,paid,canceledandexpired, the helpers areisCreated(),isPaid(),isPending(),isCanceled()andisExpired()plus the reversal helpers (there is nofailedstatus orisFailed()), and the properties and examples use the real fields (totalandsubtotalasMoney, noamount,currency,taxAmount,paidAt,checkoutIdorsubscriptionId).- Corrected the code samples and reference tables in
docs/, which called methods the SDK does not have:- The list samples for checkouts, customers, subscriptions, refunds and chargebacks now call
page(). There is nolist()method, andlimitandstartingAfterare positional arguments, not an array.endingBeforeis documented too. docs/Refunds.mdnow usesorderRefunds->createForOrderId()andcreateFullRefundForOrderId()(there is norefunds->create()), theitemsrequest body, the real properties and statuses, and documents canceling a refund. The status helpers it listed do not exist.- The hosted checkout URL is read from
$checkout->links->checkoutUrl->href.getCheckoutUrl()andgetOrderId()do not exist. - Removed the
customerIdfilter on the subscriptions list, which the API does not offer, in favor ofcustomerSubscriptions->pageForCustomerId(). docs/Checkouts.mdanddocs/Chargebacks.mdno longer listmerchantId, and the properties tables now include the fields the API returns.docs/Chargebacks.mdalso lists the dispute statuses.
- The list samples for checkouts, customers, subscriptions, refunds and chargebacks now call