Super Qi — Configuration Reference
Three configuration attributes control Super Qi. They live on PaymentSDKConfiguration and can be set at initialization or changed later via the dynamic update method (see Runtime updates).
| Attribute | Controls |
|---|---|
availablePaymentMethods | Whether Super Qi appears at all |
paymentMethodChoice | Who renders the method picker |
aliPaySettings | The behaviour of the Super Qi screen |
Kotlin uses UPPER_SNAKE_CASE enums and Builder.setX(...). Swift uses lowerCamelCase enum cases (.onSdk) and named init parameters. The Flutter wrapper in this repo mirrors the Kotlin style (PaymentMethodChoice.ON_SDK). All three are listed in each table below.
availablePaymentMethods
The set of payment methods the SDK is allowed to offer on its UI.
| Property | Value |
|---|---|
| Type | Set / ordered list of method enums |
| Possible values | PAYMENT_TOKEN, CARD, ALIPAY, AQSATI |
| Default | PAYMENT_TOKEN + CARD (so ALIPAY is off by default) |
| To enable Super Qi | Include ALIPAY in the set |
| Platform | How to reference it |
|---|---|
| Kotlin | AvailablePaymentMethods.ALIPAY · Builder.setAvailablePaymentMethods(set) |
| Swift | .ALIPAY · availablePaymentMethods: init param |
| Flutter (this repo) | PaymentMethodOption.ALIPAY · availablePaymentMethods: param |
If the resolved method set is empty the SDK has nothing to show. The native bridges in this repo defensively fall back to CARD when the incoming list is empty — see parsePaymentMethods(...) in MainActivity.kt and AppDelegate.swift. Mirror that guard if you build your own bridge.
paymentMethodChoice
Where the "How do you want to pay?" screen is rendered.
| Property | Value |
|---|---|
| Type | enum |
| Possible values | ON_SDK / onSdk, ON_APP / onApp |
| Default | ON_APP (the SDK does not draw a picker) |
| Value | Meaning |
|---|---|
ON_SDK / onSdk | The SDK shows its own method-selection screen (including "Pay with Super Qi"). Pick this for the least integration effort. |
ON_APP / onApp | Your application owns the selection UI. You must then tell the SDK which method to use by passing the paymentType in the payment details. |
| Platform | How to reference it |
|---|---|
| Kotlin | PaymentMethodChoice.ON_SDK · Builder.setPaymentMethodChoice(...) |
| Swift | .onSdk · paymentMethodChoice: init param |
| Flutter (this repo) | PaymentMethodChoice.ON_SDK · paymentMethodChoice: param |
ON_APP requires a paymentType of ALIPAYIn ON_APP mode the SDK skips its chooser and expects your PaymentDetails.paymentMethod.paymentType to name the method. To drive Super Qi this way you must pass paymentType = ALIPAY. The example app's processPayment currently only sets CARD or PAYMENT_TOKEN (it derives the type from whether a saved token is present), so in this repo Super Qi is reached through the ON_SDK chooser, not through an ON_APP ALIPAY call. See Testing & Troubleshooting.
aliPaySettings
Fine-tunes the Super Qi payment screen. Has no effect unless ALIPAY is in availablePaymentMethods.
| Sub-attribute | Type | Possible values | Default | Meaning |
|---|---|---|---|---|
showFirst | enum | QR, LINK | QR | Which Super Qi option to display first — a scannable QR code, or a deep link button that opens the Super Qi app. |
qrToDeepLinkFallback | bool | true / false | false | While showing the QR, also show a button to open the Super Qi app. |
deepLinkToQrFallback | bool | true / false | false | While showing the deep-link button, also show a QR (and an option to download the app). |
| Platform | Constructor |
|---|---|
| Kotlin | AliPaySettings(showFirst = PaymentTypeAliPay.QR, qrToDeepLinkFallback = true, deepLinkToQrFallback = true) |
| Swift | AliPaySettings(showFirst: .QR, qrToDeepLinkFallback: true, deepLinkToQrFallback: true) |
| Flutter (this repo) | Only showFirst is exposed, via AliPayShowFirst.QR / .LINK. See the note below. |
showFirstThe Dart API surfaces a single aliPayShowFirst parameter (QR / LINK). The two fallback flags are hardcoded to true on both native bridges in this repo (MainActivity.kt and AppDelegate.swift). If you need to control qrToDeepLinkFallback / deepLinkToQrFallback from Dart, extend the channel arguments and the AliPaySettings(...) constructors on both sides. See Flutter Integration → Extending the bridge.
Recommended presets
| Scenario | availablePaymentMethods | paymentMethodChoice | aliPaySettings.showFirst |
|---|---|---|---|
| Easiest "just turn it on" | CARD, ALIPAY, PAYMENT_TOKEN | ON_SDK | QR |
| Same-device app users (phone) | CARD, ALIPAY | ON_SDK | LINK (+ both fallbacks) |
| In-store / cross-device (scan) | CARD, ALIPAY | ON_SDK | QR (+ qrToDeepLinkFallback) |
| You already have a method UI | CARD, ALIPAY, PAYMENT_TOKEN | ON_APP | QR |
Runtime updates
Every attribute above can be changed on a live SDK without re-initializing.
| Platform | API |
|---|---|
| Kotlin | PaymentSDK.updateConfiguration(value) — call once per value (Set<AvailablePaymentMethods>, PaymentMethodChoice, AliPaySettings). |
| Swift | sdk.updatePaymentSDKConfiguration(availablePaymentMethods:), (paymentMethodChoice:), (aliPaySettings:). |
| Flutter (this repo) | PaymentSdkFlutter.updatePaymentMethods(methods:, choice:, aliPayShowFirst:) — pushes all three in one channel call. |
The SDK must already be initialized before a runtime update. The bridges in this repo return SDK_NOT_INITIALIZED if you call the update method too early; the Flutter service (payment_service.dart) instead just stores the config and applies it at the next init.