Testing your hosted checkout integration (Windows)

You can test the hosted checkout experience without much code. These steps show how to test a checkout session using basic tools (PowerShell and a web browser).

  1. 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`": `"{emailAddress}`",
`n    `"firstName`" : `"Example`",
`n    `"lastName`": `"Customer"`,
`n    `"phoneNumber`": `"223-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 }

$response = Invoke-RestMethod 'https://dev1.dev.clover.com/invoicingcheckoutservice/v1/checkouts' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
  1. In a text editor, paste the command and then replace the following placeholders:
    • merchantId
    • privateKey
    • emailAddress
  2. Copy the edited command.
  3. Start a terminal session.
  4. Paste the edited cURL command and press Enter to run it.
    A response is returned.
  5. Copy the URL value from the href field.
  6. In a web browser, paste the URL and press Enter.
  7. On the checkout page, verify the following information is correct:
    • The items and their quantities are correct
    • The customer’s information is correct
  8. Enter the following card information:
    • Card Number - 6011 3610 0000 6668
    • MM/YY - any month and year in the future
    • CVV - any three-digit number
    • Zip - any five-digit number
  9. Click Pay.
    The payment is processed and a Payment Received message appears.
  10. Verify a receipt was sent to your email address.

Did this page help you?