Flutter — platform notes
pdirect_pay declares Android and iOS plugins only. Web, macOS,
Linux, and Windows are unsupported — neither in the pubspec.yaml
nor at runtime. If your Flutter app targets one of those, use the
HTTP API directly.
Android
Section titled “Android”Minimum SDK
Section titled “Minimum SDK”minSdkVersion 21 (Android 5.0 Lollipop). Set this in
android/app/build.gradle:
android { defaultConfig { minSdkVersion 21 targetSdkVersion 34 }}Permissions
Section titled “Permissions”Required:
<uses-permission android:name="android.permission.INTERNET" />The SDK computes the device fingerprint from ANDROID_ID and
Build.FINGERPRINT — neither requires runtime permissions.
Google Pay (optional)
Section titled “Google Pay (optional)”Only if you’ll surface paymentMethod: 'google_pay':
<application> <meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" /></application>Set the merchant IDs on PdirectPayConfig.googlePayMerchantId and
googlePayGatewayMerchantId.
WebView for Mastercard hosted session
Section titled “WebView for Mastercard hosted session”The card payment flow loads Mastercard’s hosted session in an
embedded WebView. This is provided by the webview_flutter
transitive dependency — no extra config needed.
Native crash on launch?
Section titled “Native crash on launch?”If your app crashes immediately after PdirectPay.init, the
likeliest cause is a missing kotlin runtime. Add to your top-level
build.gradle:
buildscript { ext.kotlin_version = '1.9.0' // ...}Minimum version
Section titled “Minimum version”platform :ios, '12.0' in ios/Podfile.
Apple Pay (optional)
Section titled “Apple Pay (optional)”Only if you’ll surface paymentMethod: 'apple_pay':
- Enable the Apple Pay capability on your target in Xcode.
- Add a merchant ID under Signing & Capabilities → Apple Pay.
- Set
PdirectPayConfig.applePayMerchantIdto the same identifier.
Info.plist
Section titled “Info.plist”No keys are required for the gateway flow. The SDK uses standard
URLSession and the gateway only serves over HTTPS, so no ATS
exception is needed.
Pod install slow?
Section titled “Pod install slow?”cd iospod install --repo-updateIf pod install complains about deployment-target mismatches with
your existing pods, raise IPHONEOS_DEPLOYMENT_TARGET in the Podfile
post-install hook.
TLS pinning
Section titled “TLS pinning”PdirectPayConfig.pinnedSpkiSha256 returns a list of pinned SPKI
SHA-256 hashes. Currently empty in production — pinning is on the
roadmap but not yet enforced.
Mastercard DIRECT_CAPTURE
Section titled “Mastercard DIRECT_CAPTURE”PdirectPaymentBody.mastercardPaymentMethod accepts
'HOSTED_SESSION' or 'DIRECT_CAPTURE'. Only HOSTED_SESSION is
implemented — passing 'DIRECT_CAPTURE' falls back to the standard
submit endpoint with a logged warning. Track
the Flutter changelog for when this lands.
Native pay (google_pay, apple_pay)
Section titled “Native pay (google_pay, apple_pay)”Configuration fields exist on PdirectPayConfig and the pay: ^2.0.0
dependency is included, but the public SDK does not yet expose a
top-level method to invoke a native-pay charge. The pay package
gives you the button and the token — you then pass the token to
PdirectPaymentBody.nativePayToken on /payments/collect.
This will be tightened up in a future release with a single
PdirectPayCheckout.nativePayMode flag.
Web / desktop
Section titled “Web / desktop”Not supported. The plugin’s pubspec.yaml does not declare a web,
macos, linux, or windows block, and there’s no platform-specific
implementation in the source tree.
If you target Flutter Web, you have two options:
- Build that part of your product as a separate Angular app and use
@mms/pdirect-pay. - Talk to the HTTP API directly via
package:httporpackage:dio. The gateway’s CORS policy allows browser origins.
See also
Section titled “See also”- Configuration — TLS pin field, native pay merchant IDs
- Card payments with 3DS — hosted-session flow
- Changelog