Fix if setup not complete

This commit is contained in:
Laurent Destailleur 2019-05-18 02:22:23 +02:00
parent c6af18b240
commit a850c7aede

View File

@ -1943,6 +1943,12 @@ if (preg_match('/^dopayment/', $action))
print '</form>'."\n"; print '</form>'."\n";
if (empty($stripearrayofkeys['publishable_key']))
{
print info_admin($langs->trans("ErrorModuleSetupNotComplete", "stripe"), 0, 0, 'error');
}
else
{
print '<script src="https://js.stripe.com/v3/"></script>'."\n"; print '<script src="https://js.stripe.com/v3/"></script>'."\n";
// Code to ask the credit card. This use the default "API version". No way to force API version when using JS code. // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
@ -1951,6 +1957,7 @@ if (preg_match('/^dopayment/', $action))
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION)) if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
{ {
?> ?>
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set
// Create a Stripe client. // Create a Stripe client.
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>'); var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
@ -2055,7 +2062,7 @@ if (preg_match('/^dopayment/', $action))
else else
{ {
?> ?>
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off
// Create a Stripe client. // Create a Stripe client.
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>'); var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
@ -2179,6 +2186,7 @@ if (preg_match('/^dopayment/', $action))
print '</script>'; print '</script>';
} }
}
} }