Here is the Video link : https://www.awesomescreenshot.com/video/34941340?key=074f660aedd1fd99b859eff56a119c43
Below is the payload :
// Define the payload
$payload = [
"customer" => [
"email" => "victorjohn20@yopmail.com",
"firstName" => "Example",
"lastName" => "Customer",
"phoneNumber" => "555-555-0002"
],
"currency"=> "USD",
"shoppingCart" => [
"lineItems" => [
[
"name" => "Apple",
"unitQty" => 3, // Quantity
"price" => $this->convertToCloverPrice(2),
],
[
"name" => "Agua de Sandía",
"unitQty" => 1,
"price" => $this->convertToCloverPrice(4) // Price in cents ($4.99)
],
[
"name" => "Tax",
"unitQty" => 1,
"price" => $this->convertToCloverPrice(17),
],
[
"name" => "Shipping Charge",
"unitQty" => 1,
"price" => $this->convertToCloverPrice(3),
]
]
],
"redirectUrl" => "https://coherent-husky-golden.ngrok-free.app/clover/success", // Ensure this is correct
"cancelUrl" => "https://coherent-husky-golden.ngrok-free.app/clover/cancel"
];
$response = Http::withHeaders([
'X-Clover-Merchant-Id' => $merchantId,
'Authorization' => "Bearer {$accessToken}",
'Content-Type' => 'application/json',
])->post('https://apisandbox.dev.clover.com/invoicingcheckoutservice/v1/checkouts', $payload);