Skip to main content
Version: v2.0.4 latest

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).

AttributeControls
availablePaymentMethodsWhether Super Qi appears at all
paymentMethodChoiceWho renders the method picker
aliPaySettingsThe behaviour of the Super Qi screen
Naming across platforms

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.

PropertyValue
TypeSet / ordered list of method enums
Possible valuesPAYMENT_TOKEN, CARD, ALIPAY, AQSATI
DefaultPAYMENT_TOKEN + CARD (so ALIPAY is off by default)
To enable Super QiInclude ALIPAY in the set
PlatformHow to reference it
KotlinAvailablePaymentMethods.ALIPAY · Builder.setAvailablePaymentMethods(set)
Swift.ALIPAY · availablePaymentMethods: init param
Flutter (this repo)PaymentMethodOption.ALIPAY · availablePaymentMethods: param
Never pass an empty set

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.

PropertyValue
Typeenum
Possible valuesON_SDK / onSdk, ON_APP / onApp
DefaultON_APP (the SDK does not draw a picker)
ValueMeaning
ON_SDK / onSdkThe SDK shows its own method-selection screen (including "Pay with Super Qi"). Pick this for the least integration effort.
ON_APP / onAppYour application owns the selection UI. You must then tell the SDK which method to use by passing the paymentType in the payment details.
PlatformHow to reference it
KotlinPaymentMethodChoice.ON_SDK · Builder.setPaymentMethodChoice(...)
Swift.onSdk · paymentMethodChoice: init param
Flutter (this repo)PaymentMethodChoice.ON_SDK · paymentMethodChoice: param
ON_APP requires a paymentType of ALIPAY

In 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-attributeTypePossible valuesDefaultMeaning
showFirstenumQR, LINKQRWhich Super Qi option to display first — a scannable QR code, or a deep link button that opens the Super Qi app.
qrToDeepLinkFallbackbooltrue / falsefalseWhile showing the QR, also show a button to open the Super Qi app.
deepLinkToQrFallbackbooltrue / falsefalseWhile showing the deep-link button, also show a QR (and an option to download the app).
PlatformConstructor
KotlinAliPaySettings(showFirst = PaymentTypeAliPay.QR, qrToDeepLinkFallback = true, deepLinkToQrFallback = true)
SwiftAliPaySettings(showFirst: .QR, qrToDeepLinkFallback: true, deepLinkToQrFallback: true)
Flutter (this repo)Only showFirst is exposed, via AliPayShowFirst.QR / .LINK. See the note below.
Flutter exposes only showFirst

The 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.


ScenarioavailablePaymentMethodspaymentMethodChoicealiPaySettings.showFirst
Easiest "just turn it on"CARD, ALIPAY, PAYMENT_TOKENON_SDKQR
Same-device app users (phone)CARD, ALIPAYON_SDKLINK (+ both fallbacks)
In-store / cross-device (scan)CARD, ALIPAYON_SDKQR (+ qrToDeepLinkFallback)
You already have a method UICARD, ALIPAY, PAYMENT_TOKENON_APPQR

Runtime updates

Every attribute above can be changed on a live SDK without re-initializing.

PlatformAPI
KotlinPaymentSDK.updateConfiguration(value) — call once per value (Set<AvailablePaymentMethods>, PaymentMethodChoice, AliPaySettings).
Swiftsdk.updatePaymentSDKConfiguration(availablePaymentMethods:), (paymentMethodChoice:), (aliPaySettings:).
Flutter (this repo)PaymentSdkFlutter.updatePaymentMethods(methods:, choice:, aliPayShowFirst:) — pushes all three in one channel call.
tip

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.

Next: Flutter Integration walkthrough →