UNPKG

@codemoon/phonepe-lib

Version:
1 lines • 6.65 kB
const a0_0xb4ad70=a0_0x26b0;(function(_0x47d82a,_0x5dd740){const _0x4f98f2=a0_0x26b0,_0x343f51=_0x47d82a();while(!![]){try{const _0x2380da=-parseInt(_0x4f98f2(0x111))/0x1*(parseInt(_0x4f98f2(0xe7))/0x2)+-parseInt(_0x4f98f2(0x10c))/0x3+-parseInt(_0x4f98f2(0xfd))/0x4+parseInt(_0x4f98f2(0x105))/0x5*(parseInt(_0x4f98f2(0xe1))/0x6)+-parseInt(_0x4f98f2(0x109))/0x7+-parseInt(_0x4f98f2(0xfb))/0x8*(parseInt(_0x4f98f2(0xe2))/0x9)+parseInt(_0x4f98f2(0x107))/0xa*(parseInt(_0x4f98f2(0x101))/0xb);if(_0x2380da===_0x5dd740)break;else _0x343f51['push'](_0x343f51['shift']());}catch(_0x2a03dc){_0x343f51['push'](_0x343f51['shift']());}}}(a0_0x49d3,0x2eb06));const uniqid=require(a0_0xb4ad70(0xf3)),sha256=require(a0_0xb4ad70(0xeb)),axios=require(a0_0xb4ad70(0x113)),PHONE_Test_Pay_HOST_URL=a0_0xb4ad70(0xdc),PHONE_Live_Pay_HOST_URL=a0_0xb4ad70(0xee);var word=a0_0xb4ad70(0x102)+uniqid();function phonePe(){return word;}async function phonePePayAmount(_0x50b758,_0x35cab6,_0x320c31,_0x1eaf05,_0x18adfe,_0x198991,_0x188cea,_0x1deb99){const _0x54a679=a0_0xb4ad70,_0x32dde7={'wacpM':function(_0xd66b41){return _0xd66b41();},'lTQyG':function(_0x56a4e5,_0x457ee6){return _0x56a4e5*_0x457ee6;},'Rnhqz':_0x54a679(0xf9),'KvXPi':_0x54a679(0xdb),'cUAiT':'base64','tmULX':function(_0x336334,_0x5e8c40){return _0x336334+_0x5e8c40;},'NlkRK':_0x54a679(0xef),'ahikG':function(_0x251fd0,_0x38ee95){return _0x251fd0+_0x38ee95;},'zXwUT':function(_0xafb251,_0x2549bf){return _0xafb251+_0x2549bf;},'JtGre':_0x54a679(0x10e),'UBbKI':_0x54a679(0xf7)};try{let _0x69422d=_0x32dde7[_0x54a679(0x104)](uniqid),_0x59e8fd={'merchantId':_0x198991,'merchantTransactionId':_0x69422d,'merchantUserId':_0x320c31,'amount':_0x32dde7[_0x54a679(0xf2)](_0x35cab6,0x64),'redirectUrl':_0x1eaf05+'payment/validate/'+_0x69422d,'redirectMode':_0x32dde7['Rnhqz'],'mobileNumber':_0x18adfe,'paymentInstrument':{'type':_0x32dde7['KvXPi']}},_0x1cf075=Buffer[_0x54a679(0x112)](JSON['stringify'](_0x59e8fd),_0x54a679(0xf5))[_0x54a679(0xf4)](_0x32dde7[_0x54a679(0x110)]),_0x133692=_0x32dde7[_0x54a679(0xea)](_0x32dde7[_0x54a679(0xea)](_0x1cf075,_0x32dde7['NlkRK']),_0x1deb99),_0x39d14c=_0x32dde7[_0x54a679(0xfe)](_0x32dde7[_0x54a679(0x108)](sha256(_0x133692),_0x32dde7[_0x54a679(0xde)]),_0x188cea);var _0x19cef8=_0x50b758?PHONE_Live_Pay_HOST_URL:PHONE_Test_Pay_HOST_URL;let _0x363031=await axios[_0x54a679(0x103)](_0x19cef8+'/pg/v1/pay',{'request':_0x1cf075},{'headers':{'Content-Type':_0x32dde7[_0x54a679(0xed)],'X-VERIFY':_0x39d14c,'accept':'application/json'}});return{'success':!![],'transactionId':_0x69422d,'redirectUrl':_0x363031[_0x54a679(0xf6)][_0x54a679(0xf6)]['instrumentResponse'][_0x54a679(0x10d)][_0x54a679(0xe8)],'rawResponse':_0x363031[_0x54a679(0xf6)]};}catch(_0x41d8aa){return{'success':![],'error':_0x41d8aa};}}function a0_0x49d3(){const _0x2459fc=['https://api.phonepe.com/apis/hermes','/pg/v1/pay','ePtlP','eIeaT','lTQyG','uniqid','toString','utf8','data','application/json','YQLcp','REDIRECT','Failed','24IwIHEV','base64','789148cNcojh','ahikG','/pg/v1/refund','LUIKg','275XnrocE','this\x20is\x20Phonepe\x20Integration\x20Code\x20','post','wacpM','9605wMGYSV','fSXUR','383260jKgPqS','zXwUT','1481718PBVRgo','eDxoL','GFAdQ','750474yRyroS','redirectInfo','###','Failed\x20or\x20Pending','cUAiT','1IWdJrE','from','axios','WOZrB','PAY_PAGE','https://api-preprod.phonepe.com/apis/pg-sandbox','sHNWn','JtGre','/pg/v1/status/','bdPKX','642vAKvEB','354087KWXDrM','KrUTO','stringify','yDigb','get','390622Hdsqac','url','KBkUE','tmULX','sha256','Success','UBbKI'];a0_0x49d3=function(){return _0x2459fc;};return a0_0x49d3();}function a0_0x26b0(_0x232bdb,_0x1a7daf){const _0x49d3d5=a0_0x49d3();return a0_0x26b0=function(_0x26b07f,_0x400bd9){_0x26b07f=_0x26b07f-0xda;let _0x4c1f44=_0x49d3d5[_0x26b07f];return _0x4c1f44;},a0_0x26b0(_0x232bdb,_0x1a7daf);}async function phonePeCheckMerchantId(_0x167d68,_0x3d361a,_0x4b6d8d,_0x2b56b5,_0x6a7e65){const _0x456d05=a0_0xb4ad70,_0x2842ed={'GFAdQ':'Invalid\x20transaction\x20ID','YQLcp':function(_0x2b3211,_0x352720){return _0x2b3211+_0x352720;},'KBkUE':function(_0x47303d,_0x57173d){return _0x47303d+_0x57173d;},'LUIKg':_0x456d05(0x10e),'eIeaT':_0x456d05(0xf7)};try{if(!_0x3d361a)return{'success':![],'error':_0x2842ed[_0x456d05(0x10b)]};var _0x464fb0=_0x167d68?PHONE_Live_Pay_HOST_URL:PHONE_Test_Pay_HOST_URL;let _0x336401=_0x464fb0+_0x456d05(0xdf)+_0x4b6d8d+'/'+_0x3d361a,_0x209af3=_0x456d05(0xdf)+_0x4b6d8d+'/'+_0x3d361a+_0x6a7e65,_0xcb265b=_0x2842ed[_0x456d05(0xf8)](_0x2842ed[_0x456d05(0xe9)](sha256(_0x209af3),_0x2842ed[_0x456d05(0x100)]),_0x2b56b5),_0x3f41f9=await axios[_0x456d05(0xe6)](_0x336401,{'headers':{'Content-Type':'application/json','X-VERIFY':_0xcb265b,'X-MERCHANT-ID':_0x3d361a,'accept':_0x2842ed[_0x456d05(0xf1)]}});return{'success':!![],'data':_0x3f41f9['data']};}catch(_0x2abc32){return{'success':![],'error':_0x2abc32};}}async function phonePePayRefundCheck(_0x4c5fa5,_0x4b00c2,_0x38c0ba,_0x9d7cc6,_0x3d9551,_0x503f89,_0x303a76,_0x18c135,_0x5e9ada){const _0xedf72e=a0_0xb4ad70,_0x4bd7dd={'fSXUR':function(_0x1973c3,_0x5acf03){return _0x1973c3*_0x5acf03;},'WOZrB':_0xedf72e(0xfc),'KrUTO':function(_0x45559d,_0x5bfc3c){return _0x45559d+_0x5bfc3c;},'HmPoM':_0xedf72e(0xff),'yDigb':function(_0x6be689,_0x5b3371){return _0x6be689+_0x5b3371;},'bdPKX':function(_0x351e4d,_0x423a0d){return _0x351e4d(_0x423a0d);},'sHNWn':_0xedf72e(0xf7),'eDxoL':_0xedf72e(0xec),'ePtlP':_0xedf72e(0x10f)};try{var _0x241804=_0x4c5fa5?PHONE_Live_Pay_HOST_URL:PHONE_Test_Pay_HOST_URL;let _0xb3043c={'merchantId':_0x38c0ba,'merchantUserId':_0x9d7cc6,'merchantTransactionId':''+_0x3d9551,'originalTransactionId':''+_0x503f89,'amount':_0x4bd7dd[_0xedf72e(0x106)](_0x4b00c2,0x64),'callbackUrl':''+_0x303a76},_0x5b4684=Buffer[_0xedf72e(0x112)](JSON[_0xedf72e(0xe4)](_0xb3043c))[_0xedf72e(0xf4)](_0x4bd7dd[_0xedf72e(0xda)]),_0x319cc1=_0x4bd7dd[_0xedf72e(0xe3)](_0x4bd7dd[_0xedf72e(0xe3)](_0x5b4684,_0x4bd7dd['HmPoM']),_0x18c135),_0x5cfc6b=_0x4bd7dd[_0xedf72e(0xe5)](_0x4bd7dd[_0xedf72e(0xe3)](_0x4bd7dd[_0xedf72e(0xe0)](sha256,_0x319cc1),'###'),_0x5e9ada),_0x1f7a79=await axios['post'](_0x241804+_0xedf72e(0xff),{'request':_0x5b4684},{'headers':{'Content-Type':_0x4bd7dd['sHNWn'],'X-VERIFY':_0x5cfc6b,'accept':_0x4bd7dd[_0xedf72e(0xdd)]}});return _0x1f7a79[_0xedf72e(0xf6)]['success']?{'status':_0x4bd7dd[_0xedf72e(0x10a)],'details':_0x1f7a79[_0xedf72e(0xf6)]}:{'status':_0x4bd7dd[_0xedf72e(0xf0)],'details':_0x1f7a79[_0xedf72e(0xf6)]};}catch(_0x2d3517){return{'success':_0xedf72e(0xfa),'error':_0x2d3517};}}module['exports']={'phonePe':phonePe,'phonePePayAmount':phonePePayAmount,'phonePeCheckMerchantId':phonePeCheckMerchantId,'phonePePayRefundCheck':phonePePayRefundCheck};