Skip to content

A sample Nodejs application to demonstrate Inutit Payment API's ( Support for both OAuth1.0 and OAuth2.0 )

License

Notifications You must be signed in to change notification settings

IntuitDeveloper/SampleApp-Payments-Nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rate your SampleYesNo

Intuit Payment Sample - NodeJS

Overview

This is a Sample app built using Node.js and Express Framework to showcase how to make API calls using the Intuit-Payment API's

APP screenshots

Installation

Requirements

Via Github Repo (Recommended)

$ git clone https://github.com/IntuitDeveloper/SampleApp-Payments-Nodejs
$ cd SampleApp-Payments-Nodejs
$ npm install

Pre-requisites

Create an App

  • Create an Intuit Developer account and app:
    You must have an Intuit Developer account and have created an app. To know more refer to Get Started
  • Create an App with Payment Scope:
    Login to Developer Portal and click on My Apps on the top right corner and create an App as shown below
    APP screenshots1 Select the Payments scope while creating the app. APP screenshots2

Get Access Token from OAuth Playground

  • Get AccessToken:
    Use OAuth Playground to get the OAuth2.0 accessToken from the app you just created above.
    Note: Please make sure to select Payment Scope
    APP screenshots3

Configuration

Copy the contents from .env.example to .env from the root directory:

$ cp .env.example .env

Edit the .env file to add your:

  • ACCESS_TOKEN: You can generate accessToken using the OAuth Playground
  • NGROK_ENABLED:(optional) By default it is set to false. If you want to serve the Sample App over HTTPS, set the variable to true
  • PORT:(optional) Optional port number for the app to be served

** Please note, that we are testing this Sample in Sandbox Environment. To test in Production please use the below .env variables:

  • TOKEN_URL=https://sandbox.api.intuit.com/quickbooks/v4/payments/tokens
  • CHARGE_URL=https://sandbox.api.intuit.com/quickbooks/v4/payments/charges

TLS / SSL (optional)

If you want your enpoint to be exposed over the internet. The easiest way to do that while you are still developing your code locally is to use ngrok.

You dont have to worry about installing ngrok. The sample application does that for you.

  1. Just set NGROK_ENABLED = true in .env

Usage

$ npm start

Without ngrok (if you are using localhost i.e NGROK_ENABLED=false in .env)

You will see an URL as below:

💻 Server listening on port 8000  
💳 See the Sample App in your browser: http://localhost:8000

With ngrok (if you are using ngrok i.e NGROK_ENABLED=true in .env)

Your will see an URL as below :

💻 Server listening on port 8000  
💳 See the Sample App in your browser: https://9b4ee833.ngrok.io

Click on the URL and follow through the instructions given in the sample app.

Running Sample-Payments-Nodejs App on Heroku

If you already have an Heroku account, you can use Heroku One-Button Deployment to deploy this sample and test it right away.

Deploy

Unable to follow ? Please use the link below to follow the step by step procedure to get started with this sample:

Instructions to Get Started with this Sample App

Links

Project Repo

Intuit Payment API Reference

Intuit Payments API Explorer

Contributions

Any reports of problems, comments or suggestions are most welcome.

Please report these on Issue Tracker in Github.

About

A sample Nodejs application to demonstrate Inutit Payment API's ( Support for both OAuth1.0 and OAuth2.0 )

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published