Drizz raises $2.7M in seed funding •
Featured on Forbes
Drizz raises $2.7M in seed funding •
Featured on Forbes
Logo
Schedule a demo
Blog page
>
How to Test Payment Flows in Mobile Apps Without Test Cards Failing Every Sprint

How to Test Payment Flows in Mobile Apps Without Test Cards Failing Every Sprint

Learn how to test mobile payment flows reliably using Vision AI, UPI, cards, wallets, and SDK updates without constant test failures.
Author:
Jay Saadana
Posted on:
June 18, 2026
Read time:
10 Minutes

Your payment tests passed in staging. Then PhonePe pushed an SDK update on Tuesday, the UPI intent deep link stopped launching on Samsung devices, and 12% of Wednesday's checkout attempts failed silently. The payment was never charged. The order was never placed. The user saw a frozen screen and uninstalled.

Payment testing is the highest-stakes, highest-maintenance area of mobile QA. It's also the area where most teams have the least automation coverage because payment flows depend on third-party SDKs, external app launches, OS-level intents, and provider-specific UI that changes without warning and without your involvement.

This guide covers how to build payment testing that actually survives sprint-to-sprint: what specifically breaks, why traditional automation struggles with payment flows, what to test at each layer, and how Vision AI validates the payment experience users actually see.

For the complete checkout testing deep dive, see Why Checkout Flows Break More Than Anything Else. For the full delivery app checklist, see 30 Test Cases from Order to Doorstep.

Key Takeaways

  • Payment flow testing is the highest-maintenance area of mobile QA because it depends on third-party SDKs (Razorpay, Juspay, Google Pay, PhonePe) that update independently of your release cycle, breaking your tests without any change to your code.
  • India's payment landscape requires testing 15-20+ payment paths: UPI (5+ apps), cards (Visa, Mastercard, RuPay), net banking (50+ banks), wallets (Paytm, Amazon Pay, Mobikwik), COD, platform credits, EMI, and split payments.
  • UPI is the most failure-prone payment method to test because it crosses app boundaries (your app → OS intent → UPI app → callback), and the OS-level app selector is invisible to Appium's element tree.
  • Four-layer testing strategy: API-level payment logic (every PR) → Vision AI visual flow validation (every build) → provider sandbox integration (weekly) → edge case and network resilience (pre-release).
  • Vision AI (Drizz) validates payment flows visually, so payment provider SDK updates don't break tests a card number field still looks like a card number field regardless of which SDK version rendered it.
  • A production app with 8-12 payment methods needs 40-60 payment-specific test cases. With selector-based tools, these require 10-15 hours of maintenance per sprint. With Vision AI, 1-2 hours.

What Makes Payment Flow Testing So Difficult?

Payment flow testing is uniquely difficult because it crosses the boundary between your app and external systems you don't control. Five structural factors make it the hardest area to automate reliably:

1. Third-Party SDK Dependency

A typical Indian mobile app integrates 3-5 payment SDKs: Razorpay or Juspay as the payment gateway, Google Pay / PhonePe / Paytm for UPI, and individual card network processors. Each SDK has its own release cycle, its own UI components, and its own breaking changes. When Razorpay pushes SDK version 4.2.1, your checkout screen may render differently, timeout differently, or return different callback formats without a single line of your code changing.

Your test suite has zero visibility into when these SDK updates ship. The first sign is failing tests on Monday morning.

2. OS-Level Intent and Deep Link Fragility

UPI payments on Android work through intents: your app fires an intent, the OS presents a list of UPI apps, the user selects one (Google Pay, PhonePe, Paytm), the selected app handles the transaction and returns the result to your app. Each step in this chain can break:

  • The intent format (the technical instruction Android uses to launch UPI apps) changes between Android versions
  • Samsung's One UI handles intent resolution differently than stock Android
  • Some UPI apps don't return proper success/failure callbacks
  • The UPI app selector dialog is an OS-level component invisible to your app's element tree

Appium can fire the intent. It cannot reliably interact with the OS-level app selector or the UPI app's own UI those are outside your app's process and element tree.

3. Payment State Complexity

A payment flow has more failure states than success states:

  • Payment initiated but never completed (user abandoned)
  • Payment processing (stuck in limbo between your app and the provider)
  • Payment succeeded but callback not received (money deducted, order not placed)
  • Payment failed with retry available
  • Payment failed with no retry (card blocked, insufficient funds)
  • Payment succeeded on retry but first attempt also succeeded (double charge)
  • Partial payment completed (wallet deducted, UPI portion failed)

Each state requires specific UI handling: error messages, retry buttons, refund notifications, and status indicators. Testing every state requires mocking provider responses which means your tests depend on your mock accuracy matching the provider's actual behavior.

4. India's Payment Method Diversity

The Indian market has more payment permutations than almost any other geography:

  • UPI (Google Pay, PhonePe, Paytm, BHIM, WhatsApp Pay) each with its own app, its own UI, its own callback behavior
  • Credit/Debit Cards (Visa, Mastercard, RuPay) via Razorpay, Juspay, or direct integration
  • Net Banking (50+ banks, each with their own login flow)
  • Wallets (Paytm Wallet, Amazon Pay, Mobikwik, Freecharge)
  • Cash on Delivery (toggle logic interacting with coupons and minimum order rules)
  • Platform Credits/Coins (partial payment requiring balance calculation)
  • EMI (card-based installment options with eligibility checks)
  • Split Payments (wallet balance + UPI for the remainder)

