Commit 1e63f374193d04ff7db95d5d698a8901bb12e289

Authored by Adhidarma Hadiwinoto
1 parent 385d8ff594
Exists in master

Number on amount and ending_balance

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

lib/callback/handler-prepaid.js
... ... @@ -26,8 +26,8 @@ module.exports = (req, res) => {
26 26 trx_id: getFromReq(req, 'request_id'),
27 27 rc: translatedRc || '68',
28 28 sn: getFromReq(req, 'sn'),
29   - amount: getFromReq(req, 'amount'),
30   - balance: getFromReq(req, 'ending_balance'),
  29 + amount: Number(getFromReq(req, 'amount')) || undefined,
  30 + balance: Number(getFromReq(req, 'ending_balance')) || undefined,
31 31 message: {
32 32 xid,
33 33 CALLBACK: {
... ... @@ -84,8 +84,8 @@ module.exports = async (task, isAdvice) => {
84 84 rc: response.data.rc ? translateRc[response.data.rc] || response.data.rc
85 85 : '68',
86 86 sn: response.data.sn || null,
87   - amount: 0,
88   - balance: 0,
  87 + amount: Number(response.data.amount) || undefined,
  88 + balance: Number(response.data.ending_balance) || undefined,
89 89 message: {
90 90 xid,
91 91 'DIRECT-RESPONSE': response.data,