npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vopay-node

v1.1.3

Published

An unofficial library that wraps VoPay REST API(s) to be used in node.js projects

Downloads

9

Readme

VoPay Node

[In Development]

This is an unofficial library to leverage VoPay REST API(s) for payment solutions.

npm

Table of Contents

Installation

npm i vopay-node

or

yarn add vopay-node

Usage

You will be needed to create a VoPay instance with the details provided by VoPay team. Things you will need for the instance:

| Name | | ------------- | | AccountID | | ApiKey | | ApiSecret |

const VoPay = require('vopay-node')

let VoPayClient = new VoPay({
	AccountID: "YOUR_ACCOUNT_ID",
	ApiKey: "YOUR_API_KEY",
	ApiSecret: "YOUR_API_SECRET"
})

Response Handling

vopay-node uses axios as HTTP client.

// USING PROMISES
VoPayClient.iq11.generateEmbedURL({
	RedirectURL: "https://redirect.com/page?Token=1234"
})
.then(response => console.log(response))
.catch((error) => {
	console.log(error);
});

// USING ASYNC/AWAIT
const loadEmbedUrl = async () => {
	try {
		const embedUrl = await VoPayClient.iq11.generateEmbedURL({
			RedirectURL: "https://redirect.com/page?Token=1234"
		})
		console.log(embedUrl);
	} catch(error) {
		console.log(error);
	}
}

API Reference

All methods return a Promise.

In cases where you are needed to provide AccountID, Key and Signature. you can avoid adding that, since the library instance is already having them after you initialized it.

Partner - Official Docs

Create User Account - Official Docs

This endpoint is used to create a VoPay account. You will need to sign-up as a partner account in order to use this endpoint and start creating VoPay accounts for your users.

This Endpoint does not mark the account as active, you will need to submit the rest of the required information in the POST /account/submit-extended-info endpoint

// Check Official Docs for more fields
const { Success, ErrorMessage, AccountID, APISharedSecret, APIKey } = await VoPayClient.partner.createUserAccount({
	Name: "{Name}",
  	ClientAccountEnabled: "{ClientAccountEnabled}",
  	EmailAddress: "{EmailAddress}",
})

Get a list of User Accounts - Official Docs

This endpoint is used to get a list of accounts created using a partner account. It will return the accounts data including shareholder, signing authority and balance information

// Check Official Docs for more fields
const { Success, ErrorMessage, PartnerAccount, Accounts } = await VoPayClient.partner.accountLists()

IQ11 - Official Docs

Generate Embed URL - Official Docs

// Check Official Docs for more fields
const { EmbedURL, Success, ErrorMessage } = await VoPayClient.iq11.generateEmbedURL({
	RedirectURL: "https://redirect.com/page?Token=1234"
})

Token Info - Official Docs

// Check Official Docs for more fields in response
const { MaskedAccount, Success, ErrorMessage, BankName } = await VoPayClient.iq11.tokenInfo({
	Token: "IQ11_TOKEN"
})

Tokenize - Official docs

// Check Official Docs for more fields in response
const { Token, Success, ErrorMessage } = await VoPayClient.iq11.tokenize()

Account - Official Docs

Get Account Balance - Official Docs

// Check Official Docs for more fields in response
const { AccountBalance, Success, ErrorMessage } = await VoPayClient.account.balance({
	Currency: "{Currency}"
})

Get Account Transactions - Official Docs

// Check Official Docs for more fields in response
const { Transactions, Success, ErrorMessage, NumberOfRecords } = await VoPayClient.account.transactions({
	StartDateTime: "{StartDateTime}",
	EndDateTime: "{EndDateTime}",
	Currency: "{Currency}",
	TransactionType: "{TransactionType}",
	TransactionID: "{TransactionID}",
	ClientReferenceNumber: "{ClientReferenceNumber}",
	ScheduledTransactionID: "{ScheduledTransactionID}",
	PayLinkStatus: "{PayLinkStatus}"
})

Cancel Transaction - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionID, TransactionStatus } = await VoPayClient.account.cancelTransaction({
	TransactionID: "{TransactionID}"
})

Set Webhook URL - Official Docs

The purpose of the webhook URL is to notify users of any changes in transaction status.

// Check Official Docs for more fields in response
const { Success, ErrorMessage } = await VoPayClient.account.setWebhookURL({
	WebHookUrl: "{WebHookUrl}",
	Disabled: "{Disabled}"
})

