mpesa-snap
Version:
Mpesa Add-on
2 lines • 1.79 kB
JavaScript
/*MPESA SNAP*/
var f=c,t=((()=>{for(var t=c,e=n();;)try{if(711547==+parseInt(t(316))*(-parseInt(t(298))/2)+parseInt(t(307))/3*(-parseInt(t(311))/4)+parseInt(t(310))/5+-parseInt(t(320))/6*(-parseInt(t(319))/7)+-parseInt(t(317))/8+parseInt(t(315))/9*(parseInt(t(296))/10)+-parseInt(t(303))/11)break;e.push(e.shift())}catch(t){e.push(e.shift())}})(),this&&this[f(299)]||function(t,e,i,u){return new(i=i||Promise)(function(n,r){function a(t){var e=c;try{s(u[e(308)](t))}catch(t){r(t)}}function o(t){var e=c;try{s(u[e(306)](t))}catch(t){r(t)}}function s(t){var e,r=c;t[r(314)]?n(t.value):((e=t[r(313)])instanceof i?e:new i(function(t){t(e)})).then(a,o)}s((u=u.apply(t,e||[])).next())})});import{request as h}from"./request";function c(t,e){var r=n();return(c=function(t,e){return r[t-=296]})(t,e)}import{randomBytes as v}from"node:crypto";function n(){var t=["occassion","throw","217437xtCmAJ","next","assign","2056355jfowNT","4YbfJAh","timeoutCallbackUrl","value","done","4656699tBlCKh","23857NWhTeB","6560384ZuJGRA","remarks","2836729YfvOic","12Gefyoc","10LgbLXL","toString","10SZFppm","__awaiter","hex","BusinessPayment","initiatorID","173987mkeKPu","resultCallbackUrl"];return(n=function(){return t})()}let e=p=>t(void 0,void 0,void 0,function*(){var t=f;try{var{consumer_key:e,consumer_secret:r,environment:n}=p,a=yield h({consumer_key:e,consumer_secret:r,environment:n}),{security_credentials:o,commandID:s=t(301),amount:i,shortCode:u,phoneNumber:c}=p,m={OriginatorConversationID:v(10)[t(297)](t(300)),InitiatorName:p[t(302)]||"testapi",SecurityCredential:o,CommandID:s,Amount:i,PartyA:u,PartyB:c,Remarks:p[t(318)],QueueTimeOutURL:p[t(312)],ResultURL:p[t(304)],Occassion:p[t(305)]};return yield a.post("/mpesa/b2c/v3/paymentrequest",Object[t(309)]({},m))}catch(t){throw t}});export{e as b2c};