From b74399abf62ac3803b360767b5af4fb6fabb57ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Oct 2017 02:46:19 +0100 Subject: [PATCH] Code comment --- htdocs/public/payment/newpayment.php | 2 +- htdocs/public/stripe/newpayment.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index f5fb86c8bfa..977c65d49a7 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -403,7 +403,6 @@ if ($action == 'charge') 'source' => $stripeToken // source can be a token OR array('object'=>'card', 'exp_month'=>xx, 'exp_year'=>xxxx, 'number'=>xxxxxxx, 'cvc'=>xxx, 'name'=>'Cardholder's full name', zip ?) )); // Return $customer = array('id'=>'cus_XXXX', ...) - // TODO Add 'business_vat_id' ? dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); $charge = \Stripe\Charge::create(array( @@ -414,6 +413,7 @@ if ($action == 'charge') 'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name), 'statement_descriptor' => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$FULLTAG, 22, 'right', 'UTF-8', 1) // 22 chars that appears on bank receipt )); + // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) } catch(\Stripe\Error\Card $e) { // Since it's a decline, \Stripe\Error\Card will be caught $body = $e->getJsonBody(); diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index 5fd3924644e..35ccba4ef1c 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -239,7 +239,7 @@ if ($action == 'charge') dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); $charge = \Stripe\Charge::create(array( - 'customer' => $customer->id, + 'customer' => $customer->id, // Will reuse default source of this customer card profile 'amount' => price2num($amount, 'MU'), 'currency' => $currency, 'description' => 'Stripe payment: '.$FULLTAG,