Skip to content

[BUG]: Missing Adaptive Pricing property in for Checkout Sessions #849

@azuken

Description

@azuken

What happened?

Today, @stripe/stripe-js has this typing for initCheckout() method:

export interface StripeCheckoutOptions {
  clientSecret: Promise<string> | string;
  elementsOptions?: StripeCheckoutElementsOptions;
  defaultValues?: {
    billingAddress?: StripeCheckoutContact;
    shippingAddress?: StripeCheckoutContact;
  };
}

So adaptivePricing is not referenced, but it's mandatory to have Adaptive pricing working. I can make it work today with forced casting, but it would be great to have an updated typing!

My implementation:

          this.stripeCheckout = this.stripeClient.initCheckout({
            adaptivePricing: {
              allowed: addressStore.isAdaptivePricing,
            },
            clientSecret,
          } as unknown as StripeCheckoutOptions);

Thanks in advance.

Environment

Stripe-js v8.6.1

Reproduction

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions