node-trustcommerce
Summary
A node.js library for communicating with the TrustCommerce payment gateway. This library returns promises.
You can install via npm:
npm install node-trustcommerce --save
Examples
In order to use this library, you'll need your account ID and password.
The send()
function takes two parameters: the action, and an object of parameters to send. The action
and parameters are defined in the TC Link API developer's guide.
On success, the promise will be fulfilled with an object representing the API response.
Process a new sale
var TCLink = ; var client = 'YOUR_ACCOUNT_ID' 'YOUR_PASSWORD'; client;
Handling Errors
If the request encountered an error, the promise will be rejected with an object containing an
err
message, a statusCode
, and the request body
.
If the action itself failed on TrustCommerce's end, then the rejection error will be an object representation of the API's response.
client;