CaliStyle / rise-pg-node

RiSE Payments Node.js API

Home Page:https://rise.store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RiSE Payment Gateway Node.js SDK

NPM version Build Status Test Coverage Dependency Status

Strongly typed Node SDK for RiSE Payment Gateway

Installation

npm install @calistyle/rise-pg-node --save

Documentation

Notes

Usage

Setup

Obtain an API key, username, and password, from the RiSE Payment Platform, and configure the RPG class.

const RPG = require('@calistyle/rise-pg-node').RPG
const rpg = new RPG({
  apiKey: 'your-api-key',
  username: 'your-username',
  password: 'your-password',
  debug: true,
  sandbox: true
})

Using Promises

Every method returns a chainable promise:

// Create a new customer, customer account, and then a new transaction for that customer:
rpg.customer.addCustomer({
  merchantId: 1,
  email: 'foo-customer@example.com'
}).then((customer) => {
  return rpg.customerAccount.addCustomerAccount({
    merchantId: 1,
    customerId: customer.id,
    accountToken: 'tok_visa'
  })
}).then((account) => {
  return rpg.transaction.addTransactionCC({
    merchantId: 1,
    referenceCustomerId: account.customerId,
    customerAccountId: account.id,
    amount: 1600,
    currency: 'usd'
  })
}).then((transaction) => {
  // New charge created on a new customer
}).catch((err) => {
  // Deal with an error
})

About

RiSE Payments Node.js API

https://rise.store

License:MIT License


Languages

Language:TypeScript 55.5%Language:JavaScript 44.5%