sessions->create(["paymentData" => ["amount" => ["value" => "10.00", "currency" => "EUR"], "description" => "Order #12345"], "method" => "paypal", "methodDetails" => ["checkoutFlow" => "express"], "returnUrl" => "{$protocol}://{$hostname}{$path}/shippingSelection.php?order_id={$sessionId}", "cancelUrl" => "{$protocol}://{$hostname}{$path}/cancel.php?order_id={$sessionId}"]); /* * Send the customer off to complete the payment. * This request should always be a GET, thus we enforce 303 http response code */ \header("Location: " . $session->getRedirectUrl(), \true, 303); } catch (\Mollie\Api\Exceptions\ApiException $e) { echo "API call failed: " . \htmlspecialchars($e->getMessage()); }