This repository has been archived by the owner on Mar 27, 2021. It is now read-only.
v3.0.0
New Features
- added a changelog
- added support for
stripe.handleCardPayment
andstripe.createPaymentMethod
.
These methods allow you to easily integrate Stripe's new Payment Intents API.
LikecreateToken
andcreateSource
, these new methods will automatically
find and use a corresponding Element when they are called.For more information, please review the Stripe Docs:stripe.createPaymentMethod( paymentMethodType: string, paymentMethodDetails: Object ): Promise<{error?: Object, paymentIntent?: Object}> stripe.handleCardPayment( clientSecret: string, paymentMethodDetails: Object ): Promise<{error?: Object, paymentIntent?: Object}>
Breaking Changes:
- If you were already using
handleCardPayment
orcreatePaymentMethod
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.