Skip to content

Commit

Permalink
Update Custom Checkout SDK type (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
pololi-stripe committed Aug 7, 2024
1 parent 21c3504 commit eca01da
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions types/stripe-js/custom-checkout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,32 @@ export type StripeCustomCheckoutLastPaymentError = {
message: string;
};

export type StripeCustomCheckoutRedirectBehavior = 'always' | 'if_required';

export type StripeCustomCheckoutSavedPaymentMethod = {
id: string;
type: 'card';
card: {
brand: string;
expMonth: number;
expYear: number;
last4: string;
};
billingDetails: {
email?: string | null;
name?: string | null;
phone?: string | null;
address?: {
line1?: string | null;
line2?: string | null;
city?: string | null;
postal_code?: string | null;
state?: string | null;
country?: string | null;
} | null;
};
};

export type StripeCustomCheckoutTaxAmount = {
amount: number;
inclusive: boolean;
Expand Down Expand Up @@ -179,15 +205,19 @@ export type StripeCustomCheckoutTrial = {
/* Custom Checkout session */
export interface StripeCustomCheckoutSession {
billingAddress: StripeCustomCheckoutContact | null;
businessName: string | null;
canConfirm: boolean;
confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[];
currency: string;
discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null;
email: string | null;
id: string;
lastPaymentError: StripeCustomCheckoutLastPaymentError | null;
lineItems: Array<StripeCustomCheckoutLineItem>;
livemode: boolean;
phoneNumber: string | null;
recurring: StripeCustomCheckoutRecurring | null;
savedPaymentMethods: Array<StripeCustomCheckoutSavedPaymentMethod> | null;
shipping: StripeCustomCheckoutShipping | null;
shippingAddress: StripeCustomCheckoutContact | null;
shippingOptions: Array<StripeCustomCheckoutShippingOption>;
Expand Down Expand Up @@ -374,6 +404,10 @@ export interface StripeCustomCheckout {
) => Promise<StripeCustomCheckoutResult>;
confirm: (args?: {
return_url?: string;
returnUrl?: string;
redirect?: StripeCustomCheckoutRedirectBehavior;
paymentMethod?: string;
savePaymentMethod?: boolean;
}) => Promise<StripeCustomCheckoutResult>;
session: () => StripeCustomCheckoutSession;
on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void;
Expand Down

0 comments on commit eca01da

Please sign in to comment.