Skip to content

Commit

Permalink
Rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 29, 2018
1 parent 99ada20 commit b3a4540
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions htdocs/stripe/class/stripe.class.php
Expand Up @@ -194,12 +194,12 @@ public function customerStripe(Societe $object, $key='', $status=0, $createifnot
*
* @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 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 $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
*/
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;

Expand All @@ -222,10 +222,10 @@ public function cardStripe($cu, CompanyPaymentMode $object, $key='', $status=0,
if ($cardref)
{
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);
} else {
$card = $cu->sources->retrieve($cardref, array("stripe_account" => $key));
$card = $cu->sources->retrieve($cardref, array("stripe_account" => $stripeacc));
}
}
catch(Exception $e)
Expand All @@ -249,12 +249,12 @@ public function cardStripe($cu, CompanyPaymentMode $object, $key='', $status=0,
);

//$a = \Stripe\Stripe::getApiKey();
//var_dump($a);var_dump($key);exit;
//var_dump($a);var_dump($stripeacc);exit;
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);
} else {
$card = $cu->sources->create($dataforcard, array("stripe_account" => $key));
$card = $cu->sources->create($dataforcard, array("stripe_account" => $stripeacc));
}

if ($card)
Expand Down

0 comments on commit b3a4540

Please sign in to comment.