diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php
index a97f989a37d..b82d8d65a78 100644
--- a/htdocs/stripe/charge.php
+++ b/htdocs/stripe/charge.php
@@ -96,7 +96,7 @@ if (!$rowid)
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("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"],"","","",'align="center"',$sortfield,$sortorder);
@@ -120,20 +120,20 @@ if (!$rowid)
foreach ($list->data as $charge)
{
// The metadata FULLTAG is defined by the online payment page
- $FULLTAG=$charge->metadata->FULLTAG;
+ $FULLTAG=$charge->description;
// Save into $tmparray all metadata
$tmparray = dolExplodeIntoArray($FULLTAG,'.','=');
// Load origin object according to metadata
- if (! empty($tmparray['CUS']))
+ if (! empty($tmparray['CUS']) && $charge->metadata->dol_thirdparty_id)
{
- $societestatic->fetch($tmparray['CUS']);
+ $societestatic->fetch($charge->metadata->dol_thirdparty_id);
}
else
{
$societestatic->id = 0;
}
- if (! empty($tmparray['MEM']))
+ if (! empty($tmparray['MEM']) && $charge->metadata->dol_thirdparty_id)
{
$memberstatic->fetch($tmparray['MEM']);
}
@@ -144,32 +144,40 @@ if (!$rowid)
print '
';
// Ref
- print "| ".$charge->id." | \n";
+ $url='https://dashboard.stripe.com/test/payments/'.$charge->id;
+ if ($servicestatus)
+ {
+ $url='https://dashboard.stripe.com/payments/'.$charge->id;
+ }
+ print "".img_picto($langs->trans('ShowInStripe'), 'object_globe')." ".$charge->id." | \n";
// Stripe customer
- print "".$charge->customer." | \n";
+ //print "".$charge->customer." | \n";
// Link
print "";
if ($societestatic->id > 0)
{
print $societestatic->getNomUrl(1);
}
- if ($memberstatic->id > 0)
+ elseif ($memberstatic->id > 0)
{
print $memberstatic->getNomUrl(1);
- }
+ } else print $charge->customer;
print " | \n";
// Origine
print "";
- print $FULLTAG;
- if ($charge->metadata->source=="order"){
+ if ($charge->metadata->dol_type=="order"){
$object = new Commande($db);
- $object->fetch($charge->metadata->idsource);
- print "".img_picto('', 'object_order')." ".$object->ref."";
- } elseif ($charge->metadata->source=="invoice"){
+ $object->fetch($charge->metadata->dol_id);
+ if ($object->id > 0) {
+ print "".img_picto('', 'object_order')." ".$object->ref."";
+ } else print $FULLTAG;
+ } elseif ($charge->metadata->dol_type=="invoice"){
$object = new Facture($db);
- $object->fetch($charge->metadata->idsource);
- print "".img_picto('', 'object_invoice')." ".$object->ref."";
- }
+ $object->fetch($charge->metadata->dol_id);
+ if ($object->id > 0) {
+ print "".img_picto('', 'object_invoice')." ".$object->ref."";
+ } else print $FULLTAG;
+ } else print $FULLTAG;
print " | \n";
// Date payment
print ''.dol_print_date($charge->created,'%d/%m/%Y %H:%M')." | \n";