diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 1965c8ab73d..c1c7a8febeb 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018-2023 Thibault FOUCART * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -65,8 +65,6 @@ $result = restrictedArea($user, 'banque'); */ $form = new Form($db); -$societestatic = new Societe($db); -$memberstatic = new Adherent($db); $acc = new Account($db); $stripe = new Stripe($db); @@ -129,47 +127,13 @@ if (!$rowid) { } foreach ($payout->data as $payout) { - //$charge = $payout; - //var_dump($payout); - - // The metadata FULLTAG is defined by the online payment page - /*$FULLTAG=$charge->metadata->FULLTAG; - - // Save into $tmparray all metadata - $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); - // Load origin object according to metadata - if (!empty($tmparray['CUS'])) - { - $societestatic->fetch($tmparray['CUS']); - } - else - { - $societestatic->id = 0; - } - if (!empty($tmparray['MEM'])) - { - $memberstatic->fetch($tmparray['MEM']); - } - else - { - $memberstatic->id = 0; - }*/ - - $societestatic->fetch($charge->metadata->idcustomer); - $societestatic->id = $charge->metadata->idcustomer; - $societestatic->lastname = $obj->lastname; - $societestatic->firstname = $obj->firstname; - $societestatic->admin = $obj->admin; - $societestatic->login = $obj->login; - $societestatic->email = $obj->email; - $societestatic->socid = $obj->fk_soc; print ''; // Ref if (!empty($stripeacc)) { $connect = $stripeacc.'/'; - } + } else $connect = null; $url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id; if ($servicestatus) { @@ -178,32 +142,6 @@ if (!$rowid) { print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$payout->id."\n"; - - // Stripe customer - //print "".$charge->customer."\n"; - // Link - /*print ""; - if ($societestatic->id > 0) - { - print $societestatic->getNomUrl(1); - } - if ($memberstatic->id > 0) - { - print $memberstatic->getNomUrl(1); - } - print "\n";*/ - // Origine - //print ""; - ////if ($charge->metadata->dol_type=="order"){ - // $object = new Commande($db); - // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_order')." ".$object->ref.""; - //} elseif ($charge->metadata->dol_type=="invoice"){ - // $object = new Facture($db); - // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_invoice')." ".$object->ref.""; - //} - //print "\n"; // Date payment print ''.dol_print_date($payout->created, 'dayhour')."\n"; // Date payment @@ -215,15 +153,15 @@ if (!$rowid) { // Status print ""; if ($payout->status == 'paid') { - print img_picto($langs->trans("".$payout->status.""), 'statut4'); + print img_picto($langs->trans($payout->status), 'statut4'); } elseif ($payout->status == 'pending') { - print img_picto($langs->trans("".$payout->status.""), 'statut7'); + print img_picto($langs->trans($payout->status), 'statut7'); } elseif ($payout->status == 'in_transit') { - print img_picto($langs->trans("".$payout->status.""), 'statut7'); + print img_picto($langs->trans($payout->status), 'statut7'); } elseif ($payout->status == 'failed') { - print img_picto($langs->trans("".$payout->status.""), 'statut7'); + print img_picto($langs->trans($payout->status), 'statut7'); } elseif ($payout->status == 'canceled') { - print img_picto($langs->trans("".$payout->status.""), 'statut8'); + print img_picto($langs->trans($payout->status), 'statut8'); } print ''; print "\n";