'; $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 '
Billed to | Shipped to | Total amount |
---|---|---|
' . 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 '