@@ -8,7 +8,6 @@ import s from './PaymentForm.scss';
8
8
import Paper from 'material-ui/Paper' ;
9
9
import NotificationSnackbar from '../../Notifications/Snackbar/Snackbar'
10
10
11
-
12
11
class PaymentFormContainer extends React . Component {
13
12
constructor ( props ) {
14
13
super ( props )
@@ -18,9 +17,17 @@ class PaymentFormContainer extends React.Component {
18
17
}
19
18
}
20
19
render ( ) {
21
- var content = null ;
22
-
23
- if ( this . state . stripeLoadingError ) {
20
+ let content = null ;
21
+ if ( ! this . props . stripeToken ) {
22
+ content = (
23
+ < div className = "payment-content" >
24
+ < h3 style = { { color : redA700 } } className = "payment-header" > Stripe config is invalid</ h3 >
25
+ < p >
26
+ You need a valid Stripe secret in config/stripe.js to use this page as intended.
27
+ </ p >
28
+ </ div >
29
+ ) ;
30
+ } else if ( this . state . stripeLoadingError ) {
24
31
content = (
25
32
< div className = "payment-content" >
26
33
< h3 style = { { color : redA700 } } className = "payment-header" > Error While Loading Payment System</ h3 >
@@ -29,13 +36,11 @@ class PaymentFormContainer extends React.Component {
29
36
</ p >
30
37
</ div >
31
38
) ;
32
- }
33
- else if ( this . props . paymentComplete ) {
39
+ } else if ( this . props . paymentComplete ) {
34
40
content = (
35
41
< PaymentThankYou />
36
42
) ;
37
- }
38
- else {
43
+ } else {
39
44
content = (
40
45
< PaymentForm submitDisabled = { this . props . submitDisabled } editMode = { this . props . editMode } />
41
46
)
@@ -53,7 +58,8 @@ class PaymentFormContainer extends React.Component {
53
58
const mapStateToProps = ( state ) => {
54
59
return {
55
60
paymentComplete : state . forms . paymentForm . completed ,
56
- isFormValid : ! state . forms . loginForm . error
61
+ isFormValid : ! state . forms . loginForm . error ,
62
+ stripeToken : state . paymentReducer . stripeToken ,
57
63
}
58
64
}
59
65
0 commit comments