GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jamiter/node-cheddargetter: Node.js Cheddar API wrapper

This repository was archived by the owner on Jan 23, 2024. It is now read-only.
BranchesTags
Open more actions menu
 
 

Latest commit

 

History

84 Commits
84 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
test
test
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

DEPRECATED: This package has been deprecated in favour of the cheddar package. See repo or npm.

Goals and Status

This module will simplify the process of integrating Cheddar into your existing node.js apps.

  • getAllPricingPlans()
  • getPricingPlan(planCode)
  • getAllCustomers([searchParams])
  • getCustomer(customerCode)
  • createCustomer(customerData)
  • editCustomerAndSubscription(customerData) or updateCustomerAndSubscription(customerData)
  • editCustomer(customerCode, customerData) or updateCustomer(customerCode, customerData)
  • editSubscription(customerCode, customerData) or updateSubscription(customerCode, customerData)
  • deleteCustomer(customerCode)
  • cancelSubscription(customerCode)
  • addItem(customerCode, itemCode, [amount])
  • removeItem(customerCode, itemCode, [amount])
  • setItemQuantity(customerCode, itemCode, amount)
  • addCustomCharge(customerCode, chargeCode, quantity, amount, description)
  • deleteCustomCharge(customerCode, chargeId)
  • resendInvoiceEmail(idOrNumber)
  • oneTimeInvoice(customerCode, {data})

All methods return a promise with the requested data.

Callbacks are available for backwards compatibility and are called with error and results parameters.

Not all API calls have been fully tested yet.

Install

npm install cg

Usage

var Cheddar = require("cg");

var cheddar = new Cheddar("[email protected]", "passwordExample", "ProductCode");

cheddar.getAllPricingPlans().then(function (results) {
  console.log(results);
}).catch(function (err) {
  console.error(err);
});

Proxy

You might want to set up a proxy to communicate with Cheddar. Cheddar blocks most of the Heroku servers (a range of AWS IPs):

Recently, a large block of IPs on the Heroku platform were listed by DenyHosts due to a spike in SSH brute force attacks coming from the Heroku platform. In short, you need to be coming from an IP that isn't listed.

A proxy host is easily set with the CHEDDAR_HOST environment variable:

CHEDDAR_HOST=example.com node your-server.js

Tests

First add a config file (config.json) with all your Cheddar credentials:

{
  "email": "EMAIL",
  "pass": "PASSWORD",
  "productCode": "PRODUCTCODE",
  "planCode": "PLANCODE",
  "itemCode": "ITEMCODE"
}
npm install
npm test

WARNING: Only run the tests on a development account to prevent any side effects in production

Credits

Original work was done by Kevin Smith.

About

Node.js Cheddar API wrapper

Topics

apicheddarcheddargetternodenodejs

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.