swichpay library

SwichPay SDK for Flutter.

Classes

CardDetails
Raw card details collected from the payment sheet - never logged or persisted.
DirectBank
A bank from a direct (session-less) flow's bank-list endpoint; distinct from PaymentBank.
PaymentBank
A bank enabled for a payment session, scoped per channelCode - the same bankId can repeat.
PaymentChannel
A wallet channel (e.g. EasyPaisa, JazzCash) enabled for a payment session.
PaymentDetails
Order, customer, and redirect details for a single payment attempt.
PaymentResult
Outcome of a payment attempt, returned by SwichPay.pay and delivered to SwichPay.onResult.
PaymentSessionDetails
Details of a payment session; drives the payment sheet's method list, countdown, and attempts display. Intentionally has no clientSecret field - the SDK never calls paymentsession/get directly.
PaymentSessionInquiryResult
Result of GET /gateway/paymentsession/inquire; a lightweight status check, distinct from PaymentSessionDetails.
SavedCard
A card previously saved via doCardOnFile: true. id is sent as savedCardId to pay with it.
SavedWallet
A wallet account the customer previously saved. channel is PaymentChannel.channelId as a string; match it against PaymentSessionDetails.channels to find the channel's name/code/logo.
SwichPay
Static facade and single public entry point for the SDK.

Enums

Environment
The backend environment a SwichPay client talks to.
PaymentCategory
A payment method category enabled for this merchant, from mobileappinit's categoryList.

Functions

swichpayUserMessage(Object error) → String
SwichPayException.userMessage for SwichPay errors, a generic fallback for anything else.

Exceptions / Errors

SwichPayApiException
Thrown when the SwichPay API returns an error response.
SwichPayException
Base type for every error the SDK can throw.
SwichPayNetworkException
Thrown when the SDK fails to reach the SwichPay API.
SwichPayNotInitializedException
Thrown when a method is called before SwichPay.initialize.
SwichPayValidationException
Thrown for malformed input (bad card number, missing fields, etc.) before any network call is made.