diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index cbc6013644d..9d9a1c84597 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Thibault FOUCART * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -65,11 +65,13 @@ llxHeader('', $langs->trans("StripeTransactionList")); if (! empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox','alpha'))) { $service = 'StripeTest'; + $servicestatus = '0'; dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); } else { $service = 'StripeLive'; + $servicestatus = '1'; } $stripeaccount = $stripe->getStripeAccount($service); @@ -162,7 +164,26 @@ if (! $rowid) { print ''; // Ref - print "" . $txn->source . "\n"; + if (! empty($conf->stripe->enabled) && !empty($stripeacc)) $connect=$stripeacc.'/'; + + if (preg_match('/po_/i', $txn->source)){ + $origin="payouts"; + } elseif (preg_match('/fee_/i', $txn->source)) { + $origin="connect/application_fees"; + } else { + $origin="payments"; + } + + $url='https://dashboard.stripe.com/'.$connect.'test/'.$origin.'/'.$txn->source; + + if ($servicestatus) + { + $url='https://dashboard.stripe.com/'.$connect.$origin.'/'.$txn->source; + } + + if ($txn->type == 'stripe_fee' || $txn->type == 'reserve_transaction') { + print "".$txn->type.""; + } else print "".img_picto($langs->trans('ShowInStripe'), 'object_globe')." " . $txn->source . "\n"; // Stripe customer //print "".$charge->customer."\n"; // Link