payriff library
Payriff card payments for Flutter, with Apple Pay and Google Pay.
Your server creates the order with its secret key and gives the app the
order's orderId and clientSecret. The app shows the SDK's
PayriffPaymentView, a ready-made payment screen that pays the order with
the publishable key: the card is encrypted on the device, 3-D Secure runs
in the SDK's sheet, and onResult gets a verified, typed PayriffResult.
With PayriffConfig.applePay or PayriffConfig.googlePay it also shows
the wallet's button above the card form. For a screen of your own, use
the PayriffCardForm and Payriff.confirmCardPayment it is built on, and
PayriffApplePayButton or PayriffGooglePayButton. The secret key never
ships in the app.
PayriffPaymentViewStyle and PayriffStrings adapt the screens to your app's design and languages, and Payriff.isSupported tells whether the device can pay.
The result in the app is for the user interface. Fulfil orders on your server, after it confirms them with Payriff.
Classes
- Payriff
- The Payriff SDK entry point.
- PayriffApplePayButton
-
The Apple Pay button on its own, for a payment screen of your own
(CONTRACT §17.10), as
PayriffCardFormandPayriff.confirmCardPaymentare for cards.PayriffPaymentViewalready shows it above the card form. - PayriffApplePayButtonStyle
- The look of the Apple Pay button (CONTRACT §17.10).
- PayriffApplePayConfig
-
Apple Pay in the app, on iOS (CONTRACT §17.2). Set it as
PayriffConfig.applePay; Android ignores it. - PayriffCardController
-
Controls a PayriffCardForm. Pass it to
Payriff.confirmCardPayment. - PayriffCardFieldError
-
One invalid field of a
VALIDATION_FAILEDerror: which field and why. It never contains what the customer typed. - PayriffCardForm
- The native card form (CONTRACT §16.4): card number, expiry, CVV and the cardholder name, which showHolder can hide.
- PayriffCardFormChange
-
The
changeevent of the native card form (CONTRACT §16.4). It never contains the card number, expiry, CVV or holder name. - PayriffCardFormStyle
-
The look of
PayriffCardForm(CONTRACT §16.4, §16.14 and §18). - PayriffClientOrder
-
An order as the Client API shows it to the app (
Payriff.retrieveOrder, CONTRACT §16.10): what the customer is paying and how. - PayriffClientOrderApplePay
-
The Apple Pay part of a PayriffClientOrder (CONTRACT §17.3): Payriff's
own Apple Pay merchant, for its web checkout. The SDK does not use it: in
the app, Apple Pay uses
PayriffApplePayConfig.merchantIdentifier. - PayriffClientOrderGooglePay
- The Google Pay part of a PayriffClientOrder (CONTRACT §17.3): the tokenization parameters of the Google Pay request. Google Pay is offered only when both are set.
- PayriffConfig
-
SDK-wide configuration, passed to
Payriff.configure. - PayriffError
- Describes why an SDK operation failed.
- PayriffGooglePayButton
-
The Google Pay button on its own, for a payment screen of your own
(CONTRACT §17.10), as
PayriffCardFormandPayriff.confirmCardPaymentare for cards.PayriffPaymentViewalready shows it above the card form. - PayriffGooglePayButtonStyle
- The look of the Google Pay button (CONTRACT §17.10).
- PayriffGooglePayConfig
-
Google Pay in the app, on Android (CONTRACT §17.2). Set it as
PayriffConfig.googlePay; iOS ignores it. - PayriffLogEntry
-
One line of SDK logging, delivered through
Payriff.logStreamwhenPayriffConfig.enableLoggingis on. - PayriffPayment
- What the SDK knows about the payment of one order.
- PayriffPaymentView
- The SDK's ready-made card payment screen (CONTRACT §16.14), like the card part of Payriff's hosted payment page (pay.payriff.com).
- PayriffPaymentViewStyle
-
The look of
PayriffPaymentView(CONTRACT §16.14, §17.9, §18, §20). - PayriffResult
-
The outcome of a card payment (
Payriff.confirmCardPayment) or an Apple Pay or Google Pay payment. - PayriffResultCancelled
-
Payriff reported
CANCELED,EXPIREDorPREAUTH_EXPIRED. - PayriffResultDeclined
-
The resolved status is
DECLINED. - PayriffResultFailed
- The payment could not start or run: invalid configuration or arguments, an invalid card form, an order that cannot be paid, a wallet that failed, a Client API error, or another payment is in progress.
- PayriffResultPending
- The final status could not be confirmed. Verify the order on your backend before fulfilling it.
- PayriffResultSuccess
-
The resolved status is
APPROVEDorPREAUTH_APPROVED. - PayriffStrings
- Texts of your own for the SDK's screens (CONTRACT §18.6), for example from your app's localization, or for a language the SDK does not have.
Enums
- PayriffApplePayButtonTheme
-
The colours of the Apple Pay button (CONTRACT §17.10): the
PKPaymentButtonStyleof the same name. - PayriffApplePayButtonType
-
The words on the Apple Pay button (CONTRACT §17.10): the
PKPaymentButtonTypeof the same name. - PayriffCancelReason
- Why a payment ended up PayriffResultCancelled.
- PayriffCardBrand
- A card brand the native card form accepts.
- PayriffCardField
- A field of the native card form (CONTRACT §16.4).
- PayriffCardFieldErrorCode
-
Why a card field is not valid (CONTRACT §16.4,
card_validation.json). - PayriffCardFormLayout
-
How
PayriffCardFormarranges its fields (CONTRACT §16.4). - PayriffEnvironment
- The Payriff environment the SDK talks to. Together with PayriffRegion it picks the API host, PayriffConfig.apiBaseUrl.
- PayriffErrorCode
- Machine-readable error categories, shared by all Payriff mobile SDKs.
- PayriffGooglePayButtonTheme
-
The colours of the Google Pay button (CONTRACT §17.10): the
ButtonConstants.ButtonThemeof the same name. - PayriffGooglePayButtonType
-
The words on the Google Pay button (CONTRACT §17.10): the
ButtonConstants.ButtonTypeof the same name. - PayriffLanguage
- Languages of the SDK's card form, payment view and 3-D Secure sheet.
- PayriffLogLevel
- Severity of a PayriffLogEntry.
- PayriffPaymentMethod
-
How the customer pays in
PayriffPaymentView(CONTRACT §18.5), asonPaymentStartedreports it. - PayriffPaymentStatus
-
A Payriff order
paymentStatus. - PayriffPendingReason
- Why a payment ended up PayriffResultPending.
- PayriffRegion
- The Payriff region whose Client API the SDK talks to (CONTRACT §16.2).
- PayriffWalletPlacement
-
Where
PayriffPaymentViewshows the Apple Pay or Google Pay button (CONTRACT §20.1). Without a wallet the view looks the same with either.
Exceptions / Errors
- PayriffException
-
Thrown by
Payriff.retrieveOrder.