Operations dispatched by showcase/hyperswitch/harness/hyperswitch-host/src/main.rs
Parses Euclid DSL and evaluates the same AST program through reference InterpreterBackend and production VirInterpreterBackend.
Computes card surcharge and surcharge tax via Percentage::apply_and_ceil_result and checks exact integer base-10 ceiling.
Runs StringMajorUnitForConnector, FloatMajorUnitForConnector, and Currency::to_currency_base_unit / to_currency_lower_unit round-trips.
juspay/hyperswitch @ b748596a95b8af82c1c550ee30876e4c08d3cffc
Lowers Euclid AST comparisons into DIR values with refinement and comparison logic.
Evaluates ValuedComparison logic (PositiveDisjunction vs NegativeConjunction) against payment Context.
Applies surcharge and tax-on-surcharge percentages to MinorUnit amounts and rounds up.
Converts minor integer amounts to connector major units and back.
Formats minor amounts into connector decimal wire strings and parses them back.
Processed payment counters and hyperswitch_switch emitted JSON telemetry
Tracks processed transaction count and accumulated minor-unit payment volume across steps.
JSON telemetry emitting routing outcomes, surcharge calculations, connector wire strings, and violation diagnostics.
Routing AST/VIR equivalence, exact base-10 surcharge ceiling conservation, and ISO-4217 currency unit conservation
Production VirInterpreterBackend connector selection and matched rule name must match reference AST InterpreterBackend.
Surcharge and tax-on-surcharge minor units must equal exact base-10 integer ceiling(amount * pct / 100).
Major unit strings, connector base-unit formatting, and round-trip convert_back must preserve exact ISO-4217 decimal scale (0, 2, 3, or 4 digits).
Numeric /= double-negation, IEEE-754 surcharge ceiling overcharge, and CLF/BHD decimal mis-scaling/truncation
lower_number! sets NumValueRefinement::NotEqual AND lower_comparison sets NegativeConjunction, so VirInterpreterBackend evaluates !(ctx != program) == (ctx == program).
(amount as f64 * (percentage / 100.0)).ceil() drifts +1e-16 above exact integers and overcharges 1 minor unit on exact percentages like 7.0%, 14.0%, and 28.0%.
MinorUnit/FloatMajorUnit/StringMajorUnit and Currency::to_currency_* omit is_four_decimal_currency() (CLF = 4 decimals), falling back to factor 100 instead of 10000.
Currency::to_currency_base_unit formats every currency with {:.2}, truncating/rounding the 3rd decimal digit of 3-decimal currencies (BHD, KWD, OMR, JOD, TND).