Plexy
Pay API
Gate APISDKDashboard
Pay API
Gate APISDKDashboard
  1. Flutter
  • Overview
  • Authorization
  • Webhooks
  • API Errors
  • Test Scenarios
  • Ecommerce Plugins
  • API
    • Payments
      • Overview
      • Transaction Errors
      • Payment Links
        • Create Payment Link
        • List Payment Links
        • Retrieve Payment Link by Order Reference
        • Cancel Payment Link
        • Retrieve Payment Link
        • Update Payment Link Expiration
        • Retrieve Payment Links Statistics
      • Reccurent Payments
        • Create Merchant-Initiated Payment
      • Direct Payments
        • Get Keys
        • Create Host-to-Host Payment
      • Transaction Management
        • Find Transaction's History by ID
        • Find Transaction by Payment Link ID
        • Find Transaction by ID
        • Find Transaction by Order reference
      • Payment Management
        • Cancel Payment
        • Capture Payment
        • Process Refund
      • Split Requests
        • Create
        • List
        • Update
        • Get By Id
        • Delete
    • Payouts
      • Retrieve Payout Transactions
      • Process Payout
      • Save Card for Payouts
    • Customers
      • Get Customer's Card Tokens
      • List Customers
      • Create Customer
      • Get Customer by ID
      • Get Customer's Transactions
    • Merchants
      • Payment Beneficiary
        • Create
        • Update
        • Gey By Id
        • List
        • Transfer from beneficiary balance to merchant balance
        • Create manual settlement for beneficiary
      • Retrieve Merchant's Details
    • Wallet
      • Authorize
      • Сapture
      • Refund
      • Cancel
    • Payment Methods
      • Google Pay™ Integration
    • Invoice
      • List Bank Invoices
      • Create Bank Invoice
      • Get Bank Invoice
    • Distributions
      • Create distribution
      • List distributions
      • Get distribution by ID
      • Get distributions balance
  • Client SDK
    • 00-sdk-overview
    • Server flow
      • Session server flow
    • Web
      • Web Drop-in
      • Web iFrame
      • 11-web-drop-in
      • 10-web-sdk
      • 12-web-components
      • 13-web-customization
    • Flutter
      • Flutter Drop-in
      • Plexy SDK for Flutter
    • React Native
      • Drop-in and Components
    • Wallets
      • Apple Pay Web SDK Integration
      • Apple Pay Moible Integration
      • Google Pay Integration
  • apidog-sdk-docs
  • Schemas
    • Schemas
      • response.TransactionList
      • entity.SplitRequest
      • entity.PaymentBeneficiary
      • request.CreatePaymentBeneficiary
      • entity.SettlementPaymentOrder
      • entity.PayoutRequest
      • entity.PayoutRequestRowData
      • entity.UserProfile Copy
      • entity.Store
      • request.AssignStoreToUser
      • request.RemoveStoreFromUser
      • entity.AccountExternalSystem
      • response.AssignStoreToUser
      • request.CreateStore
      • response.Store
      • response.UserList
      • request.WalletAuthorizeRequest
      • entity.ShortWalletTransaction
      • response.WalletAuthorizeResponse
      • request.WalletCapture
      • response.RemoveStoreFromUser
      • command.HandleThreeDResult
      • domain.Report
      • entity.CardSaveSessionCustomer
      • entity.Permission
      • entity.UserProfile
      • entity.UserRole
      • git_plexypay_com_ecom_back_api_internal_domain_view.Page-domain_Report
      • git_plexypay_com_ecom_back_api_internal_domain_view.Page-entity_UserProfile
      • models.CSVApiRequest
      • models.CreateBussinessDetails
      • models.KeyResponse
      • models.OnboardingRequest
      • models.Transaction
      • paymentcore.Address
      • paymentcore.CustomerDetails
      • request.AuthorizePayment
      • request.BrowserDetails
      • request.CardData
      • request.ChangeUserRole
      • request.ContinueThreeDS
      • request.CreateCardSaveSession
      • request.CreateInviteSession
      • request.CreatePaymentLink
      • request.CreatePaymentLinkMetadata
      • request.HandlePayout
      • request.MerchantInitiatedPayment
      • request.PasswordRequest
      • request.Recurring
      • request.RefundPayment
      • request.SaveCard
      • request.SaveOneCustomer
      • request.TwoStepAuthorizePayment
      • request.UpdateMerchantSettingsRequest
      • request.UpdatePaymentLink
      • response.AcquirerResponseThreeDSecure
      • response.AuthorizeAndCapturePayment
      • response.AuthorizePayment
      • response.CancelPaymentResponse
      • response.CapturePaymentResponse
      • response.ContinueThreeDS
      • response.Currency
      • response.Customer
      • response.CustomerTransaction
      • response.CustomerTransactions
      • response.Customers
      • response.Merchant
      • response.MerchantInitiatedPayment
      • response.MerchantSettings
      • response.PaymentLink
      • response.PaymentLinkInfo
      • response.PaymentLinkMetadata
      • response.PaymentLinksInfo
      • response.PaymentLinksStatistics
      • response.PaymentLinksStatisticsItem
      • response.Payout
      • response.Permission
      • response.RefundPaymentResponse
      • response.Report
      • response.SavedCard
      • response.Session
      • response.Settlement
      • response.SettlementTransaction
      • response.Store
      • response.Stores
      • response.Transaction
      • response.TransactionDetails
      • response.TransactionEvents
      • response.TransactionHistoryEvent
      • response.TransactionHistoryEventData
      • response.TransactionResponse
      • response.TransactionWebhookDetails
      • response.Transactions
      • response.UpdateMerchantSettingsResponse
      • response.UserProfile
      • value.PaymentMethod
    • receipt
    • Error
    • response.BankInvoice
    • DistributionStatus
    • DecimalAmount
    • errors.Source
    • Currency
    • ProductType
    • errors.Message
    • DistributionRecipient
    • ProductCategory
    • request.CreateBankInvoice
    • DistributionCreateRequest
    • Product
    • git_plexypay_com_ecom_back_api_internal_platform_errors.Code
    • DistributionBase
    • response.Error
    • Order
    • DistributionCreatedResponse
    • AgentBalance
    • response.BankInvoiceList
    • DistributionDetailResponse
    • AgentDeposit
    • errors.Type
    • DistributionListItem
    • TopupRequest
    • DistributionListResponse
    • CreateOrderRequest
    • DistributionBalanceResponse
  1. Flutter

