@advisoa/gateway-clients
Advanced tools
Comparing version 1.0.20 to 1.0.21
@@ -1,1 +0,1 @@ | ||
var A=Object.create;var h=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var g=(o,t)=>{for(var e in t)h(o,e,{get:t[e],enumerable:!0})},m=(o,t,e,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of E(t))!_.call(o,a)&&a!==e&&h(o,a,{get:()=>t[a],enumerable:!(c=P(t,a))||c.enumerable});return o};var y=(o,t,e)=>(e=o!=null?A(I(o)):{},m(t||!o||!o.__esModule?h(e,"default",{value:o,enumerable:!0}):e,o)),S=o=>m(h({},"__esModule",{value:!0}),o);var b={};g(b,{Reepay:()=>u});module.exports=S(b);var r=y(require("node-fetch"));var R={SUCCESS:200,SUCCESS_NEW_RESOURCE:201,SUCCESS_WITHOUT_RESPONSE:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,FORBIDDEN:403,INTERNAL_SERVER:500},d={DEVELOPMENT:"development",PRODUCTION:"production",STAGING:"staging"},T="Something went wrong. Please try again.",N=10,w=1,O=1,v=1,x=0,U=100,f=100,C={API_URL:"https://api.reepay.com/v1",LOGIN:"https://api.reepay.com/v1/authenticate/login",GET_PRIVATE_KEY:"https://api.reepay.com/v1/account/privkey"},L={SESSION_TIMEOUT:3e5},M=100,G={API_URL:"https://manage.quickpay.net/api",AGREEMENT:"https://manage.quickpay.net/api/agreements",ME:"https://manage.quickpay.net/api/me"},$=100,k={TRANSACTIONS:"https://api.onpay.io/v1/transaction",ACQUIRERS:"https://api.onpay.io/v1/acquirer"},K=100,D={AUTH_TOKEN:"https://api.sumup.com/token",TRANSACTIONS:"https://api.sumup.com/v0.1/me/transactions/history",PAYOUTS:"https://api.sumup.com/v0.1/me/financials/payouts",CHECKOUTS:"https://api.sumup.com/v0.1/checkouts",PROFILE:"https://api.sumup.com/v0.1/me/"},Y=100,i={RESPONSE_CODE:R,NODE_ENVIRONMENT:d,SOMETHING_WENT_WRONG:T,PER_PAGE:N,PAGE:w,DEFAULT_PAGE:O,SUCCESS:v,FAIL:x,BULK_CREATE_LIMIT:U,REEPAY_MAX_PAGE_LIMIT:f,REEPAY:C,CLEARHAUS:L,QUICK_PAY_PAGINATION_LIMIT:M,QUICK_PAY_API_URLS:G,ON_PAY_PAGINATION_LIMIT:$,ON_PAY_APIS_URLS:k,SUM_UP_PAGINATION_LIMIT:K,SUM_UP_APIS_URLS:D,PENSOPAY_PER_PAGE_LIMIT:Y};var l=class{static async getTokenAndMerchants(t,e){let a=await(await(0,r.default)("https://api.reepay.com/v1/authenticate/login",{headers:{accept:"application/json, text/plain, */*","accept-language":"da-DK,da;q=0.9","content-type":"application/x-www-form-urlencoded","sec-ch-ua":'"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-site","x-auth-token":"",Referer:"https://app.reepay.com/","Referrer-Policy":"strict-origin-when-cross-origin"},body:`email=${t}&password=${e}`,method:"POST"})).json();return{token:a.token,organisations:a.organisations}}static async generateMerchantAccessKey(t,e,c){let a=await(0,r.default)("https://api.reepay.com/v1/authenticate/login",{headers:{accept:"application/json, text/plain, */*","accept-language":"da-DK,da;q=0.9","content-type":"application/x-www-form-urlencoded","sec-ch-ua":'"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-site","x-auth-token":`${t}`,Referer:"https://app.reepay.com/","Referrer-Policy":"strict-origin-when-cross-origin"},body:`account=${e}&organisation=${c}`,method:"POST"}),{token:n}=await a.json(),p=await(await(0,r.default)("https://api.reepay.com/v1/account/privkey",{headers:{accept:"application/json, text/plain, */*","accept-language":"da-DK,da;q=0.9","sec-ch-ua":'"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-site","x-auth-token":`${n}`},referrer:"https://app.reepay.com/",referrerPolicy:"strict-origin-when-cross-origin",body:null,method:"POST",mode:"cors",credentials:"omit"})).json();process.exit(0)}constructor(t){this.base64PrivateKey=t}async callAPI(t,e,c="GET"){let a=new URLSearchParams({size:i.REEPAY_MAX_PAGE_LIMIT,...e}).toString();try{let n=[],s=await(await(0,r.default)(`${i.REEPAY.API_URL}/${t}${a?`?${a}`:""}`,{method:c,headers:{Authorization:`Basic ${this.base64PrivateKey}`}})).json(),p=s.next_page_token;if(t.indexOf("list/")===-1)return s;for(s.content&&n.push(...s.content);p;)a=new URLSearchParams({size:i.REEPAY_MAX_PAGE_LIMIT,next_page_token:p,...e}).toString(),s=await(await(0,r.default)(`${i.REEPAY.API_URL}/${t}${a?`?${a}`:""}`,{method:c,headers:{Authorization:`Basic ${this.base64PrivateKey}`}})).json(),s.content&&n.push(...s.content),p=s.next_page_token;return n}catch(n){return console.log("error: ",n),null}}async getCustomers(t){return await this.callAPI("list/customer",t)}async getCharges(t){return await this.callAPI("list/charge",t)}async getTransactions(t){return await this.callAPI("list/transactions",t)}async getInvoices(t){return await this.callAPI("list/invoice",t)}async getInvoice(t,e){return await this.callAPI(`invoice/${t}`,e)}async getCharge(t,e){return await this.callAPI(`charge/${t}`,e)}async settleInvoice(t){return await this.callAPI(`charge/${t}/settle`,null,"POST")}async cancelInvoice(t){return await this.callAPI(`charge/${t}/cancel`,null,"POST")}async getPaymentMethods(t){return await this.callAPI("list/payment_method",t)}async getPayouts(t){return await this.callAPI("list/payout",t)}},u=l;0&&(module.exports={Reepay}); | ||
var P=Object.create;var h=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var g=(a,t)=>{for(var e in t)h(a,e,{get:t[e],enumerable:!0})},m=(a,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of I(t))!y.call(a,o)&&o!==e&&h(a,o,{get:()=>t[o],enumerable:!(n=E(t,o))||n.enumerable});return a};var S=(a,t,e)=>(e=a!=null?P(_(a)):{},m(t||!a||!a.__esModule?h(e,"default",{value:a,enumerable:!0}):e,a)),d=a=>m(h({},"__esModule",{value:!0}),a);var b={};g(b,{Reepay:()=>A});module.exports=d(b);var i=S(require("node-fetch"));var T={SUCCESS:200,SUCCESS_NEW_RESOURCE:201,SUCCESS_WITHOUT_RESPONSE:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,FORBIDDEN:403,INTERNAL_SERVER:500},R={DEVELOPMENT:"development",PRODUCTION:"production",STAGING:"staging"},N="Something went wrong. Please try again.",w=10,O=1,v=1,f=1,x=0,U=100,C=100,L={API_URL:"https://api.reepay.com/v1",LOGIN:"https://api.reepay.com/v1/authenticate/login",GET_PRIVATE_KEY:"https://api.reepay.com/v1/account/privkey"},M={SESSION_TIMEOUT:3e5},G=100,$={API_URL:"https://manage.quickpay.net/api",AGREEMENT:"https://manage.quickpay.net/api/agreements",ME:"https://manage.quickpay.net/api/me"},k=100,K={TRANSACTIONS:"https://api.onpay.io/v1/transaction",ACQUIRERS:"https://api.onpay.io/v1/acquirer"},D=100,Y={AUTH_TOKEN:"https://api.sumup.com/token",TRANSACTIONS:"https://api.sumup.com/v0.1/me/transactions/history",PAYOUTS:"https://api.sumup.com/v0.1/me/financials/payouts",CHECKOUTS:"https://api.sumup.com/v0.1/checkouts",PROFILE:"https://api.sumup.com/v0.1/me/"},j=100,p={RESPONSE_CODE:T,NODE_ENVIRONMENT:R,SOMETHING_WENT_WRONG:N,PER_PAGE:w,PAGE:O,DEFAULT_PAGE:v,SUCCESS:f,FAIL:x,BULK_CREATE_LIMIT:U,REEPAY_MAX_PAGE_LIMIT:C,REEPAY:L,CLEARHAUS:M,QUICK_PAY_PAGINATION_LIMIT:G,QUICK_PAY_API_URLS:$,ON_PAY_PAGINATION_LIMIT:k,ON_PAY_APIS_URLS:K,SUM_UP_PAGINATION_LIMIT:D,SUM_UP_APIS_URLS:Y,PENSOPAY_PER_PAGE_LIMIT:j};var u=class{static async getTokenAndMerchants(t,e){let o=await(await(0,i.default)("https://api.reepay.com/v1/authenticate/login",{headers:{accept:"application/json, text/plain, */*","accept-language":"da-DK,da;q=0.9","content-type":"application/x-www-form-urlencoded","sec-ch-ua":'"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-site","x-auth-token":"",Referer:"https://app.reepay.com/","Referrer-Policy":"strict-origin-when-cross-origin"},body:`email=${t}&password=${e}`,method:"POST"})).json();return{token:o.token,organisations:o.organisations}}static async generateMerchantAccessKey(t,e,n){let o=await(0,i.default)("https://api.reepay.com/v1/authenticate/login",{headers:{accept:"application/json, text/plain, */*","accept-language":"da-DK,da;q=0.9","content-type":"application/x-www-form-urlencoded","sec-ch-ua":'"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-site","x-auth-token":`${t}`,Referer:"https://app.reepay.com/","Referrer-Policy":"strict-origin-when-cross-origin"},body:`account=${e}&organisation=${n}`,method:"POST"}),{token:c}=await o.json(),s=await(await(0,i.default)("https://api.reepay.com/v1/account/privkey",{headers:{accept:"application/json, text/plain, */*","accept-language":"da-DK,da;q=0.9","sec-ch-ua":'"Google Chrome";v="111", "Not(A:Brand";v="8", "Chromium";v="111"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-site","x-auth-token":`${c}`},referrer:"https://app.reepay.com/",referrerPolicy:"strict-origin-when-cross-origin",body:null,method:"POST",mode:"cors",credentials:"omit"})).json();process.exit(0)}constructor(t){this.base64PrivateKey=t}async callAPI(t,e,n="GET",o=null){let c=new URLSearchParams({size:p.REEPAY_MAX_PAGE_LIMIT,...e}).toString();try{let r=[],s=await(await(0,i.default)(`${p.REEPAY.API_URL}/${t}${c?`?${c}`:""}`,{method:n,headers:{Authorization:`Basic ${this.base64PrivateKey}`,"Content-Type":"application/json"},body:o?JSON.stringify(o):null})).json(),l=s.next_page_token;if(t.indexOf("list/")===-1)return s;for(s.content&&r.push(...s.content);l;)c=new URLSearchParams({size:p.REEPAY_MAX_PAGE_LIMIT,next_page_token:l,...e}).toString(),s=await(await(0,i.default)(`${p.REEPAY.API_URL}/${t}${c?`?${c}`:""}`,{method:n,headers:{Authorization:`Basic ${this.base64PrivateKey}`}})).json(),s.content&&r.push(...s.content),l=s.next_page_token;return r}catch(r){return console.log("error: ",r),null}}async getCustomers(t){return await this.callAPI("list/customer",t)}async getCharges(t){return await this.callAPI("list/charge",t)}async getTransactions(t){return await this.callAPI("list/transactions",t)}async getInvoices(t){return await this.callAPI("list/invoice",t)}async getInvoice(t,e){return await this.callAPI(`invoice/${t}`,e)}async getCharge(t,e){return await this.callAPI(`charge/${t}`,e)}async settleInvoice(t){return await this.callAPI(`charge/${t}/settle`,null,"POST")}async cancelInvoice(t){return await this.callAPI(`charge/${t}/cancel`,null,"POST")}async refundInvoice(t){return await this.callAPI("refund",null,"POST",{invoice:t})}async getPaymentMethods(t){return await this.callAPI("list/payment_method",t)}async getPayouts(t){return await this.callAPI("list/payout",t)}},A=u;0&&(module.exports={Reepay}); |
{ | ||
"name": "@advisoa/gateway-clients", | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11636
41