payture-official
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -181,27 +181,33 @@ var payture = new (require('./paytureCommon')).PaytureCommon(); | ||
*/ | ||
this.init = function(data, callbackFunc){ | ||
payture.sendRequest(this, payture.COMMANDS.INIT, 'POST', [ | ||
{ | ||
name: 'VWID', | ||
value: this.VWID | ||
}, | ||
this.init = function(data, callbackFunc) { | ||
let encodedData = {}; | ||
{ | ||
name: 'Data', | ||
value: payture.toEncodeUrl({ | ||
SessionType : data.SessionType, | ||
IP : data.IP, | ||
OrderId : data.OrderId, | ||
Amount : data.Amount, | ||
VWUserLgn : data.VWUserLgn, | ||
VWUserPsw : data.VWUserPsw, | ||
PhoneNumber : data.PhoneNumber, | ||
CardId : data.CardId, | ||
TemplateTag : data.TemplateTag, | ||
Language : data.Language | ||
}) | ||
}, | ||
], callbackFunc, (data.SessionType == 'Add' ? 'Add' : 'Pay')); | ||
}; | ||
// Iterate over each key in the data object | ||
for (let key in data) { | ||
if (data.hasOwnProperty(key)) { | ||
encodedData[key] = data[key]; | ||
} | ||
} | ||
// Prepare the request data | ||
let requestData = [ | ||
{ | ||
name: 'VWID', | ||
value: this.VWID | ||
}, | ||
{ | ||
name: 'Data', | ||
value: payture.toEncodeUrl(encodedData) | ||
}, | ||
]; | ||
// Determine the command type | ||
let commandType = (data.SessionType === 'Add' ? 'Add' : 'Pay'); | ||
// Send the request | ||
payture.sendRequest(this, payture.COMMANDS.INIT, 'POST', requestData, callbackFunc, commandType); | ||
}; | ||
this.merchantPayRegCard = function(data, callbackFunc){ | ||
@@ -208,0 +214,0 @@ |
{ | ||
"name": "payture-official", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Official Payture API for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "payture-official.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
667
49925
1