15. Testing: mock servers, test cards and go-live checklist
The repository's README describes a demo app and two local mock servers: a Praxis backend mock (port 8787) that mirrors the Praxis cashier API, and a merchant backend mock (port 8788) that plays the merchant's server and creates the session. No credentials are needed. The SDK reaches the mock with CashierEnvironment.mock(), in debug builds only.
ImportantOn 22 Nov 2026 the master branch holds README.md, Package.swift and Sources only. The Example app, the mock servers, the docs folder (API contract, specifications) and the Scripts folder the README points to are not on master. Ask the mobile team for the branch that has them before following the steps below.
Run the demo (as the README describes it)
cd Example/mock-server && npm start # both mock servers; Ctrl-C stops them
cd Example && xcodegen generate && open CashierDemo.xcodeprojRun the CashierDemo scheme on a simulator and tap Deposit with card. The demo's "Withdrawals" and "Decline recovery and retry" groups open those flows on the mock.
Test cards on the mock
Any future expiry such as 12/34, holder Test User. For Visa cards the last four digits decide the result.
| Card | Number | CVV | Result |
|---|---|---|---|
| Visa approved | 4111 1111 1111 1111 | 123 | Approved |
| Visa 0002 | 4000 0000 0000 0002 | 123 | Declined |
| Visa 0003 | 4000 0000 0009 0003 | 123 | Pending, then approved on the second status read |
| Visa 0004 | 4000 0000 0008 0004 | 123 | Server error |
| Visa 0005 | 4000 0000 0007 0005 | 123 | Redirect to the 3-D Secure page |
| Visa 0006 | 4000 0000 0006 0006 | 123 | Partially approved (60 % of the amount) |
| Visa 0007 | 4000 0000 0005 0007 | 123 | Field errors (full name, postal code) |
| Visa 0008 | 4000 0000 0004 0008 | 123 | Cancelled |
| Visa 0009 | 4000 0000 0003 0009 | 123 | Authorized |
| Visa 0010 | 4000 0000 0000 0010 | 123 | Pending that stays pending |
| Mastercard | 5555 5555 5555 4444 | 123 | Approved |
| Amex | 3782 822463 10005 | 1234 | Approved |
| Discover | 6011 1111 1111 1117 | 123 | Approved |
Praxis core dev
The demo's core dev mode runs the SDK against the native Cashier backend of Praxis core dev: the local merchant server opens a native session (channel: ios_sdk, app_return_url) with a test merchant's credentials and sends the app only the token and the three service addresses. The credentials stay on the Mac, in a git-ignored file.
Documentation and checks in the repository
- Every public symbol has DocC documentation. Build it with the command below.
Scripts/check.sh(not on master) runs the ring and boundary checks, a warnings-as-errors build, the tests, the mock server tests, an iOS simulator build and the public surface check.
xcodebuild docbuild -scheme tech.praxis.cashier.sdk -destination 'generic/platform=iOS Simulator'Go-live checklist
- Server creates the session with
channel: ios_sdkand anapp_return_url, and sends the app only the token - App uses
CashierEnvironment(graphqlURL:pciURL:logsURL:)with the addresses of the same environment the session was created in - Final status is taken from the Praxis notification on the server, not from the device
- Every failed result logs
errorCode.rawValueandtraceID; the switch over error codes has a default branch - "Maybe" codes (network, server_error, unexpected_response, unknown) do not tell the customer the payment failed for good
- Apple Pay: the app's entitlement lists the merchant identifier of the session's settings, or the feature is off
-
app_return_urlis registered in the app when methods hand the customer to a bank app - An own layout was tested with each method the merchant account offers (no layout_incomplete event)
Updated about 8 hours ago