Skip to content

Build an end-to-end integration with Primer and start accepting payments in a few lines of code. Learn more about Primer at: https://primer.io

Notifications You must be signed in to change notification settings

primer-io/example-web-checkout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Web Checkout

Example integration of Universal Checkout using the Primer Web SDK

This is a companion project to the Web Getting Start Guide.


✅ Pre-requisites

  • A Primer sandbox account 🚀

  • A handful of programs installed on your machine
    node, and yarn or npm, that's it! 💪

  • 5 minutes of your time
    Then you can show your colleagues how powerful Universal Checkout is 😎

🚀 Get Started

👨‍💻 Installation

Clone this repository:

git clone https://github.com/primer-io/example-web-checkout.git
cd ./example-web-checkout

Then install the dependencies using yarn or npm:

# With yarn
yarn
# With npm
npm i

🔑 Set up the API Key

Grab your API Key, or create a new one, from the Primer Dashboard.

Dashboard API Key

Copy env.example and name the file .env.

cp env.example .env

Open .env and set the environment variable API_KEY with the API key available on your dashboard.

# .env
API_KEY=1234-1234-1234-1234 # Your Primer API Key

🏃‍♂️ Run the server

# With yarn
yarn start

# With npm
npm start

The server is deployed on port 8880 by default. You can change the port by setting the PORT environment variable in the .env file.

This server uses nodemon under the hood to automatically re-run the server when a change to the source files or .env is made.

💳 Access the checkout

Check the checkout at http://localhost:8880/.

You should see Universal Checkout appear with the payment methods configured on your Dashboard! 🎉

Checkout UI

👀 What's next?

About

Build an end-to-end integration with Primer and start accepting payments in a few lines of code. Learn more about Primer at: https://primer.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published