Rename parameter

This commit is contained in:
Laurent Destailleur 2018-03-29 19:44:38 +02:00
parent 99ada20f6d
commit b3a454033e

View File

@ -194,12 +194,12 @@ class Stripe extends CommonObject
* *
* @param \Stripe\StripeCustomer $cu Object stripe customer * @param \Stripe\StripeCustomer $cu Object stripe customer
* @param CompanyPaymentMode $object Object companypaymentmode to check, or create on stripe (create on stripe also update the societe_rib table for current entity) * @param CompanyPaymentMode $object Object companypaymentmode to check, or create on stripe (create on stripe also update the societe_rib table for current entity)
* @param string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect * @param string $stripeacc ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect
* @param int $status Status (0=test, 1=live) * @param int $status Status (0=test, 1=live)
* @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card * @param int $createifnotlinkedtostripe 1=Create the stripe card and the link if the card is not yet linked to a stripe card
* @return \Stripe\StripeCard|null Stripe Card or null if not found * @return \Stripe\StripeCard|null Stripe Card or null if not found
*/ */
public function cardStripe($cu, CompanyPaymentMode $object, $key='', $status=0, $createifnotlinkedtostripe=0) public function cardStripe($cu, CompanyPaymentMode $object, $stripeacc='', $status=0, $createifnotlinkedtostripe=0)
{ {
global $conf, $user; global $conf, $user;
@ -222,10 +222,10 @@ class Stripe extends CommonObject
if ($cardref) if ($cardref)
{ {
try { try {
if (empty($key)) { // If the Stripe connect account not set, we use common API usage if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage
$card = $cu->sources->retrieve($cardref); $card = $cu->sources->retrieve($cardref);
} else { } else {
$card = $cu->sources->retrieve($cardref, array("stripe_account" => $key)); $card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc));
} }
} }
catch(Exception $e) catch(Exception $e)
@ -249,12 +249,12 @@ class Stripe extends CommonObject
); );
//$a = \Stripe\Stripe::getApiKey(); //$a = \Stripe\Stripe::getApiKey();
//var_dump($a);var_dump($key);exit; //var_dump($a);var_dump($stripeacc);exit;
try { try {
if (empty($key)) { // If the Stripe connect account not set, we use common API usage if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage
$card = $cu->sources->create($dataforcard); $card = $cu->sources->create($dataforcard);
} else { } else {
$card = $cu->sources->create($dataforcard, array("stripe_account" => $key)); $card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc));
} }
if ($card) if ($card)