Commit f9cc9b6420e8a362a5a40435ab847ab78ee1ca04

Authored by Adhidarma Hadiwinoto
1 parent 07218fe3ec
Exists in master

cleanNumber responseHarga

Showing 1 changed file with 5 additions and 3 deletions Side-by-side Diff

... ... @@ -54,7 +54,7 @@ function decodeResponseBody(responseBody) {
54 54 return response;
55 55 }
56 56  
57   -function cleanBalance(balance) {
  57 +function cleanNumber(balance) {
58 58 try {
59 59 balance = balance.replace(/\D/g, '');
60 60 }
... ... @@ -114,9 +114,10 @@ function processPartnerResponseBody(body, task) {
114 114 let responseHarga;
115 115 if (response.data && response.data.harga) {
116 116 responseHarga = response.data.harga;
  117 + messages.push('Price: ' + responseHarga);
117 118  
118 119 if (responseHarga) {
119   - messages.push('Price: ' + responseHarga);
  120 + responseHarga = cleanNumber(responseHarga);
120 121 }
121 122 }
122 123  
... ... @@ -124,8 +125,9 @@ function processPartnerResponseBody(body, task) {
124 125 if (response.data && response.data.balance) {
125 126 responseBalance = response.data.balance;
126 127 messages.push('Balance: ' + responseBalance);
  128 +
127 129 if (responseBalance) {
128   - responseBalance = cleanBalance(responseBalance);
  130 + responseBalance = cleanNumber(responseBalance);
129 131 }
130 132 }
131 133