Test your hosted checkout integration (Windows)
North America—United States and Canada
You can test the hosted checkout experience without much code with basic tools, such as PowerShell and a web browser.
- Generate a private token and view the
merchantId
to set up a hosted checkout integration. - Copy the following PowerShell script:
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("X-Clover-Merchant-Id", "{merchantID}")
$headers.Add("Authorization", "Bearer {privateKey}")
$headers.Add("Content-Type", "application/json")
$body = "{
`n `"customer`" : {
`n `"email`": `"[email protected]`",
`n `"firstName`" : `"Example`",
`n `"lastName`": `"Customer`",
`n `"phoneNumber`": `"555-555-0002`"
`n },
`n `"shoppingCart`" : {
`n `"lineItems`": [
`n {
`n `"name`": `"Lime`",
`n `"unitQty`": 3,
`n `"price`": 100
`n },
`n {
`n `"name`": `"Pear`",
`n `"unitQty`": 2,
`n `"price`": 150
`n }
`n ]
`n }
`n }
`n"
$response = Invoke-RestMethod 'https://apisandbox.dev.clover.com/invoicingcheckoutservice/v1/checkouts' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
- In a text editor, paste the command and then replace the following placeholders:
merchantId
privateKey
emailAddress
- Copy the edited command.
- Start a terminal session.
- Paste the edited cURL command and press Enter to run it. A response is returned.
- Copy the URL value from the
href
field. - In a web browser, paste the URL and press Enter.
- On the checkout page, verify the following information is correct:
- Items and their quantities
- Customer’s information
- Enter the following card information:
- Card Number:
6011 3610 0000 6668
- MM/YY: a month and year in the future
- CVV: a 3-digit number
- ZIP: a 5-digit number
- Card Number:
- Click Pay. The payment is processed and a Payment Received message appears.
- Verify a receipt is sent to your email address.
Updated 19 days ago