@@ -37,10 +37,10 @@ export const GivingSettingsEdit: React.FC<Props> = (props) => {
3737 const getKeys = ( ) => {
3838 if ( provider === "" ) return null ;
3939 else {
40- const publicLabel = provider === "paypal "
40+ const publicLabel = provider === "Paypal "
4141 ? Locale . label ( "settings.givingSettingsEdit.clientId" ) || "Client ID"
4242 : Locale . label ( "settings.givingSettingsEdit.pubKey" ) ;
43- const privateLabel = provider === "paypal "
43+ const privateLabel = provider === "Paypal "
4444 ? Locale . label ( "settings.givingSettingsEdit.clientSecret" ) || "Client Secret"
4545 : Locale . label ( "settings.givingSettingsEdit.secKey" ) ;
4646
@@ -104,9 +104,9 @@ export const GivingSettingsEdit: React.FC<Props> = (props) => {
104104 setPayFees ( false ) ;
105105 } else {
106106 setGateway ( gateways [ 0 ] ) ;
107- setProvider ( gateways [ 0 ] . provider ) ;
108- setPublicKey ( gateways [ 0 ] . publicKey ) ;
109- setPayFees ( gateways [ 0 ] . payFees ) ;
107+ setProvider ( gateways [ 0 ] . provider || "" ) ;
108+ setPublicKey ( gateways [ 0 ] . publicKey || "" ) ;
109+ setPayFees ( gateways [ 0 ] . payFees || false ) ;
110110 }
111111 setPrivateKey ( "" ) ;
112112 } ;
@@ -123,21 +123,21 @@ export const GivingSettingsEdit: React.FC<Props> = (props) => {
123123 < Grid size = { { xs : 12 , md : 4 } } >
124124 < FormControl fullWidth >
125125 < InputLabel > { Locale . label ( "settings.givingSettingsEdit.prov" ) } </ InputLabel >
126- < Select name = "provider" label = { Locale . label ( "settings.givingSettingsEdit.prov" ) } value = { provider } onChange = { handleChange } >
126+ < Select name = "provider" label = { Locale . label ( "settings.givingSettingsEdit.prov" ) } value = { provider || "" } onChange = { handleChange } >
127127 < MenuItem value = "" > { Locale . label ( "settings.givingSettingsEdit.none" ) } </ MenuItem >
128- < MenuItem value = "stripe " > { Locale . label ( "settings.givingSettingsEdit.stripe" ) } </ MenuItem >
129- < MenuItem value = "paypal " > { Locale . label ( "settings.givingSettingsEdit.paypal" ) } </ MenuItem >
128+ < MenuItem value = "Stripe " > { Locale . label ( "settings.givingSettingsEdit.stripe" ) } </ MenuItem >
129+ < MenuItem value = "Paypal " > { Locale . label ( "settings.givingSettingsEdit.paypal" ) } </ MenuItem >
130130 </ Select >
131131 </ FormControl >
132132 </ Grid >
133- { provider === "stripe " && (
133+ { provider === "Stripe " && (
134134 < Grid size = { { xs : 12 } } >
135135 < Typography variant = "body2" color = "textSecondary" component = "div" >
136136 Visit < a href = "https://dashboard.stripe.com/" target = "_blank" rel = "noopener noreferrer" > Stripe Dashboard</ a > and go to < strong > Developers → API keys</ strong > to copy your Publishable and Secret keys (test & live ) .
137137 </ Typography >
138138 </ Grid >
139139 ) }
140- { provider === "paypal " && (
140+ { provider === "Paypal " && (
141141 < Grid size = { { xs : 12 } } >
142142 < Typography variant = "body2" color = "textSecondary" component = "div" >
143143 Go to < a href = "https://developer.paypal.com/" target = "_blank" rel = "noopener noreferrer" > PayPal Developer</ a > , log in, then under < strong > API Credentials</ strong > create an app to get your Client ID and Secret.
0 commit comments