Commit d3598b456af9a42e876370eae669a500ac6eefe1

Authored by Adhidarma Hadiwinoto
1 parent 5d2fb7b3e7
Exists in master

AUTO request id on buy use CORE

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

lib/command-handler/buy.js
1   -const moment = require('moment');
  1 +// const moment = require('moment');
2 2  
3 3 const logger = require('komodo-sdk/logger');
4 4  
... ... @@ -9,9 +9,11 @@ const coreapi = require('../coreapi');
9 9  
10 10 const coreEndpoint = '/prepaid/buy';
11 11  
  12 +/*
12 13 function generateRequestId(product, destination) {
13 14 return `AUTO_${ product.toUpperCase() }_${ destination }_${ moment().format('YYYYMMDD') }`;
14 15 }
  16 +*/
15 17  
16 18 function help() {
17 19 return `Untuk pembelian, ketik perintah dengan format: <KODEPRODUK>.<NOMORTUJUAN>.<PIN>`;
... ... @@ -42,7 +44,8 @@ function execute(tokens, params, cb) {
42 44 product_name: (tokens[1] || '').trim().toUpperCase(),
43 45 destination,
44 46 password: tokens[3],
45   - request_id: `${generateRequestId(tokens[1], destination)}${Number(tokens[4]) ? '_req' + Number(tokens[4]) : ''}`,
  47 + // request_id: `${generateRequestId(tokens[1], destination)}${Number(tokens[4]) ? '_req' + Number(tokens[4]) : ''}`,
  48 + request_id_suffix: tokens[4] || '',
46 49 postpaid: 0
47 50 };
48 51