synapsepay
Advanced tools
Comparing version 0.8.1 to 0.9.0
@@ -10,2 +10,89 @@ 'use strict'; | ||
Node.prototype.shipDebitCard = function(options, callback) { | ||
const config = { | ||
client: this.user.client, | ||
ip_address: this.user.ip_address, | ||
fingerprint: this.user.fingerprint, | ||
oauth_key: this.user.oauth_key | ||
}; | ||
let url = `${this.json._links.self.href}`; | ||
const payload = {}; | ||
if (options) { | ||
if (options.ship) { | ||
url += `?ship=${options.ship}`; | ||
} | ||
if (options.fee_node_id) { | ||
payload.fee_node_id = options.fee_node_id; | ||
} | ||
if (options.expedite) { | ||
payload.expedite = options.expedite; | ||
} | ||
if (options.card_style_id) { | ||
payload.card_style_id = options.card_style_id; | ||
} | ||
} | ||
APIClient.patch(url, config, payload, (err, json) => { | ||
if (err) { | ||
callback(err); | ||
} else { | ||
callback(null, json); | ||
} | ||
}); | ||
}; | ||
Node.prototype.resetDebitCard = function(options, callback) { | ||
const config = { | ||
client: this.user.client, | ||
ip_address: this.user.ip_address, | ||
fingerprint: this.user.fingerprint, | ||
oauth_key: this.user.oauth_key | ||
}; | ||
let url = `${this.json._links.self.href}`; | ||
if (options) { | ||
if (options.reset) { | ||
url += `?reset=${options.reset}`; | ||
} | ||
} | ||
APIClient.patch(url, config, {}, (err, json) => { | ||
if (err) { | ||
callback(err); | ||
} else { | ||
callback(null, json); | ||
} | ||
}); | ||
}; | ||
Node.prototype.triggerDummyTransaction = function(options, callback) { | ||
const config = { | ||
client: this.user.client, | ||
ip_address: this.user.ip_address, | ||
fingerprint: this.user.fingerprint, | ||
oauth_key: this.user.oauth_key | ||
}; | ||
let url = `${this.json._links.self.href}/dummy-tran`; | ||
if (options) { | ||
if (options.is_credit) { | ||
url += `?is_credit=${options.is_credit}`; | ||
} | ||
} | ||
APIClient.get(url, config, (err, json) => { | ||
if (err) { | ||
callback(err); | ||
} else { | ||
callback(null, json); | ||
} | ||
}); | ||
}; | ||
Node.prototype.updateJSON = function(err, json, callback) { | ||
@@ -12,0 +99,0 @@ if (err) { |
{ | ||
"name": "synapsepay", | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"description": "Node.js Library for SynapsePay API v3.x Rest", | ||
@@ -5,0 +5,0 @@ "repository": { |
45442
1197