customers->page(null, 1)[0];
/*
* Get the all payments for this API key ordered by newest.
*/
$payments = $customer->payments();
echo "
";
foreach ($payments as $payment) {
echo "- ";
echo "" . htmlspecialchars($payment->id) . "
";
echo htmlspecialchars($payment->description) . "
";
echo htmlspecialchars($payment->amount->currency) . " " . htmlspecialchars($payment->amount->value) . "
";
echo "Status: " . htmlspecialchars($payment->status) . "
";
if ($payment->hasRefunds()) {
echo "Payment has been (partially) refunded.
";
}
if ($payment->hasChargebacks()) {
echo "Payment has been charged back.
";
}
if ($payment->canBeRefunded() && $payment->amountRemaining->currency === 'EUR' && $payment->amountRemaining->value >= '2.00') {
echo " (id) . "\">refund)";
}
echo " ";
}
echo "
";
} catch (\Mollie\Api\Exceptions\ApiException $e) {
echo "API call failed: " . htmlspecialchars($e->getMessage());
}