Conversation
Edge-to-edge alone leaves the navigation bar covering the bottom of the page: Android WebView maps only the display cutout onto CSS `env(safe-area-inset-*)`, never the system bars, so the web layer cannot pad around them. Hiding the bars (transiently revealed by a swipe) and re-hiding them whenever the window regains focus keeps the app a fullscreen kiosk for a whole shift, including after returning from another activity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BK6n6yMEXHuB1LsHBmX4Pa
Adds a card payment method backed by the SwitchioPay app's ECR v8 intent API. The protocol has no HTTP or local-socket interface, so the method is Android-only and stays hidden outside the Capacitor runtime: an `intent://` launch from a browser or PWA returns its result to the browser, not to the page. The native half is a local Capacitor plugin (`SwitchioPlugin.java`, registered in `MainActivity`); `src/core/native/switchio.ts` wraps it behind `SwitchioTerminalDep` and interprets the result. A payload that cannot be read on a success result code, or a bridge failure other than a missing SwitchioPay app, is reported as an unknown outcome rather than a decline — the card may well have been charged, so it must never be shown as "declined". Domain-side this mirrors cash: `paymentCardSwitchio` records the terminal result, a new `paymentCardSwitchio` account kind receives the account transaction, and a reconciliation claim is what makes the payment read as paid. The claim is written before the terminal's trace fields so a crash leaves a paid payment with a thinner audit trail rather than a charged card that still shows as unpaid. The terminal is only asked to charge a payment that is still pending: the methods can coexist on one payment, and the wait screen's own paid check trails the database, so without the guard a payment already settled over Lightning could be charged again by card. The ECR request id is persisted before the intent leaves, both as `transactionId` and as `unresolvedTransactionId`; the latter is cleared on a definite answer and blocks another attempt while the last outcome is unknown, until staff confirms having checked SwitchioPay. When Android kills the app while the terminal is in the foreground, the result comes back as a Capacitor `appRestoredResult` event carrying the echoed request id, and `SwitchioRestoredResult` settles it. ECR adds `tipAmount` to the `amount` it is given (its result documents `amount` as the total including the tip, its request does not), so `calculatePaymentBaseAmount` takes the tip back out of the stored total before the request is built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BK6n6yMEXHuB1LsHBmX4Pa
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The payment accounts page already warned outside the native app, but on Android a missing SwitchioPay app only surfaced when a card payment was attempted. The plugin now probes the exact ECR payment intent it launches, declared in the manifest's <queries> so Android 11+ package visibility lets it resolve, and the card row shows a warning when nothing handles it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BK6n6yMEXHuB1LsHBmX4Pa
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SwitchioPlugin.java) drives the SwitchioPay app's ECR v8 intent API;src/core/native/switchio.tswraps it behindSwitchioTerminalDep. The method is hidden outside the native runtime, because anintent://launch from a browser/PWA returns its result to the browser, not to the page.paymentCardSwitchiostores the terminal result, a newcardSwitchioaccount receives the account transaction, and a reconciliation claim marks the payment paid. The claim is written before the terminal's trace fields.pending. Another method on the same payment may already have settled it.transactionIdandunresolvedTransactionId. While the last attempt's outcome is unknown (unreadable result, bridge failure, app killed), another attempt is refused until staff confirms having checked SwitchioPay.appRestoredResultevent carrying the echoed request id.SwitchioRestoredResultsettles it.tipAmountto theamountit receives, so the request sends the stored total minus the tip.env(safe-area-inset-*), so the navigation bar was covering the page.Test plan
bun run check:tsbun run check:tests: unit tests for the paid/canceled guards, the unresolved-attempt block and explicit retry, restored-result settlement, and the tip splitSwitchioPlugin.javacompiles in the Android build (it was not compiled locally)🤖 Generated with Claude Code
https://claude.ai/code/session_01BK6n6yMEXHuB1LsHBmX4Pa