link to stripe customer

This commit is contained in:
ptibogxiv 2018-09-14 17:46:02 +02:00 committed by GitHub
parent bf38f1a80f
commit e9fb2387b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,16 +62,16 @@ llxHeader('', $langs->trans("StripeChargeList"));
if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))) if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha')))
{ {
$service = 'StripeTest'; $service = 'StripeTest';
$servicestatus = '0'; $servicestatus = '0';
dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning');
} }
else else
{ {
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = '1'; $servicestatus = '1';
} }
$stripeaccount = $stripe->getStripeAccount($service); $stripeacc = $stripe->getStripeAccount($service);
/*if (empty($stripeaccount)) /*if (empty($stripeaccount))
{ {
print $langs->trans('ErrorStripeAccountNotDefined'); print $langs->trans('ErrorStripeAccountNotDefined');
@ -109,9 +109,9 @@ if (!$rowid)
print "</TR>\n"; print "</TR>\n";
if ($stripeaccount) if ($stripeacc)
{ {
$list=\Stripe\Charge::all(array("limit" => $limit), array("stripe_account" => $stripeaccount)); $list=\Stripe\Charge::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
} }
else else
{ {
@ -149,8 +149,10 @@ if (!$rowid)
} }
print '<TR class="oddeven">'; print '<TR class="oddeven">';
if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/';
// Ref // Ref
if (! empty($conf->stripe->enabled) && !empty($stripeaccount)) $connect=$stripeaccount.'/';
$url='https://dashboard.stripe.com/'.$connect.'test/payments/'.$charge->id; $url='https://dashboard.stripe.com/'.$connect.'test/payments/'.$charge->id;
if ($servicestatus) if ($servicestatus)
{ {
@ -158,7 +160,17 @@ if (!$rowid)
} }
print "<TD><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."</a></TD>\n"; print "<TD><a href='".$url."' target='_stripe'>".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id."</a></TD>\n";
// Stripe customer // Stripe customer
print "<TD>".$charge->customer."</TD>\n"; print "<TD>";
if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/';
$url='https://dashboard.stripe.com/'.$connect.'test/customers/'.$charge->customer;
if ($servicestatus)
{
$url='https://dashboard.stripe.com/'.$connect.'customers/'.$charge->customer;
}
print ' <a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').' '.$charge->customer.'</a>';
print "</TD>\n";
// Link // Link
print "<TD>"; print "<TD>";
if ($societestatic->id > 0) if ($societestatic->id > 0)