When the payment terminal is an Android phone and the merchant's pocket is the POS, traditional perimeter security doesn't apply. There's no hardware security module in a glass device. No dedicated network segment. No physical tamper protection.
Building Vishnora Pay taught me that securing tap-on-glass payments requires rethinking the entire security model from the API layer inward. Here's the architecture we landed on.
Why Zero-Trust Is the Only Model That Works
In a traditional POS environment, the terminal is trusted by virtue of being a known, controlled device on a managed network. That assumption is gone the moment your POS is a consumer Android running your SDK.
Zero-trust means: never trust, always verify. Every API call is treated as potentially hostile regardless of origin. Every token has a minimum viable scope. Every transaction is verified independently.
The API Security Architecture

  1. Mutual TLS on Every Connection Every device that calls the payment API must present a client certificate issued by our CA. No certificate, no connection. This eliminates a large class of MITM attacks before the application layer is even involved.
  2. Short-Lived Tokens with Tight Scopes Authentication tokens are issued per-transaction with a 90-second TTL. Each token is scoped to a single merchant, a single transaction type, and a single amount range. A stolen token is useless outside its exact context.
  3. Request Signing Every API request is signed with the device's private key (stored in Android Keystore, never extractable). The server verifies the signature before processing. Replayed requests fail signature validation because the nonce doesn't match.
  4. Anomaly Detection at the Gateway Transaction patterns that deviate from a merchant's baseline, unusual amounts, velocity spikes, geographic anomalies are flagged before they reach the payment processor. This isn't fraud detection; it's pre-processor triage.
  5. Encrypted Payload + Transport PAN data is encrypted at the point of capture on-device, before transmission. Even if transport is compromised, the payload is useless without the decryption key, which never leaves our HSM. What This Looks Like in Practice Device captures NFC/tap event → Payload encrypted on-device (AES-256, key from Keystore) → Request signed with device private key → mTLS connection established to API gateway → Gateway: verify cert, verify signature, check token scope → Anomaly engine: check transaction against merchant baseline → Processor: submit encrypted payload → Response signed by processor, verified by gateway → Result returned to device Every step is logged. Every step can be audited. No single point of compromise exposes cardholder data. The Lessons The hardest part wasn't the cryptography that's solved. The hardest part was key lifecycle management on consumer devices you don't control. Android Keystore helps, but certificate rotation, revocation, and re-provisioning in a fleet of merchant devices is an operational problem as much as a security one. Build the ops model before you build the crypto model. The certificates and tokens are only as good as the system that rotates and revokes them. About the author: Technology executive and hands-on engineer with 20+ years across enterprise IT, digital transformation, and AI delivery. Founder of Vishnora Pay, a Tap-on-Glass payment infrastructure platform. — Srinivasa Sitapavani Srikanth Mulakaluri