Releases: stripe-archive/react-stripe-elements
4.0.1
Bug Fixes
- Fixes a bug where calling
stripe.handleCardPayment
with only a client secret
caused an error to be thrown.
v4.0.0
New Features
-
Renamed
CardCVCElement
toCardCvcElement
which better mirrors the Elements
API. We will keep the old component name around as an alias until 5.0.0. -
Added support for
stripe.handleCardSetup
stripe.handleCardSetup( clientSecret: string, data?: Object ): Promise<{error?: Object, setupIntent?: Object}>
For more information, please review the Stripe Docs:
Deprecations
CardCVCElement
has been renamed toCardCvcElement
.CardCVCElement
will
be removed in version 5.0.0.
Breaking Changes
-
If you were already using
handleCardSetup
withreact-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.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.
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
IbanElement
andIdealBankElement
.
Breaking Changes
-
stripe.createSource
now 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' })
. -
elementRef
is no longer a valid prop you can pass to an<Element />
. UseonReady
instead to get a reference to the underlying Element instance.
v1.7.0
Deprecations
createSource
automatically 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
elementRef
callback is deprecated and will be removed in version 2.0.0.- Use
onReady
instead, which is the exact same.
- Use
Bug fixes
- The
id
prop from v1.5.0 was absent from thePaymentRequestButtonElement
.
Now, thePaymentRequestButtonElement
behaves like all the other*Element
components.