Commit 043c7829876cf0befb8b947e1b4a7fe7838ac4f6
1 parent
dbacc12f55
Exists in
master
strftime
Showing 2 changed files with 14 additions and 1 deletions Side-by-side Diff
package.json
partner-datacell.js
... | ... | @@ -255,6 +255,17 @@ function balanceCheck() { |
255 | 255 | |
256 | 256 | } |
257 | 257 | |
258 | +function balanceFromMessage(message) { | |
259 | + matches = message.match(/Saldo: Rp (\d+)/); | |
260 | + if (!matches) { | |
261 | + return null; | |
262 | + } | |
263 | + | |
264 | + if (matches.length <= 1) { | |
265 | + return null; | |
266 | + } | |
267 | + return matches[0]; | |
268 | +} | |
258 | 269 | |
259 | 270 | function start(_config, _callbackReport) { |
260 | 271 | config = _config; |
... | ... | @@ -265,3 +276,4 @@ function start(_config, _callbackReport) { |
265 | 276 | |
266 | 277 | exports.start = start; |
267 | 278 | exports.topupRequest = topupRequest; |
279 | +exports.balanceFromMessage = balanceFromMessage; |