Releases: stripe-archive/react-stripe-elements
4.0.1
Bug Fixes
- Fixes a bug where calling
stripe.handleCardPaymentwith only a client secret
caused an error to be thrown.
v4.0.0
New Features
-
Renamed
CardCVCElementtoCardCvcElementwhich better mirrors the Elements
API. We will keep the old component name around as an alias until 5.0.0. -
Added support for
stripe.handleCardSetupstripe.handleCardSetup( clientSecret: string, data?: Object ): Promise<{error?: Object, setupIntent?: Object}>
For more information, please review the Stripe Docs:
Deprecations
CardCVCElementhas been renamed toCardCvcElement.CardCVCElementwill
be removed in version 5.0.0.
Breaking Changes
-
If you were already using
handleCardSetupwithreact-stripe-elements, you
should upgrade your integration. This method will now automatically find and
use valid Elements.Old Way
<CardElement ... onReady={this.handleReady} /> handleReady = (element) => { this.setState({cardElement: element}) ; }; const {setupIntent, error} = await this.props.stripe.handleCardSetup( intent.client_secret, this.state.cardElement, {} );
New Way
<CardElement />; const {setupIntent, error} = await this.props.stripe.handleCardSetup( intent.client_secret, {} );
v3.0.0
New Features
- added a changelog
- added support for
stripe.handleCardPaymentandstripe.createPaymentMethod.
These methods allow you to easily integrate Stripe's new Payment Intents API.
LikecreateTokenandcreateSource, 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
handleCardPaymentorcreatePaymentMethodwith
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>
PostalCodeElementhas been removed. Users are suggested to build their own
postal code input.
v2.0.3
v2.0.2
(This release was tagged mistakenly and should not be used. Sorry for the confusion.)
v2.0.1
v2.0.0
New Features
- Support for the
IbanElementandIdealBankElement.
Breaking Changes
-
stripe.createSourcenow requires the Source type be passed in.For example, if you previously called
stripe.createSource({ name: 'Jenny Rosen' }), you now must usestripe.createSource({ type: 'card', name: 'Jenny Rosen' }). -
elementRefis no longer a valid prop you can pass to an<Element />. UseonReadyinstead to get a reference to the underlying Element instance.
v1.7.0
Deprecations
createSourceautomatically infers the type of Source to create based on which Elements are in use. This behavior is now deprecated, and the Source type will be required in version 2.0.0.
v1.6.0
Deprecations
- The
elementRefcallback is deprecated and will be removed in version 2.0.0.- Use
onReadyinstead, which is the exact same.
- Use
Bug fixes
- The
idprop from v1.5.0 was absent from thePaymentRequestButtonElement.
Now, thePaymentRequestButtonElementbehaves like all the other*Element
components.