How Transnational Payments (TNP) Works
Source: transnational_payments_controller.rb
- TNP only operates in production mode when the Rails environment is production AND the user is not a superuser; superuser access always forces test mode
- The API key is stored in CompanyPrivateSetting with a corresponding flag on CompanyIntegration to indicate TNP is enabled
- Multi-terminal support is available with automatic default terminal assignment when terminals are added
- Transaction amount cannot be zero — zero-amount transactions are rejected before being sent to the API
- Response code interpretation follows specific ranges: codes starting with "X" indicate invalid credentials, codes 100-199 indicate success, and all other codes are treated as errors
Support scenarios
- "TNP transactions aren't going through and we're getting credential errors" → Response codes starting with "X" mean invalid credentials. Check the API key in CompanyPrivateSetting and verify it matches what TNP issued.
- "We're a superuser but transactions seem to be in test mode" → Superuser accounts are always forced into test mode regardless of environment. This is by design to prevent accidental live transactions during admin work.
- "TNP says our transaction amount is invalid" → Zero-amount transactions are explicitly rejected. Ensure the invoice has a balance due greater than zero before attempting payment.