Moved to stripe/react-stripe-js.
Renamed CardCVCElement
to CardCvcElement
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:
CardCVCElement
has been renamed to CardCvcElement
. CardCVCElement
will
be removed in version 5.0.0.If you were already using handleCardSetup
with react-stripe-elements
, you
should upgrade your integration. This method will now automatically find and
use valid Elements.
<CardElement
...
onReady={this.handleReady}
/>
handleReady = (element) => {
this.setState({cardElement: element}) ;
};
const {setupIntent, error} = await this.props.stripe.handleCardSetup(
intent.client_secret, this.state.cardElement, {}
);
<CardElement />;
const {setupIntent, error} = await this.props.stripe.handleCardSetup(
intent.client_secret,
{}
);
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:
handleCardPayment
or createPaymentMethod
with
react-stripe-elements
, you should upgrade your integration. These methods
will now automatically find and use valid Elements.
<CardElement
...
onReady={this.handleReady}
/>
handleReady = (element) => {
this.setState({cardElement: element}) ;
};
let { paymentIntent, error } = await this.props.stripe.handleCardPayment(
intent.client_secret, this.state.cardElement, {}
);
<CardElement />
let { paymentIntent, error } = await this.props.stripe.handleCardPayment(
intent.client_secret, {}
);
// Old Way
const stripe = window.Stripe(
publicKey,
{betas: ['payment_intent_beta_3']},
);
<StripeProvider stripe={stripe}>
<YourCheckoutComponent>
</StripeProvider>
<StripeProvider apiKey={publicKey}>
<YourCheckoutComponent>
</StripeProvider>
PostalCodeElement
has been removed. Users are suggested to build their own
postal code input.elements.update
event was triggered far too often, incorrectly, when an Element was repeatedly rendered with the same options (#304)(This release was tagged mistakenly and should not be used. Sorry for the confusion.)
IbanElement
and IdealBankElement
.stripe.createSource
now requires the Source type be passed in.
For example, if you previously called stripe.createSource({ name: 'Jenny Rosen' })
, you now must use stripe.createSource({ type: 'card', name: 'Jenny Rosen' })
.
elementRef
is no longer a valid prop you can pass to an <Element />
. Use onReady
instead to get a reference to the underlying Element instance.
elementRef
callback is deprecated and will be removed in version 2.0.0.
onReady
instead, which is the exact same.id
prop from v1.5.0 was absent from the PaymentRequestButtonElement
.
Now, the PaymentRequestButtonElement
behaves like all the other *Element
components.