Skip to content
This repository has been archived by the owner before Nov 9, 2022. It is now read-only.

v3.0.0

Compare
Choose a tag to compare
@dweedon-stripe dweedon-stripe released this 22 Apr 17:43
· 104 commits to master since this release

New Features

  • added a changelog
  • added support for stripe.handleCardPayment and stripe.createPaymentMethod.
    These methods allow you to easily integrate Stripe's new Payment Intents API.
    Like createToken and createSource, these new methods will automatically
    find and use a corresponding Element when they are called.
      stripe.createPaymentMethod(
        paymentMethodType: string,
        paymentMethodDetails: Object
      ): Promise<{error?: Object, paymentIntent?: Object}>
    
      stripe.handleCardPayment(
        clientSecret: string,
        paymentMethodDetails: Object
      ): Promise<{error?: Object, paymentIntent?: Object}>
    For more information, please review the Stripe Docs:

Breaking Changes:

  • If you were already using handleCardPayment or createPaymentMethod with
    react-stripe-elements, you should upgrade your integration. These methods
    will now automatically find and use valid Elements.

    Old Way

    <CardElement
      ...
      onReady={this.handleReady}
    />
    
    handleReady = (element) => {
      this.setState({cardElement: element}) ;
    };
    
    let { paymentIntent, error } = await this.props.stripe.handleCardPayment(
      intent.client_secret, this.state.cardElement, {}
    );

    New Way

    <CardElement />
    
    let { paymentIntent, error } = await this.props.stripe.handleCardPayment(
      intent.client_secret, {}
    );
  • Passing a beta flag to Stripe.js to use one of the PaymentIntents betas is not
    supported.

    Old Way

    // Old Way
    const stripe = window.Stripe(
      publicKey,
      {betas: ['payment_intent_beta_3']},
    );
    
    <StripeProvider stripe={stripe}>
      <YourCheckoutComponent>
    </StripeProvider>

    New Way

    <StripeProvider apiKey={publicKey}>
      <YourCheckoutComponent>
    </StripeProvider>
  • PostalCodeElement has been removed. Users are suggested to build their own
    postal code input.