Repository navigation
fix(upi): M4.3.3 provider verification integrity review — remove currency defaults & status merchant fallback - #33
Open
Satelink-Protocol wants to merge 1 commit into
Conversation
…ency defaults & status merchant fallback
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Open
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR delivers the M4.3.3 Final Provider Verification Integrity Review, closing critical verification fallback vectors, removing manufactured currency defaults, enforcing fail-closed provider merchant verification, documenting Core Banking Solution (CBS) manual refund operational limits, and verifying isolation between client return redirects and payment confirmation.
1. Remove Currency Defaults from Verification Paths
lib/upi/adapter.js):PhonePeAdapter.getPaymentStatus: Extractedcurrencyfaithfully fromdata.currency(data.currency ? String(data.currency).trim().toUpperCase() : null). Removed hardcodedcurrency: 'INR'.PhonePeAdapter.verifyWebhook: Extractedcurrencyfaithfully fromdata.currency(data.currency !== undefined && data.currency !== null ? String(data.currency).trim().toUpperCase() : null). Removed hardcodedcurrency: 'INR'.MockUpiAdapter: Propagates explicitcurrencyfrom simulated status or webhook payload without default.lib/services/upi-payments.js):getUpiPaymentStatus: Polling verification passes provider-returned currency directly (currency: gatewayStatus.currency) without defaulting to'INR'.processUpiWebhook: Webhook processing passes verified currency directly (currency: verified.currency) without defaulting to'INR'.applySuccessfulUpiPayment: Confirmation logic rejects missing, null, empty, or mismatched currency (missing_currency/currency_mismatch), maintaining fail-closed behavior and recording immutable audit entries.2. Remove Merchant Identity Fallback in Provider Status Verification
lib/upi/adapter.js):PhonePeAdapter.getPaymentStatus: Removed fallback tothis.merchantId. Returns exact provider datadata.merchantId ? String(data.merchantId).trim() : null.merchantIdin all configurations; where omitted, it remainsnullrather than manufacturing identity.lib/services/upi-payments.js):applySuccessfulUpiPayment: Enforces strict three-way identity comparison: provider-verified merchant ID (verifiedMerchantId), stored payment intent merchant ID (storedMerchantId), and server-configured merchant ID (configuredMerchantId). Rejects any missing, empty, or mismatched merchant identity before confirmation (merchant_mismatch).3. Review Provider Status Authenticity & Invariant Gating
X-VERIFY: SHA256(endpoint + saltKey) + '###' + saltIndex)./checkout/upi/return) never confirm payments or create bookings; they merely redirect the user to polling/order status screens.pending,failed,disputed,tampered) never create confirmed bookings, tickets, or Telegram invites.4. Manual Refund Operational Limitation & Attestation
operator_attested: trueandbankVerified: false.REFUND123,TEST,000000, etc.) are rejected.5. Test Suite Verification
Governance
feature/m4-3-2-financial-integrityENABLE_LIVE_PAYMENTS=falsepreserved.