Cybersource APIs Client Library for Node.js
Description
The Cybersource API Client Library enables you to work with Cybersource Rest APIs on your server.
Basic Example
See the examples/ directory for examples of the key client features.
Configuration
var ApiClient = require('apiClient.js'); var options = { apikey: '<apikey>', //replace with your apikey secretKey: '<secretkey>', //replace with your secrekey domain: 'https://sandbox.api.visa.com/cybersource' //url };
Authorization
var restClient = new ApiClient(options); restClient .authorizePayment(req) .then(function(res) { console.info("Authorization:" + JSON.stringify(res.body)); }, function(err) { console.error("Failed to Authorize" + err.message); });
Capture
var req = { id: <authorization id>, captureRequest: { amount: "100.00" } } var restClient = new ApiClient(options); restClient .capture(req) .then(function(res) { console.info("Capture:" + JSON.stringify(res.body)); }, function(err) { console.error("Failed to Authorize" + err.message); });
Documentation
Cybersource: https://devint.vdp.visa.com/products/cybersource/guides