Get Webhook URL - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, WebHookURL } = await VoPayClient.account.getWebhookURL()

Test Webhook URL - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage } = await VoPayClient.account.testWebhookURL()

Transfer funds to another VoPay Account - Official Docs

This method allows you to transfer funds between VoPay accounts.

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionID } = await VoPayClient.account.transferAccountFundsTo({
	Amount: "{Amount}",
	Currency: "{Currency}",
	RecipientAccountID: "{RecipientAccountID}",
	ClientReferenceNumber: "{ClientReferenceNumber}",
	Notes: "{Notes}",
	ParentTransactionID: "{ParentTransactionID}",
	IdempotencyKey: "{IdempotencyKey}"
})

Transfer funds from another VoPay Account to your VoPay Account - Official Docs

This method allows you to transfer funds from a pre-authorized VoPay account to your VoPay account.

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionID } = await VoPayClient.account.transferAccountFundsFrom({
	Amount: "{Amount}",
	Currency: "{Currency}",
	DebitorAccountID: "{DebitorAccountID}",
	ClientReferenceNumber: "{ClientReferenceNumber}",
	Notes: "{Notes}",
	IdempotencyKey: "{IdempotencyKey}"
})

Set Up Auto Balance Transfer - Official Docs

This method allows you to set up an auto-balance transfer from your VoPay account to your linked bank account. The frequency available to set the auto-transfer can be daily, weekly, bi-weekly or monthly.

// Check Official Docs for more fields in response
const { Success, ErrorMessage } = await VoPayClient.account.setupAutoBalanceTransfer({
	ScheduleStartDate: "{ScheduleStartDate}",
	AutoBalanceTransferAmount: "{AutoBalanceTransferAmount}",
	TypeOfFrequency: "{TypeOfFrequency}",
	EmailAddress: "{EmailAddress}",
	FirstName: "{FirstName}",
	LastName: "{LastName}",
	CompanyName: "{CompanyName}",
	Address1: "{Address1}",
	City: "{City}",
	Province: "{Province}",
	Country: "{Country}",
	PostalCode: "{PostalCode}",
	AccountNumber: "{AccountNumber}",
	FinancialInstitutionNumber: "{FinancialInstitutionNumber}",
	BranchTransitNumber: "{BranchTransitNumber}",
	FlinksAccountID: "{FlinksAccountID}",
	FlinksLoginID: "{FlinksLoginID}",
	Token: "{Token}",
	PlaidPublicToken: "{PlaidPublicToken}",
	PlaidAccessToken: "{PlaidAccessToken}",
	PlaidAccountID: "{PlaidAccountID}",
	PlaidProcessorToken: "{PlaidProcessorToken}",
	InveriteRequestGUID: "{InveriteRequestGUID}"
})

Get Auto Balance Transfer Details - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, AutoBalanceTransferAmount, NameOfFrequency,... } = await VoPayClient.account.getAutoBalanceTransferInfo()

Cancel Auto Balance Transfer - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, Status } = await VoPayClient.account.cancelAutoBalanceTransfer()

EFT - Official Docs

Fund Your Vopay Account - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionID } = await VoPayClient.eft.fundAccount({
	FirstName: "{FirstName}",
	LastName: "{LastName}",
	CompanyName: "{CompanyName}",
	DOB: "{DOB}",
	PhoneNumber: "{PhoneNumber}",
	Address1: "{Address1}",
	City: "{City}",
	Province: "{Province}",
	Country: "{Country}",
	PostalCode: "{PostalCode}",
	AccountNumber: "{AccountNumber}",
	FinancialInstitutionNumber: "{FinancialInstitutionNumber}",
	BranchTransitNumber: "{BranchTransitNumber}",
	Amount: "{Amount}",
	Currency: "{Currency}",
	ClientReferenceNumber: "{ClientReferenceNumber}",
	KYCPerformed: "{KYCPerformed}",
	KYCReferenceNumber: "{KYCReferenceNumber}",
	EmailAddress: "{EmailAddress}",
	IPAddress: "{IPAddress}",
	FlinksAccountID: "{FlinksAccountID}",
	FlinksLoginID: "{FlinksLoginID}",
	Token: "{Token}",
	PlaidPublicToken: "{PlaidPublicToken}",
	PlaidAccessToken: "{PlaidAccessToken}",
	PlaidAccountID: "{PlaidAccountID}",
	PlaidProcessorToken: "{PlaidProcessorToken}",
	InveriteRequestGUID: "{InveriteRequestGUID}",
	TransactionLabel: "{TransactionLabel}",
	Notes: "{Notes}",
	DelayBankingInfo: "{DelayBankingInfo}",
	IdempotencyKey: "{IdempotencyKey}"
})

