mpay24 / mpay24-node Goto Github PK
View Code? Open in Web Editor NEWOffical Unzer Austria (former mPAY24) Node.js SDK
Home Page: https://npmjs.com/mpay24-node
License: MIT License
Offical Unzer Austria (former mPAY24) Node.js SDK
Home Page: https://npmjs.com/mpay24-node
License: MIT License
We currently have a problem with our (online) server. The "selectPayment" function always throws an error. This error is only thrown online (ec2), but it does not occur locally.
Error: Cannot parse response
at finish (/var/app/current/node_modules/soap/lib/client.js:393:19)
at parseSync (/var/app/current/node_modules/soap/lib/client.js:381:12)
at /var/app/current/node_modules/soap/lib/client.js:357:14
at Request._callback (/var/app/current/node_modules/soap/lib/http.js:117:5)
at Request.self.callback (/var/app/current/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/var/app/current/node_modules/request/request.js:1163:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at IncomingMessage. (/var/app/current/node_modules/request/request.js:1085:12)
at IncomingMessage.g (events.js:292:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
Change naming of functions to standard names
Like checkout, capture, refund,...
In my opinion, the init and createSoapRequest methods must immediately return whenever a resolve or reject is done. At the moment, the statements after a resolve/reject are executed, although it should not do so. Another approach would be to use "else" so that the intended logic is exactly executed.
For instance, the code for createSoapRequest could be so implemented:
createSoapRequest(method, data = {}) {
return new Promise((resolve, reject) => {
data.merchantID = mpay24.username;
mpay24.client[method](data, (err, res) => {
if (!err) {
if (res.status === 'OK') {
resolve(res);
}
else reject(res);
}
else reject(err);
});
});
}
createSoapRequest(method, data = {}) {
return new Promise((resolve, reject) => {
data.merchantID = mpay24.username;
mpay24.client[method](data, (err, res) => {
if (!err) {
if (res.status === 'OK') {
resolve(res);
return;
}
reject(res);
return;
}
reject(err);
return;
});
});
}
@tobiaslins after i get the proper pass and login to test I'm trying to handle payment and got this error:
Token from response:
4+Kd8kzwmD5nnF21PJTu+zUrbd+fL2r8Qqj6/IQQ9Xs=
Token used with payment request:
paymentsApi.acceptPayment({
tid: '12345',
pType: 'TOKEN',
payment: {
amount: 100,
currency: 'EUR',
token: result.token
}
})
and:
{ status: 'ERROR', returnCode: 'TOKEN_NOT_FOUND', errNo: 30 }
on initializing the mpay24 sdk node-soap throws an error!
_.defaultsDeep is not a function
This is a already known bug from node-soap
In order to fix it we should update the node-soap version to 0.18.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.