bluesnap
TypeScript icon, indicating that this package has built-in type declarations

0.3.4 • Public • Published

bluesnap-node

A node sdk for the BlueSnap API. Built with TypeScript definitions.

Developing

npm install

Copy your sandbox username & password into a config/test.yml file in order to be able to run the tests.

Getting Started

Installation

npm i --save bluesnap

Quick Start

With Typescript

import { BlueSnapGateway, BlueSnapConfig } from 'bluesnap';

const bluesnapConfig = new BlueSnapConfig('Sandbox', 'username', 'password', '3.0');
const gateway = new BlueSnapGateway(bluesnapConfig);

Without Typescript

const bluesnap = require('bluesnap');

const gateway = new bluesnap.BlueSnapGateway({
  environment: 'Sandbox', // 'Production' or 'Sandbox'
  username: 'smrubin', // BlueSnap username
  password: 'password', // BlueSnap password
  apiVersion: '3.0', // Optional
});

Api Examples

Create Shopper

const shopper = await gateway.shopper.create({
  // Vaulted Shopper Request Object
});

Post Card Transaction

const cardTransaction = await gateway.transaction.card.create({
  // Card Transaction Request Object
});

Post Alt Transaction (PayPal)

const paypalTransaction = await gateway.transaction.paypal.get('orderId'); // PayPal Order Id

Refund

await gateway.refund.refund('transactionId'); // The Transaction Id

Get a Wallet

const wallet = await gateway.wallet.get('walletId'); // Wallet Id

More Examples

For more examples check out tests located in the test directory.

Package Sidebar

Install

npm i bluesnap

Weekly Downloads

133

Version

0.3.4

License

MIT

Unpacked Size

247 kB

Total Files

279

Last publish

Collaborators

  • videoblocks-dev