1 | # Changelog
|
2 |
|
3 | `react-stripe-elements` adheres to
|
4 | [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
5 |
|
6 | ## v6.1.1 - 2020-04-01
|
7 |
|
8 | ### Changes
|
9 |
|
10 | - Register package version with Stripe instance (#512)
|
11 |
|
12 | ## v6.1.0 - 2020-02-14
|
13 |
|
14 | ### New Features
|
15 |
|
16 | Added the `auBankAccount` and `fpxBank` elements. These elements will not have
|
17 | automatic Element detection/insertion. To use them you will need to use
|
18 | `elements.getElement` and pass them directly to other Stripe.js methods (e.g.
|
19 | `stripe.confirmFpxPayment`):
|
20 |
|
21 | ```jsx
|
22 | const FpxForm = injectStripe(({stripe, elements}) => {
|
23 | const handleSubmit = async (event) => {
|
24 | event.preventDefault();
|
25 | const {error} = await stripe.confirmFpxPayment('{{CLIENT_SECRET}}', {
|
26 | payment_method: {
|
27 | fpx: elements.getElement('fpxBank'),
|
28 | },
|
29 | });
|
30 | };
|
31 |
|
32 | return (
|
33 | <form onSubmit={handleSubmit}>
|
34 | <FpxBankElement accountHolderType="individual" />
|
35 | <button>Pay</button>
|
36 | </form>
|
37 | );
|
38 | });
|
39 | ```
|
40 |
|
41 | ## v6.0.1 - 2019-11-13
|
42 |
|
43 | Version bump that fixes some typos, no changes.
|
44 |
|
45 | ## v6.0.0 - 2019-11-13
|
46 |
|
47 | ### New Features
|
48 |
|
49 | - `injectStripe` now injects a reference to the Elements instance created by
|
50 | `<Elements>` as the prop `elements`.
|
51 |
|
52 | The primary reason you would want an Elements instance is to use
|
53 | [`elements.getElement()`](https://stripe.com/docs/stripe-js/reference#elements-get-element).
|
54 | which provides an easy way to get a reference to an Element. You will need to
|
55 | get a reference to an Element to use
|
56 | [`confirmCardPayment`](https://stripe.com/docs/stripe-js/reference#stripe-confirm-card-payment),
|
57 | [`confirmCardSetup()`](https://stripe.com/docs/stripe-js/reference#stripe-confirm-card-setup),
|
58 | or
|
59 | [`createPaymentMethod()`](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method).
|
60 |
|
61 | Note that the old API for `createPaymentMethod` will continue to work and
|
62 | provide automatic element injection, but we are updating documentation and
|
63 | examples to use the new argument shape:
|
64 |
|
65 | ```js
|
66 | // old shape with automatic element detection - still works
|
67 | this.props.stripe.createPaymentMethod('card').then(/* ... */);
|
68 |
|
69 | // new shape without automatic element detection - recommended and will work with new non-card PaymentMethods
|
70 | this.props.stripe
|
71 | .createPaymentMethod({
|
72 | type: 'card',
|
73 | card: this.props.elements.getElement('card'),
|
74 | })
|
75 | .then(/* ... */);
|
76 | ```
|
77 |
|
78 | ### Breaking Changes
|
79 |
|
80 | - We have removed the `getElement` method on RSE components that we introduced
|
81 | in v5.1.0 in favor of the above change. Sorry for the churn.
|
82 |
|
83 | ## v5.1.0 - 2019-10-22
|
84 |
|
85 | ### New Features
|
86 |
|
87 | - Add support for accessing the underlying Element using refs via `getElement`.
|
88 |
|
89 | ### Bug Fixes
|
90 |
|
91 | - Fix crash when trying to create element while unmounting. Thanks @CarsonF!
|
92 |
|
93 | ## v5.0.1 - 2019-09-18
|
94 |
|
95 | ### Bug Fixes
|
96 |
|
97 | - Fixes a bug where calling `stripe.createPaymentMethod` would error in IE.
|
98 |
|
99 | ## v5.0.0 - 2019-08-27
|
100 |
|
101 | ### New Features
|
102 |
|
103 | - React 16.9 compatibility.
|
104 |
|
105 | ### Breaking Changes
|
106 |
|
107 | - We replaced the internal use of deprecated `componentWillReceiveProps`. This
|
108 | internal movement of logic between lifecycle methods is likely safe for almost
|
109 | all apps and should not require any changes.
|
110 |
|
111 | ## v4.0.1 - 2019-08-14
|
112 |
|
113 | ### Bug Fixes
|
114 |
|
115 | - Fixes a bug where calling `stripe.handleCardPayment` with only a client secret
|
116 | caused an error to be thrown.
|
117 |
|
118 | ## v4.0.0 - 2019-07-05
|
119 |
|
120 | ### New Features
|
121 |
|
122 | - Renamed `CardCVCElement` to `CardCvcElement` which better mirrors the Elements
|
123 | API. We will keep the old component name around as an alias until 5.0.0.
|
124 | - Added support for `stripe.handleCardSetup`
|
125 |
|
126 | ```js
|
127 | stripe.handleCardSetup(
|
128 | clientSecret: string,
|
129 | data?: Object
|
130 | ): Promise<{error?: Object, setupIntent?: Object}>
|
131 | ```
|
132 |
|
133 | For more information, please review the Stripe Docs:
|
134 |
|
135 | - [`stripe.handleCardSetup`](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-setup)
|
136 |
|
137 | ### Deprecations
|
138 |
|
139 | - `CardCVCElement` has been renamed to `CardCvcElement`. `CardCVCElement` will
|
140 | be removed in version 5.0.0.
|
141 |
|
142 | ### Breaking Changes
|
143 |
|
144 | - If you were already using `handleCardSetup` with `react-stripe-elements`, you
|
145 | should upgrade your integration. This method will now automatically find and
|
146 | use valid Elements.
|
147 |
|
148 | #### Old Way
|
149 |
|
150 | ```js
|
151 | <CardElement
|
152 | ...
|
153 | onReady={this.handleReady}
|
154 | />
|
155 |
|
156 | handleReady = (element) => {
|
157 | this.setState({cardElement: element}) ;
|
158 | };
|
159 |
|
160 | const {setupIntent, error} = await this.props.stripe.handleCardSetup(
|
161 | intent.client_secret, this.state.cardElement, {}
|
162 | );
|
163 | ```
|
164 |
|
165 | #### New Way
|
166 |
|
167 | ```js
|
168 | <CardElement />;
|
169 |
|
170 | const {setupIntent, error} = await this.props.stripe.handleCardSetup(
|
171 | intent.client_secret,
|
172 | {}
|
173 | );
|
174 | ```
|
175 |
|
176 | ## v3.0.0 - 2019-04-17
|
177 |
|
178 | ### New Features
|
179 |
|
180 | - added a [changelog](/CHANGELOG.md)
|
181 | - added support for `stripe.handleCardPayment` and `stripe.createPaymentMethod`.
|
182 | These methods allow you to easily integrate Stripe's new Payment Intents API.
|
183 | Like `createToken` and `createSource`, these new methods will automatically
|
184 | find and use a corresponding Element when they are called.
|
185 |
|
186 | ```js
|
187 | stripe.createPaymentMethod(
|
188 | paymentMethodType: string,
|
189 | paymentMethodDetails: Object
|
190 | ): Promise<{error?: Object, paymentIntent?: Object}>
|
191 |
|
192 | stripe.handleCardPayment(
|
193 | clientSecret: string,
|
194 | data?: Object
|
195 | ): Promise<{error?: Object, paymentIntent?: Object}>
|
196 | ```
|
197 |
|
198 | For more information, please review the Stripe Docs:
|
199 |
|
200 | - [`stripe.createPaymentMethod`](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method)
|
201 | - [`stripe.handleCardPayment`](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
|
202 | - [Payment Intents API](https://stripe.com/docs/payments/payment-intents)
|
203 | - [Payment Methods API](https://stripe.com/docs/payments/payment-methods)
|
204 |
|
205 | ### Breaking Changes:
|
206 |
|
207 | - If you were already using `handleCardPayment` or `createPaymentMethod` with
|
208 | `react-stripe-elements`, you should upgrade your integration. These methods
|
209 | will now automatically find and use valid Elements.
|
210 |
|
211 | #### Old Way
|
212 |
|
213 | ```js
|
214 | <CardElement
|
215 | ...
|
216 | onReady={this.handleReady}
|
217 | />
|
218 |
|
219 | handleReady = (element) => {
|
220 | this.setState({cardElement: element}) ;
|
221 | };
|
222 |
|
223 | let { paymentIntent, error } = await this.props.stripe.handleCardPayment(
|
224 | intent.client_secret, this.state.cardElement, {}
|
225 | );
|
226 | ```
|
227 |
|
228 | #### New Way
|
229 |
|
230 | ```js
|
231 | <CardElement />;
|
232 |
|
233 | let {paymentIntent, error} = await this.props.stripe.handleCardPayment(
|
234 | intent.client_secret,
|
235 | {}
|
236 | );
|
237 | ```
|
238 |
|
239 | - Passing a beta flag to Stripe.js to use one of the PaymentIntents betas is not
|
240 | supported.
|
241 |
|
242 | #### Old Way
|
243 |
|
244 | ```js
|
245 | const stripe = window.Stripe(
|
246 | publicKey,
|
247 | {betas: ['payment_intent_beta_3']},
|
248 | );
|
249 |
|
250 | <StripeProvider stripe={stripe}>
|
251 | <YourCheckoutComponent>
|
252 | </StripeProvider>
|
253 | ```
|
254 |
|
255 | #### New Way
|
256 |
|
257 | ```js
|
258 | <StripeProvider apiKey={publicKey}>
|
259 | <YourCheckoutComponent>
|
260 | </StripeProvider>
|
261 | ```
|
262 |
|
263 | - `PostalCodeElement` has been removed. We suggest that you build your own
|
264 | postal code input.
|
265 |
|
266 | ## v2.0.3 - 2019-01-25
|
267 |
|
268 | ### Bug Fixes
|
269 |
|
270 | - Fixes a bug where the elements.update event was triggered far too often,
|
271 | incorrectly, when an Element was repeatedly rendered with the same options.
|
272 |
|
273 | ## v2.0.1 - 2018-07-11
|
274 |
|
275 | ### Bug Fixes
|
276 |
|
277 | - The Element higher-order component now reports a proper displayName, which is
|
278 | more useful for debugging. (Thanks @emilrose!)
|
279 |
|
280 | ## v2.0.0 - 2018-06-01
|
281 |
|
282 | ### New Features
|
283 |
|
284 | - Support for the `IbanElement` and `IdealBankElement`.
|
285 |
|
286 | ### Breaking Changes
|
287 |
|
288 | - `stripe.createSource` now requires the Source type be passed in.
|
289 | - For example, if you previously called
|
290 | `stripe.createSource({ name: 'Jenny Rosen' })`, you now must use
|
291 | `stripe.createSource({ type: 'card', name: 'Jenny Rosen' })`.
|
292 | - elementRef is no longer a valid prop you can pass to an `<Element />`. Use
|
293 | onReady instead to get a reference to the underlying Element instance.
|
294 |
|
295 | ## v1.7.0 - 2018-05-31
|
296 |
|
297 | ### Deprecations
|
298 |
|
299 | - `createSource` automatically infers the type of Source to create based on
|
300 | which Elements are in use. This behavior is now deprecated, and the Source
|
301 | type will be required in version 2.0.0.
|
302 |
|
303 | ## v1.6.0 - 2018-03-05
|
304 |
|
305 | ### Deprecations
|
306 |
|
307 | - The elementRef callback is deprecated and will be removed in version 2.0.0.
|
308 | Use onReady instead, which is the exact same.
|
309 |
|
310 | ### Bug Fixes
|
311 |
|
312 | - The id prop from v1.5.0 was absent from the `PaymentRequestButtonElement`.
|
313 | Now, the `PaymentRequestButtonElement` behaves like all the other \*Element
|
314 | components.
|
315 |
|
316 | ## v1.5.0 - 2018-03-02
|
317 |
|
318 | ### New Features
|
319 |
|
320 | - (#177 / #178) The \*Element classes learned a new id prop. This can be used to
|
321 | set the ID of the underlying DOM Element.
|
322 |
|
323 | ## v1.4.1 - 2018-01-22
|
324 |
|
325 | ### Bug Fixes
|
326 |
|
327 | - Fixed a TODO in an error message emitted by Provider.js.
|
328 |
|
329 | ## v1.4.0 - 2018-01-17
|
330 |
|
331 | ### Bug Fixes
|
332 |
|
333 | - Modify build pipeline to fix issues with IE9 and IE10.
|
334 |
|
335 | ## v1.3.2 - 2018-01-11
|
336 |
|
337 | ### Bug Fixes
|
338 |
|
339 | - Fix split Element token creation for async codepath. (#148)
|
340 |
|
341 | ## v1.3.1 - 2018-01-10
|
342 |
|
343 | ### Bug Fixes
|
344 |
|
345 | - Fixes a regression introduced by v1.3.0 (#146).
|
346 |
|
347 | ## v1.3.0 - 2018-01-09
|
348 |
|
349 | ### New Features
|
350 |
|
351 | - Loading Stripe.js and react-stripe-elements asynchronously
|
352 | - Rendering react-stripe-elements on the server
|
353 | - Passing a custom stripe instance to `StripeProvider`
|
354 | - For an overview of how this works, see the Advanced integrations section.
|
355 |
|
356 | ## v1.2.1 - 2017-11-21
|
357 |
|
358 | ### Bug Fixes
|
359 |
|
360 | - Fixed a bug where using pure components under the `<Elements>` component would
|
361 | lead to an error.
|
362 |
|
363 | ## v1.2.0 - 2017-10-12
|
364 |
|
365 | ### New Features
|
366 |
|
367 | - The PaymentRequestButtonElement now accepts an onClick prop that maps to the
|
368 | `element.on('click')` event.
|
369 |
|
370 | ## v1.1.1 - 2017-10-11
|
371 |
|
372 | ### Bug Fixes
|
373 |
|
374 | - The instance of Stripe provided by StripeProvider is now consistent across
|
375 | StripeProvider usages across your application, as long as you're passing in
|
376 | the same API key & configuration.
|
377 |
|
378 | ## v1.1.0 - 2017-10-05
|
379 |
|
380 | ### New Features
|
381 |
|
382 | - We've added a new component! You can now use `<PaymentRequestButtonElement />`
|
383 | which wraps up `elements.create('paymentRequestButton')` in a React component.
|
384 |
|
385 | ## v1.0.0 - 2017-09-18
|
386 |
|
387 | ### New Features
|
388 |
|
389 | - Update dependencies
|
390 | - Improve test coverage
|
391 | - Allow React 16 as peer dependency
|
392 |
|
393 | ## v0.1.0 - 2017-09-13
|
394 |
|
395 | ### New Features
|
396 |
|
397 | - You can now pass the `withRef` option to `injectStripe` to make the wrapped
|
398 | component instance available via `getWrappedInstance()`
|
399 |
|
400 | ## v0.0.8 - 2017-08-21
|
401 |
|
402 | ### New Features
|
403 |
|
404 | - Render \*Element components with div instead of span (#61)
|
405 |
|
406 | ## v0.0.7 - 2018-08-03
|
407 |
|
408 | ### New Features
|
409 |
|
410 | - You can now pass `className` to `<*Element>` (e.g.
|
411 | <CardElement className="foo"> and it will be passed down to the element
|
412 | container DOM element.
|
413 |
|
414 | ## v0.0.6 - 2017-07-25
|
415 |
|
416 | ### Bug Fixes
|
417 |
|
418 | - Bugfix for collapsed Elements: #45 #48
|
419 |
|
420 | ## v0.0.5 - 2017-07-20
|
421 |
|
422 | ### Bug Fixes
|
423 |
|
424 | - Same as v0.0.3 but fixed corrupted npm upload.
|
425 |
|
426 | ## v0.0.3 - 2017-07-20
|
427 |
|
428 | ### Bug Fixes
|
429 |
|
430 | - Bug fixes for: #29, #40
|
431 |
|
432 | ## v0.0.2 - 05-04-2017
|
433 |
|
434 | ### New Features
|
435 |
|
436 | Initial release! Support for:
|
437 |
|
438 | - StripeProvider
|
439 | - Elements
|
440 | - injectStripe
|
441 | - Individual elements:
|
442 | - CardElement
|
443 | - CardNumberElement
|
444 | - CardExpiryElement
|
445 | - CardCVCElement
|
446 | - PostalCodeElement
|
447 |
|
\ | No newline at end of file |