- Clone the project
- Install dependencies:
$ npm install
Before you can run this example, you will need to create a sandbox account and add your configuration values.
- Retrieve your
Secret
andPublishable
API keys- If you don't have a Secret and Publishable API key, you can create them here.
- Retrieve the Merchant Account ID. To do this, you can go to the Merchants page and click on the Merchant you want to use. The Merchant Account ID will be located on the Company Overview box under the Account ID field.
- By default, you should already have a Merchant account named
Shovel Shop (demo)
.- Optionally, you can create a new Merchant by following the instructions here
- Note: Prefix the name of the account with an asterisk (ex.
*The Surf Shop
) to bypass needing to submit an onboarding form.
- Note: Prefix the name of the account with an asterisk (ex.
- Optionally, you can create a new Merchant by following the instructions here
- By default, you should already have a Merchant account named
-
Create a
.env
file in this project's root directory (simple-payment-example/.env
) with your Secret API Key:TILLED_SECRET_KEY=sk_...
-
Add your Merchant Account ID and Publishable API Key to
index.html
(Lines 238-239)const accountId = "acct_..."; const publishableKey = "pk_...";
-
Enter the following command from this project's root:
$ node app.js
-
Open your web browser and go to http://localhost:3000
- Enter
4037111111000000
as the card number, use a valid expiration date for the card, and enter123
as the CVV code. - Fill out the billing details section.
- Click the Pay to complete the payment.
- Optionally, you can use your browser's developer console to review the logs related to the creation of the payment intent.
- Enter
-
To view the payment in the Tilled Console, go here.
-
You can utilize the Testing page in our Tilled Docs for Test Card Numbers and ACH routing numbers, Simulating Errors, and more.
- For test cards to use in the Sandbox environment, see the Basic Test Card Numbers section.
- For ACH payments, the Account Number can be any 4 or 17-digit number, but the Routing Number must a valid test routing number. See the ACH Debit Testing section.
- In the browser, toggle the Save payment method? switch, make sure to fill out the billing details, and then click the Save button.
- This will create a payment method without processing a payment.
- View the paymentMethod ID in the alert or the console.
- Tilled Docs
- Tilled.js Docs
- API Docs
- Partner Help Center
- The tilled-example-monorepo which contains more advanced examples of how to use the Tilled API and Tilled.js.
You can try out attaching payment methods to customers, adding metadata, including platform fees on payment intents and much, much more via the Tilled API.