Commit a763dfeea0629a6ca6397ec7a41e5e79205d7469
1 parent
102e390547
Exists in
master
amount
Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff
lib/partner.js
1 | -"use strict"; | |
2 | - | |
3 | 1 | const moment = require('moment'); |
4 | 2 | |
5 | 3 | const config = require('komodo-sdk/config'); |
... | ... | @@ -9,9 +7,10 @@ const pull = require('komodo-sdk/gateway/pull'); |
9 | 7 | |
10 | 8 | function buy(task) { |
11 | 9 | logger.verbose('Got task from CORE', {task: task}); |
10 | + const [remoteProduct, amount] = task.remote_product.split(/ *, */); | |
12 | 11 | |
13 | 12 | setTimeout( |
14 | - function() { | |
13 | + () => { | |
15 | 14 | if (task.destination % 2) { |
16 | 15 | pull.report({ |
17 | 16 | trx_id: task.trx_id, |
... | ... | @@ -25,8 +24,9 @@ function buy(task) { |
25 | 24 | trx_id: task.trx_id, |
26 | 25 | rc: '00', |
27 | 26 | sn: moment().format('YYYYMMDDHHmmssSSS'), |
27 | + amount: amount, | |
28 | + remote_product: remoteProduct, | |
28 | 29 | message: `BERHASIL karena nomor tujuan ${task.destination} adalah nomor genap`, |
29 | - amount: config.supplier_price ? config.supplier_price[task.product] : null, | |
30 | 30 | balance: config.supplier_ending_balance |
31 | 31 | }); |
32 | 32 | } |