Created
August 14, 2018 16:24
-
-
Save daviddsp/857d3976d5261596e6f9c95ebb65bbf8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const funcion = 'transaccion/crear'; | |
| let montoFixed = monto.toFixed(2) | |
| let data = { "trx_id":trx_id.toString(), "medio_pago":medio_pago.toString(), "monto":montoFixed } | |
| let fecha = moment().toDate().toUTCString(); | |
| let mensaje = funcion+"\n"+trx_id+"\n"+montoFixed+"\n"+fecha | |
| let firma = this.FirmarMensaje(mensaje, key, secret); | |
| axios({ | |
| method:'POST', | |
| url:`${url}`, | |
| headers: { | |
| 'Content-Type': 'application/json;charset=utf-8', | |
| 'Accept-Charset': 'utf-8', | |
| 'Autorizacion': firma, | |
| 'Fecha': fecha, | |
| }, | |
| //json: true, | |
| //headers: header_array, | |
| data: data | |
| }) | |
| .then(function (response) { | |
| return response | |
| }) | |
| .catch(function (error) { | |
| return error | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment