tommythorsen / braintree_auth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A payment app and backend using Braintree Auth

The backend consists of an e-commerce portal and a payment app, which is meant to be used together with the web payments extension for Chrome/Opera.

There is also a simple merchant site which can be onboarded through the e-commerce portal and uses the payment app for processing payments.

Here's how to test this code:

1. Put Braintree Client ID and Client Secret in the environment

You can do this by adding this to your .bashrc, for instance:

export BRAINTREE_CLIENT_ID='<your client id>'
export BRAINTREE_CLIENT_SECRET='<your client secret>'

2. Create certificate files cert.pem and key.pem for https

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 999 -nodes

3. Set the username of the merchant braintree account

Change this line so that it contains your braintree username instead of tommyt@opera.com.

4. Install/update node packages

npm install

5. Run the web server

node index.js

6. Install the web payments mediator extension.

By clicking here.

7. Install the Braintree Auth payment app.

By navigating to https://localhost:9002/payment-app and clicking Install.

8. Register the merchant in the e-commerce portal

Navigate to https://localhost:9002/portal and log in with the merchant braintree account used in step 3.

9. Do some shopping

Make a sandbox purchase in https://localhost:9002/merchant

About

License:Apache License 2.0


Languages

Language:HTML 63.9%Language:JavaScript 29.1%Language:CSS 7.0%