Exemplo n.º 1
0
        <?php 
echo "<h2><i class='fa fa-list'></i> Latest payments:</h2><hr />";
echo "<table class='table table-striped'>";
echo "<thead>";
echo "<tr>";
echo "<td class='text-center'></td>";
echo "<td class='text-center'>Amount</td>";
echo "<td class='text-center'>Customer</td>";
echo "<td class='text-center'>Creation date</td>";
echo "<td class='text-center'>Status</td>";
echo "<td class='text-center'>Payment ID</td>";
echo "<td class='text-center'></td>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
\Payplug\Payplug::setSecretKey($secretkey);
$payments = \Payplug\Payment::listPayments(50, 0);
$payment = $payments['data'][0];
foreach ($payments['data'] as $payment) {
    $is_paid = $payment->is_paid;
    $error_code = $payment->failure->code;
    $is_refunded = $payment->is_refunded;
    $cardid = $payment->card->id;
    if ($error_code == "aborted") {
        $aborted = "true";
    } else {
        $aborted = "false";
    }
    echo "<tr>";
    echo "<td class='text-center'>";
    if ($payment->hosted_payment != null && $payment->save_card == true) {