Skip to content

Enables management of sagepay admin and report panel through API

License

Notifications You must be signed in to change notification settings

richardweaver/sagepay-admin-api-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SagePay Administration API Client - Node.js

Enables management of sagepay admin and report panel through API.

Overview

You need to read the API document here: Customised reporting and admin API

The API uses a tiny subset of XML syntax.

Quick Start

npm install --save sagepay-admin-api-client
const SagepayAdminApiClient = require("sagepay-admin-api-client");
const client = new SagepayAdminApiClient({
    user: "username",
    password: "password",
    vendor: "vendorname"
});
client.request({
    command: "version"
})
.then(res => {
    console.log(res);
    if (res.errorcode === '0000')
        console.log("Test connection succeed!");
    else
        console.log("Connection failed!");
});

SagepayAdminApiClient

The class that provides access to the SagePay Administration and Reporting API.

SagepayAdminApiClient.constructor

const foo = new SagepayAdminApiClient(options);

Creates a new instance.

Parameters

  • options Required, values to pass with the request.
  • options.endpoint Optional, defaults to the live system.
  • options.user Required, passed as the user to the API.
  • options.password Required, used to sign the requests.
  • options.vendor Required, passed as the vendor to the API.
  • options.command Required, the SagePay API requires this at a minimum.

SagepayAdminApiClient.request

let foo = client.request(options);

Makes a request and returns a promise that resolves to the response.

Licence

MIT

About

Enables management of sagepay admin and report panel through API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%