DeprecatrAI

2023-10-16

Released 2023-10-16Active
Migration Effort
Medium
Estimated Hours
~6h
Primary risk if skipped: Incorrect handling of `checkout.session` objects leading to failed checkouts, incorrect customer data, or payment processing errors.

Breaking Changes5

fieldMediumCheckout

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.

Before
checkout.session.customer could be a string (customer ID) or an object.
After
checkout.session.customer will be a full Customer object or null.

Update code to expect a Customer object or null for checkout.session.customer.

fieldMediumCheckout

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.

Before
checkout.session.customer might be populated even with `if_required`.
After
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.

fieldMediumCheckout

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.

Before
`amount_subtotal` and `amount_total` on line items might not reflect customer-level discounts.
After
`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.

paramHighTerminalPayments

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.

Before
Use `issuer_priority` for card_present methods.
After
Use `preferred_network` for card_present methods.

Update `payment_intent.create` and `setup_intent.create` calls to use `preferred_network` instead of `issuer_priority`.

paramMediumTerminalPayments

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.

Before
Could be set/updated after Payment Intent creation.
After
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