Giter Site home page Giter Site logo

webpay-nodejs's Introduction

webpay-nodejs

Módulo no oficial para integrar la API de WebPay, Anulaciones y OneClick de Transbank en Node.js, con soporte para promesas.

Instalación

npm install webpay-nodejs

Transacción normal

Revisa el directorio /showcase para ver ejemplos funcionando $ node showcase/test<DesiredTest>

  1. Instanciar
const WebPay = require('webpay-nodejs');

let wp = new WebPay({
    commerceCode: youCommerceCode,
    publicKey: youPublicKey, // .cert file
    privateKey: youPrivateKey, // .key file
    webpayKey: youWebpayKey, // .pem file
    env: WebPay.ENV.INTEGRACION
});
  1. Iniciar Transacción
wp.initTransaction({
    buyOrder: buyOrden,
    sessionId: req.sessionId,
    returnURL: url + '/verificar',
    finalURL: url + '/comprobante',
    amount: amount
}).then((data) => {
    res.redirect(data.url + '?token_ws=' + data.token);
})
  1. Obtener datos de la transacción
wp.getTransactionResult(token).then((transaccion) => {
    // datos de la transaccion
})
  1. Aceptar la transacción
wp.acknowledgeTransaction(token)

Opcionalmente, anular

wp.nullify({
    authorizationCode: '123',
    authorizedAmount: 2000,
    buyOrder: buyOrder
})

Para los métodos de OneClick, usar wp.oneclick.* y wp.onclickmall.* respectivamente.

Changelog

v1.4.0

