PrimerSettings
object, no matter whether you’re
using the drop-in or headless integration, auto or manual flow. This object greatly depends on your
payment methods configuration.
Hide Properties
.auto
.Hide Cases
primerDidTokenizePaymentMethod(_:decisionHandler:)
delegate function of PrimerDelegate
, create a payment on your backend and call the decisionHandler
of the delegate function once you receive your backend’s response.Hide Properties
Hide Properties
false
. Set to true
to let Apple Pay capture the customer’s billing address.Use BillingOptions to configure required billing fields.false
. The default value is true
.Default value is true
. Set to false
if you do not want to present
Apple Pay option on unsupported devices.false
. The default value true
.Default value is true
. This flag supports the old behavior where Apple
Pay flow might not present if there are no cards in the Wallet.Hide Properties
Hide Properties
Hide Properties
uiOptions
for custom UI options of the Primer SDK.Hide Properties
false
to hide the loading screen before the Universal Checkout or the Vault Manager. Defaults to true
.false
to hide the screen after a successful payment, or tokenization on the vault flow. Defaults to true
.false
to hide the error screen when an error occurs. Defaults to true
.gestures
: The dialog can be dismissed by tapping outside or by swiping down.closeButton
: A close button is provided, allowing users to dismiss the dialog manually.Hide Properties
true
, responses from the server will be cached on the client side, allowing for faster subsequent
access to the same data within the cache duration. When set to false
, every request to the server will be
processed without utilizing any client-side cache, ensuring that the client always receives the most up-to-date data.PrimerApiVersion.V2_3
- will use ApiVersion 2.3PrimerApiVersion.V2_4
- will use ApiVersion 2.4V2.4
will be used by default.settings
object.
// 👇 Add this
import PrimerSDK
class MyViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// 👇 Create your settings
let settings = PrimerSettings(
paymentHandling: .auto,
localeData: PrimerLocaleData(
languageCode: "en",
regionCode: "US"),
paymentMethodOptions: PrimerPaymentMethodOptions(
urlScheme: "URL_SCHEME://",
applePayOptions: PrimerApplePayOptions(
merchantIdentifier: "MERCHANT_IDENTIFIER",
merchantName: "MERCHANT_NAME",
isCaptureBillingAddressEnabled: true,
showApplePayForUnsupportedDevice: true,
checkProvidedNetworks: true,
shippingOptions: PrimerApplePayOptions.ShippingOptions(
shippingContactFields: [.name, .emailAddress],
requireShippingMethod: true
),
billingOptions: PrimerApplePayOptions.BillingOptions(
requiredBillingContactFields: [.postalAddress]
)
),
klarnaOptions: PrimerKlarnaOptions(
recurringPaymentDescription: "RECURRING_PAYMENT_DESCRIPTION"),
stripeOptions: PrimerStripeOptions(
publishableKey: "STRIPE_PUBLISHABLE_KEY")),
uiOptions: PrimerUIOptions(
isInitScreenEnabled: false,
isSuccessScreenEnabled: false,
isErrorScreenEnabled: false),
debugOptions: PrimerDebugOptions(is3DSSanityCheckEnabled: false),
clientSessionCachingEnabled: false)
}
}