Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Javascript wrapper for the SagePay Administration and Reporting API

License

Notifications You must be signed in to change notification settings

NewRedo/sagepay-admin-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING
This repository is no longer maintained.

SagePay Administration API for Node.js

Provides a wrapper for making requests to SagePay that deals with its custom authentication and request signing, and reducing the results to their simplest form.

Overview

Knowledge of the Customised reporting and admin API is essential.

The API uses a tiny subset of XML syntax, so transformation of both requests and responses into simpler Javascript objects is performed. String properties of an object map to text elements of the same name, and visa-versa. Non-string properties, which must be arrays, are mapped to nested elements of the same name as the property, and visa-versa.

Quick Start

const SagepayAdminApiClient = require("sagepay-admin-api");
var client = new SagepayAdminApiClient({
    user: "me",
    password: "you",
    vendor: "acme"
});
client.request({
    command: "version"
})
.then(console.log);

Command line

node node_modules/sagepay-admin-api/cmd --user me --password you --vendor acme
> request({command:"version"});

Documentation

SagepayAdminApiClient

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

SagepayAdminApiClient.constructor

var foo = new SagepayAdminApiClient(options);

Creates a new instance.

Parameters

  • options Required, connection options.
  • options.endpoint Optional, defaults to the test 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.

SagepayAdminApiClient.request

var foo = client.request(options);

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

Parameters

  • options Required, values to pass with the request.
  • options.command Required, the SagePay API requires this at a minimum.

Licence

MIT

About

Javascript wrapper for the SagePay Administration and Reporting API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%