#!/usr/bin/env elixir # Test script to verify YSP routing fix # This script tests that transactions with DE24 = "782" route to YSP Mix.install([ {:jason, "~> 1.4"} ]) defmodule TestYSPRouting do def run_test do IO.puts("Testing YSP routing fix...") IO.puts("=============================") # Create a test ISO message similar to your transaction test_message = %{ "0" => "0200", "2" => "4854980600736740", "3" => "000000", "4" => "000000003500", "11" => "000344", "14" => "3105", "22" => "051", "23" => "000", "24" => "782", # This should route to YSP "25" => "00", "35" => "4854980600736740=31052060011790", "41" => "12345671", "42" => "123456789012345", "49" => "784", "62" => "000001", "63" => "12345678901234400072", "64" => "4Vx4Vx" } IO.puts("Test message created with DE24 = #{test_message["24"]}") IO.puts("\nExpected result: Should route to 'ysp_plain' network") IO.puts("\nTo test this properly, you'll need to:") IO.puts("1. Start your application") IO.puts("2. Send a transaction with DE24 = '782'") IO.puts("3. Check the logs for: 'RoutingProcessor: Field-based routing - DE24: 782 matches rule, routing to: ysp_plain'") IO.puts("4. Verify it no longer shows 'visa_network' in the routing logs") IO.puts("\n✅ Test script completed. Please test with actual transaction.") end end TestYSPRouting.run_test()