1.0.5 • Published 3 years ago

opayo-reporting-api v1.0.5

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 years ago

Opayo Reporting API

License: MIT NPM Dependencies Builds Coverage

A module to allow easy usage of Opayo Reporting & Admin Api https://developer-eu.elavon.com/docs/opayo-reporting-api

Installation

npm install opayo-reporting-api

Usage

import { OpayoReportingApi } from 'opayo-reporting-api';
// or
// var OpayoReportingApi = require("opayo-reporting-api").OpayoReportingApi

var opayo = new OpayoReportingApi('vendor', 'username', 'passsword')

var validIPs = await opayo.command('getValidIPs')
console.log(validIPs.vspaccess.ipaddresses)

await opayo.command('addValidIPs', {
validips: {
  ipaddress: [
    {
      address: "123.123.123.123",
      mask: "255.255.255.255",
      note: "test IP address"
    }
  ]
}
})

validIPs = await opayo.command('getValidIPs')
console.log(validIPs.vspaccess.ipaddresses)

All commands are available to see in Opayo Reporting & Admin API Reference.

The second argument of OpayoReportingApi.command method is the object that will be converted into XML. However, you shouldn't add there command, vendor, username and signature as those values will be added automatically by this module.

Response of that method is a JavaScript object representing XML structure of the API response. Including the vspaccess key.

Constructor

Constructor takes 4 arguments:

  1. vendor: string - Opayo vendor name
  2. username: string - Opayo username
  3. password: string - Opayo password
  4. option: OpayoReportingApiOptions - options for this module

OpayoReportingApiOptions

This is an options object allowing to change behaviour of module.

Allowed options:

  • baseURL: string - allows entering custom API url. Overrides testMode value.
  • testMode: boolean - whether use test or live mode (does not make difference if baseURL is specified).
  • axiosConfig: AxiosRequestConfig - custom axios configuration. Specifying baseURL won't make any change.
1.0.5

3 years ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago