Guest User

Untitled

a guest
Aug 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. const funcion = 'transaccion/crear';
  2.  
  3. let montoFixed = monto.toFixed(2)
  4.  
  5. let data = { "trx_id":trx_id.toString(), "medio_pago":medio_pago.toString(), "monto":montoFixed }
  6. let fecha = moment().toDate().toUTCString();
  7.  
  8. let mensaje = funcion+"\n"+trx_id+"\n"+montoFixed+"\n"+fecha
  9.  
  10. let firma = this.FirmarMensaje(mensaje, key, secret);
  11.  
  12. axios({
  13. method:'POST',
  14. url:`${url}`,
  15. headers: {
  16. 'Content-Type': 'application/json;charset=utf-8',
  17. 'Accept-Charset': 'utf-8',
  18. 'Autorizacion': firma,
  19. 'Fecha': fecha,
  20.  
  21. },
  22. //json: true,
  23. //headers: header_array,
  24. data: data
  25. })
  26. .then(function (response) {
  27. return response
  28.  
  29. })
  30. .catch(function (error) {
  31. return error
  32.  
  33. });
Add Comment
Please, Sign In to add comment