Below, you can find instructions on how to use testmode, along with a set of useful tools to test various scenarios deterministically.
To use the Elevate APIs in testmode, follow the instructions below to generate a Customer and make a purchase. Note that you can only make purchases in testmode with Customers created in testmode.
The below instructions allow you to onboard a Customer in testmode and test your onboarding flow.
To test your Guest customer onboarding flow, you can use our test card collection component, which will create Customers in testmode.
To use the test component, change the path in the iframe URL from card
to card-test
:
<iframe frameborder="0" width="600" height="1200" src="https://elev4te-onboarding-423322.wm.r.appspot.com/card-test?client_token=your_client_token" />
This will create a Customer in testmode. Testmode Customers can only be used with testmode PurchaseIntents.
Test card numbers Use test card numbers with the test customer onboarding component. Here are a few examples that will work:
Brand | Card number | Expiration date | CVC |
---|---|---|---|
Visa | 4242424242424242 | any future date | any 3 digits |
Mastercard | 5555555555554444 | any future date | any 3 digits |
Discover | 6011111111111117 | any future date | any 3 digits |
To test your Amazon customer onboarding flow, you can use our test account connection component, which will create Customers in testmode.
To use the test component, change the path in the iframe URL from amazon
to amazon-test
:
<iframe frameborder="0" width="550" height="650" src="https://elev4te-onboarding-423322.wm.r.appspot.com/amazon-test?client_token=your_client_token" />
This will create a Customer in testmode. Testmode Customers can only be used with testmode PurchaseIntents.
The below instructions allow you to make a purchase in testmode. There will be no actual products purchased or payments charged while using testmode.
To make a purchase in testmode, set livemode
to false
when creating the PurchaseIntent (note livemode
defaults to false if you do not include livemode
in the request).
curl --request POST \
--url https://api-agent.useelevate.dev/v1/purchase_intents \
--header 'Authorization: Bearer YOUR_KEY_HERE' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "cus_my-test-customer",
"product_url": "https://www.test-useelevate.dev/p=success",
"livemode": false,
}
'
These test product URLs can be used to mock different scenarios deterministically. We will not attempt to execute a real purchase (in either testmode or livemode) when using these test URLs.
Product URL | Description |
---|---|
https://www.test-useelevate.dev/p=success | Mocks a successful purchase for valid requests. |
https://www.test-useelevate.dev/p=no_input_required | Mocks a successful purchase that doesn't need additional inputs. |
https://www.test-useelevate.dev/p=no_product_variant | Mocks a successful purchase for a product with no variants. |
https://www.test-useelevate.dev/p=single_prop_product_variant | Mocks a successful purchase for a product with variants that have only one property type. |
https://www.test-useelevate.dev/p=multi_prop_product_variant | Mocks a successful purchase for a product with variants that have multiple property types. |
https://www.test-useelevate.dev/p=execution | Mocks an execution error for the purchase. This may include a payment error (e.g. the customer's card was declined) or an issue with the execution flow of the purchase. |
https://www.test-useelevate.dev/p=out_of_stock | Mocks the item is no longer available (e.g. out of stock) when we go to make the purchase. |
https://www.test-useelevate.dev/p=price_changed | Mocks that the price has changed for the item. |
https://www.test-useelevate.dev/p=access_expired | Mocks that the customer's account authentication has expired. |
https://www.test-useelevate.dev/p=ineligible | Any URL that isn't claimed for one of the above scenarios will be considered ineligible in test mode. |