react-native-bynn-sdk
Version:
Bynn Mobile SDK for React Native - Identity verification and KYC
1 lines • 13.3 kB
JavaScript
;const _0xdab9b9=_0xc243;(function(_0x3b22fe,_0x1351b2){const _0x201457=_0xc243,_0x236df5=_0x3b22fe();while(!![]){try{const _0x2d3b09=-parseInt(_0x201457(0x18e))/0x1*(-parseInt(_0x201457(0x179))/0x2)+parseInt(_0x201457(0x194))/0x3+parseInt(_0x201457(0x1ac))/0x4*(-parseInt(_0x201457(0x191))/0x5)+-parseInt(_0x201457(0x1a3))/0x6*(-parseInt(_0x201457(0x192))/0x7)+-parseInt(_0x201457(0x18c))/0x8*(parseInt(_0x201457(0x1b2))/0x9)+parseInt(_0x201457(0x18a))/0xa*(-parseInt(_0x201457(0x199))/0xb)+parseInt(_0x201457(0x19a))/0xc*(-parseInt(_0x201457(0x1a6))/0xd);if(_0x2d3b09===_0x1351b2)break;else _0x236df5['push'](_0x236df5['shift']());}catch(_0x2ba2ed){_0x236df5['push'](_0x236df5['shift']());}}}(_0x73ca,0x68f5d));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0xdab9b9(0x180)]=exports[_0xdab9b9(0x182)]=exports[_0xdab9b9(0x1b9)]=exports['uploadMedia']=exports['updateAgeVerificationLiveness']=exports['submitPhoneVerification']=exports['submitFundsVerification']=exports[_0xdab9b9(0x1b5)]=exports[_0xdab9b9(0x1aa)]=exports['submitAddressVerification']=exports['startLivenessCheck']=exports[_0xdab9b9(0x1af)]=exports[_0xdab9b9(0x196)]=exports['completeLivenessCheck']=exports[_0xdab9b9(0x183)]=void 0x0;function _0xc243(_0xa8ffa3,_0xf27a90){const _0x73cae7=_0x73ca();return _0xc243=function(_0xc2438c,_0xb9214d){_0xc2438c=_0xc2438c-0x178;let _0x2fc294=_0x73cae7[_0xc2438c];return _0x2fc294;},_0xc243(_0xa8ffa3,_0xf27a90);}const createSession=async _0xcd79ed=>{const _0x928495=_0xdab9b9;console[_0x928495(0x17b)]('Creating\x20session\x20with:',{'apiKey':_0xcd79ed[_0x928495(0x19c)],'body':{'kyc_level':_0xcd79ed['kycLevel'],'first_name':_0xcd79ed['firstName'],'last_name':_0xcd79ed['lastName'],'unique_id':_0xcd79ed[_0x928495(0x1a2)],'phone_number':_0xcd79ed[_0x928495(0x19d)],'email':_0xcd79ed['email']}});const _0x4ade87=await fetch('https://api.bynn.com/v1/sessions',{'method':'POST','headers':{'accept':'application/json','content-type':'application/json','Authorization':_0xcd79ed[_0x928495(0x19c)]},'body':JSON['stringify']({'kyc_level':_0xcd79ed[_0x928495(0x17a)],'first_name':_0xcd79ed[_0x928495(0x19b)],'last_name':_0xcd79ed['lastName'],'unique_id':_0xcd79ed['uniqueId'],'phone_number':_0xcd79ed[_0x928495(0x19d)],'email':_0xcd79ed[_0x928495(0x198)]})});if(!_0x4ade87['ok'])throw new Error('Failed\x20to\x20create\x20session:\x20'+_0x4ade87[_0x928495(0x19f)]);const _0x41328a=await _0x4ade87[_0x928495(0x1a1)]();return console[_0x928495(0x17b)](_0x41328a),_0x41328a;};exports[_0xdab9b9(0x196)]=createSession;const submitConsent=async(_0x1c5f9e,_0x564668)=>{const _0x2b9ac4=_0xdab9b9;console[_0x2b9ac4(0x17b)](_0x2b9ac4(0x1a8),_0x1c5f9e,_0x564668);const _0x795243={'method':'PATCH','headers':{'accept':_0x2b9ac4(0x1ab),'content-type':'application/json'},'body':JSON['stringify']({'gives_consent':!![]})};try{const _0x13514c=await fetch('https://api.bynn.com/v1/sessions/'+_0x1c5f9e+'/consent',_0x795243);console[_0x2b9ac4(0x17b)](_0x2b9ac4(0x17d)+JSON['stringify'](_0x13514c));if(!_0x13514c['ok'])throw new Error(_0x2b9ac4(0x18f)+_0x13514c['status']);return _0x13514c[_0x2b9ac4(0x1a1)]();}catch(_0x428a0d){console['error'](_0x428a0d);const _0x23b7b9=typeof _0x428a0d===_0x2b9ac4(0x181)&&_0x428a0d!==null&&_0x2b9ac4(0x1ad)in _0x428a0d?_0x428a0d[_0x2b9ac4(0x1ad)]:String(_0x428a0d);throw new Error(_0x2b9ac4(0x197)+_0x23b7b9);}};exports['submitConsent']=submitConsent;const uploadMedia=async(_0x49d7c5,_0x420c79,_0x30290f)=>{const _0xfd9bbd=_0xdab9b9,_0x156842={'method':'POST','headers':{'accept':_0xfd9bbd(0x1ab),'content-type':'application/json'},'body':JSON[_0xfd9bbd(0x195)]({'app_screen':_0x30290f,'media_base64_strict':_0x420c79})};try{const _0x12bd8e=await fetch('https://api.bynn.com/v1/sessions/'+_0x49d7c5+'/media',_0x156842);if(!_0x12bd8e['ok'])throw new Error(_0xfd9bbd(0x186)+_0x12bd8e[_0xfd9bbd(0x19f)]);return _0x12bd8e['json']();}catch(_0x4e46cc){console['error'](_0x4e46cc);throw new Error(_0xfd9bbd(0x1b3)+_0x4e46cc?.['message']);}};exports[_0xdab9b9(0x184)]=uploadMedia;const submitPhoneVerification=async(_0x9bb39f,_0x531f80)=>{const _0x23facd=_0xdab9b9,_0x2865e7={'method':_0x23facd(0x1a0),'headers':{'accept':_0x23facd(0x1ab),'content-type':'application/json'},'body':JSON['stringify']({'phone_number':_0x531f80})};console[_0x23facd(0x17b)](_0x531f80,_0x9bb39f);try{const _0x4af380=await fetch(_0x23facd(0x18b)+_0x9bb39f+_0x23facd(0x187),_0x2865e7);if(!_0x4af380['ok']){console['log'](_0x4af380);throw new Error(_0x23facd(0x178)+_0x4af380['status']);}return _0x4af380['json']();}catch(_0x1b2999){console['error'](_0x1b2999);throw new Error('Failed\x20to\x20submit\x20phone\x20verification:\x20'+_0x1b2999?.['message']);}};exports['submitPhoneVerification']=submitPhoneVerification;const verifyPhoneCode=async(_0x28bfa7,_0x59a1db)=>{const _0x1601bf=_0xdab9b9,_0x2c5ae1={'method':'PATCH','headers':{'accept':_0x1601bf(0x1ab),'content-type':_0x1601bf(0x1ab)},'body':JSON['stringify']({'code':_0x59a1db})};console['log'](_0x59a1db,_0x28bfa7);try{const _0x4f4217=await fetch(_0x1601bf(0x18b)+_0x28bfa7+'/phone_verification',_0x2c5ae1);console['log'](_0x4f4217);if(!_0x4f4217['ok'])throw new Error('Phone\x20code\x20verification\x20failed:\x20'+_0x4f4217['status']);return _0x4f4217[_0x1601bf(0x1a1)]();}catch(_0x4a2aa3){console['error'](_0x4a2aa3);throw new Error(_0x1601bf(0x1b4)+_0x4a2aa3?.[_0x1601bf(0x1ad)]);}};exports[_0xdab9b9(0x180)]=verifyPhoneCode;const submitEmailVerification=async(_0x4708d3,_0x3322db)=>{const _0x5e41e3=_0xdab9b9;console[_0x5e41e3(0x17b)](_0x4708d3,_0x3322db);const _0x46d627={'method':_0x5e41e3(0x1a0),'headers':{'accept':'application/json','content-type':_0x5e41e3(0x1ab)},'body':JSON['stringify']({'email_address':_0x3322db})};try{const _0x8aa5dc=await fetch(_0x5e41e3(0x18b)+_0x4708d3+'/email_verification',_0x46d627);if(!_0x8aa5dc['ok'])throw new Error('Email\x20verification\x20failed:\x20'+_0x8aa5dc[_0x5e41e3(0x19f)]);return _0x8aa5dc[_0x5e41e3(0x1a1)]();}catch(_0x2a88e3){console[_0x5e41e3(0x18d)](_0x2a88e3);throw new Error(_0x5e41e3(0x17f)+_0x2a88e3?.['message']);}};exports[_0xdab9b9(0x1b5)]=submitEmailVerification;const verifyEmailCode=async(_0x5c286d,_0x31e779)=>{const _0x3b55d6=_0xdab9b9,_0xce39c7={'method':_0x3b55d6(0x190),'headers':{'accept':_0x3b55d6(0x1ab),'content-type':_0x3b55d6(0x1ab)},'body':JSON[_0x3b55d6(0x195)]({'code':_0x31e779})};try{const _0xa37543=await fetch('https://api.bynn.com/v1/sessions/'+_0x5c286d+'/email_verification',_0xce39c7);if(!_0xa37543['ok'])throw new Error('Email\x20code\x20verification\x20failed:\x20'+_0xa37543['status']);return _0xa37543['json']();}catch(_0x7ac4de){console[_0x3b55d6(0x18d)](_0x7ac4de);throw new Error('Failed\x20to\x20verify\x20email\x20code:\x20'+_0x7ac4de?.['message']);}};exports['verifyEmailCode']=verifyEmailCode;const submitAddressVerification=async(_0x472633,_0x4672bd,_0x27a048)=>{const _0x16e755=_0xdab9b9;console['log'](_0x16e755(0x1a5),_0x472633,_0x4672bd);const _0x2efc9d={'method':_0x16e755(0x1a0),'headers':{'accept':_0x16e755(0x1ab),'content-type':_0x16e755(0x1ab)},'body':JSON['stringify']({'document_base64_strict':_0x4672bd,'latitude':37.4316,'longitude':78.6569})};console['log']('--->>',_0x472633);try{const _0x5ae72d=await fetch('https://api.bynn.com/v1/sessions/'+_0x472633+_0x16e755(0x1b0),_0x2efc9d);if(!_0x5ae72d['ok'])throw new Error('Address\x20verification\x20failed:\x20'+_0x5ae72d['status']);return _0x5ae72d['json']();}catch(_0x30a769){console[_0x16e755(0x18d)](_0x30a769);throw new Error('Failed\x20to\x20submit\x20address\x20verification:\x20'+_0x30a769?.[_0x16e755(0x1ad)]);}};exports[_0xdab9b9(0x1b7)]=submitAddressVerification;const submitFundsVerification=async(_0xb6b90e,_0x5c2b2f,_0xdb39b9)=>{const _0x268381=_0xdab9b9,_0x280b9a={'method':'POST','headers':{'accept':_0x268381(0x1ab),'content-type':_0x268381(0x1ab)},'body':JSON['stringify']({'document_base64_strict':_0x5c2b2f})};console['log']('===>',_0xb6b90e,_0xdb39b9);try{const _0x15cdc1=await fetch(_0x268381(0x18b)+_0xb6b90e+_0x268381(0x1a4),_0x280b9a);if(!_0x15cdc1['ok'])throw new Error('Funds\x20verification\x20failed:\x20'+_0x15cdc1['status']);return _0x15cdc1[_0x268381(0x1a1)]();}catch(_0x4797f5){console['error'](_0x4797f5);throw new Error(_0x268381(0x193)+_0x4797f5?.[_0x268381(0x1ad)]);}};exports[_0xdab9b9(0x1a9)]=submitFundsVerification;const startLivenessCheck=async _0x2999fd=>{const _0x141bc1=_0xdab9b9,_0x4b68a0={'method':'POST','headers':{'accept':'application/json'}};try{const _0x2f3e4f=await fetch(_0x141bc1(0x18b)+_0x2999fd+_0x141bc1(0x17c),_0x4b68a0);if(!_0x2f3e4f['ok'])throw new Error(_0x141bc1(0x19e)+_0x2f3e4f[_0x141bc1(0x19f)]);return _0x2f3e4f[_0x141bc1(0x1a1)]();}catch(_0xe69620){console['error'](_0xe69620);throw new Error('Failed\x20to\x20start\x20liveness\x20check:\x20'+_0xe69620?.['message']);}};exports['startLivenessCheck']=startLivenessCheck;const completeLivenessCheck=async _0x14648b=>{const _0x1a3005=_0xdab9b9,_0x53e342={'method':_0x1a3005(0x1a0),'headers':{'accept':'application/json'}};try{const _0x42e0e1=await fetch(_0x1a3005(0x18b)+_0x14648b+'/liveness/complete',_0x53e342);if(!_0x42e0e1['ok'])throw new Error('Liveness\x20check\x20failed\x20to\x20complete:\x20'+_0x42e0e1[_0x1a3005(0x19f)]);return _0x42e0e1['json']();}catch(_0x28a498){console[_0x1a3005(0x18d)](_0x28a498);throw new Error('Failed\x20to\x20complete\x20liveness\x20check:\x20'+_0x28a498?.[_0x1a3005(0x1ad)]);}};exports['completeLivenessCheck']=completeLivenessCheck;const verifyAgeWithLiveness=async(_0x468693,_0x551af3)=>{const _0x3c2c83=_0xdab9b9,_0x182bc5={'method':_0x3c2c83(0x1a0),'headers':{'accept':'application/json','content-type':'application/json','Authorization':_0x551af3},'body':JSON['stringify']({'unique_id':_0x468693})};try{const _0x16192f=await fetch(_0x3c2c83(0x185),_0x182bc5);if(!_0x16192f['ok'])throw new Error(_0x3c2c83(0x188)+_0x16192f['status']);return _0x16192f['json']();}catch(_0x450948){console['error'](_0x450948);throw new Error(_0x3c2c83(0x1b8)+_0x450948?.[_0x3c2c83(0x1ad)]);}};exports[_0xdab9b9(0x1b9)]=verifyAgeWithLiveness;function _0x73ca(){const _0x4106f4=['PATCH','5sFhsQk','7HDJOps','Failed\x20to\x20submit\x20funds\x20verification:\x20','2261295NciRPc','stringify','createSession','Failed\x20to\x20submit\x20consent:\x20','email','22emuqlb','10865868ILZtqX','firstName','apiKey','phoneNumber','Liveness\x20check\x20failed\x20to\x20start:\x20','status','POST','json','uniqueId','4317894DdErMX','/funds_verification','--->>','13sZYLZK','Failed\x20to\x20complete\x20age\x20verification:\x20','CALL','submitFundsVerification','submitConsent','application/json','738532gDrItz','message','GET','getAgeVerificationLiveness','/address_verification','Age\x20verification\x20retrieval\x20failed:\x20','235701KhGExr','Failed\x20to\x20upload\x20media:\x20','Failed\x20to\x20verify\x20phone\x20code:\x20','submitEmailVerification','Failed\x20to\x20update\x20age\x20verification:\x20','submitAddressVerification','Failed\x20to\x20verify\x20age\x20with\x20liveness:\x20','verifyAgeWithLiveness','Phone\x20verification\x20failed:\x20','1431774lGzozq','kycLevel','log','/liveness/start','response\x20is','https://api.bynn.com/v1/age_verification/liveness/','Failed\x20to\x20submit\x20email\x20verification:\x20','verifyPhoneCode','object','verifyEmailCode','completeAgeVerificationLiveness','uploadMedia','https://api.bynn.com/v1/age_verification/liveness','Media\x20upload\x20failed:\x20','/phone_verification','Age\x20verification\x20failed:\x20','/complete','2560640AMMybs','https://api.bynn.com/v1/sessions/','48zQUjys','error','1bykJqN','Consent\x20failed:\x20'];_0x73ca=function(){return _0x4106f4;};return _0x73ca();}const updateAgeVerificationLiveness=async _0x29e408=>{const _0x4cf6f3=_0xdab9b9,_0x19512b={'method':_0x4cf6f3(0x190),'headers':{'accept':'application/json'}};try{const _0x4a3761=await fetch('https://api.bynn.com/v1/age_verification/liveness/'+_0x29e408,_0x19512b);if(!_0x4a3761['ok'])throw new Error('Age\x20verification\x20update\x20failed:\x20'+_0x4a3761[_0x4cf6f3(0x19f)]);return _0x4a3761[_0x4cf6f3(0x1a1)]();}catch(_0x5d3aec){console[_0x4cf6f3(0x18d)](_0x5d3aec);throw new Error(_0x4cf6f3(0x1b6)+_0x5d3aec?.['message']);}};exports['updateAgeVerificationLiveness']=updateAgeVerificationLiveness;const completeAgeVerificationLiveness=async _0x244db8=>{const _0x10bae0=_0xdab9b9,_0x3d7544={'method':_0x10bae0(0x1ae),'headers':{'accept':'application/json'}};try{const _0x39253d=await fetch(_0x10bae0(0x17e)+_0x244db8+_0x10bae0(0x189),_0x3d7544);if(!_0x39253d['ok'])throw new Error('Age\x20verification\x20completion\x20failed:\x20'+_0x39253d['status']);return _0x39253d[_0x10bae0(0x1a1)]();}catch(_0x1416c6){console['error'](_0x1416c6);throw new Error(_0x10bae0(0x1a7)+_0x1416c6?.['message']);}};exports[_0xdab9b9(0x183)]=completeAgeVerificationLiveness;const getAgeVerificationLiveness=async _0x22733c=>{const _0x9b64e3=_0xdab9b9,_0x229ac2={'method':'GET','headers':{'accept':'application/json'}};try{const _0x5570cf=await fetch('https://api.bynn.com/v1/age_verification/liveness/'+_0x22733c,_0x229ac2);if(!_0x5570cf['ok'])throw new Error(_0x9b64e3(0x1b1)+_0x5570cf['status']);return _0x5570cf['json']();}catch(_0x430897){console[_0x9b64e3(0x18d)](_0x430897);throw new Error('Failed\x20to\x20get\x20age\x20verification:\x20'+_0x430897?.[_0x9b64e3(0x1ad)]);}};exports[_0xdab9b9(0x1af)]=getAgeVerificationLiveness;