forked from RazerMS/Mobile-XDK-RazerMS_Cordova
-
Notifications
You must be signed in to change notification settings - Fork 0
/
molpay.js
1 lines (1 loc) · 13.8 KB
/
molpay.js
1
var _0xc230=['cordova/exec','startMolpay','module_id','enable','getElementById','molpay','createElement','iframe','updateSdkData','removeEventListener','load','border','padding','mainUiFrame','allowScriptAccess','molpayTransactionRequestFrame','always','setAttribute','src','body','appendChild','closeMolpay','closemolpay','testMerchantCredentials','testMerchantChannels','exports','open','InAppBrowser','prototype','remove','parentElement','removeChild','length','molpay-mobile-xdk-www/index.html','mpopenmolpaywindow://','mptransactionresults://','mprunscriptonpopup://','MOLPay/result.php','MOLPay/nbepay.php','\x22msgType\x22:\x22B4\x22','\x22msgType\x22:\x22C6\x22','style','visibility','hidden','position','absolute','width','0px','height','visible','100%','<iframe','exec','slice','match','index','substring','parse','tranID','contentWindow','transactionRequestWithTransactionId','data:text/html;base64,','transactionRequest','exit','addEventListener','test','url','executeScript','window.close\x20=\x20function\x20()\x20{\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.location.assign(window.location);\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};','loadstop','document.body.innerHTML','close','loadstart','plugins','toast','showWithOptions','bottom','Image\x20saved\x20fail!','requestPermission','WRITE_EXTERNAL_STORAGE','indexOf','replace','atob','stringify','innerHTML','MOLPayPrivacyScreen','base64ImageUrlData','filename','PNG','imageSaver','saveBase64Image'];(function(_0x574e54,_0x2c5784){var _0x581fc5=function(_0x281c81){while(--_0x281c81){_0x574e54['push'](_0x574e54['shift']());}};_0x581fc5(++_0x2c5784);}(_0xc230,0x75));var _0x0c23=function(_0x34c708,_0x4af9ef){_0x34c708=_0x34c708-0x0;var _0x2296ce=_0xc230[_0x34c708];return _0x2296ce;};function MOLPay(){window[_0x0c23('0x0')]=cordova[_0x0c23('0x1')][_0x0c23('0x0')];}Element[_0x0c23('0x2')][_0x0c23('0x3')]=function(){this[_0x0c23('0x4')][_0x0c23('0x5')](this);},NodeList[_0x0c23('0x2')][_0x0c23('0x3')]=HTMLCollection[_0x0c23('0x2')][_0x0c23('0x3')]=function(){for(var _0xfe4072=this[_0x0c23('0x6')]-0x1;_0xfe4072>=0x0;_0xfe4072--)this[_0xfe4072]&&this[_0xfe4072][_0x0c23('0x4')]&&this[_0xfe4072][_0x0c23('0x4')][_0x0c23('0x5')](this[_0xfe4072]);};var isInternalDebugging=!0x1,moduleId='molpay-mobile-xdk-cordova',wrapperVersion='0',molpaySdkUrl=_0x0c23('0x7'),mpopenmolpaywindow=_0x0c23('0x8'),mptransactionresults=_0x0c23('0x9'),mprunscriptonpopup=_0x0c23('0xa'),mpcloseallwindows='mpcloseallwindows://',mppinstructioncapture='mppinstructioncapture://',molpayresulturl=_0x0c23('0xb'),molpaynbepayurl=_0x0c23('0xc'),b4results=_0x0c23('0xd'),c6results=_0x0c23('0xe'),molpayPaymentDetails,transactionResultCallback,molpayDiv,mainUiFrame,bankUiWindow,molpayTransactionRequestFrame,isClosingMolpay=!0x1,hideFrame=function(_0x2a2c2b){_0x2a2c2b[_0x0c23('0xf')][_0x0c23('0x10')]=_0x0c23('0x11'),_0x2a2c2b[_0x0c23('0xf')][_0x0c23('0x12')]=_0x0c23('0x13'),_0x2a2c2b[_0x0c23('0xf')][_0x0c23('0x14')]=_0x0c23('0x15'),_0x2a2c2b[_0x0c23('0xf')][_0x0c23('0x16')]=_0x0c23('0x15');},showFrame=function(_0x202de9){_0x202de9[_0x0c23('0xf')]['visibility']=_0x0c23('0x17'),_0x202de9[_0x0c23('0xf')]['position']=_0x0c23('0x13'),_0x202de9[_0x0c23('0xf')][_0x0c23('0x14')]=_0x0c23('0x18'),_0x202de9[_0x0c23('0xf')][_0x0c23('0x16')]=_0x0c23('0x18');},postMolpayResultHandler=function(_0x2fd1c7){var _0x5b240c=_0x2fd1c7;if(_0x5b240c){var _0x15794d=new RegExp(_0x0c23('0x19')),_0x3cbcf3=_0x15794d[_0x0c23('0x1a')](_0x5b240c);_0x3cbcf3&&(_0x5b240c=_0x5b240c[_0x0c23('0x1b')](0x0,_0x3cbcf3['index']));var _0x14646d=function(_0x3cedb1){var _0x1f2e8f,_0x972c8,_0x4d1c75=_0x3cedb1,_0x5e00e5=new RegExp('<','g'),_0x4b8981=new RegExp('<'),_0x19b6c4=new RegExp('>'),_0x5007a9=_0x4d1c75[_0x0c23('0x1c')](_0x5e00e5);if(_0x4d1c75&&_0x5007a9&&_0x4b8981[_0x0c23('0x1a')](_0x4d1c75)&&_0x19b6c4[_0x0c23('0x1a')](_0x4d1c75))for(var _0x5a78e2=_0x5007a9[_0x0c23('0x6')]-0x1;_0x5a78e2>=0x0;_0x5a78e2--)_0x1f2e8f=_0x4b8981[_0x0c23('0x1a')](_0x4d1c75)[_0x0c23('0x1d')],_0x972c8=_0x19b6c4[_0x0c23('0x1a')](_0x4d1c75)['index'],_0x4d1c75=_0x4d1c75[_0x0c23('0x1e')](0x0,_0x1f2e8f)+''+_0x4d1c75[_0x0c23('0x1e')](_0x972c8+0x1);return _0x4d1c75;};_0x5b240c=_0x14646d(_0x5b240c);var _0x28cb45,_0x5d6c82;if(_0x28cb45=new RegExp(b4results),_0x28cb45['test'](_0x5b240c)&&(_0x5d6c82=JSON[_0x0c23('0x1f')](_0x5b240c))){var _0x5a18be=_0x5d6c82[_0x0c23('0x20')];_0x5a18be&&mainUiFrame[_0x0c23('0x21')][_0x0c23('0x22')](_0x5a18be);}}},isBankUiWindowClosedByCloseWindowEvent=!0x1,createBankUiWindow=function(_0x4f8102){var _0x50c4a9=_0x0c23('0x23')+_0x4f8102;bankUiWindow=window['open'](_0x50c4a9,'_blank','location=no,hardwareback=no,disallowoverscroll=yes,toolbarposition=top,transitionstyle=crossdissolve,useWideViewPort=no');var _0x2e23a8=function(_0x1d6cc6){isBankUiWindowClosedByCloseWindowEvent||mainUiFrame['contentWindow'][_0x0c23('0x24')](),bankUiWindow['removeEventListener'](_0x0c23('0x25'),_0x2e23a8);};bankUiWindow[_0x0c23('0x26')]('exit',_0x2e23a8);var _0x33f494=function(_0x3af457){var _0x116e8b;_0x116e8b=new RegExp(molpaynbepayurl),_0x3af457&&_0x116e8b[_0x0c23('0x27')](_0x3af457[_0x0c23('0x28')])&&(bankUiWindow[_0x0c23('0x29')]({'code':'window.open\x20=\x20function\x20(open)\x20{\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20function\x20(url,\x20name,\x20features)\x20{\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.location\x20=\x20url\x20;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20window;\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20(window.open);'},function(_0x4d74b3){}),bankUiWindow['executeScript']({'code':_0x0c23('0x2a')},function(_0xda1ea0){}));};bankUiWindow[_0x0c23('0x26')](_0x0c23('0x2b'),_0x33f494);var _0x569612=function(_0x3bb836){var _0x41138b;if(mainUiFrame[_0x0c23('0x21')]['nativeWebRequestUrlUpdates']({'requestPath':_0x3bb836[_0x0c23('0x28')]}),_0x41138b=new RegExp(molpaynbepayurl),_0x3bb836&&_0x41138b['test'](_0x3bb836[_0x0c23('0x28')]))var _0x590e15=0xa,_0x4f5d16=0x0,_0x311b5f=setInterval(function(){_0x285766();},0x3e8),_0x285766=function(){_0x4f5d16++,_0x4f5d16>_0x590e15?clearInterval(_0x311b5f):bankUiWindow[_0x0c23('0x29')]({'code':_0x0c23('0x2c')},function(_0x4f3816){var _0x21bb0f=_0x4f3816[0x0],_0x2af229=new RegExp(b4results);_0x2af229[_0x0c23('0x27')](_0x21bb0f)&&(postMolpayResultHandler(_0x21bb0f),bankUiWindow['removeEventListener']('loadstart',_0x569612),bankUiWindow[_0x0c23('0x2d')](),clearInterval(_0x311b5f));});};};bankUiWindow[_0x0c23('0x26')](_0x0c23('0x2e'),_0x569612);},inAppCallback=function(_0xa25a38){function _0x331921(){window[_0x0c23('0x2f')][_0x0c23('0x30')][_0x0c23('0x31')]({'message':'Image\x20saved\x20success!','duration':0x3e8,'position':_0x0c23('0x32')});}function _0x2d3a42(){window[_0x0c23('0x2f')]['toast'][_0x0c23('0x31')]({'message':_0x0c23('0x33'),'duration':0x3e8,'position':_0x0c23('0x32')});}function _0x120125(){var _0xa25a38=cordova['plugins']['permissions'];_0x2d3a42();var _0x3fc927=function(){_0x2d3a42();};_0xa25a38[_0x0c23('0x34')](_0xa25a38[_0x0c23('0x35')],function(_0x30317c){_0x30317c['hasPermission']?_0x1d8b74():_0x3fc927();},_0x3fc927);}var _0xbab929,_0x5befe9;if(_0xa25a38&&_0xa25a38['indexOf'](mpopenmolpaywindow)>-0x1)_0x5befe9=new RegExp(mpopenmolpaywindow,'g'),_0xbab929=_0xa25a38['replace'](_0x5befe9,''),_0xbab929&&_0xbab929[_0x0c23('0x6')]>0x0&&createBankUiWindow(_0xbab929);else if(_0xa25a38&&_0xa25a38[_0x0c23('0x36')](mpcloseallwindows)>-0x1)isBankUiWindowClosedByCloseWindowEvent=!0x0,bankUiWindow[_0x0c23('0x2d')]();else if(_0xa25a38&&_0xa25a38[_0x0c23('0x36')](mptransactionresults)>-0x1){if(_0x5befe9=new RegExp(mptransactionresults,'g'),_0xbab929=_0xa25a38[_0x0c23('0x37')](_0x5befe9,''),_0xbab929&&_0xbab929['length']>0x0){var _0x5ae77d=window[_0x0c23('0x38')](_0xbab929),_0xe8a6f1=JSON[_0x0c23('0x39')](JSON[_0x0c23('0x1f')](_0x5ae77d));transactionResultCallback(_0xe8a6f1),isClosingMolpay&&(molpayDiv[_0x0c23('0x3a')]='',isClosingMolpay=!0x1),molpayTransactionRequestFrame&&molpayTransactionRequestFrame[_0x0c23('0x3')](),window['MOLPayPrivacyScreen']&&window[_0x0c23('0x3b')]['disable']();}}else if(_0xa25a38&&_0xa25a38['indexOf'](mppinstructioncapture)>-0x1){_0x5befe9=new RegExp(mppinstructioncapture,'g'),_0xbab929=_0xa25a38[_0x0c23('0x37')](_0x5befe9,'');var _0x39c00d=JSON[_0x0c23('0x1f')](atob(_0xbab929)),_0x549cac={'data':_0x39c00d[_0x0c23('0x3c')],'prefix':_0x39c00d[_0x0c23('0x3d')],'format':_0x0c23('0x3e'),'quality':0x64,'mediaScanner':!0x0};window[_0x0c23('0x3f')]['saveBase64Image'](_0x549cac,function(_0x5f561e){_0x331921();},_0x120125);var _0x1d8b74=function(){window[_0x0c23('0x3f')][_0x0c23('0x40')](_0x549cac,function(_0x2f1a86){_0x331921();},function(_0xa5867a){_0x2d3a42();});};}if(_0xa25a38&&_0xa25a38[_0x0c23('0x36')](mprunscriptonpopup)>-0x1&&(_0x5befe9=new RegExp(mprunscriptonpopup,'g'),_0xbab929=_0xa25a38['replace'](_0x5befe9,''),_0xbab929&&_0xbab929[_0x0c23('0x6')]>0x0)){var _0x41be72=window[_0x0c23('0x38')](_0xbab929);bankUiWindow[_0x0c23('0x29')]({'code':_0x41be72},function(_0x464a59){});}},molpayCredentialsRequestFrame,testMerchantCredentialsCallback,onTestMerchantCredentialsDone=function(_0xf5b549,_0x42615e){testMerchantCredentialsCallback(_0xf5b549,_0x42615e),isClosingMolpay&&(molpayDiv[_0x0c23('0x3a')]='',isClosingMolpay=!0x1),molpayCredentialsRequestFrame&&molpayCredentialsRequestFrame[_0x0c23('0x3')]();},molpayChannelsRequestFrame,testMerchantChannelsCallback,onTestMerchantChannelsDone=function(_0x13b835,_0x390040){testMerchantChannelsCallback&&testMerchantChannelsCallback(_0x13b835,_0x390040),isClosingMolpay&&(molpayDiv[_0x0c23('0x3a')]='',isClosingMolpay=!0x1),molpayChannelsRequestFrame&&molpayChannelsRequestFrame[_0x0c23('0x3')]();},exec=require(_0x0c23('0x41'));MOLPay[_0x0c23('0x2')][_0x0c23('0x42')]=function(_0x1b9534,_0x114df7){isClosingMolpay=!0x1,isBankUiWindowClosedByCloseWindowEvent=!0x1;try{molpayPaymentDetails=JSON[_0x0c23('0x1f')](_0x1b9534);}catch(_0x294b6a){molpayPaymentDetails=_0x1b9534;}molpayPaymentDetails[_0x0c23('0x43')]=moduleId,molpayPaymentDetails['wrapper_version']=wrapperVersion,transactionResultCallback=_0x114df7,window[_0x0c23('0x3b')]&&window[_0x0c23('0x3b')][_0x0c23('0x44')](),molpayDiv=document[_0x0c23('0x45')](_0x0c23('0x46')),molpayDiv['style']['width']=_0x0c23('0x18'),molpayDiv[_0x0c23('0xf')]['padding']=_0x0c23('0x15'),molpayDiv[_0x0c23('0xf')]['border']=_0x0c23('0x15'),mainUiFrame=document[_0x0c23('0x47')](_0x0c23('0x48'));var _0x71e23=function(_0x3e045d){mainUiFrame[_0x0c23('0x21')][_0x0c23('0x49')](JSON['stringify'](molpayPaymentDetails),inAppCallback),mainUiFrame[_0x0c23('0x4a')](_0x0c23('0x4b'),_0x71e23);};mainUiFrame['style'][_0x0c23('0x4c')]=_0x0c23('0x15'),mainUiFrame[_0x0c23('0xf')][_0x0c23('0x4d')]=_0x0c23('0x15'),mainUiFrame[_0x0c23('0xf')][_0x0c23('0x14')]=_0x0c23('0x18'),mainUiFrame[_0x0c23('0xf')][_0x0c23('0x16')]='100%',mainUiFrame['id']=_0x0c23('0x4e'),mainUiFrame[_0x0c23('0x4f')]='always',mainUiFrame['setAttribute']('src',molpaySdkUrl),molpayDiv['appendChild'](mainUiFrame),mainUiFrame[_0x0c23('0x26')](_0x0c23('0x4b'),_0x71e23);},MOLPay[_0x0c23('0x2')][_0x0c23('0x24')]=function(_0x5f71fa,_0x3af515){try{molpayPaymentDetails=JSON[_0x0c23('0x1f')](_0x5f71fa);}catch(_0x48bd3b){molpayPaymentDetails=_0x5f71fa;}molpayPaymentDetails['module_id']=moduleId,molpayPaymentDetails['wrapper_version']=wrapperVersion,transactionResultCallback=_0x3af515,molpayTransactionRequestFrame=document[_0x0c23('0x47')](_0x0c23('0x48'));var _0x2ad1bf=function(_0x599cc4){molpayTransactionRequestFrame['contentWindow'][_0x0c23('0x49')](molpayPaymentDetails,inAppCallback),molpayTransactionRequestFrame[_0x0c23('0x4a')](_0x0c23('0x4b'),_0x2ad1bf);};molpayTransactionRequestFrame['id']=_0x0c23('0x50'),molpayTransactionRequestFrame[_0x0c23('0x4f')]=_0x0c23('0x51'),molpayTransactionRequestFrame[_0x0c23('0x52')](_0x0c23('0x53'),molpaySdkUrl),hideFrame(molpayTransactionRequestFrame),document[_0x0c23('0x54')][_0x0c23('0x55')](molpayTransactionRequestFrame),molpayTransactionRequestFrame[_0x0c23('0x26')](_0x0c23('0x4b'),_0x2ad1bf);},MOLPay[_0x0c23('0x2')][_0x0c23('0x56')]=function(){mainUiFrame[_0x0c23('0x21')][_0x0c23('0x57')]();},MOLPay['prototype'][_0x0c23('0x58')]=function(_0x377c23,_0xa8d85c){_0xa8d85c&&(testMerchantCredentialsCallback=_0xa8d85c),molpayCredentialsRequestFrame=document[_0x0c23('0x47')](_0x0c23('0x48'));var _0x10fbc4=function(_0x502e4c){molpayCredentialsRequestFrame[_0x0c23('0x21')]['testMerchantCredentials'](_0x377c23,onTestMerchantCredentialsDone),molpayCredentialsRequestFrame[_0x0c23('0x4a')](_0x0c23('0x4b'),_0x10fbc4);};molpayCredentialsRequestFrame[_0x0c23('0x4f')]=_0x0c23('0x51'),molpayCredentialsRequestFrame[_0x0c23('0x52')](_0x0c23('0x53'),molpaySdkUrl),hideFrame(molpayCredentialsRequestFrame),document[_0x0c23('0x54')]['appendChild'](molpayCredentialsRequestFrame),molpayCredentialsRequestFrame[_0x0c23('0x26')](_0x0c23('0x4b'),_0x10fbc4);},MOLPay[_0x0c23('0x2')][_0x0c23('0x59')]=function(_0x198c4f,_0xa58c63){_0xa58c63&&(testMerchantChannelsCallback=_0xa58c63),molpayChannelsRequestFrame=document[_0x0c23('0x47')](_0x0c23('0x48'));var _0x241626=function(_0x12d0ee){molpayChannelsRequestFrame[_0x0c23('0x21')][_0x0c23('0x59')](_0x198c4f,onTestMerchantChannelsDone),molpayChannelsRequestFrame[_0x0c23('0x4a')](_0x0c23('0x4b'),_0x241626);};molpayChannelsRequestFrame[_0x0c23('0x4f')]='always',molpayChannelsRequestFrame[_0x0c23('0x52')](_0x0c23('0x53'),molpaySdkUrl),hideFrame(molpayChannelsRequestFrame),document[_0x0c23('0x54')]['appendChild'](molpayChannelsRequestFrame),molpayChannelsRequestFrame[_0x0c23('0x26')](_0x0c23('0x4b'),_0x241626);};var molpay=new MOLPay();module[_0x0c23('0x5a')]=molpay;