5. Configuration and features

CashierConfiguration holds the options of one cashier session. Every option has a default, so CashierConfiguration() gives the recommended cashier, and new options are added with defaults so your code keeps compiling.

let configuration = CashierConfiguration(
    features: CashierFeatures.default.subtracting(.promotions),
    theme: CashierTheme(brandColorLight: "#006FFF", buttonShape: .pill),
    texts: CashierTexts([.pay: "Pay now"]),
    closeButton: .visible)

CashierView(token: token, environment: environment, configuration: configuration) { result in
    handle(result)
}
OptionDefaultWhat it does
featuresCashierFeatures.default (all)The parts of the cashier that are on. The SDK fetches data only for these
themeempty (server theme applies)Theme values set in code. Each value you set wins over the server theme for the same key (section 10)
textsempty (server texts apply)Texts set in code. Each text you set wins over the server text of the same key (section 10)
hooksnoneYour code that the cashier calls: events, live amount, method filter, field rules (section 7)
paymentHandler.praxisWho sends the payment after the final tap (section 8)
lockCardholderNamefalseLocks the cardholder name field: the customer cannot change the name prefilled from the profile
prefillsMethodFieldstrueThe method fields start with the customer's profile values. false leaves them empty (a saved template or a default value still fills them)
returnsAfterResultfalsetrue ends the cashier at once when a payment result arrives that opens no provider page; onResult gets the result with closedBy = sdk. The SDK's result, bank details, partial approval and pending screens are skipped
closeButton.automatic.automatic follows the session's server setting show_close_button; .visible always shows it; .hidden never shows it (your app then closes the cashier with close())

Features

A feature that is off costs no network request and shows nothing. The server settings still decide what shows when a feature is on.

FeatureOnOff
.editableAmountThe customer can change the amountThe session amount shows as fixed text
.amountLimitsThe cashier fetches the method limits for the session currency and blocks amounts outside themNo limits are fetched; Praxis checks the amount only when the customer pays
.quickAmountsQuick amount buttons, and the customer's last deposit as the starting amountNo buttons, no last deposit is read
.currencyChangeThe customer can change the payment currencyThe currency stays the starting currency; the method list is still read for it
.promotionsBonuses and promotion codesNo bonus or code block, no bonus data is read, no code is sent with the payment
.savedInstrumentsSaved cards and saved accountsSaved rows are hidden, no saved card list is read, nothing can be removed
.applePayApple Pay as its own method and as the switch inside the card method (when the session and the entitlement allow it)Apple Pay methods are left out and the card method shows no switch
// Fixed amount and no promotions: no limits or bonuses are fetched.
let configuration = CashierConfiguration(
    features: CashierFeatures.default.subtracting([.editableAmount, .amountLimits, .promotions]))

Did this page help you?