npm.io
0.0.3 • Published 3 years ago

@paystack-js/rest

Licence
MIT
Version
0.0.3
Deps
0
Size
62 kB
Vulns
0
Weekly
0
Stars
3

Mantine Hooks

npm

A simple Paystack SDK for Node.js

Installation

# With yarn
yarn add @paystack-js/rest

# With npm
npm install @paystack-js/rest

Usage

import Paystack from '@paystack/rest';

// initialize with either the token or an object containing the config
const p1 = new Paystack('sk_test_1234567890');
const p2 = new Paystack({
  token: 'sk_test_1234567890',
});

// await the result
const res = await p1.miscellaneous.listBanks();

p1.applePay.listDomains({
  query: { use_cursor: true },
});
p1.applePay.registerDomain({
  body: { domainName: 'example.com' },
});
p1.subAccounts.fetchSubaccount({
  params: { id_or_code: '1234567890' },
});
p1.subAccounts.updateSubaccount({
  params: { id_or_code: '1234567890' },
  body: { active: false },
});

License

MIT