Skip to content

maytheu/paystack-endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paystack-endpoint

npm

This node module is a reference to the paystack api docs

Installation

npm install paystack-endpoint

Usage

Create a free paystack account to get paystack key. Do not commit your keys.

No extra configuration, just require the module

const Paystack = require(paystack-endpoint)(process.env.secret)

Most resources in this modules accept object(both optional and required) as parameter unless stated other wise.

Paystack.verify
  .verifyBvn({
    bvn: 0000011111,
    account_number: 0000011111,
    bank_code: 058,
    last_name: "Abiola",
  })
  .then((resp) => {
    console.log(resp);
  });

This example accept optional object params to transactiion.list()

Paystack.transaction.list({perPage:2}).then((resp) => {
  console.log(resp);
});

This example accept both object and customer_code as params

Paystack.customer
  .update({ last_name: "Adetunji" }, "CUS_XXXXXX")
  .then((resp) => {
    console.log(resp);
  });

Resources

Paystack

  • transaction
    • initialize
    • fetch - accept id
    • verify - accept reference
    • list
    • chargeAuth
    • checkAuth
    • view - acept reference
    • total
    • exportTrans
    • partialDebit
  • customer
    • create
    • fetch - accept email
    • list
    • update - accept object and customer_code
    • validate - accept country, bvn, customer_code, first_name, last_name
    • blacklist
    • deactivateAuth - authorization_code
  • plan
    • create
    • list
    • fetch - accept id
    • update - accept object and id
  • product
    • create
    • list
    • fetch - accept id
    • update - accept object and id
  • invoice
    • create
    • list
    • view - accept id
    • verify - accept code
    • notification - accept code
    • total
    • finalize - accept id
    • update - accept object and id
    • archive - accept id
  • transfer
    • initiate
    • finalize - accept transfer_code and otp
    • initiateBulk
    • list
    • fetch - accept id
    • verify - accept reference
    • resendOtp - accept transfer_code and reason
    • disableOtp
    • disableOtpFinally - accept otp
    • enableOtp
  • verify
    • verifyBvn
    • resolveAccount - accept account_number and bank_code
    • resolveCardBin -accept card
  • charge
    • create
    • submitPin - accept pin and reference
    • submitOtp - accept otp and reference
    • submitPhone - accept phone and reference
    • submitBirthday - accept birthday and reference
    • submitAddress - accept address, city, state, zipcode and reference
    • check - accep reference
  • subsription
    • create
    • list
    • fetch - accept id
    • enable - accept code and token
    • disable - accept code and token
  • split
    • create
    • list
    • fetch - accept id
    • update - accept object and id
    • addSubaccount - accept subaccount, share and id
    • removeSubaccount - accept subaccount and id
  • subaccount
    • create
    • list
    • fetch - accept id
    • update - accept object and id
  • page
    • create
    • list
    • fetch - accept id
    • update - accept object and id
    • check - accept url
    • addProduct - accept product and id
  • bulk
    • initiate - accept array
    • list
    • fetch - accept id
    • fetchCharges - accept object and id
    • pause - accept code
    • resume - accept code
  • control
    • fetch
    • update -accept timeout
  • dispute
    • list
    • fetch - accept id
    • listTransaction - accept id
    • update - accept object and id
    • addEvidence - accept object and id
    • upload - accept id and file.ext
    • resolve - accept object and id
    • exportDispute
  • balance
    • check
    • fetch
  • nuban
    • create
    • list
    • fetch - accept id
    • deactivate - accept id
    • split
    • removeSplit - accept account_number
    • fetchBank
  • refund
    • create
    • list
    • fetch - accept reference
  • transferRecipient
    • create
    • bulkCreate - accept batch
    • list
    • fetch - accept id
    • update - accept object and id
    • deleteRecipient - accept id
  • misc
    • list
    • listProviders
    • listCountries
    • listStates - accept country code

Run test

npm test

Add PAYSTACK_SECRET to .env file, pass the required params to the function for all test to pass

tested with jest jest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published