Plexy SDK for Flutter

Flutter SDK#

Flutter SDK
Integrate Plexy with Flutter mobile applications
The official Plexy SDK for Flutter. Build a full checkout with Drop-in, or compose individual payment Components. Works on both iOS and Android, with the Sessions flow (recommended) or the Advanced flow.
Requirements
Flutter 3.16 or later
Dart 3.2 or later
iOS 12 or later
Android API level 21 (Android 5.0) or later
Plexy Checkout API v2 or later

Installation#

Copy install command: flutter pub add plexy_checkout
Add the package to your app:
Or add it manually to pubspec.yaml:
Then run flutter pub get.

Platform Setup#

Android#

1.
Set minSdkVersion to 21 in android/app/build.gradle:
2.
Make sure your project uses Kotlin 1.8.22 or later and Android Gradle Plugin 8.1 or later.
3.
Change your MainActivity to extend FlutterFragmentActivity — the native Plexy Android SDK requires it:

iOS#

1.
Set the iOS deployment target to 12.0 or later in ios/Podfile:
2.
Add a custom URL scheme for your return URL in ios/Runner/Info.plist:
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>com.yourcompany.yourapp</string>
    </array>
  </dict>
</array>
3.
Forward the return URL to the SDK in ios/Runner/AppDelegate.swift:
If you handle other URL schemes in the same AppDelegate, combine the results (e.g. return handledByOther || true) instead of falling through to super, which returns false.
Get the matching return URL at runtime with await PlexyCheckout.instance.getReturnUrl(). Pass this value to your backend when creating a session or payment.

Quick Start: Drop-in with Sessions Flow#

The Sessions flow is the simplest way to accept payments. Your backend creates a session, your app renders Drop-in.
1. Create a session on your backend. Call POST /sessions on the Plexy Checkout API with the amount, country, and return URL, and return id and sessionData to your app.
2. Open Drop-in:
See Handling the payment result for handleResult.

Drop-in with Advanced Flow#

Use the Advanced flow when you need to control each /payments and /payments/details call yourself.
onSubmit and onAdditionalDetails both return a PaymentEvent:
Finished(resultCode) — terminal; Drop-in closes.
Action(actionResponse) — Drop-in runs the additional action (3DS, redirect, QR).
Update(paymentMethodsJson, orderJson) — refresh Drop-in (used for gift cards / partial payments).
Error(errorMessage, reason, dismissDropIn) — show an error.

Configuring Drop-in#

DropInConfiguration accepts per-method configs:
Also available on DropInConfiguration: cashAppPayConfiguration, storedPaymentMethodConfiguration (showing and deleting saved methods), and skipListWhenSinglePaymentMethod. See the plugin source for the full field list of each configuration.

Card Component#

Render the Card Component as a Flutter widget inside your own screen. It works with either SessionCheckout or AdvancedCheckout.
For the Advanced flow, construct an AdvancedCheckout (as shown above) and pass it as checkout. Fetch the list of payment methods from POST /paymentMethods and extract the scheme entry the same way.

Apple Pay Component#

Requires the Apple Pay entitlement (Merchant IDs capability) on your iOS app.

Google Pay Component#

Google Pay requires Play Services Wallet, which is bundled by the plugin — no extra Gradle changes needed.

Handling the Payment Result#

PaymentResult is a sealed class. Switch on it:
ResultCode values: authorised, refused, pending, cancelled, error, received, redirectShopper, identifyShopper, challengeShopper, presentToShopper, partiallyAuthorised, authenticationFinished, authenticationNotRequired, unknown.
Never treat the client-side resultCode as a source of truth for "payment completed" — always confirm on the server via webhooks or a GET /sessions/{id} poll.

Return URL#

Pass the value returned by PlexyCheckout.instance.getReturnUrl() into the returnUrl field of your POST /sessions or POST /payments request. On iOS this value matches the URL scheme you registered in Info.plist; on Android the plugin uses an auto-generated scheme.

Debugging#

Enable plugin console logging in debug builds:
The call is a no-op in release builds.
Modified at 2026-07-01 13:46:03
Previous
Flutter Drop-in
Next
Drop-in and Components
Built with