Las versiones anteriores tienen problemas de seguridad en sus dependencias. Se recomienda actualizar a ésta versión como punto mínimo.

  • Se agregaron dependencias faltantes (ejs). Notificado por ffflabs (#15).
  • Se agregó una versión propia de ursa, y actualización de soap. Ahora la instalación no tiene problemas de seguridad. Gracias nicolaslopezj (#20).
  • Se corrigieron problemas en los ejemplos. Gracias DiruzCode (#17), Rubenazo (#9).
  • Agregado soporte parcial para pagos diferidos (Falta documentación). BluebambooSRL (#11).
  • Se agregó más formalismo en la licencia (archivos COPYING, COPYING.LESEER). La licencia sigue siendo la misma, LGPL.

v1.3.0

  • Se agregó soporte para WebPay OneClick Mall. Gracias Alonso Gaete! (#6).
  • Correcciones menores internas al manejo de errores (no implica cambios en la API).
  • Los ejemplos ahora manejan los errores (solo a modo de demostración).
  • Se actualizaron los certificados de WebPay Normal.
  • Se eliminaron dependencias sin uso.

v1.2.0

  • Se agregó soporte para WebPay OneClick
  • Gracias a la observación de Joaquin Gumucio L., se reemplazó la dependencia de "ursa" por una versión pura en js "ursa-purejs", solucionando de esta forma problemas en algunos equipos productos de usar una librería nativa. Ahora el código es 100% js.
  • Se actualizaron los ejemplos, ahora están en el directorio showcase

v1.0.0 (Breaking Changes)

  • getTransactionResult retornaba transaction.detailOutput como un array con un único objeto las propiedades, ahora transaction.detailOutput retorna directamente dicho objeto.

    • Ejemplo antes: transaction.detailOutput[0].amount
    • Ejemplo ahora: transaction.detailOutput.amount

Legalidades

Agradecimientos a FabianBravoA por el algoritmo de verificación especial de Transbank.

Agradecimientos a Leonardo Gatica por descubrir el significado de los códigos de respuesta de WebPay OneClick desde el número -8 al -1.

Éste código se distribuye con la licencia libre LGPL. Revisar COPYING.LESSER para detalles.

webpay-nodejs's People

Contributors

alonso-gaete-safecard avatar bluebamboosrl avatar diruzcode avatar nicolaslopezj avatar rgcl avatar rubenazo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webpay-nodejs's Issues

Certificado .pem ?

Hola, entiendo que hace poco transbank cambio la forma en la que reciben la información para el paso a producción, ya no entregan ningún certificado solo reciben los de uno, tengo la duda sobre que certificado debo colocar este paquete pide tres y solo tengo un key y un crt, Transbank ya no entrega ningún otro certificado actualmente.

Dependencias antiguas o faltantes

@rgcl dos observaciones:

1. se está llamando la dependencia ejs en

Pero ésta no figura en el package.json.

2. Se está usando una versión vieja de node-soap (0.18, la actual es la 0.29). Comprobé que no hay breaking changes.

Lo malo de la 0.18 es que todavía intenta compilar ursa con node-gyp, pero las versiones recientes de OpenSSL son incompatibles con el script que intenta ejecutar, luego salen errores horribles. De todos modos es una dependencia opcional que se quitó en versiones posteriores, pero el error sigue siendo feo.

UnhandledPromiseRejectionWarning: TypeError: path must be a string or Buffer

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

Problemas al instalar librería, intenta instalar ursa y ejecuta node-gyp rebuild

Hola chicos, excelente librería!!

tengo un problema, no logro instalarla en mi Mac con Node v11.6.0 y NPM v6.5.0, por lo que entiendo se usa una versión javascript de Ursa, sin embargo intenta compilar de igual forma esa librería.

Me podrían indicar que estoy haciendo mal, se los agradecería mucho.

npm install webpay-nodejs
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: Critical security bugs fixed in 2.5.5

> [email protected] install /Users/kattatzu/sites/mktv/node_modules/ursa
> node-gyp rebuild

  CXX(target) Release/obj.target/ursaNative/src/ursaNative.o
../src/ursaNative.cc:208:23: warning: 'Utf8Length' is deprecated: Use Isolate version instead [-Wdeprecated-declarations]
    int length = str->Utf8Length();
                      ^
/Users/kattatzu/.node-gyp/11.6.0/include/node/v8.h:2682:3: note: 'Utf8Length' has been explicitly marked deprecated here
  V8_DEPRECATED("Use Isolate version instead", int Utf8Length() const);
  ^
...
14 warnings and 16 errors generated.
make: *** [Release/obj.target/ursaNative/src/ursaNative.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:188:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/node/11.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/kattatzu/sites/mktv/node_modules/ursa
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/ursa):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 65 packages from 75 contributors and audited 16279 packages in 27.555s
found 4 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

soporte webpay mall

Hola buenas , queria saber si es posible integrar webpay mall para multiples tiendas , solo veo soporte a oneclick mall pero no para el "normal".
se que esto no es stackoverflow pero agradecería su respuesta.

webpaykey

Hola,
me entrega el sgte error y no me deja avanzar, ya cree la llave publica y privada con el codigo de comercio que me entrego transbank
initTransaction:error! { Error: soap:Server:
at finish (/**/node_modules/soap/lib/wsdl.js:1488:21)

Problema con el "returnURL"

Hola, estoy intentando realizar una transacción "normal" con el ejemplo "showcase/testNormal.js" y tengo el siguiente problema:

  1. ingreso a la raiz del website para que se cargue el HTML por defecto que pide un monto
  2. le hago submit y va al handler "/pagar" y este inicia el initTransaction con el returnURL: 'https://dominio.com/verificar' y me redirige correctamente al sitio de webpay,
  3. ingreso en el formulario el número de tarjeta de debito de prueba, luego ingreso el rut y pass, y le hago submit
  4. aparece otra pantalla con un dropdown para indicar si quiere ACEPTAR o RECHAZAR la transacción.
  5. al hacer submit a esta página me redirigen al returnURL, sin embargo lo hace con un GET y no me entregan ninguna información en el request que me permita identificar de parte de qué transacción se origina.

Habrán actualizado el sistema? está este módulo actualizado y funcionando actualmente?
Alguna idea de porqué hace un GET y no un POST?

Gracias!

Manejo de cancelar compra

Hola una consulta que no he podido dar con ella, como manejo el control de los siguientes errores

Si el usuario cierra el portal de pago, como le digo a la peticion, cortate, porque como que queda en cola la peticion soap.

Si el banco tuvo un problema y cerro el portal, como detecto eso ?

Si el usuario le da anular, vi que habia una forma en este caso, pero no lo entendi del todo el authorizacion code, entre otros

Alguna ayuda, actualmente lo adapte con socket.io para abrir un webview en una aplicacion hibrida creada con ionic 3 y tambien la adapte de la misma forma para angular. Saludos

Como generar certificado webpay

Hola buenos días como genero el certificado webpay, debido a que según TBK tengo que generar solo dos certificados con el codigo de comercio, uno publico y uno privado, pero según tu libreria tengo que tener un webpay cert, no comprendo ese punto y lo otro puedo probarlo en localhost ? o tengo que tener una ip fija.

Saludos, estoy intentando hacer que webpay haga la transacción pero quiero manejar las vistas en Angular

Muchas gracias de ante mano.

Problema con openssl - Error: Invalid openssl exit code: 1

Hola, al intentar usar la version de Integración usando como ejemplo lo que esta en el repositorio, me sale este error

Error: Invalid openssl exit code: 1
% openssl x509 -noout -nameopt RFC2253,sep_multiline,space_eq,-esc_msb,utf8 -text -in /var/folders/0y/9r69vb0n7r34qcrp3ljt8psw0000gn/T/31a6e2f6ab934ac1c713ef74de24c64772f8657b
unable to load certificate
4629958252:error:09FFF066:PEM routines:CRYPTO_internal:bad end line:/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-47.11.1/libressl-2.8/crypto/pem/pem_lib.c:792:

at done (/path/to/project/node_modules/pem/lib/openssl.js:158:27)
at ChildProcess.<anonymous> (/path/to/project/node_modules/pem/lib/openssl.js:175:7)
at ChildProcess.emit (events.js:310:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

Error: Could not find openssl on your system on this path: openssl

Hola, estoy trabajando con fastify en vez de express. En local, initTransaction() me genera el token y la url, pero en producción (Google Cloud App Engine) me arroja el siguiente error:

Error: Could not find openssl on your system on this path: openssl at /usr/src/app/node_modules/pem/lib/openssl.js:237:23 at F (/usr/src/app/node_modules/which/which.js:68:16) at E (/usr/src/app/node_modules/which/which.js:80:29) at /usr/src/app/node_modules/which/which.js:89:16 at /usr/src/app/node_modules/isexe/index.js:42:5 at /usr/src/app/node_modules/isexe/mode.js:8:5 at FSReqWrap.oncomplete (fs.js:154:21)
2019-11-03 06:30:04 default[20191030t042847] "POST /webpay" 502

la función es la siguiente:

const pay = async (req, res) => {
let buyOrden = Date.now();
//transactions[buyOrden] = { amount: amount};
let url = 'xxxxxx';

await wp.initTransaction({
  buyOrder: buyOrden,
  sessionId: req.body.sessionId,
  returnURL: url + '/verify',
  finalURL: url + '/voucher',
  amount: 10000
}).then((data) => {
    return res.send(data.url + '?token_ws=' + data.token);
}).catch(onError(res));

};

Anuncio: Cambio de nombre

Buenas, cambiaré mi nombre de usuario ahora, esto puede afectar a las nuevas descargas de npm que se hagan durante ahora. El cambio será rápido, de modo que no debería haber nadie afectado; aun así, si intentas descargar de npm y no te funciona, solo espera hasta mañana por favor.

Los ejemplos estan funcionando?

No he realizado nada, solo queria probar la libreria. Corrí el testNormal.js y lanza "initTransaction: result doesn't have a valid signature!".

Se cae en esta linea:
let res = sig.checkSignature(xml);

getTransactionResult

Hola, yo de nuevo, estoy teniendo un problema con conseguir el resultado de la transacción, me esta tirando un "Timeout error(272)".

Este es mi código:

const wp_token = req.body.wp_token

    wp.getTransactionResult(wp_token).then((transaccion) => {

        res.json({
            status: 1,
            transaccion
        })

    }).catch((e) => {
        res.json({
            status: 0,
            e
        })

    })

Y esta es la respuesta que me da, que viene por el catch:

"e": {
        "root": {
            "Envelope": {
                "Header": {
                    "Security": {
                        "attributes": {
                            "soap:mustUnderstand": "1"
                        },
                        "Signature": {
                            "attributes": {
                                "Id": "SIG-1037504"
                            },
                            "SignedInfo": {
                                "CanonicalizationMethod": {
                                    "attributes": {
                                        "Algorithm": "http://www.w3.org/2001/10/xml-exc-c14n#"
                                    },
                                    "InclusiveNamespaces": {
                                        "attributes": {
                                            "PrefixList": "soap"
                                        }
                                    }
                                },
                                "SignatureMethod": {
                                    "attributes": {
                                        "Algorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
                                    }
                                },
                                "Reference": {
                                    "attributes": {
                                        "URI": "#id-1037503"
                                    },
                                    "Transforms": {
                                        "Transform": {
                                            "attributes": {
                                                "Algorithm": "http://www.w3.org/2001/10/xml-exc-c14n#"
                                            },
                                            "InclusiveNamespaces": {
                                                "attributes": {
                                                    "PrefixList": ""
                                                }
                                            }
                                        }
                                    },
                                    "DigestMethod": {
                                        "attributes": {
                                            "Algorithm": "http://www.w3.org/2000/09/xmldsig#sha1"
                                        }
                                    },
                                    "DigestValue": "kDFv8tyfbaGv5co0PuqmkdSzL50="
                                }
                            },
                            "SignatureValue": "otwu102WzVVEV3kXqJrcCtQT/Xkte6bQD9K1W4tb66fnrcCMK3Uk+uJsUfmLZxQyZzGZfUG24Ldy\n/a/STGJd30FwgnOR2IKzujorSLqqFJaFvuQRn/mrqKDlrRC9EDadsn3RQHlEzNPNB0jBVrOcTobj\nHo1OofqOsgdC2NTPXDXA7MjsR3qPG9PC9OrFV0unAXCeUdG4nN926ZAIPs0hMebTLPMs9rj9Mumz\nmahevIrAZgfJJ16pV7xge3ekkDO93JQTYImqsKp7AuXEarfVHhy6rPq7fyjPfJooids9krHqoxns\nE5qRe+pvJTs71EQlXI0/NaEQ5wUxX7cU6EWELg==",
                            "KeyInfo": {
                                "attributes": {
                                    "Id": "KI-AFF6A1C21E97D2C94215303031813931556261"
                                },
                                "SecurityTokenReference": {
                                    "attributes": {
                                        "wsu:Id": "STR-AFF6A1C21E97D2C94215303031813931556262"
                                    },
                                    "X509Data": {
                                        "X509IssuerSerial": {
                                            "X509IssuerName": "CN=10,OU=PRD,O=transbank,L=Santiago,ST=RM,C=CL",
                                            "X509SerialNumber": "9876689033494141554"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "Body": {
                    "attributes": {
                        "wsu:Id": "id-1037503"
                    },
                    "Fault": {
                        "faultcode": "soap:Server",
                        "faultstring": "<!-- Timeout error(272) -->"
                    }
                }
            }
        },
        "response": {
            "statusCode": 500,
            "body": "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-1037504\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"/><ds:Reference URI=\"#id-1037503\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"/><ds:DigestValue>kDFv8tyfbaGv5co0PuqmkdSzL50=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>otwu102WzVVEV3kXqJrcCtQT/Xkte6bQD9K1W4tb66fnrcCMK3Uk+uJsUfmLZxQyZzGZfUG24Ldy\n/a/STGJd30FwgnOR2IKzujorSLqqFJaFvuQRn/mrqKDlrRC9EDadsn3RQHlEzNPNB0jBVrOcTobj\nHo1OofqOsgdC2NTPXDXA7MjsR3qPG9PC9OrFV0unAXCeUdG4nN926ZAIPs0hMebTLPMs9rj9Mumz\nmahevIrAZgfJJ16pV7xge3ekkDO93JQTYImqsKp7AuXEarfVHhy6rPq7fyjPfJooids9krHqoxns\nE5qRe+pvJTs71EQlXI0/NaEQ5wUxX7cU6EWELg==</ds:SignatureValue><ds:KeyInfo Id=\"KI-AFF6A1C21E97D2C94215303031813931556261\"><wsse:SecurityTokenReference wsu:Id=\"STR-AFF6A1C21E97D2C94215303031813931556262\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>CN=10,OU=PRD,O=transbank,L=Santiago,ST=RM,C=CL</ds:X509IssuerName><ds:X509SerialNumber>9876689033494141554</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-1037503\"><soap:Fault><faultcode>soap:Server</faultcode><faultstring>&lt;!-- Timeout error(272) --></faultstring></soap:Fault></soap:Body></soap:Envelope>",
            "headers": {
                "connection": "close",
                "date": "Fri, 29 Jun 2018 20:13:01 GMT",
                "transfer-encoding": "chunked",
                "content-type": "text/xml; charset=UTF-8",
                "set-cookie": [
                    "dtCookie=843E8D2E7E30A199BE4FE72269F9B5E4; domain=.transbank.cl; path=/",
                    "cookie_webpay3g=!35cKArih4L6VBAICxjiACn6ARqnkUc/IYzSiL7Y5IiBDaNNOat8qL8D770lgywaiG8qqI0/LlKcv9pQZwKJQ7PPk0yT0zNR4KgxJ9z3RAA==; path=/; Httponly; Secure"
                ],
                "x-powered-by": "Servlet/2.5 JSP/2.1"
            },
            "request": {
                "uri": {
                    "protocol": "https:",
                    "slashes": true,
                    "auth": null,
                    "host": "webpay3g.transbank.cl:443",
                    "port": "443",
                    "hostname": "webpay3g.transbank.cl",
                    "hash": null,
                    "search": null,
                    "query": null,
                    "pathname": "/WSWebpayTransaction/cxf/WSWebpayService",
                    "path": "/WSWebpayTransaction/cxf/WSWebpayService",
                    "href": "https://webpay3g.transbank.cl:443/WSWebpayTransaction/cxf/WSWebpayService"
                },
                "method": "POST",
                "headers": {
                    "User-Agent": "node-soap/0.18.0",
                    "Accept": "text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8",
                    "Accept-Encoding": "none",
                    "Accept-Charset": "utf-8",
                    "Connection": "close",
                    "Host": "webpay3g.transbank.cl:443",
                    "Content-Length": 4572,
                    "Content-Type": "text/xml; charset=utf-8",
                    "SOAPAction": "\"\""
                }
            }
        },
        "body": "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Header><wsse:Security xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" soap:mustUnderstand=\"1\"><ds:Signature xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" Id=\"SIG-1037504\"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"soap\"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"/><ds:Reference URI=\"#id-1037503\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"><ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"\"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"/><ds:DigestValue>kDFv8tyfbaGv5co0PuqmkdSzL50=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>otwu102WzVVEV3kXqJrcCtQT/Xkte6bQD9K1W4tb66fnrcCMK3Uk+uJsUfmLZxQyZzGZfUG24Ldy\n/a/STGJd30FwgnOR2IKzujorSLqqFJaFvuQRn/mrqKDlrRC9EDadsn3RQHlEzNPNB0jBVrOcTobj\nHo1OofqOsgdC2NTPXDXA7MjsR3qPG9PC9OrFV0unAXCeUdG4nN926ZAIPs0hMebTLPMs9rj9Mumz\nmahevIrAZgfJJ16pV7xge3ekkDO93JQTYImqsKp7AuXEarfVHhy6rPq7fyjPfJooids9krHqoxns\nE5qRe+pvJTs71EQlXI0/NaEQ5wUxX7cU6EWELg==</ds:SignatureValue><ds:KeyInfo Id=\"KI-AFF6A1C21E97D2C94215303031813931556261\"><wsse:SecurityTokenReference wsu:Id=\"STR-AFF6A1C21E97D2C94215303031813931556262\"><ds:X509Data><ds:X509IssuerSerial><ds:X509IssuerName>CN=10,OU=PRD,O=transbank,L=Santiago,ST=RM,C=CL</ds:X509IssuerName><ds:X509SerialNumber>9876689033494141554</ds:X509SerialNumber></ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature></wsse:Security></soap:Header><soap:Body xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" wsu:Id=\"id-1037503\"><soap:Fault><faultcode>soap:Server</faultcode><faultstring>&lt;!-- Timeout error(272) --></faultstring></soap:Fault></soap:Body></soap:Envelope>"
    }
}

Sabes porque podria estar pasando este error, me da el timeout inmediatamente despues de hacer el pedido.

Error manejando promesas

Hola,
Estoy tratando de realizar esta integración para una plataforma que estoy creando actualmente, pero me tira un error, específicamente en la línea en que se instancia webpay, es decir:

const WebPay = require('webpay-nodejs');

let wp = new WebPay({
    commerceCode: youCommerceCode,
    publicKey: youPublicKey,
    privateKey: youPrivateKey,
    webpayKey: youWebpayKey,
    env: WebPay.ENV.INTEGRACION
});

Cuando corro el servidor para realizar pruebas me arroja el siguiente error:

UnhandledPromiseRejectionWarning: Error: Could not find openssl on your system on this path: openssl
    at C:\Users\marti\Desktop\WebpayPrueba\node_modules\pem\lib\openssl.js:238:23
    at F (C:\Users\marti\Desktop\WebpayPrueba\node_modules\which\which.js:68:16)
    at E (C:\Users\marti\Desktop\WebpayPrueba\node_modules\which\which.js:80:29)
    at C:\Users\marti\Desktop\WebpayPrueba\node_modules\which\which.js:89:16
    at C:\Users\marti\Desktop\WebpayPrueba\node_modules\isexe\index.js:42:5
    at C:\Users\marti\Desktop\WebpayPrueba\node_modules\isexe\windows.js:36:5
    at FSReqWrap.oncomplete (fs.js:152:21)
(node:10224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10224) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Alguna idea? Estuve leyendo que con versiones nuevas de Node no se pueden manejar los rejects de promesas de manera asíncrona pero no estoy muy seguro como solucionar esto.

Seguridad en las versiones de las dependencias.

Hola qué tal?

Estaba inspeccionando problemas de seguridad de mi desarrollo con nsp y detectó los siguientes problemas de seguridad:

± |master U:1 ✗| → nsp check
(+) 4 vulnerabilities found
┌────────────┬────────────────────────────────────────────────────────────────────┐
│ │ Regular Expression Denial of Service │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Name │ debug │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ CVSS │ 3.7 (Low) │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Installed │ 0.7.4 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Vulnerable │ <= 2.6.8 || >= 3.0.0 <= 3.0.1 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Patched │ >= 2.6.9 < 3.0.0 || >= 3.1.0 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Path │ [email protected] > [email protected] > [email protected] > [email protected]
├────────────┼────────────────────────────────────────────────────────────────────┤
│ More Info │ https://nodesecurity.io/advisories/534
└────────────┴────────────────────────────────────────────────────────────────────┘

┌────────────┬────────────────────────────────────────────────────────────────────┐
│ │ Regular Expression Denial of Service │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Name │ debug │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ CVSS │ 3.7 (Low) │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Installed │ 2.2.0 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Vulnerable │ <= 2.6.8 || >= 3.0.0 <= 3.0.1 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Patched │ >= 2.6.9 < 3.0.0 || >= 3.1.0 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Path │ [email protected] > [email protected] > [email protected] > │
│ │ [email protected] > [email protected]
├────────────┼────────────────────────────────────────────────────────────────────┤
│ More Info │ https://nodesecurity.io/advisories/534
└────────────┴────────────────────────────────────────────────────────────────────┘

┌────────────┬────────────────────────────────────────────────────────────────────┐
│ │ Prototype Pollution │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Name │ lodash │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ CVSS │ 2 (Low) │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Installed │ 3.10.1 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Vulnerable │ <4.17.5 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Patched │ >=4.17.5 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Path │ [email protected] > [email protected] > [email protected] > [email protected]
├────────────┼────────────────────────────────────────────────────────────────────┤
│ More Info │ https://nodesecurity.io/advisories/577
└────────────┴────────────────────────────────────────────────────────────────────┘

┌────────────┬────────────────────────────────────────────────────────────────────┐
│ │ Prototype Pollution │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Name │ lodash │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ CVSS │ 2 (Low) │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Installed │ 3.3.0 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Vulnerable │ <4.17.5 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Patched │ >=4.17.5 │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Path │ [email protected] > [email protected] > [email protected] > │
│ │ [email protected] > [email protected]
├────────────┼────────────────────────────────────────────────────────────────────┤
│ More Info │ https://nodesecurity.io/advisories/577
└────────────┴────────────────────────────────────────────────────────────────────┘

Como verás todos son relativos a su módulo, para que lo tengan en cuenta y puedan actualizar a algo más reciente.

Saludos.

TimeOut transbank port 80

Desde ayer 17 de oct, transbank cambio su endpoint y ya no acepta puerto 80 solo 443 para integración , etc ... el repo usa el puerto 80 para hacer el envio ya que saca el enpoint del xml si no estoy mal.

Tuve que modificarlo para seguir usandolo aqui :

WebPay.js linea 93

_getClient function

y agregar eesto en el option

let options = {
ignoredNamespaces: {
namespaces: [],
override: true
},
endpoint:this.env[type].replace('?wsdl','')
};

Nose si sera la mejor manera pero al menos se corrigio., debo probar en producción cualquier cosa igual aviso y si a alguien mas le ocurre que avise.

oneclickmall.initInscription: result doesn't have a valid signature!

Buenas,
Tratando de realizar un initTransacion con el mismo ejemplo que está en la carpeta showcase, me retorna el siguiente error:

oneclickmall.initInscription: result doesn't have a valid signature!
ERROR Error: Invalid signature response

Desde ya agradezco cualquier info para solucionarlo.
Slds.

Webpay Produccion

No he podido ponerlo en marcha desde productivo, me dice error null key 263 y tengo todos los certificados bien, alguna ayuda o solución ?

Captura diferida

Que tal? Es posible hacer capturas diferidas por montos inferiores o completos con ésta librería? Porque no encontré la opción. Gracias

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.