Merge pull request #1092 from sharetribe/fix-showing-error-in-stripe-form

Fix bug in showing error message
This commit is contained in:
Jenni Nurmi 2019-05-16 15:20:18 +03:00 committed by GitHub
commit 622dfa18ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -14,7 +14,9 @@ way to update this template, but currently, we follow a pattern:
## Upcoming version 2019-XX-XX
- [cghange] Use Final Form on `StripePaymentForm` for consistency. Note that card form Stripe
- [fix] Show error when typing credit card number if e.g. the number is invalid. Fixes bug that was
introduced in PR #1088. [#1092](https://github.com/sharetribe/flex-template-web/pull/1092)
- [change] Use Final Form on `StripePaymentForm` for consistency. Note that card form Stripe
Elements in `StripePaymentForm` is not a Final Form field so it's not available trough Final Form
but handled separately. [#1088](https://github.com/sharetribe/flex-template-web/pull/1088)
- [change] Move Stripe SDK call from `StripePaymentForm` to `stripe.duck.js` for consistency.

View file

@ -241,8 +241,8 @@ class StripePaymentForm extends Component {
this.cardContainer = el;
}}
/>
{stripePaymentTokenError && !submitInProgress ? (
<span style={{ color: 'red' }}>{stripePaymentTokenError}</span>
{this.state.error && !submitInProgress ? (
<span style={{ color: 'red' }}>{this.state.error}</span>
) : null}
{initialMessage}
<div className={css.submitContainer}>