Skip to main content
A payment flow can return a success page while the amount, the method, or the recorded status is wrong. These use cases check what the shopper sees against what the merchant side records: the receipt against the charge, the dashboard against the payment, and the order page against the webhook. Every use case below was recorded against a demo payment app with test cards and test accounts, and comes with the _test.md file that produced the run. No real money moves in any of these runs, and you should point your own copies at a sandbox or test-mode environment.

Run these recipes

Save any recipe below as a file ending in _test.md, change the url to your sandbox checkout, and replace the amounts, test cards, and IDs with values from your own test data. Then run it:
The first run authors and records each step, and later runs replay the recording. Keep card numbers and account passwords out of the file by passing them as variables, for example {{test_card}} with --variables-file. See Variables & Context for secrets and Test.md for the file format.

Card checkout

Card checkout is the path most payment changes touch. These recipes cover the happy path, a declined card, a stored card, and a guest card, and each one checks the receipt rather than only the success banner.

Hosted checkout session

A hosted checkout page has to charge the amount the order summary shows. This recipe checks the plan and total, pays with a test card, and then checks the receipt for the payment ID, the amount paid, the card, and the succeeded status.
hosted-checkout-session_test.md
Kane CLI compares the receipt with the order summary, so a success banner over a different amount or a failed status fails the run.

Declined card recovery

When a shopper’s first card is declined, the second card still has to work on the same page. This recipe pays with a decline test card, checks the inline error, confirms the form is still editable, and retries with a working card.
declined-card-recovery_test.md
The receipt has to show the successful card and a badge recording one declined attempt, so a form that locks after a decline fails the run.

Stored card reuse

A returning customer paying with a stored card should never see a card number field. This recipe checks that the stored card is preselected, that no card entry is shown, and that the payment result names the stored token.
stored-card-reuse_test.md
A checkout that asks for the card again, or charges a different method, fails the run.

Guest card payment in a wallet window

Many wallets let shoppers pay by card without an account, and that path is easy to break when the wallet login changes. This recipe opens the wallet window, switches to paying by card as a guest, and checks the payment completes with the guest card.
guest-card-payment_test.md
Kane CLI checks the method on the result banner, so a payment recorded against a wallet balance instead of the guest card fails the run.

Wallets, redirects, and local methods

Wallets, bank redirects, and local methods add a popup, a second site, or a validation step to checkout. These recipes follow the shopper through that extra step and back.

Wallet express checkout

A shopper who reaches the wallet button has already decided to buy, which makes it the worst place for an untested change. This recipe opens the wallet approval window, logs in with a test account, approves the payment, and checks the order completed.
express-checkout_test.md
The run passes only when the result names the amount, the merchant, the wallet balance as the method, and a transaction ID.

Bank redirect (iDEAL)

Bank redirect methods send the shopper to the bank and back, and the return trip is where the state gets lost. This recipe picks iDEAL and an issuer, approves the payment in the issuer simulator, and checks the result after the redirect.
ideal-redirect_test.md
Kane CLI checks for an Authorised result code with the method and issuer the shopper picked, so a redirect that returns without a result fails the run.

UPI intent and VPA validation

A UPI ID field has to reject malformed and unknown IDs before it accepts a good one. This recipe tries a malformed ID, an unknown ID, and a valid ID in turn, and then pays.
upi-intent_test.md
Each invalid ID must show its own inline error, and the valid ID must lead to a successful payment, so the run fails on the first state that is wrong.

Currency conversion before sending

An international payment has to show the rate, the spread, and the converted amount before the sender confirms. This recipe enters an amount for a recipient in another currency and checks that the same numbers appear on the review screen and the receipt.
currency-conversion_test.md
If the receipt shows a different rate or amount from the one quoted before confirmation, the run fails.

Pay later and instalments

Pay-later and EMI flows show a schedule or a plan table that the customer agrees to. These recipes check those numbers before confirmation, and check the fallback when credit is declined.

Pay in 4

A pay-in-4 checkout has to show the full instalment schedule before the shopper confirms. This recipe completes the quick credit check and checks the four payment amounts, their due dates, the total, and the zero interest line before placing the order.
pay-in-4_test.md
Kane CLI checks the schedule before the confirm button is clicked, so a schedule that is missing or adds up to the wrong total fails the run.

Credit decision decline

When a pay-later provider declines a shopper, the merchant still has to offer another way to pay. This recipe triggers a decline, checks the decline message, and confirms the shopper is returned to the other payment options.
credit-decision-decline_test.md
A decline that leaves the shopper on a dead end, with no card or bank transfer option, fails the run.

EMI plan table

EMI should appear only on orders above the threshold, and each tenure has to show the right rate and monthly amount. This recipe checks that a high-value order offers EMI while a low-value one does not, and then checks every row of the plan table.
emi-options_test.md
Kane CLI reads each tenure, rate, and monthly amount from the table, so one wrong row fails the run. Links and invoices are paid outside the main checkout, often from an email. These recipes check that each one is paid once and that its status changes everywhere it appears. A payment link should take one payment and then refuse another. This recipe pays an open link and checks that the badge, the payment banner, and the disabled pay button all show the link as used.
payment-link_test.md
A link that still accepts payment after it is paid fails the run at the last step. A checkout link sent to a customer has to charge the listed amount and send the receipt to the right address. This recipe pays a checkout link and checks the receipt for the payment ID, the item, the total, and the receipt email.
checkout-link_test.md
Kane CLI fails the run if the receipt names a different item, amount, or email from the ones entered.

Invoice pay

Paying an invoice has to flip its status on the invoice page and in the invoice list. This recipe opens an unpaid invoice, checks the billing details and amount due, pays it, and checks the paid status in both places.
invoice-pay_test.md
An invoice that shows paid on its own page but unpaid in the list fails the run.

Back office and reconciliation

Support and finance teams work from the dashboard, not the checkout. These recipes check that refunds, disputes, lookups, and webhooks agree with the payment the shopper made.

Dashboard payment lookup

When a customer questions a charge, support searches the dashboard, and opening the wrong payment sends a refund to the wrong person. This recipe takes a payment, searches the dashboard for its ID, and checks the same ID, amount, and status on the detail page.
dashboard-payment-lookup_test.md
Kane CLI checks the payment ID on the search row and again on the detail page, so a search that opens a different payment fails the run.

Partial refund from the dashboard

A partial refund has to update the payment row and the net sales figure together. This recipe refunds part of a payment from the dashboard and checks the refunded amount, the net amount, the status badge, and the net sales total.
refund-from-dashboard_test.md
If the payment row updates but the net sales total does not, or the other way round, the run fails.

Dispute filing

A dispute has to create a case with a reference that support can look up later. This recipe opens a transaction, files a dispute with a reason and details, and checks the case reference, reason, and status.
dispute-filing_test.md
A dispute that shows a success banner but records no case reference fails the run.

Webhook status parity

The status a merchant sees on the order page has to match the status the payment provider sent in its notification. This recipe takes a payment, opens the merchant order page, and compares the UI status with the webhook status for the same order.
webhook-status-parity_test.md
Kane CLI checks the PSP reference on both pages and the parity card that compares them, so an order page that drifts from the notification fails the run.

Next steps