Code comment
This commit is contained in:
parent
df28be443b
commit
79cbdf7fd1
@ -444,10 +444,12 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
|
||||
$thirdparty = new Societe($db);
|
||||
$thirdparty->fetch($thirdparty_id);
|
||||
|
||||
// Create Stripe customer
|
||||
include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
|
||||
$stripe = new Stripe($db);
|
||||
$customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1);
|
||||
|
||||
// Create Stripe card from Token
|
||||
$card = $customer->sources->create(array("source" => $stripeToken, "metadata" => $metadata));
|
||||
|
||||
if (empty($card))
|
||||
@ -1559,7 +1561,7 @@ if (preg_match('/^dopayment/',$action))
|
||||
|
||||
?>
|
||||
|
||||
// Create a Stripe client
|
||||
// Create a Stripe client.
|
||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||
|
||||
// Create an instance of Elements
|
||||
|
||||
@ -46,11 +46,11 @@ $stripearrayofkeysbyenv = array(
|
||||
$stripearrayofkeys = array();
|
||||
if (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))
|
||||
{
|
||||
$stripearrayofkeys = $stripearrayofkeysbyenv[0];
|
||||
$stripearrayofkeys = $stripearrayofkeysbyenv[0]; // Test
|
||||
}
|
||||
else
|
||||
{
|
||||
$stripearrayofkeys = $stripearrayofkeysbyenv[1];
|
||||
$stripearrayofkeys = $stripearrayofkeysbyenv[1]; // Live
|
||||
}
|
||||
|
||||
\Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user