Description: Implement three core API endpoints for transaction processing and MFA verification.
Endpoints:
- processTransaction(hashCC, amount, location, merchantApiKey, emailAddress)
Logic Flow:
- Validate merchant API key
- Check if user exists in system
- If user doesn't exist → return AUTH_REQUIRED
- If user exists → evaluate transaction rules
- Return response based on rules evaluation
Response Types:
- SUCCESS: Transaction approved
- AUTH_REQUIRED: Include array of enabled auth method IDs (e.g., [1, 3] for email and phone)
- FAILURE: Transaction denied
- requestCode(hashCC, authMode)
Logic Flow:
- Identify authentication method from authMode parameter
- Generate random 6-digit code
- Update userTable.authCode with generated code
- Send code via selected method (email, SMS, etc.)
- Return confirmation status
- verifyMFA(hashCC, code)
Logic Flow:
- Retrieve stored auth code from userTable.authCode
- Compare with submitted code
- Return SUCCESS if match, AUTH_REQUIRED if mismatch, FAILURE for errors
Technical Requirements:
- All endpoints return standardized status codes
- Implement proper error handling
- Log all attempts to mfa_events table
- Support multiple authentication methods (email, phone, etc.)
Description: Implement three core API endpoints for transaction processing and MFA verification.
Endpoints:
Logic Flow:
Response Types:
Logic Flow:
Logic Flow:
Technical Requirements: