0.0.4 • Published 3 years ago

credo-node v0.0.4

Weekly downloads
50
License
MIT
Repository
github
Last release
3 years ago

Credo

NPM Version Build Status

A NodeJS Wrapper for Credo

Overview

This project provides an easy-to-use object-oriented API to consume endpoints on Credo. For more information, visit https://developers.credo.co/reference for API documentation

Getting Started

Install from the NPM Registry

	$ npm i --save credo-node

Usage

let Credo = require('credo')

let API_KEY = ""
let API_KEY_SECRET = ""

const environment = process.env.NODE_ENV

const credo = new Credo(APIKEY, environment)

credo.initiatePayments({
  amount: 100,
  currency: "NGN",
  redirectUrl: "https://mywebsites.com/callback",
  transRef: "string",
  paymentOptions: "CARD,BANK,USSD",
  customerEmail: "customer@something.com",
  customerName: "John Doe",
  customerPhoneNo: "+234 813 000 000"
}).then(data => {
  //do payments here
}, err => {
  //throw error here
})


//Create new credo instance to verify transaction using secret key
const credoTransaction = new Credo(API_KEY_SECRET, environment)

let verifyTransaction = await credoTransaction.verifyTransaction({transReference: "ref:11111"})

console.log(verifyTransaction)

API Resources

Each method expects an object literal with both route parameters and request parameters (query / body). Please, go through the src/endpoints folder to see the specific items that should make up the object literal for each method.

  • Payments

    • credo.initiatePayments()
    • credo.cardThirdParty()
    • credo.verifyCardNumber()
    • credo.pay()
  • Transactions

    • credo.verifyTransaction()

License

MIT

Credits

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

4 years ago

0.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago