1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0xe122=['request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','SAPaymentMethod,\x20%s,\x20%s','debug','SAPaymentMethod,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4a3936,_0x36830f){var _0x1ac5da=function(_0x3058a9){while(--_0x3058a9){_0x4a3936['push'](_0x4a3936['shift']());}};_0x1ac5da(++_0x36830f);}(_0xe122,0x156));var _0x2e12=function(_0x45066d,_0x12330c){_0x45066d=_0x45066d-0x0;var _0x5e1c7f=_0xe122[_0x45066d];return _0x5e1c7f;};'use strict';var _=require(_0x2e12('0x0'));var util=require('util');var moment=require(_0x2e12('0x1'));var BPromise=require(_0x2e12('0x2'));var rs=require(_0x2e12('0x3'));var fs=require('fs');var Redis=require(_0x2e12('0x4'));var db=require(_0x2e12('0x5'))['db'];var utils=require(_0x2e12('0x6'));var logger=require(_0x2e12('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e12('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545556,_0x126fb2,_0x549d5b){return new BPromise(function(_0x2a5511,_0x151b04){return client[_0x2e12('0x9')](_0x545556,_0x549d5b)[_0x2e12('0xa')](function(_0x49da60){logger[_0x2e12('0xb')](_0x2e12('0xc'),_0x126fb2,'request\x20sent');logger[_0x2e12('0xd')](_0x2e12('0xe'),_0x126fb2,'request\x20sent',JSON[_0x2e12('0xf')](_0x49da60));if(_0x49da60['error']){if(_0x49da60[_0x2e12('0x10')]['code']===0x1f4){logger['error'](_0x2e12('0xc'),_0x126fb2,_0x49da60['error'][_0x2e12('0x11')]);return _0x151b04(_0x49da60[_0x2e12('0x10')][_0x2e12('0x11')]);}logger[_0x2e12('0x10')](_0x2e12('0xc'),_0x126fb2,_0x49da60[_0x2e12('0x10')]['message']);return _0x2a5511(_0x49da60['error'][_0x2e12('0x11')]);}else{logger[_0x2e12('0xb')](_0x2e12('0xc'),_0x126fb2,_0x2e12('0x12'));_0x2a5511(_0x49da60[_0x2e12('0x13')][_0x2e12('0x11')]);}})['catch'](function(_0x4daa62){logger['error']('SAPaymentMethod,\x20%s,\x20%s',_0x126fb2,_0x4daa62);_0x151b04(_0x4daa62);});});}