Hero Background

Power Your Software Testing with AI Agents and Cloud

The Native AI-Agentic Cloud Platform to Supercharge Quality Engineering. Test Intelligently and Ship Faster.

Kane CLIUPI

Test a scan to pay flow through the PIN step

A merchant, an amount, a PIN and a receipt that has to name the merchant it actually paid.

Published on:

Scan to pay is the most-used payment flow in India and the one with the least margin for confusion. The customer is standing at a counter and the merchant is watching.

This use case runs the scan flow on the PhonePey clone through to the receipt.

Failure modes in this flow

The merchant identity appears at three points in the flow and has to be the same one each time.

  • At the scan - the merchant is identified before any amount is entered.
  • At the PIN step - restated alongside the amount, which is the last confirmation before authorisation.
  • On the receipt - named with their UPI address, so the payment is attributable afterwards.
  • The balance - asserted before paying, so the customer knows the payment can clear.

The PIN step assertion is the important one. It is the point where the customer authorises, and a screen that shows one merchant while paying another is the fraud this flow exists to prevent.

Note

Note: A PIN step is an ordinary part of a plain English flow, so an authorisation screen does not force the test to be split in two. Try it on TestMu AI. Try free!

Writing the objective

The amount is asserted on the PIN screen alongside the merchant, because those two values together are what the customer is agreeing to when they enter their PIN.

---
mode: testing
url: https://my-testing-repo-main.vercel.app/phonepe-clone-app/scan?reset=true
max_steps: 45
tags: [phonepe, fintech, upi]
---

# PhonePey 21.1: QR scan to pay

Catalog objective: simulate the scan-to-pay flow with amount entry.
Key assertion: the payment succeeds with the merchant name shown.

## Scan a QR code
Click "Scan" on "Sunrise Chai Corner" and verify an "Enter amount" step appears.

## Enter the amount
Type "120" into "Amount", type "Two cutting chai" into "Note", verify "Available balance" reads "₹12,480.00", then click "Continue".

## Enter the UPI PIN
Verify the PIN step shows "Paying" of "Sunrise Chai Corner · ₹120.00", type "4321" into "UPI PIN", and click "Pay ₹120.00".

## Verify the success screen names the merchant
Verify a green banner titled "Payment successful" says "₹120.00" was paid to "Sunrise Chai Corner", and the receipt shows "Transaction ID" of "T-9501", "Paid to" of "Sunrise Chai Corner · sunrisechai@ybl" and "Amount" of "₹120.00".

The receipt assertion includes the merchant UPI address as well as their name, which is the value that makes a payment traceable if it is later disputed.

The assertions in detail

A scan, an amount, an authorisation and a receipt.

StepWhat it proves
Scan a QR codeA merchant code resolves and moves the flow to amount entry
Enter the amountAmount and note are accepted and the balance is visible
Enter the UPI PINThe authorisation screen restates merchant and amount before the PIN
Verify the success screen names the merchantThe receipt carries the transaction id, merchant, address and amount

Asserting the available balance in the middle of the flow is a small thing that matters at a counter. A payment attempted against insufficient funds fails in front of the merchant.

Next-generation test execution with TestMu AI

Running it locally

kane-cli testmd run tests/phonepe/qr-scan-pay_test.md

Add a variant with an incorrect PIN, since a wrong PIN handled badly is the difference between a retry and an abandoned payment.

Authorisation steps are the usual reason a payment flow is left uncovered. The Kane CLI introduction covers pausing for input, and running in CI covers the headless case.

Author

...

Bhawana

Blogs: 75

  • Twitter
  • Linkedin

Bhawana is a Community Evangelist at TestMu AI with over 3 years of experience creating technically accurate, strategy-driven content in software testing. She has authored 50+ blogs on test automation, cross-browser testing, mobile testing, and real device testing. She also serves as Product Marketing Manager for Kane CLI, the command-line tool that runs browser automation from the terminal using natural-language flows in a real Chrome browser. Bhawana is certified in KaneAI, Selenium, Appium, Playwright, and Cypress, reflecting her hands-on knowledge of modern automation practices. On LinkedIn, she is followed by 6000+ QA engineers, testers, AI automation testers, and tech leaders.

Add to Google preferred sources

Summarise with AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Scan to Pay FAQs

Did you find this page helpful?

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests