'."\n";
-
- print '';
- print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
- print_liste_field_titre("StripeCustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
- print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
- print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
- print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center ');
- print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left ');
- print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right ');
- print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right ');
- print "
\n";
-
- //print $list;
- $i = 0;
- foreach ($list->data as $charge)
- {
- if ($i >= $limit) {
- break;
- }
-
- if ($charge->refunded == '1') {
- $status = img_picto($langs->trans("refunded"), 'statut6');
- } elseif ($charge->paid == '1') {
- $status = img_picto($langs->trans((string) $charge->status), 'statut4');
- } else {
- $label = $langs->trans("Message").": ".$charge->failure_message."
";
- $label .= $langs->trans("Network").": ".$charge->outcome->network_status."
";
- $label .= $langs->trans("Status").": ".$langs->trans((string) $charge->outcome->seller_message);
- $status = $form->textwithpicto(img_picto($langs->trans((string) $charge->status), 'statut8'), $label, -1);
- }
-
- if ($charge->payment_method_details->type == 'card') {
- $type = $langs->trans("card");
- } elseif ($charge->source->type == 'card') {
- $type = $langs->trans("card");
- } elseif ($charge->payment_method_details->type == 'three_d_secure') {
- $type = $langs->trans("card3DS");
- } elseif ($charge->payment_method_details->type == 'sepa_debit') {
- $type = $langs->trans("sepadebit");
- } elseif ($charge->payment_method_details->type == 'ideal') {
- $type = $langs->trans("iDEAL");
- }
-
- // Why this ?
- /*if (! empty($charge->payment_intent)) {
- if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage
- $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent);
- } else {
- $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc));
- }
- }*/
-
- // 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']) && $tmparray['CUS'] > 0)
+ try {
+ if ($stripeacc)
{
- $societestatic->fetch($tmparray['CUS']);
- } elseif (!empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0)
- {
- $societestatic->fetch($charge->metadata->dol_thirdparty_id);
+ $list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc));
} else {
- $societestatic->id = 0;
- }
- if (!empty($tmparray['MEM']) && $tmparray['MEM'] > 0)
- {
- $memberstatic->fetch($tmparray['MEM']);
- } else {
- $memberstatic->id = 0;
+ $list = \Stripe\Charge::all($option);
}
- print '';
+ $num = count($list->data);
- if (!empty($stripeacc)) $connect = $stripeacc.'/';
+ $totalnboflines = '';
- // Ref
- $url = 'https://dashboard.stripe.com/'.$connect.'test/payments/'.$charge->id;
- if ($servicestatus)
- {
- $url = 'https://dashboard.stripe.com/'.$connect.'payments/'.$charge->id;
- }
- print "";
- print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$charge->id."";
- if ($charge->payment_intent) print ' '.$charge->payment_intent.'';
- print " | \n";
+ $param = '';
+ //if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
+ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
+ $param .= '&starting_after_'.($page + 1).'='.$list->data[($limit - 1)]->id;
+ //$param.='&ending_before_'.($page+1).'='.$list->data[($limit-1)]->id;
- // Stripe customer
- print "";
- 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;
- }
- if (!empty($charge->customer))
- {
- print ''.img_picto($langs->trans('ShowInStripe'), 'globe').' '.$charge->customer.'';
- }
- print " | \n";
+ $moreforfilter = '';
- // Link
- print "";
- if ($societestatic->id > 0)
- {
- print $societestatic->getNomUrl(1);
- } elseif ($memberstatic->id > 0)
- {
- print $memberstatic->getNomUrl(1);
- }
- print " | \n";
+ print '';
+ } catch(Exception $e) {
+ print $e->getMessage();
}
}
diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php
index 6823c32c0b7..07b6b696f2b 100644
--- a/htdocs/stripe/payout.php
+++ b/htdocs/stripe/payout.php
@@ -109,111 +109,115 @@ if (!$rowid) {
print "
\n";
- if ($stripeacc)
- {
- $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
- } else {
- $payout = \Stripe\Payout::all(array("limit" => $limit));
- }
-
- 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']))
+ try {
+ if ($stripeacc)
{
- $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.'/';
-
- $url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id;
- if ($servicestatus) {
- $url = 'https://dashboard.stripe.com/'.$connect.'payouts/'.$payout->id;
+ $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
+ } else {
+ $payout = \Stripe\Payout::all(array("limit" => $limit));
}
- print "| ".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$payout->id." | \n";
+ 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.'/';
+
+ $url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id;
+ if ($servicestatus) {
+ $url = 'https://dashboard.stripe.com/'.$connect.'payouts/'.$payout->id;
+ }
+
+ 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);
+ // 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, '%d/%m/%Y %H:%M')." | \n";
+ // Date payment
+ print ''.dol_print_date($payout->arrival_date, '%d/%m/%Y %H:%M')." | \n";
+ // Type
+ print ''.$payout->description.' | ';
+ // Amount
+ print ''.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency))." | ";
+ // Status
+ print "";
+ if ($payout->status == 'paid') {
+ print img_picto($langs->trans("".$payout->status.""), 'statut4');
+ } elseif ($payout->status == 'pending') {
+ print img_picto($langs->trans("".$payout->status.""), 'statut7');
+ } elseif ($payout->status == 'in_transit') {
+ print img_picto($langs->trans("".$payout->status.""), 'statut7');
+ } elseif ($payout->status == 'failed') {
+ print img_picto($langs->trans("".$payout->status.""), 'statut7');
+ } elseif ($payout->status == 'canceled') {
+ print img_picto($langs->trans("".$payout->status.""), 'statut8');
+ }
+ print ' | ';
+ print "
\n";
}
- 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, '%d/%m/%Y %H:%M')." | \n";
- // Date payment
- print ''.dol_print_date($payout->arrival_date, '%d/%m/%Y %H:%M')." | \n";
- // Type
- print ''.$payout->description.' | ';
- // Amount
- print ''.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency))." | ";
- // Status
- print "";
- if ($payout->status == 'paid') {
- print img_picto($langs->trans("".$payout->status.""), 'statut4');
- } elseif ($payout->status == 'pending') {
- print img_picto($langs->trans("".$payout->status.""), 'statut7');
- } elseif ($payout->status == 'in_transit') {
- print img_picto($langs->trans("".$payout->status.""), 'statut7');
- } elseif ($payout->status == 'failed') {
- print img_picto($langs->trans("".$payout->status.""), 'statut7');
- } elseif ($payout->status == 'canceled') {
- print img_picto($langs->trans("".$payout->status.""), 'statut8');
- }
- print ' | ';
- print "\n";
+ } catch(Exception $e) {
+ print '| '.$e->getMessage().' | ';
}
print "