/home/techb158/immovalet.com/vendor/mollie/mollie-api-php/examples/orders
Edit: /home/techb158/immovalet.com/vendor/mollie/mollie-api-php/examples/orders/list-orders.php (1661B)
';
$latestOrders = $mollie->orders->page();
printOrders($latestOrders);
$previousOrders = $latestOrders->next();
printOrders($previousOrders);
echo '';
} catch (\Mollie\Api\Exceptions\ApiException $e) {
echo "API call failed: " . htmlspecialchars($e->getMessage());
}
function printOrders($orders)
{
if (empty($orders)) {
return ;
}
foreach ($orders as $order) {
echo '
Order ' . htmlspecialchars($order->id) . ': (' . htmlspecialchars($order->createdAt) . ')';
echo '
Status: ' . htmlspecialchars($order->status);
echo '| Billed to | Shipped to | Total amount |
';
echo '';
echo '| ' . htmlspecialchars($order->shippingAddress->givenName) . ' ' . htmlspecialchars($order->shippingAddress->familyName) . ' | ';
echo '' . htmlspecialchars($order->billingAddress->givenName) . ' ' . htmlspecialchars($order->billingAddress->familyName) . ' | ';
echo '' . htmlspecialchars($order->amount->currency) . str_replace('.', ',', htmlspecialchars($order->amount->value)) . ' | ';
echo '
';
echo '
';
echo 'Click here to pay';
echo '';
}
}