Coder Social home page Coder Social logo

mpay24-node's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mpay24-node's Issues

Cannot parse response

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

Change naming of functions to standard names
Like checkout, capture, refund,...

init and createSoapRequest methods do not return immediately when sth is resolved or rejected

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;
      });
    });
 }

TOKEN NOT FOUND error

@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 }

getting loadash error on init

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.