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

677 B
Raw Blame
export const unavailableFlows=new Set(['cit_metadata_changed','mit','saved_card_checkout']);
export function normalizePaymentFlows(flows=[]){
 const used=new Set();return flows.map(flow=>{
  let name=flow.name?.replace(/^(?:nomod|mod)_/,'')||flow.scenario,base=name,index=2;
  while(used.has(name))name=`${base}_${index++}`;used.add(name);
  return {...flow,name,merchant_path:'modular'};
 });
}
export function assertSupportedPaymentFlows(flows){
 for(const flow of flows)if(Number(flow.weight)>0&&unavailableFlows.has(flow.scenario))throw new Error(`${flow.scenario.replaceAll('_',' ')} is not yet supported by the payment-method service; remove it from the traffic mix`);
}