open-pay / openpay-node

Openpay Node.js bindings
29 stars 16 forks source link

openpayCreateCustomer #12

Closed Unixon-solutions closed 5 years ago

Unixon-solutions commented 5 years ago

Please let me know which is causing this excetion.

Getting Exception after this openPay.customers.create(customer, function (error, body)

Uncaught exception TypeError: Cannot read property 'statusCode' of undefined at Request._callback (/user_code/node_modules/openpay/lib/openpay.js:795:22) at self.callback (/user_code/node_modules/openpay/node_modules/request/request.js:123:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at ClientRequest.self.clientErrorHandler (/user_code/node_modules/openpay/node_modules/request/request.js:232:10) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:310:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7)

oswaldopenpay commented 5 years ago

This error is caused by an unexpected response from server, please send me your merchant id in order to look for the error detail in our logs

josejesusguzman commented 5 years ago

Hi @oswaldopenpay , I have the same error:

TypeError: Cannot read property 'statusCode' of undefined at Request._callback (/user_code/node_modules/openpay/lib/openpay.js:795:22) at self.callback (/user_code/node_modules/openpay/node_modules/request/request.js:123:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at ClientRequest.self.clientErrorHandler (/user_code/node_modules/openpay/node_modules/request/request.js:232:10) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:310:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7)

My merchant ID is mtmuz3xc87hh8werawkl

Unixon-solutions commented 5 years ago

@oswaldopenpay Merchant ID : m9wnwnidtfgasn78bmqj

oswaldopenpay commented 5 years ago

Hi @Unixon-solutions, @jose1824 The main cause is an unexpected error, we are handling this case wrongly, we will fix it soon

We do not see any request in our server logs for those merchant id, you can try to identify this error on your side, while we have the fix, it is highly probably a network error

Unixon-solutions commented 5 years ago

@oswaldopenpay Thank you for your support. Actually I was calling OpenPay http request from firebase (in free plan), so firebase does not allow to http request other than google service in free plan. This issue has been fixed by upgrading firebase plan to blaze