> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://tester.army/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://tester.army/_mcp/server.

# Test Apple Pay

TesterArmy can exercise Apple Pay checkout flows in native iOS apps. When your app presents the Apple Pay payment sheet during a test, the agent authorizes it and your app's payment flow continues — so you can verify the full user journey from "tap the Apple Pay button" through your success screen.

## What a test covers

Mobile tests run on iOS Simulators, which ship with a simulated card (no Wallet setup required). During a run the agent:

1. Taps your app's Apple Pay button like a user would.
2. Waits for the payment sheet and verifies it appears with your line items and total.
3. Authorizes the payment.
4. Continues through your app's post-payment flow (confirmation screen, receipt, navigation).

## What a test can't cover

iOS Simulators have no Secure Element, so the payment token your app receives is Apple's simulator dummy — it contains no card data and cannot be decrypted or settled by a payment processor. That means:

* **Covered:** button rendering, sheet presentation, line items and totals, your authorization handler, error and cancel handling, and everything in your app after authorization.
* **Not covered:** server-side token decryption, processor calls, and settlement.

If you process payments with **Stripe**, more of the flow may be covered: Stripe documents that its test mode recognizes stubbed simulator token data for iOS integrations, so your app-side Stripe calls can run against real Stripe test infrastructure. Verify how your backend handles the simulator token in Stripe test mode before relying on this.

## Requirements

Your uploaded build must include the **Apple Pay capability** (the `com.apple.developer.in-app-payments` entitlement with at least one merchant ID). Simulator builds don't need a provisioning profile for this — enabling the capability on your target in Xcode is enough. Without the capability, Apple Pay UI will not appear in the app and payment steps will fail.

## Writing the test

Describe the flow in plain language — no special syntax is needed:

```
Add the "Classic Burger" to the cart, go to checkout,
pay with Apple Pay, and verify the order confirmation
screen shows the order number.
```

The agent handles the payment sheet automatically when it appears. If your checkout requires a billing address (the sheet asks to "Update Billing Address"), the agent adds a test address to the simulated card and continues.

## Limitations

* Native iOS apps only. Apple Pay on the mobile web (Safari) is not supported — Apple's payment sheet does not function in Safari on any iOS Simulator.
* The simulated card is always a Visa; card-network-specific behavior can't be selected.
* Payment declines can't be simulated — the simulator always authorizes.