Testing "payment works" means testing 15-20+ payment paths, each with its own failure modes.

5. Provider-Specific Element IDs Change Without Notice

When a payment provider updates their SDK, the element IDs inside their payment UI change. The Razorpay checkout sheet that had resource-id="rzp_card_number" in version 4.1 might use resource-id="card_number_input" in version 4.2. Your Appium tests targeting Razorpay elements break and you didn't change anything.

This is the unique maintenance burden of payment testing: your tests break because of someone else's code changes.

What Specifically Breaks in Payment Testing?

Based on patterns across mobile apps processing millions of daily transactions in India:

UPI Failures (Most Common)

  • Intent not launching. The UPI app selector doesn't appear, or appears but shows "No UPI apps installed" on a device that has Google Pay.
  • App-specific failures. Payment works via Google Pay but fails via PhonePe on the same device, same amount, same merchant.
  • Callback not received. The UPI app deducts money and shows success, but your app never receives the callback. User sees a frozen "Processing" screen.
  • Timeout handling. User opens UPI app, gets distracted for 3 minutes, the transaction times out but your app doesn't show a timeout message.
  • Collect vs Pay flow confusion. Some integrations use collect requests (merchant initiates), others use pay flows (user initiates). The UI flow differs and tests written for one break on the other.

Card Payment Failures

  • 3D Secure redirect breaking. The bank's OTP/authentication page fails to load inside the payment gateway's WebView.
  • Saved card tokens expiring. A test using saved card credentials fails when the token expires or the card is re-issued.
  • RuPay-specific flows. RuPay cards route through different processors than Visa/Mastercard, with different UI and different timeout behavior.

Wallet and Split Payment Failures

  • Partial payment state corruption. Wallet balance deducted successfully, but the UPI portion for the remainder fails. Total is now wrong. Refund for wallet portion doesn't trigger automatically.
  • Wallet balance display stale. Cached wallet balance shows 500 but actual balance is 200. User selects wallet, payment fails with insufficient funds but the UI showed enough balance.
  • Platform credits + coupon interaction. A 100-credit platform discount applied alongside a 20% coupon does the coupon apply before or after credits? Different builds have calculated this differently.

COD-Specific Failures

  • COD availability logic. COD is available for orders under 1,500 but the threshold changes by city. Test written for Delhi (1,500 limit) fails in a tier-3 city (500 limit).
  • COD + coupon interaction. Free delivery coupon applied with COD does the delivery fee get added back to the COD amount or absorbed?
  • COD toggle state. User selects COD, then switches to UPI, then switches back to COD the order total should be identical. Sometimes it's not.

What Should You Test at Each Layer?

Layer 1: API-Level Payment Logic (Run on every PR)

Test payment calculation, coupon interaction, and state management without touching the UI:

  • Order total calculation with different item combinations
  • Coupon discount applied correctly (flat, percentage, capped)
  • Delivery fee calculation by distance and time
  • Surge pricing applied and reflected in total
  • Wallet balance deduction and remainder calculation
  • Payment callback handling for each status (success, failure, pending, timeout)
  • Refund trigger logic for failed partial payments
  • COD availability rules by city and order amount

Tools: Postman, RestAssured, pytest with API client.

Layer 2: Visual Payment Flow Testing (Run on every build)

Validate what the user actually sees during each payment method:

Select UPI as payment method

Verify UPI app selector or UPI ID input appears

Verify at least one UPI app option is visible

Select Credit/Debit Card as payment method

Verify card number input field appears

Verify expiry and CVV fields are visible

Verify "Pay" button is displayed with correct amount

Select Cash on Delivery

Verify order total updates (no payment processing fee)

Tap "Place Order"

Verify order confirmation shows COD as payment method

Toggle "Use Wallet Balance" on

Verify wallet balance is deducted from total

Verify remaining amount is displayed

Select UPI for remaining amount

Complete payment

Verify order confirmed with split payment summary

Tool: Drizz (Vision AI) tests validate the visual payment flow regardless of which payment SDK version is running or what element IDs the provider uses.

Layer 3: Payment Provider Integration Testing (Run weekly)

With test/sandbox credentials from each payment provider:

  • Complete a full transaction via each UPI app (Google Pay, PhonePe, Paytm)
  • Complete a card transaction with 3D Secure OTP
  • Complete a net banking transaction with at least 2 banks
  • Test timeout behavior (wait for provider timeout, verify your app handles it)
  • Test failure scenarios (insufficient funds, declined, network error)

Tools: Provider sandbox environments + Drizz for visual flow validation.

Layer 4: Edge Case and Regression (Run before releases)

  • Double-tap on "Place Order"  verify order isn't placed twice
  • Network drop during payment processing  verify graceful recovery
  • App backgrounded during UPI payment  verify callback still received on return
  • Payment succeeded but app crashed verify order status on relaunch
  • Retry after failed payment  verify amount is correct (not doubled)

