WARNING |
---|
This repository is no longer maintained. |
This module provides integration for Node.js applications wishing to utilise Sage Pay Form Integration.
Knowledge of the Form Integration is essential.
This module provides utility functions for correctly building the hidden form fields and for decoding the response crypt
field. The user needs to provide the web server, rendering for the hidden fields and routing for the response.
const SagePayFormClient = require("sagepay-form");
var client = new SagePayFormClient({
password: "guess",
vendor: "acme"
});
A class that provides utilities for formatting and decoding messages used in form integration.
var foo = new SagePayFormClient(options);
Creates a new instance.
options
Required, connection options.options.password
Required. See Sage Pay Form Integration and Protocol Guidelines 3.00.options.vendor
Required. See Sage Pay Form Integration and Protocol Guidelines 3.00, A1. Form Fields, "Vendor".
SagePayFormClient.createHiddenFields
var foo = client.createHiddenFields(transaction);
Returns an object containing the hidden fields required to post the transaction to the gateway.
transaction
Required. See Sage Pay Form Integration and Protocol Guidelines 3.00, A1.3 Request Crypt Fields for properties.
Returns an Object containing the decrypted data, one property for each field.
crypt
Required. See Sage Pay Form Integration and Protocol Guidelines 3.00, Appendix B.
To run the example, install the relevant npm modules and then use the following command:
VENDOR_NAME=<vendor_name> VENDOR_PASSWORD=<vendor_password> node example/
MIT