2023-10-16
Breaking Changes5
checkout.session.customer
The `customer` attribute on `checkout.session` objects now always returns a full Customer object or `null` instead of sometimes returning just a string ID. This change aligns the behavior when a `customer` ID is explicitly set.
checkout.session.customer could be a string (customer ID) or an object.
checkout.session.customer will be a full Customer object or null.
Update code to expect a Customer object or null for checkout.session.customer.
checkout.session.customer
The `customer` field on `checkout.session` is no longer populated when `customer_creation` is set to `if_required`. The field will be `null` in these cases, requiring you to retrieve the customer after the session completes.
checkout.session.customer might be populated even with `if_required`.
checkout.session.customer will be null if `customer_creation: 'if_required'`.
Adjust logic to retrieve Customer object from checkout.session.customer only if `customer_creation` is `always`, or retrieve separately after session.
checkout.session.line_items.amount_subtotal, checkout.session.line_items.amount_total
When a customer-level discount is applied to a `checkout.session` with an existing `Customer` and `line_items`, `amount_subtotal` and `amount_total` now correctly include the discount. Previously, these fields did not reflect customer-level discounts.
`amount_subtotal` and `amount_total` on line items might not reflect customer-level discounts.
`amount_subtotal` and `amount_total` on line items correctly reflect customer-level discounts.
Review any calculations or display logic that relies on `amount_subtotal` or `amount_total` for sessions with customer-level discounts.
issuer_priority parameter
The `issuer_priority` parameter has been renamed to `preferred_network` for `card_present` payment methods and in `payment_intent.create` and `setup_intent.create` calls.
Use `issuer_priority` for card_present methods.
Use `preferred_network` for card_present methods.
Update `payment_intent.create` and `setup_intent.create` calls to use `preferred_network` instead of `issuer_priority`.
payment_method_options[card_present][request_extended_authorization]
The `request_extended_authorization` parameter for `card_present` payment method options can now only be set during the initial Payment Intent creation. Attempts to set or update this value post-creation will trigger an error.
Could be set/updated after Payment Intent creation.
Only settable during `payment_intent.create`.
Ensure `request_extended_authorization` is only set during `payment_intent.create` for `card_present` payment methods.
Never get blindsided by an API change again
Deprecatr AI monitors 150+ providers, maps changes to your codebase, and delivers migration checklists before your team hits a breaking change.
Join the Waitlist