Releases: stripe-archive/react-stripe-elements
v6.1.2
v6.1.1
v6.1.0
New Features
Added the auBankAccount
and fpxBank
elements. These elements will not have automatic Element detection/insertion. To use them you will need to use elements.getElement
and pass them directly to other Stripe.js methods (e.g. stripe.confirmFpxPayment
):
const FpxForm = injectStripe(({stripe, elements}) => {
const handleSubmit = async (event) => {
event.preventDefault();
const {error} = await stripe.confirmFpxPayment('{{CLIENT_SECRET}}', {
payment_method: {
fpx: elements.getElement('fpxBank'),
},
});
}
return (
<form onSubmit={handleSubmit}>
<FpxBankElement accountHolderType="individual" />
<button>Pay</button>
</form>
);
});
v6.0.1
Version bump that fixes some typos, no changes.
v6.0.0
New Features
injectStripe
now injects a reference to the Elements instance created by
<Elements>
as the propelements
.
The primary reason you would want an Elements instance is to use elements.getElement()
, which provides an easy way to get a reference to an Element. You will need to get a reference to an Element to use confirmCardPayment
, confirmCardSetup()
, or createPaymentMethod()
.
Note that the old API for createPaymentMethod
will continue to work and
provide automatic element injection, but we are updating documentation and
examples to use the new argument shape:
// old shape with automatic element detection - still works
this.props.stripe.createPaymentMethod('card').then(/* ... */);
// new shape without automatic element detection - recommended and
// will work with new non-card PaymentMethods
this.props.stripe
.createPaymentMethod({
type: 'card',
card: this.props.elements.getElement('card'),
})
.then(/* ... */);
Breaking Changes
- We have removed the
getElement
method on RSE components that we introduced
in v5.1.0 in favor of the above change. Sorry for the churn.
v5.1.0
v5.0.1
Bug Fixes
- Fixes a bug where calling
stripe.createPaymentMethod
would error in IE.
v4.0.2
Bug Fixes
- Fixes a bug where calling
stripe.createPaymentMethod
would error in IE.
v3.0.1
Bug Fixes
- Fixes a bug where calling
stripe.createPaymentMethod
would error in IE.
v5.0.0
New Features
- React 16.9 compatibility.
Breaking Changes
- We replaced the internal use of deprecated componentWillReceiveProps. This internal movement of logic between lifecycle methods is likely safe for almost all apps and should not require any changes.