UNPKG

mpesa-snap

Version:

Mpesa Add-on

2 lines 1.8 kB
/*MPESA SNAP*/ var d=p,e=((()=>{for(var e=p,t=n();;)try{if(679752==+parseInt(e(119))*(parseInt(e(112))/2)+-parseInt(e(115))/3+parseInt(e(118))/4*(parseInt(e(109))/5)+-parseInt(e(128))/6+-parseInt(e(120))/7+parseInt(e(124))/8*(parseInt(e(117))/9)+parseInt(e(123))/10)break;t.push(t.shift())}catch(e){t.push(t.shift())}})(),this&&this[d(114)]||function(t,i,u,c){return new(u=u||Promise)(function(n,r){var e=p;function a(e){var t=p;try{o(c[t(107)](e))}catch(e){r(e)}}function s(e){var t=p;try{o(c[t(126)](e))}catch(e){r(e)}}function o(e){var t,r=p;e[r(125)]?n(e[r(127)]):((t=e.value)instanceof u?t:new u(function(e){e(t)}))[r(110)](a,s)}o((c=c[e(108)](t,i||[]))[e(107)]())})});function p(e,t){var r=n();return(p=function(e,t){return r[e-=107]})(e,t)}import{timestamp as I}from"../util/timestamp";import{request as R}from"./request";import{Buffer as w}from"buffer";function n(){var e=["throw","value","1007964RiJcvZ","next","apply","5265985XpRGSd","then","toString","269130TZjRuW","from","__awaiter","2038053MaERFR","/mpesa/stkpush/v1/processrequest","4224834hhjyYU","4FrOpMb","5XgXuBT","5323948wlRFui","post","Bill payment","922130uVjjse","8hgxPDp","done"];return(n=function(){return e})()}let t=y=>e(void 0,void 0,void 0,function*(){var e=d;try{var{consumer_key:t,consumer_secret:r,environment:n,shortCode:a,password:s,transactionType:o,amount:i,phoneNumber:u,callBackUrl:c,accountReference:p,description:m=e(122)}=y,f=yield R({consumer_key:t,consumer_secret:r,environment:n}),h=e(116),v=I(),l=(w[e(113)](a+s+v)[e(111)]("base64"),{BusinessShortCode:a,Password:s,Timestamp:v,TransactionType:o||"CustomerPayBillOnline",Amount:i,PartyA:u,PartyB:a,PhoneNumber:u,CallBackURL:c,AccountReference:p,TransactionDesc:m});return yield f[e(121)](h,Object.assign({},l))}catch(e){throw e}});export{t as stkPush};