GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - eversend/eversend-node-sdk

BranchesTags
Open more actions menu

Latest commit

 

History

52 Commits
52 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
lib
lib
 
 
.DS_Store
.DS_Store
 
 
.editorconfig
.editorconfig
 
 
.eslintignore
.eslintignore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

Eversend Nodejs SDK

NPM version Build Status Dependencies

Nodejs SDK for Eversend payments API

Table of Contents

  1. Installation
  2. Initialization
  3. Usage
  4. Contribution Guidelines
  5. License

Installation

$ npm install --save @eversend/node-sdk

Initialization

const eversendClient = require('@eversend/node-sdk')
    ({clientId: "clientId", clientSecret: "clientSecret"});

You can get your clientId and clientSecret from the settings section in the dashboard

Usage

Wallets

Get all wallets

const wallets = await eversendClient.wallets.getWallets();

Get one wallet

const usdWallet = await eversendClient.wallets.getWallet({ id: "USD" });

Transactions

Get all transactions

const transactions = await eversendClient.transactions.fetchTransactions({ page: 1, limit: 10});

If page and limit are not set, the default of 1 and 10 are used respectively.

Get one transaction

const transaction = await eversendClient.transactions.fetchTransaction({ id: "EVS12345678" });

Exchange

To exchange from one wallet to another, you first have to generate a quotation. This returns a token with a 30s timeout that you can use to make the exchange.

Get exchange quotation

const quotation = await eversendClient.exchanges.getQuotation({
  from: "USD", to: "UGX", amount: 10.0,
});

Exchange currency

const exchange = await eversendClient.exchanges.createExchange({
  quotationToken: "dhhsggajjshhdhdhd",
  transactionRef: "EVS-12345678", // optional field
});

Beneficiaries

Get beneficiaries

const beneficiaries = await eversendClient.beneficiaries.getBeneficiaries({
  page: 1,
  limit: 10
});

If page and limit are not set, the default of 1 and 10 are used respectively.

Get single beneficiary

const beneficiary = await eversendClient.beneficiaries.getBeneficiaries({
  id: 100
});

Create a beneficiary

const beneficiary = await eversendClient.beneficiaries.addBeneficiary({
  firstName: "John",
  lastName: "Okello",
  country: "UG", // Alpha-2 country code
  phoneNumber: "+256712345678", // Should be in international format
  bankAccountName: "John Okello",
  bankAccountNumber: "12345678",
  bankName: "Stanbic Bank",
  bankCode: 1234 // You can get the bank code from payouts.getDeliveryBanks()
});

Note that all bank fields are optional if bank payments will not be required Delete a beneficiary

const beneficiary = await eversendClient.beneficiaries.deleteBeneficiary({
  id: 100
});

Collections

Get collection fees

const collectionFees = await eversendClient.collections.getCollectionFees({
  amount: 1000,
  currency: "KES",
  method: "momo"
});

Get collection OTP

Required when initiating mobile money collections

const collectionOTP = await eversendClient.collections.getCollectionOTP({
  phone: "+256712345678"
});

Initiate Mobile Money collection

eversendClient.collections.initiateMomoCollection({
  phone: "+256712345678",
  amount: 1000,
  country: "UG",
  currency: "UGX",
  otpPin: 123456, // From phone number passed in Get Collection OTP
  otpPinId: "dg524fhsgfde", // From Get Collection OTP
  transactionRef: "EVS-12345678", // Optional transaction ref generated by you
  customer: { name: "John Okello" } // Optional customer object with your metadata
});

Payouts

Get payout quotation

const quotation = await eversendClient.payouts.getQuotation({
  amount: 100,
  amountType: "SOURCE", // amountType can be SOURCE or DESTINATION
  sourceWallet: "USD",
  destinationCountry: "KE",
  destinationCurrency: "KES"
});

amountType refers to whether you want amount to represent sourceWallet (SOURCE) or destinationCurrency (DESTINATION)

Pay existing beneficiary

const payout = eversendClient.payouts.payoutExistingBeneficiary({
  beneficiaryId: 100,
  quotationToken: "token",
  transactionRef: "EVS-12345678" // Optional transaction ref generated by you
});

Pay new beneficiary

const payout = eversendClient.payouts.payoutNewBeneficiary({
  firstName: "John",
  lastName: "Okello",
  country: "UG", // Alpha-2 country code
  phoneNumber: "+256712345678", // Should be in international format
  bankAccountName: "John Okello",
  bankAccountNumber: "12345678",
  bankName: "Stanbic Bank",
  bankCode: 1234, // You can get the bank code from payouts.getDeliveryBanks()
  quotationToken: "token",
  transactionRef: "EVS-12345678" // Optional transaction ref generated by you
});

Get delivery countries

const countries = await eversendClient.payouts.getDeliveryCountries()

Get delivery banks

const banks = await eversendClient.payouts.getDeliveryBanks({
  country: "UG"
});

Cards

Create a card user

const createUser = await eversendClient.card.createCardUser({
  firstName: "John",
  lastName: "Okello",
  email: "[email protected]",
  phoneNumber: "+256712345678", // Should be in international format but optional
});

Note that phone number field is optional

Get card users

const cardUsers = await eversendClient.card.getCardUsers({
   page: 1,
   limit: 10
});

If page and limit are not set, the default of 1 and 10 are used respectively.

Create a card

const card = await eversendClient.card.createCard({
  title: "Netflix payment" // Reason for creating the card, which you can use to identify why you created the card
  color: "blue" // could be blue, black, purple, yellow, orange
  amount: 1000, // Amount to be added to card
  currency: "USD", //The currency which the card creation amount will be deducted from. Use USD
  brand: "visa", // could be visa, mastercard
});

Get all cards

const cards = await eversendClient.card.getAllCards({
   page: 1, // optional
   limit: 10, // optional
   status, // optional
   query, // optional
   from, // optional
   to, // optional
});

If page and limit are not set, the default of 1 and 10 are used respectively.

Get single card details

const card = await eversendClient.card.getSingleCardDetails({
  cardId
});

Get single card transactions

const singleCardTransactions = await eversendClient.card.fetchSingleCardTransaction({
  cardId,
  status, // optional
  query, // optional
  from,  // optional
  to, // optional
  type // optional
  page: 1, // optional
  limit: 10, // optional
});

Get all card transactions

const cardTransactions = await eversendClient.card.fetchAllCardsTransaction({
  status, // optional
  query, // optional
  from,  // optional
  to, // optional
  type // optional
  page: 1, // optional
  limit: 10, // optional
});

Fund a card

const fundCard = await eversendClient.card.fundCard({
  amount, cardId, currency
});

Withdraw from a card

const withDrawCard = await eversendClient.card.cardWithdrawal({
  amount, cardId, currency
});

Freeze a card

const freezeCard = await eversendClient.card.freezeCard({
  cardId
});

Unfreeze a card

const unfreezeCard = await eversendClient.card.unfreezeCard({
  cardId
});

Delete a card

const deleteCard = await eversendClient.card.deleteCard({
  cardId
});

Get card analytics

const cardAnalytics = await eversendClient.card.getCardsAnalytics({
  from,  // optional
  to, // optional
});

Contribution Guidelines

Contributions are welcome and encouraged. Learn more about our contribution guidelines here

License

MIT © Eversend

About

No description, website, or topics provided.

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.