Commit 107ff7b0f6128093e27e3daa1b0f63173b2bc4c6
1 parent
caeb5ddbc6
Exists in
master
easysoap
Showing 1 changed file with 22 additions and 14 deletions Side-by-side Diff
partner-kospinjasa.js
... | ... | @@ -59,26 +59,34 @@ function topupRequest(task, retry) { |
59 | 59 | function topupRequestEasySoap(task, args, retry) { |
60 | 60 | //partner=http://203.130.243.155/ApiH2H/index.php?wsdl |
61 | 61 | |
62 | - var params = { | |
62 | + var clientParams = { | |
63 | 63 | host: '203.130.243.155', |
64 | 64 | path: '/ApiH2H/index.php', |
65 | 65 | wsdl: '/ApiH2H/index.php?wsdl' |
66 | 66 | } |
67 | 67 | |
68 | - var soapClient = easysoap.createClient(params); | |
69 | - soapClient.call({ | |
70 | - method: 'billpayment', | |
71 | - params: args, | |
72 | - }) | |
73 | - .then((callResponse) => { | |
74 | - console.log(callResponse.data); // response data as json | |
75 | - console.log(callResponse.body); // response body | |
76 | - console.log(callResponse.header); //response header | |
77 | - }) | |
78 | - .catch((err) => { throw new Error(err); }); | |
79 | - | |
80 | - callbackReport(task.requestId, '68', 'debug'); | |
68 | + var clientOptions { | |
69 | + secure: false, | |
70 | + } | |
81 | 71 | |
72 | + var soapClient = new easysoap.Client(clientParams, clientOptions); | |
73 | + soapClient.call( | |
74 | + {method: 'billpayment', params: args} | |
75 | + ).done( | |
76 | + //success | |
77 | + function(res) { | |
78 | + res.data // response data as array | |
79 | + res.response // full response data (including xml) | |
80 | + res.header // response header | |
81 | + }, | |
82 | + | |
83 | + //method fail | |
84 | + function(err) { | |
85 | + console.log(err); | |
86 | + } | |
87 | + ); | |
88 | + | |
89 | + callbackReport(task.requestId, '68', 'debug'); | |
82 | 90 | } |
83 | 91 | |
84 | 92 | function topupRequestSoap(task, args, retry) { |