0.1.1 • Published 6 years ago
pushpay v0.1.1
Pushpay Node.js Client
an npm package for interacting with the Pushpay API
Usage
Prerequisites
This package uses async/await, so requires a node version > 7.6
Build a request
currently, only get payments and recurring gifts is implemented
const Pushpay = require('./src/app.js');
const pushpay = new Pushpay();
const start = moment().subtract(4, 'day').toDate()
const end = moment().toDate()
const data = await pushpay.getPayments(start, end)
console.info("data!", data);
to run the above example, you can run
node example.js
, just remember to set your environment variables.
Development
Install dependencies
npm i
Run tests (no passing tests yet)
npm test
# or, to run tests as you change files
npm test:watch
Environment Variables needed
- PUSHPAY_API_ENDPOINT=https://sandbox-api.pushpay.io/v1
- PUSHPAY_AUTH_ENDPOINT=https://auth.pushpay.com/pushpay-sandbox/oauth
- PUSHPAY_CLIENT_ID=client-id-abc
- PUSHPAY_CLIENT_SECRET=secret-password-777
- PUSHPAY_MERCHANT_KEY=merchant-key-453