HOWTO:

Step 1:

Signup for Circle sandbox API account and get API key:

Step 2:

Install sample payments web app

https://developers.circle.com/docs/circle-payments-api-quickstart

# Clone the sample app Github repository
git clone <https://github.com/circlefin/payments-sample-app.git>

# Change into sample app folder
cd payments-sample-app

# Create a .env file and configure the base url for api calls
echo BASE_URL=https://api-sandbox.circle.com > .env

# Install the dependencies
yarn install

# Run the sample app locally
yarn dev

Note: If you face an issue with the "yarn install" command throwing up the error No such file or directory: 'install' then try sudo apt remove cmdtest

The sample application should now be running at: http://localhost:3011.

Step 3:

On the sample application, click on the Charge Flow button under the "Example UI implementation" section.

Use one of the test card numbers available on the sandbox environment. For example, 4007400000000007.

Type in an amount, pick a value for CVV and expiry date, and add some billing information details.

Submit the payment creation request by clicking on the Make Payment button.

🎉 Congrats, you processed your first card payment that settles in USDC! You should see a payment identifier on the resulting screen, something like Payment id: 81855279-b53d-4119-9f1e-5d0af00f0c24

Step 4:

Check the status of your card payment at https://developers.circle.com/reference-link/payments-payments-get-id

Note: It's the GET "Get a payment." NOT "Get a list of payments."

# Replace ${YOUR_API_KEY} with the API key obtained on step 1
# Replace ${PAYMENT_ID} with the payment id obtained on step 3
curl -H 'Accept: application/json' \\
  -H "Authorization: Bearer ${YOUR_API_KEY}" \\
  -X GET --url <https://api-sandbox.circle.com/v1/payments/${PAYMENT_ID}>