Get Status of a Fund Transaction - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionStatus, SubTransactions } = await VoPayClient.eft.getFundTransactionStatus({
	TransactionID: "{TransactionID}"
})

Get Details of a Fund Transaction - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionStatus, TransactionDateTime, Amount, SubTransactions } = await VoPayClient.eft.getFundTransactionInfo({
	TransactionID: "{TransactionID}"
})

Withdraw funds out of your VoPay account - Official Docs

This endpoint is used to take funds out of your VoPay account, and deposit them to the specified recipient’s bank account. In the below endpoint, either CompanyName OR FirstName and LastName must be provided.

If either Token, Flinks (FlinksAccountID, FlinksLoginID), Inverite (InveriteRequestGUID), or Plaid (PlaidPublicToken/PlaidAccessToken, PlaidAccountID) is provided, then the FinancialInstitutionNumber, BranchTransitNumber, and AccountNumber will not be required.

If the bank information is provided (FinancialInstitutionNumber, BranchTransitNumber, and AccountNumber), then the Address1, City, Province, Country, and PostalCode are required.

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionID } = await VoPayClient.eft.withdraw({
	ClientAccountID: "{ClientAccountID}",
	FirstName: "{FirstName}",
	LastName: "{LastName}",
	CompanyName: "{CompanyName}",
	DOB: "{DOB}",
	PhoneNumber: "{PhoneNumber}",
	Address1: "{Address1}",
	City: "{City}",
	Province: "{Province}",
	Country: "{Country}",
	PostalCode: "{PostalCode}",
	AccountNumber: "{AccountNumber}",
	FinancialInstitutionNumber: "{FinancialInstitutionNumber}",
	BranchTransitNumber: "{BranchTransitNumber}",
	IBAN: "{IBAN}",
	ABARoutingNumber: "{ABARoutingNumber}",
	SortCode: "{SortCode}",
	Amount: "{Amount}",
	Currency: "{Currency}",
	ClientReferenceNumber: "{ClientReferenceNumber}",
	KYCPerformed: "{KYCPerformed}",
	KYCReferenceNumber: "{KYCReferenceNumber}",
	EmailAddress: "{EmailAddress}",
	IPAddress: "{IPAddress}",
	FlinksAccountID: "{FlinksAccountID}",
	FlinksLoginID: "{FlinksLoginID}",
	Token: "{Token}",
	PlaidPublicToken: "{PlaidPublicToken}",
	PlaidAccessToken: "{PlaidAccessToken}",
	PlaidAccountID: "{PlaidAccountID}",
	PlaidProcessorToken: "{PlaidProcessorToken}",
	InveriteRequestGUID: "{InveriteRequestGUID}",
	ParentTransactionID: "{ParentTransactionID}",
	TransactionLabel: "{TransactionLabel}",
	Notes: "{Notes}",
	DelayBankingInfo: "{DelayBankingInfo}",
	IdempotencyKey: "{IdempotencyKey}"
})

Get single withdraw transaction info - Official Docs

This endpoint is used to look up details on a single withdraw transaction. Withdraw transactions debit funds from your account and deposit them into the customer's account.

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionID, TransactionStatus, PayLinkDetails } = await VoPayClient.eft.getWithdrawTransactionInfo({
	TransactionID: "{TransactionID}"
})

Get single withdraw transaction status - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, TransactionID, TransactionStatus, Timestamp } = await VoPayClient.eft.getWithdrawTransactionStatus({
	TransactionID: "{TransactionID}"
})

Get Failed Transactions - Official Docs

// Check Official Docs for more fields in response
const { Success, ErrorMessage, NumberOfRecords, FailedTransactions } = await VoPayClient.eft.getFailedTransactions({
	StartDateTime: "{StartDateTime}",
	EndDateTime: "{EndDateTime}"
})

Development

yarn install