coinforbarter-node
v1.0.7
Published
CoinForBarter Nodejs Library - Integrate and Manage cryptocurrency payments for goods and services
Downloads
132
Maintainers
Readme
CoinForBarter NodeJs Library
CoinForBarter Nodejs Library - Integrate and Manage cryptocurrency payments for goods and services
Table of Contents
About
This is a NodeJs package for implementing CoinForBarter.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. See references for links to dashboard and API documentation.
Installation
$ npm install coinforbarter-node
# or
$ yarn add coinforbarter-node
Usage
const CoinForBarter = require('coinforbarter-node');
const publicKey = 'xxxxxxxxxxxxx';
const privateKey = 'xxxxxxxxxxxxx';
const secretHash = 'xxxxxxxxxxxxx';
const coinforbarter = new CoinForBarter(publicKey, privateKey, secretHash);
# An example to get all customers
const customers = coinforbarter.Customer.findAll();
Services and Methods
Customer
This method handles all customers related to your account. The methods exposed by this service are listed below. See customer object properties
findAll
This method gets the list of all customers.
const query = {};
const getAllCustomers = async () => {
return await coinforbarter.Customer.findAll(query);
}
See list of query parameters
findOne
This method gets a particular customer by id.
const query = {};
const customerId = '';
const getCustomer = async (customerId) => {
return await coinforbarter.Customer.findOne(customerId);
}
create
This method creates a customer.
const params = {};
const createCustomer = async (params) => {
return await coinforbarter.Customer.create(params);
}
update
This method updates a customer.
const params = {};
const createCustomer = async (params) => {
return await coinforbarter.Customer.update(params);
}
See customer update parameters
BankAccount
- getBankAccountName
- create
- findAll
- findOne
- makePrimary
- getBanks
Payment
Methods
- findOne
- findAll
- create
- setCurrency
- lockCurrency
- getPaymentUpdates
- cancel
PaymentPlan
Methods
- findAll
- findOne
- create
- update
PaymentPlanSubscriber
Methods
- create
- findOne
- findAll
- remove
Payout
Methods
- findAll
- findOne
Transaction
Methods
- findAll
- findOne
- verify
- events
- getFee
- webhook
Transfer
Methods
- findAll
- findOne
- create
- getFee
WalletAddress
Methods
- create
- findAll
- findOne
- makePrimary
Webhook
Methods
- validate
Misc
Methods
- getCountries
- getBalance
- getCurrencies
This SDK can be used closely with the official API Reference. All services and methods can be called this way
const customers = c4b.Customer.findAll();
i.e
c4b:{
[service]:method
}
# I will do more on documenting each method till i can complete it 😂
Built Using
- Typescript
CoinForBarter API References
- CoinForBarter Developers Doc
- CoinForBarter API Reference
- CoinForBarter Inline Payment Doc
- CoinForBarter Dashboard
Stay in Touch
- Author - Nwachukwu, Kingsley Tochukwu
- Twitter - @tkings_
- Github - t-kings
Contributions are open, meta properties are not being returned yet by this SDK. You can send me an email via [email protected]