From 79cbdf7fd193234db9542b39efb9d27151d69f1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jun 2018 15:29:19 +0200 Subject: [PATCH] Code comment --- htdocs/public/payment/newpayment.php | 4 +++- htdocs/stripe/config.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index af30cf2ff57..a531a821d29 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -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(''); // Create an instance of Elements diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 1e9eb7a5181..c61de994874 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -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']);