0.1.9 • Published 1 year ago

@jeetar/jeetcash-sdk v0.1.9

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

JeetCash NodeJS Library

npm npm NPM

Introduction

The JeetCash Node library provides easy access to JeetCash API. It abstracts the complexity involved in direct integration and allows you to make quick calls to the APIs.

Available features include:

  • Client Onboarding
  • Account Provisioning

Table of Content

  1. Requirements
  2. Installation
  3. Initialization
  4. Usage
  5. Support
  6. Contribution guidelines
  7. License

Requirements

  1. Jeetcash Client ID
  2. Jeetcash Client Secret

Installation

To install the library, run this comman in your terminal:

npm install @jeetar/jeetcash-sdk

Initialization

const JeetCash = require('@jeetar/jeetcash-sdk');

const walletAPI = new JeetCash(process.env.JEETCASH_CLIENT_ID, process.env.JEETCASH_CLIENT_SECRET);

Usage

Create Account (Onboard end user)

const user = walletAPI.account.create.createUserAccount({
    fullName: 'Yusuff Mustapha',
    email: "yusuff.mustapha@jeetar.com",
    phoneNumber: "+2348160532895",
    userId: "635804230fa9fd2ec9b33207"
})
  .then(response => console.log(response))
  .catch(e => console.error(e))

// Response
{
  status: 'success',
  data: {
    user: {
      id: 21,
      txSource: 'JEETAR',
      userId: '635804230fa9fd2ec9b33207',
      phoneNumber: '2348160530101',
      transactionKey: 'fddf5c32429b3ae4444017a9d00d5603$BDE294660AF8CDC3',
      email: 'yusuff.mustapha@jeetar.com',
      fullName: 'Yusuff Mustapha',
      isAdmin: false,
      clientId: 4,
      createdAt: '2022-12-21T03:47:15.816Z',
      updatedAt: '2022-12-21T03:47:15.816Z',
      deletedAt: null
    },
    wallets: { count: 1 }
  }
}

Fetch User Wallet

const user = walletAPI.user({
    userId: "635804230fa9fd2ec9b33207",
    transactionKey: "63378A16CB" 
    }).wallet.getUserWallet()
  .then(response => console.log(response))
  .catch(e => console.error(e))

// Response
{
  status: 'success',
  data: [
    {
      id: 903,
      hash: '63a281c2de0ec20100000001',
      currency: 'NGN',
      balance: '0',
      isMaster: false,
      lastAction: null,
      balanceBefore: '0',
      balanceAfter: '0',
      walletProviderId: null,
      accountNumber: '6222033984',
      accountName: 'Yusuff Mustapha',
      accountBankName: 'Sterling Bank',
      accountBankCode: '232',
      accountProvider: 'flutterwave',
      ledgerBalance: '0',
      hold: false,
      userId: 1445,
      sourceId: 4,
      meta: [Object],
      providerRef: 'PSAEA5AF284444447453',
      providerTrfId: '234000001444847',
      isActive: true,
      createdAt: '2022-12-21T03:47:15.835Z',
      updatedAt: '2022-12-21T03:47:27.536Z',
      deletedAt: null
    }
  ],
  message: 'Wallets fetched successfully'
}

Support

For additional assistance using this library, contact the developer experience (DX) team via email

Contribution guidelines

None yet, but keep your eyes open

License

By contributing to this library, you agree that your contributions will be licensed under its ISC license.

Copyright (c) Jeetar Technologies.

0.1.8

1 year ago

0.1.9

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.0.1

1 year ago