rgcl / webpay-nodejs

[Spanish/Chile] Módulo no oficial para integrar WebPay Plus en Node.js, con soporte para promesas.
GNU Lesser General Public License v3.0
93 stars 32 forks source link

UnhandledPromiseRejectionWarning: TypeError: path must be a string or Buffer #2

Closed Gonzalo9823 closed 6 years ago

Gonzalo9823 commented 6 years ago

Hola! Al momento de hacer una transacción me esta dando este error, que puede ser?

Este es mi codigo:

apiRoutes.post('/webpay/new', (req, ress) => {

    let buyOrden = Date.now();
    let amount = 1000;
    let url = 'https://www.******.cl';

    wp.initTransaction({
        buyOrder: buyOrden,
        sessionId: req.sessionId,
        returnURL: url + '/verificar',
        finalURL: url + '/comprobante',
        amount: amount
    }).then((data) => {
        ress.json({
            status: 1,
            url: data.url + '?token_ws=' + data.token
        })
    });
})
rgcl commented 6 years ago

Hola, por favor, agrega un .catch(..) luego del .then(..) con un console.log(error), luego copia y pega aquí lo que arroje la consola para poder ver qué puede ser.

Ejemplo: ...

.then((data) => { ress.json({ status: 1, url: data.url + '?token_ws=' + data.token }) }).catch(console.log);

El lun., 28 de may. de 2018 18:23, Gonzalo9823 notifications@github.com escribió:

Hola! Al momento de hacer comenzar una transacción me esta dando este error, que puede ser?

Este es mi codigo:

`apiRoutes.post('/webpay/new', (req, ress) => {

let buyOrden = Date.now(); let amount = 1000; let url = 'https://www.******.cl';

wp.initTransaction({ buyOrder: buyOrden, sessionId: req.sessionId, returnURL: url + '/verificar', finalURL: url + '/comprobante', amount: amount }).then((data) => { ress.json({ status: 1, url: data.url + '?token_ws=' + data.token }) });

})`

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sapienman/webpay-nodejs/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AAyltph_v0sL1CS3fTDP3twqHFbPev9Sks5t3GrmgaJpZM4UQnPs .

Gonzalo9823 commented 6 years ago

Hola, ya lo logre hacer funcionar, muchas gracias igual por tu ayuda

manuelabarca commented 6 years ago

Hola, ya lo logre hacer funcionar, muchas gracias igual por tu ayuda

hola me sale un error al iniciar la transacción "initTransaction:error! { Error: soap:Server: For input string: """