forked from Wavyzz/dolibarr
Merge pull request #11627 from ptibogxiv/patch-209
FIX display payment intent in stripe's charge list
This commit is contained in:
@@ -121,6 +121,30 @@ if (!$rowid)
|
|||||||
//print $list;
|
//print $list;
|
||||||
foreach ($list->data as $charge)
|
foreach ($list->data as $charge)
|
||||||
{
|
{
|
||||||
|
if ($charge->refunded=='1'){
|
||||||
|
$status = img_picto($langs->trans("refunded"), 'statut6');
|
||||||
|
} elseif ($charge->paid=='1'){
|
||||||
|
$status = img_picto($langs->trans("".$charge->status.""), 'statut4');
|
||||||
|
} else {
|
||||||
|
$label="Message: ".$charge->failure_message."<br>";
|
||||||
|
$label.="Réseau: ".$charge->outcome->network_status."<br>";
|
||||||
|
$label.="Statut: ".$langs->trans("".$charge->outcome->seller_message."");
|
||||||
|
$status = $form->textwithpicto(img_picto($langs->trans("".$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");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($charge->payment_intent)) {
|
||||||
|
$charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent);
|
||||||
|
}
|
||||||
|
|
||||||
// The metadata FULLTAG is defined by the online payment page
|
// The metadata FULLTAG is defined by the online payment page
|
||||||
$FULLTAG=$charge->metadata->FULLTAG;
|
$FULLTAG=$charge->metadata->FULLTAG;
|
||||||
|
|
||||||
@@ -205,31 +229,13 @@ if (!$rowid)
|
|||||||
print '<td class="center">'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."</td>\n";
|
print '<td class="center">'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."</td>\n";
|
||||||
// Type
|
// Type
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($charge->source->object=='card')
|
print $type;
|
||||||
{
|
|
||||||
print $langs->trans("card");
|
|
||||||
}
|
|
||||||
elseif ($charge->source->type=='card'){
|
|
||||||
print $langs->trans("card");
|
|
||||||
} elseif ($charge->source->type=='three_d_secure'){
|
|
||||||
print $langs->trans("card3DS");
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Amount
|
// Amount
|
||||||
print '<td class="right">'.price(($charge->amount-$charge->amount_refunded)/100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."</td>";
|
print '<td class="right">'.price(($charge->amount-$charge->amount_refunded)/100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."</td>";
|
||||||
// Status
|
// Status
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($charge->refunded=='1'){
|
print $status;
|
||||||
print img_picto($langs->trans("refunded"), 'statut6');
|
|
||||||
} elseif ($charge->paid=='1'){
|
|
||||||
|
|
||||||
print img_picto($langs->trans("".$charge->status.""), 'statut4');
|
|
||||||
} else {
|
|
||||||
$label="Message: ".$charge->failure_message."<br>";
|
|
||||||
$label.="Réseau: ".$charge->outcome->network_status."<br>";
|
|
||||||
$label.="Statut: ".$langs->trans("".$charge->outcome->seller_message."");
|
|
||||||
print $form->textwithpicto(img_picto($langs->trans("".$charge->status.""), 'statut8'), $label, 1);
|
|
||||||
}
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user