diff --git a/src/containers/CheckoutPage/CheckoutPage.js b/src/containers/CheckoutPage/CheckoutPage.js index a2670126..2c7f580f 100644 --- a/src/containers/CheckoutPage/CheckoutPage.js +++ b/src/containers/CheckoutPage/CheckoutPage.js @@ -516,6 +516,8 @@ CheckoutPageComponent.defaultProps = { enquiredTransaction: null, currentUser: null, stripePaymentToken: null, + stripePaymentTokenInProgress: false, + stripePaymentTokenError: null, }; CheckoutPageComponent.propTypes = { @@ -539,8 +541,8 @@ CheckoutPageComponent.propTypes = { }).isRequired, sendOrderRequest: func.isRequired, onCreateStripePaymentToken: func.isRequired, - stripePaymentTokenInProgress: bool.isRequired, - stripePaymentTokenError: bool.isRequired, + stripePaymentTokenInProgress: bool, + stripePaymentTokenError: propTypes.error, stripePaymentToken: object, // from connect diff --git a/src/containers/CheckoutPage/CheckoutPage.test.js b/src/containers/CheckoutPage/CheckoutPage.test.js index 82588f8d..41712660 100644 --- a/src/containers/CheckoutPage/CheckoutPage.test.js +++ b/src/containers/CheckoutPage/CheckoutPage.test.js @@ -26,7 +26,7 @@ describe('CheckoutPage', () => { scrollingDisabled: false, onCreateStripePaymentToken: noop, stripePaymentTokenInProgress: false, - stripePaymentTokenError: false, + stripePaymentTokenError: null, }; const tree = renderShallow(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/CheckoutPage/__snapshots__/CheckoutPage.test.js.snap b/src/containers/CheckoutPage/__snapshots__/CheckoutPage.test.js.snap index 19f87dd7..56452338 100644 --- a/src/containers/CheckoutPage/__snapshots__/CheckoutPage.test.js.snap +++ b/src/containers/CheckoutPage/__snapshots__/CheckoutPage.test.js.snap @@ -95,7 +95,7 @@ exports[`CheckoutPage matches snapshot 1`] = ` paymentInfo="CheckoutPage.paymentInfo" showInitialMessageInput={true} stripePaymentToken={null} - stripePaymentTokenError={false} + stripePaymentTokenError={null} stripePaymentTokenInProgress={false} /> diff --git a/src/ducks/stripe.duck.js b/src/ducks/stripe.duck.js index fb57b6db..273c43b7 100644 --- a/src/ducks/stripe.duck.js +++ b/src/ducks/stripe.duck.js @@ -34,7 +34,7 @@ const initialState = { stripeAccount: null, stripeAccountFetched: false, stripePaymentTokenInProgress: false, - stripePaymentTokenError: false, + stripePaymentTokenError: null, stripePaymentToken: null, }; diff --git a/src/forms/StripePaymentForm/StripePaymentForm.example.js b/src/forms/StripePaymentForm/StripePaymentForm.example.js index 845308a5..739a31e6 100644 --- a/src/forms/StripePaymentForm/StripePaymentForm.example.js +++ b/src/forms/StripePaymentForm/StripePaymentForm.example.js @@ -18,7 +18,7 @@ export const Empty = { intl: fakeIntl, onCreateStripePaymentToken: noop, stripePaymentTokenInProgress: false, - stripePaymentTokenError: false, + stripePaymentTokenError: null, }, group: 'forms', }; diff --git a/src/forms/StripePaymentForm/StripePaymentForm.js b/src/forms/StripePaymentForm/StripePaymentForm.js index acfb28a4..da3775f5 100644 --- a/src/forms/StripePaymentForm/StripePaymentForm.js +++ b/src/forms/StripePaymentForm/StripePaymentForm.js @@ -272,6 +272,8 @@ StripePaymentForm.defaultProps = { onChange: () => null, showInitialMessageInput: true, stripePaymentToken: null, + stripePaymentTokenInProgress: false, + stripePaymentTokenError: null, }; const { bool, func, string, object } = PropTypes; @@ -288,8 +290,8 @@ StripePaymentForm.propTypes = { authorDisplayName: string.isRequired, showInitialMessageInput: bool, onCreateStripePaymentToken: func.isRequired, - stripePaymentTokenInProgress: bool.isRequired, - stripePaymentTokenError: bool.isRequired, + stripePaymentTokenInProgress: bool, + stripePaymentTokenError: propTypes.error, stripePaymentToken: object, };