Update charge.php

This commit is contained in:
Laurent Destailleur 2018-09-12 18:47:00 +02:00 committed by GitHub
parent 30c393d2da
commit 9efa3816c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,12 +120,16 @@ if (!$rowid)
foreach ($list->data as $charge) foreach ($list->data as $charge)
{ {
// The metadata FULLTAG is defined by the online payment page // The metadata FULLTAG is defined by the online payment page
$FULLTAG=$charge->description; $FULLTAG=$charge->metadata->FULLTAG;
// Save into $tmparray all metadata // Save into $tmparray all metadata
$tmparray = dolExplodeIntoArray($FULLTAG,'.','='); $tmparray = dolExplodeIntoArray($FULLTAG,'.','=');
// Load origin object according to metadata // Load origin object according to metadata
if (! empty($tmparray['CUS']) && $charge->metadata->dol_thirdparty_id) if (! empty($tmparray['CUS']) && $tmparray['CUS'] > 0)
{
$societestatic->fetch($tmparray['CUS']);
}
elseif (! empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0)
{ {
$societestatic->fetch($charge->metadata->dol_thirdparty_id); $societestatic->fetch($charge->metadata->dol_thirdparty_id);
} }
@ -133,7 +137,7 @@ if (!$rowid)
{ {
$societestatic->id = 0; $societestatic->id = 0;
} }
if (! empty($tmparray['MEM']) && $charge->metadata->dol_thirdparty_id) if (! empty($tmparray['MEM']) && $tmparray['MEM'] > 0)
{ {
$memberstatic->fetch($tmparray['MEM']); $memberstatic->fetch($tmparray['MEM']);
} }
@ -142,9 +146,9 @@ if (!$rowid)
$memberstatic->id = 0; $memberstatic->id = 0;
} }
print '<TR class="oddeven">'; print '<TR class="oddeven">';
// Ref // Ref
$url='https://dashboard.stripe.com/test/payments/'.$charge->id; $url='https://dashboard.stripe.com/test/payments/'.$charge->id;
if ($servicestatus) if ($servicestatus)
{ {
$url='https://dashboard.stripe.com/payments/'.$charge->id; $url='https://dashboard.stripe.com/payments/'.$charge->id;