4edc225a79cd514273fd7e749229121a6a2d8b21
[motion2.git] / server / api / saPaymentMethod / saPaymentMethod.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x0988=['info','SAPaymentMethod,\x20%s,\x20%s','request\x20sent','SAPaymentMethod,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0988,0x128));var _0x8098=function(_0x35197d,_0x33eda7){_0x35197d=_0x35197d-0x0;var _0x157a26=_0x0988[_0x35197d];return _0x157a26;};'use strict';var _=require(_0x8098('0x0'));var util=require(_0x8098('0x1'));var moment=require(_0x8098('0x2'));var BPromise=require(_0x8098('0x3'));var rs=require(_0x8098('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8098('0x5'));var logger=require('../../config/logger')(_0x8098('0x6'));var config=require('../../config/environment');var jayson=require(_0x8098('0x7'));var client=jayson[_0x8098('0x8')][_0x8098('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56053f,_0x489824,_0x37fb2f){return new BPromise(function(_0x2d4638,_0x57259d){return client[_0x8098('0xa')](_0x56053f,_0x37fb2f)[_0x8098('0xb')](function(_0x353e16){logger[_0x8098('0xc')](_0x8098('0xd'),_0x489824,_0x8098('0xe'));logger['debug'](_0x8098('0xf'),_0x489824,_0x8098('0xe'),JSON[_0x8098('0x10')](_0x353e16));if(_0x353e16[_0x8098('0x11')]){if(_0x353e16[_0x8098('0x11')][_0x8098('0x12')]===0x1f4){logger[_0x8098('0x11')]('SAPaymentMethod,\x20%s,\x20%s',_0x489824,_0x353e16[_0x8098('0x11')]['message']);return _0x57259d(_0x353e16['error']['message']);}logger['error'](_0x8098('0xd'),_0x489824,_0x353e16[_0x8098('0x11')][_0x8098('0x13')]);return _0x2d4638(_0x353e16[_0x8098('0x11')]['message']);}else{logger[_0x8098('0xc')]('SAPaymentMethod,\x20%s,\x20%s',_0x489824,_0x8098('0xe'));_0x2d4638(_0x353e16[_0x8098('0x14')][_0x8098('0x13')]);}})[_0x8098('0x15')](function(_0x15ac09){logger[_0x8098('0x11')](_0x8098('0xd'),_0x489824,_0x15ac09);_0x57259d(_0x15ac09);});});}