Socket
Book a DemoInstallSign in
Socket

paywhirljs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paywhirljs

PayWhirl API wrapper

latest
Source
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

paywhirljs

An simple wrapper for the PayWhirl API.

Installation

npm install --save paywhirljs

Description

This package is revamping/refactoring of the nodejs PayWhirl API SDK. The original SDK was not in the npm registry and initializing it with your api key and secret was a bit weird so I put my own here and in the npm registry. More api documentation can be found here.

Example

const paywhirl = require('paywhirljs')({
	api_key: 'pwpk_##########################',
	api_secret: 'pwpk_###########################'
});

// Get Customer by id: 226713 
paywhirl.Customers.getCustomer(226713, (err, data) => {
	console.log(err, data.body)
});

// Get Invoices for customer_id: 226713 
paywhirl.Invoices.getInvoices(226713, (err, data) => {
	console.log(err, data.body)
});

// Get Subscriptions for customer_id: 226713 
paywhirl.Subscriptions.getSubscriptions(226713, (err, data) => {
	console.log(err, data.body)
});

paywhirl.Promo.createPromo({
	"user_id": 1,
	"code": "50OFF",
	"amount_off": 0,
	"percent_off": 100,
	"duration": "once",
	"duration_uses": 0,
	"max_redemptions": 1,
	"times_redeemed": 3,
	"is_valid": 1,
	"one_use": 1,
	"apply_to": "subtotal",
	"plans": null
}, (err, data) => {
	console.log(data.body)
	paywhirl.Promo.getPromos((err, data) => {
		console.log(err, data.body[0].id)
	});
});

Keywords

paywhirl

FAQs

Package last updated on 04 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts