עשיתי לפי ה PDF השני שהוא הביא.
ServicesAPI_-Programmer_Manual-_Hebrew.pdf
זה נראה יותר טוב בגלל שזה עובד עם JSON.
var request = require("request");
// Submit the data into pelecard servers
function do_post_request(operation, params ,callback) {
var url = 'https://gateway20.pelecard.biz/services/' + operation;
request.post(url, { json: params } ,function(error,response,body){
callback(error,body);
});
}
var params = {
"terminalNumber": "0962210",
"user": "UserName",
"password": "XXXXXXXX",
"shopNumber": "001",
"creditCard": "458045804580",
"creditCardDateMmYy": "1214",
"token": "",
"total": "100",
"currency": "1",
"paymentsNumber": "2",
"firstPayment": "50",
"cvv2": "123",
"id": "123456789",
"authorizationNumber": "",
"paramX": "test"
};
do_post_request('DebitRegularType',params, function(error,json){
console.log(error,json);
});
פורסם במקור בפורום CODE613 ב27/09/2015 12:02 (+03:00)