Skip to content

Commit

Permalink
Update Custom Checkout SDK types (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
danwang-stripe authored Oct 18, 2024
1 parent 8a68460 commit 7d39b66
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions types/stripe-js/custom-checkout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import {Appearance, CssFontSource, CustomFontSource} from './elements-group';
import {StripeError} from './stripe';
import {
FieldsOption,
StripeElementBase,
StripeExpressCheckoutElement,
StripeExpressCheckoutElementConfirmEvent,
Expand Down Expand Up @@ -151,6 +152,7 @@ export type StripeCustomCheckoutLineItem = {
usageType: 'metered' | 'licensed';
} | null;
adjustableQuantity: StripeCustomCheckoutAdjustableQuantity | null;
images: string[];
};

export type StripeCustomCheckoutRecurring = {
Expand Down Expand Up @@ -236,6 +238,7 @@ export type StripeCustomCheckoutPaymentElementOptions = {
paymentMethodOrder?: Array<string>;
readonly?: boolean;
terms?: TermsOption;
fields?: FieldsOption;
};

export type StripeCustomCheckoutAddressElementOptions = {
Expand All @@ -252,6 +255,7 @@ export type StripeCustomCheckoutExpressCheckoutElementOptions = {
buttonType: StripeExpressCheckoutElementOptions['buttonType'];
layout: StripeExpressCheckoutElementOptions['layout'];
paymentMethodOrder: StripeExpressCheckoutElementOptions['paymentMethodOrder'];
paymentMethods: StripeExpressCheckoutElementOptions['paymentMethods'];
};

export type StripeCustomCheckoutUpdateHandler = (
Expand Down Expand Up @@ -393,8 +397,10 @@ export interface StripeCustomCheckout {
updateBillingAddress: (
billingAddress: StripeCustomCheckoutContact | null
) => Promise<StripeCustomCheckoutResult>;
updatePhoneNumber: (phoneNumber: string) => void;
updateEmail: (email: string) => void;
updatePhoneNumber: (
phoneNumber: string
) => Promise<StripeCustomCheckoutResult>;
updateEmail: (email: string) => Promise<StripeCustomCheckoutResult>;
updateLineItemQuantity: (args: {
lineItem: string;
quantity: number;
Expand All @@ -403,7 +409,6 @@ export interface StripeCustomCheckout {
shippingOption: string
) => Promise<StripeCustomCheckoutResult>;
confirm: (args?: {
return_url?: string;
returnUrl?: string;
redirect?: StripeCustomCheckoutRedirectBehavior;
paymentMethod?: string;
Expand Down

0 comments on commit 7d39b66

Please sign in to comment.