A Sample Payments Application

Here you will find a sample web application that demonstrates some of the features of the Circle Payments API.

Circle API Documentation Portal

For full details on what you can do with Circle's APIs and how to use them, please check the API documentation portal.

Clone and configure the sample app

You can manually clone the sample app by running:

$ git clone https://github.com/circlefin/payments-sample-app.git

Create a .env file in the project's root folder in order to configure the base url for api calls. To run the sample app against the sandbox environment API endpoints, configure it as follows:

$ echo BASE_URL=https://api-sandbox.circle.com > .env

Install the dependencies

Run the following to install the dependencies:

$ yarn install

Run the sample app locally

Run the following to run the sample app locally:

$ yarn dev

The sample app is now running at: http://localhost:3011/.

After you generate an API key for the sandbox environment, enter it on the settings tab on the top right corner of the sample app.

You are now ready to use the sample app and test some payments flows. In a production environment these payments would settle in the USDC stablecoin.

Test Card Numbers

To automatically trigger certain responses from the Circle Payments API, you can use some pre-defined test card numbers that exercise specific behaviors.

Nuxt

This sample app was written with Nuxt. For a more detailed explanation of how Nuxt works, check the Nuxt.js docs.

Tests

The sample app uses jest for testing. You can find the tests in the test folder.

To run the tests:

$ yarn test

To watch the tests:

$ yarn test:watch