Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

857 B
Raw Blame
import { parentPort, workerData } from 'node:worker_threads';
import { listRuns, describeRun, requestHistory, reconcileRun, testDatabase } from './queries.mjs';
import {paymentBars,paymentPage,paymentDetail,nextDiscrepancy} from './reconciliation-index.mjs';
try {
  const {task,args}=workerData;
  const result=task==='payment-bars'?paymentBars(args):task==='payment-page'?paymentPage(args):task==='payment-detail'?paymentDetail(args):task==='next-discrepancy'?nextDiscrepancy(args):task==='list'?await listRuns():task==='run'?await describeRun(args.id):task==='requests'?requestHistory(args)
    :task==='database-test'?await testDatabase(args.database,args.timeoutMillis):task==='reconcile'?await reconcileRun(args,p=>parentPort.postMessage({progress:p})):null;
  parentPort.postMessage({result});
} catch(e) {parentPort.postMessage({error:e.message});}