Testing & Troubleshooting
How to test the flow
- Configure for visibility. Set
availablePaymentMethodsto includeALIPAYandpaymentMethodChoice = ON_SDK. In the example app, open Debug options, tick Pay with Super Qi, set selection toON_SDK, and tap Apply config. - Start a payment. Trigger the normal payment flow with a valid
paymentIdfrom your gateway. - Confirm the chooser. The SDK's method screen should list "Pay with Super Qi" next to card.
- Open the Super Qi screen. Tap it and verify the first option matches your
showFirst(QRorLINK). - Exercise the fallbacks. With
qrToDeepLinkFallback/deepLinkToQrFallbackon, confirm the secondary option (open-app button or QR) is present. - Complete or cancel. Approve in the Super Qi app to see the result screen; or back out to confirm the "close without saving?" dialog behaves as expected.
Both bridges log the resolved configuration. On Android: adb logcat | grep -i "payment methods" shows lines like Available payment methods: [CARD, ALIPAY], choice: ON_SDK. This is the fastest way to confirm your Dart arguments actually reached the SDK.
Troubleshooting
Super Qi button doesn't appear
Work down this list in order:
| Check | Fix |
|---|---|
Is ALIPAY in availablePaymentMethods? | It's off by default. Add it. |
Is paymentMethodChoice = ON_SDK? | The SDK only draws a chooser in ON_SDK. The default is ON_APP (no chooser). |
| Did the arguments reach native? | Check logcat / Xcode console for the "Available payment methods" log line. |
| Did an empty list get sent? | The bridges fall back to card-only when the list is empty — so Super Qi silently disappears. Ensure at least ALIPAY is included. |
| Is the SDK initialized with the new config? | A runtime updatePaymentMethods only works after init. Re-initialize if needed. |
ON_APP doesn't launch Super Qi
In ON_APP mode the SDK does not show a chooser — your app must pass paymentType = ALIPAY in the payment details. The example app's processPayment only sets CARD or PAYMENT_TOKEN (it picks based on whether a saved token is present), so it cannot trigger Super Qi in ON_APP mode.
Fix: either use ON_SDK (recommended for this app), or extend processPayment on both native sides to accept and set PaymentType.ALIPAY / .ALIPAY.
Crash on payment: null accountId
SDK 2.0.4 rejects a null accountId when constructing CustomerInfo. Symptoms appear right after starting a payment, not at init.
Fix: always pass a non-null account id. The Android bridge already guards this by falling back to a generated id when the customer id is blank (generateFakeAccountId() in MainActivity.kt). Make sure your own integration supplies a real account id in production.
QR shows but the Super Qi app never opens (same device)
The customer is on the same phone and scanning a QR is awkward. Turn on qrToDeepLinkFallback so an "Open Super Qi" button appears alongside the QR — or set showFirst = LINK for same-device-first journeys.
Deep link offered but Super Qi isn't installed
Enable deepLinkToQrFallback so the SDK also shows a QR / download path when the app can't be opened.
Runtime update returns false / SDK_NOT_INITIALIZED
You called updatePaymentMethods before the SDK was initialized. In the example app the service (payment_service.dart) handles this by storing the config and applying it at the next initialize. If you call the channel method directly, initialize first.
MissingPluginException / method not implemented
The channel method isn't registered on one of the platforms. Confirm updatePaymentMethods exists in the channel when/switch in both MainActivity.kt and AppDelegate.swift. See Flutter Integration → native bridges.
Pre-release checklist
-
ALIPAYincluded inavailablePaymentMethods. -
paymentMethodChoicematches your UX (ON_SDKfor SDK-drawn picker). -
showFirstmatches your primary journey (QR for cross-device, LINK for same-device). - Fallback flags set appropriately for your audience.
-
accountIdis always non-null in production payments. - Button label reads "Pay with Super Qi", never "ALIPAY", in every locale.
-
updatePaymentMethodsregistered on both native platforms (if you use runtime switching). - Tested success, cancel, and fallback paths on a real device.
See also
- Overview — concepts and the user-facing flow
- Enable — Quick Start — the minimal change
- Configuration Reference — every field and default
- Flutter Integration — the bridge implementation