Tools: Manual testing + network simulation (Charles Proxy) + Vision AI for visual state validation.

How Does Vision AI Change Payment Testing?

Drizz is a Vision AI mobile testing platform that validates payment flows by looking at the rendered screen the same way a user does rather than querying element IDs inside third-party payment SDKs. The core advantage for payment testing: your tests don't break when someone else's SDK updates.

Payment provider SDK updates don't break tests. When Razorpay changes their checkout sheet UI, the card number field still looks like a card number field on screen. Vision AI finds it visually. The test passes without updating selectors for the new SDK version.

UPI app selector is testable. The OS-level UPI app selector that's invisible to Appium (it's outside your app's process) is visible to Vision AI it's rendered on the screen. "Verify UPI app options are displayed" works because the AI sees what's on screen, not what's in your app's element tree.

Payment confirmation is visually verified. "Verify Order Confirmed screen appears with order ID and payment method" validates the actual rendered result, not an element tree property that might say "success" while the screen shows an error.

Visual bugs in payment flows are caught. "Pay 449" button text truncated to "Pay 4..." on a small screen. Card input field covered by keyboard. CVV field not visible without scrolling. Dark mode rendering showing white text on white input field. These are invisible to Appium but visible to Vision AI.

Watch Drizz testing the Licious app for a real example of Vision AI navigating a payment flow on a delivery app handling product selection, cart, and payment confirmation visually.

How Many Payment Tests Does a Typical App Need?

A production app with 8-12 payment methods typically maintains 40-60 payment-specific test cases:

  • 8-12 happy path flows (one per payment method)
  • 5-8 failure/error handling flows (timeout, decline, insufficient funds)
  • 3-5 split/partial payment flows (wallet + UPI, credits + card)
  • 3-5 coupon + payment interaction flows
  • 3-5 COD-specific flows (availability, toggle state, amount calculation)
  • 2-3 retry and double-charge prevention flows
  • 3-5 visual rendering tests (keyboard overlap, truncation, dark mode)
  • 2-3 network resilience flows (payment under poor connectivity)

With selector-based tools, these 40-60 tests require 10-15 hours of maintenance per sprint largely driven by payment provider SDK updates breaking element references. With Vision AI, the same suite requires 1-2 hours because tests validate visual patterns rather than provider-specific element IDs.

Conclusion

Payment testing will always be harder than testing any other flow in a mobile app. The dependency on third-party SDKs, OS-level intents, and external provider UIs makes it structurally different from testing screens you fully control.

But the majority of payment test maintenance the selector updates every time Razorpay ships an SDK bump, the element ID changes every time PhonePe redesigns their checkout sheet, the broken intents every time Android updates its intent resolver is caused by coupling your tests to internal identifiers inside systems you don't own.

Vision AI eliminates that coupling. A card number field is tested as a card number field, not as rzp_card_input_v4_2_1. A UPI app selector is tested as a list of payment apps on screen, not as an OS-level intent that may or may not be in your element tree. The payment confirmation screen is verified as what the user actually sees, not as an element property that says "success" while the screen says nothing.

The teams that build resilient payment testing don't test more. They test differently at the API layer for logic, at the visual layer for experience, and at the provider layer for integration. That combination catches the payment bugs that cost revenue while spending a fraction of the maintenance time.

Get started with Drizz

Frequently Asked Questions

Can you fully automate payment testing?

You can automate the UI flow (selecting payment method, entering credentials, verifying confirmation) and the API logic (calculation, callbacks, state management). Actual money movement requires sandbox/test credentials from each payment provider. Most providers (Razorpay, Juspay, Stripe) offer test modes that simulate transactions without real charges.

How do you test UPI payments in CI/CD?

UPI testing in CI requires either mocked UPI responses (API-level) or test UPI credentials that complete without launching a real UPI app. Vision AI validates the visual flow up to the UPI app selector and after the callback returns. The actual UPI transaction is either mocked or uses a test-mode integration.

Why do payment tests break more than other tests?

Payment tests depend on third-party SDKs (Razorpay, Juspay, Google Pay) that update independently of your app's release cycle. When a provider changes their SDK, the element IDs inside their payment UI change breaking your selectors without any change to your code. This is unique to payment testing and doesn't affect other flows.

How does Vision AI handle different payment provider UIs?

Vision AI identifies payment elements visually a card number field looks like a card number field regardless of whether it's Razorpay's UI or Juspay's UI. When a provider updates their SDK and changes element IDs, the visual appearance remains similar and the test continues passing. This eliminates the most frequent cause of payment test maintenance.

What's the most critical payment test to automate first?

The "happy path" for your highest-volume payment method. In India, that's typically UPI (60-70% of digital transactions). Automate: select UPI → verify app selector → complete payment → verify order confirmed. This single flow catches the most common payment failure the UPI intent not launching or the callback not returning.

About the Author:

Jay Saadana
DevRel & Technical Writer
DevRel professional and tech community strategist with experience scaling developer ecosystems, open-source programs, and technical outreach initiatives.
Schedule a demo