Skip to content

davidnuzik/simple-payment-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dependencies

Get started

  • Clone the project
  • Install dependencies:
    $ npm install
    

Create a sandbox account and add your configuration values

  • Register a sandbox account

  • Create secret and publishable API keys

    • Add your secret API key to the tilledSecretApiKey variable in app.js
    • Add your publishable API Key to the pk_PUBLISHABLE_KEY variable in index.html
  • View your list of connected accounts and either use the auto-created Shovel Shop (demo) account or create your own connected account. Note: Prefix the name of the account with an asterisk (ex. '*The Surf Shop') to bypass needing to submit an onboarding form.

    • Add an active connected Account ID to the account_id variable in index.html
  • Run the sample server:

    $ node app.js
    

Process your first payment

Example

  • Navigate to http://localhost:5000 in your browser, enter 4037111111000000 as the test card number with a valid expiration date and 123 as the CVV Code and click Pay
  • Optional: Look in the browser's developer console to see payment intent creation logs
  • Go here to see your payment

Manually create payment methods

Example

  • In the browser, check the save payment checkbox, fill in the additional fields and click Save.
  • View the paymentMethod.id in the alert or the console.

What's Next?

API Docs

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 92.3%
  • JavaScript 7.7%