Clean code

This commit is contained in:
Laurent Destailleur 2019-04-26 03:11:46 +02:00
parent 5b9716b9d0
commit 653790fb5d
3 changed files with 6 additions and 4 deletions

View File

@ -395,7 +395,8 @@ if ($action == 'dopayment')
}
// Called when choosing Stripe mode, after clicking the 'dopayment'
// Called when choosing Stripe mode, after clicking the 'dopayment' with the Charge API architecture.
// When using the PaymentItent architecture, we dont need this, the Stripe customer is created when creating PaymentItent when showing payment page.
if ($action == 'charge' && ! empty($conf->stripe->enabled))
{
$amountstripe = $amount;

View File

@ -309,7 +309,6 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
// Save into $tmptag all metadata
$tmptag=dolExplodeIntoArray($fulltag, '.', '=');
// TODO: Set $_POST var from $event->data and call newpayment.php with $action = 'charge'
$stripe=new Stripe($db);
/*
$stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here)

View File

@ -238,7 +238,7 @@ class Stripe extends CommonObject
}
/**
* Get the Stripe payment intent
* Get the Stripe payment intent. Create it with confirm=false
*
* @param Societe $object Object to pay with Stripe
* @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe()
@ -318,7 +318,9 @@ class Stripe extends CommonObject
$description=$object->element.$object->id;
$dataforintent = array(
"amount" => $stripeamount,
"confirm" => false, // Do not confirm immediatly during creation of intent
"confirmation_method" => $mode,
"amount" => $stripeamount,
"currency" => $object->multicurrency_code,
"customer" => $customer,
"allowed_source_types" => ["card"],