Clean code
This commit is contained in:
parent
5b9716b9d0
commit
653790fb5d
@ -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))
|
if ($action == 'charge' && ! empty($conf->stripe->enabled))
|
||||||
{
|
{
|
||||||
$amountstripe = $amount;
|
$amountstripe = $amount;
|
||||||
|
|||||||
@ -309,7 +309,6 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
|
|||||||
// Save into $tmptag all metadata
|
// Save into $tmptag all metadata
|
||||||
$tmptag=dolExplodeIntoArray($fulltag, '.', '=');
|
$tmptag=dolExplodeIntoArray($fulltag, '.', '=');
|
||||||
|
|
||||||
// TODO: Set $_POST var from $event->data and call newpayment.php with $action = 'charge'
|
|
||||||
$stripe=new Stripe($db);
|
$stripe=new Stripe($db);
|
||||||
/*
|
/*
|
||||||
$stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here)
|
$stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here)
|
||||||
|
|||||||
@ -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 Societe $object Object to pay with Stripe
|
||||||
* @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe()
|
* @param string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe()
|
||||||
@ -318,7 +318,9 @@ class Stripe extends CommonObject
|
|||||||
$description=$object->element.$object->id;
|
$description=$object->element.$object->id;
|
||||||
|
|
||||||
$dataforintent = array(
|
$dataforintent = array(
|
||||||
"amount" => $stripeamount,
|
"confirm" => false, // Do not confirm immediatly during creation of intent
|
||||||
|
"confirmation_method" => $mode,
|
||||||
|
"amount" => $stripeamount,
|
||||||
"currency" => $object->multicurrency_code,
|
"currency" => $object->multicurrency_code,
|
||||||
"customer" => $customer,
|
"customer" => $customer,
|
||||||
"allowed_source_types" => ["card"],
|
"allowed_source_types" => ["card"],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user