NexiCore

public final class NexiCore : NSObject

The main entry point for interacting with the Nexi Paygate SDK.

NexiCore provides a centralized interface for configuring the SDK, managing global settings, and initiating payment flows (Card and Apple Pay). It also exposes helper methods for creating payment views.

Properties

  • The current version of the NexiPaygateSDK.

    Declaration

    Swift

    public static let sdkVersion: String
  • The shared configuration object for the SDK.

    This object manages global settings like language, appearance, and enabled card schemes. It is observable, allowing UI components to react to configuration changes.

    Declaration

    Swift

    public static let configuration: NexiConfiguration
  • The language used for the CardView and other UI components.

    Defaults to .english. Setting this property updates the configuration.language property. If set to .automatic, the SDK will attempt to resolve the language based on the device’s system settings.

    Declaration

    Swift

    public static var language: CardViewLanguage { get set }
  • The central point for managing the appearance of the SDK’s UI components.

    You can assign your own custom appearance object that conforms to CustomizableComponents to this property to theme the entire SDK. This updates configuration.appearance.

    Declaration

    Swift

    public static var appearance: CustomizableComponents { get set }
  • The set of currently enabled card schemes.

    This property determines which card brands are accepted by the SDK. Updates configuration.enabledCardSchemes.

    Declaration

    Swift

    public static var enabledCardSchemes: Set<CardScheme> { get set }
  • All available card schemes that are supported by the SDK.

    This static property provides a comprehensive list of all card schemes (e.g., Visa, Mastercard) that the SDK is capable of processing.

    Declaration

    Swift

    public static let availableCardSchemes: Set<CardScheme>

Payment: Manual Card Payment

  • Creates a CardPayment instance configured with optional merchant preferences.

    Use this method to initiate a standard card payment flow where the user enters card details manually.

    Declaration

    Swift

    public static func cardPayment(
        with merchant: CardMerchantPreferences = Merchant()
    ) -> CardPayment

    Parameters

    merchant

    The merchant preferences and configuration options. Defaults to a new Merchant instance with standard settings.

    Return Value

    A new CardPayment instance ready to process a transaction.

Payment: Apple Pay Payment

View: Manual Card Entry

  • Provides a SwiftUI view for manual card entry.

    This method returns a view that renders the card input form, handling user interaction and validation.

    Declaration

    Swift

    @ViewBuilder
    public static func cardDetailsEntry(
        for cardPayment: Binding<CardPayment>,
        bannerTitle: String?,
        saveCardToggleOption: SaveCardToggleOption,
        onFormAction: @escaping (FormEvent) -> Void
    ) -> some View

    Parameters

    cardPayment

    A binding to the CardPayment instance that manages the payment state.

    bannerTitle

    An optional title to display on the banner of the card entry view.

    saveCardToggleOption

    Specifies the visibility and labeling of the “Save Card” toggle within the form. Use .none to hide it, .defaultLabel for standard localized text, or .customLabel(String) for custom text.

    onFormAction

    A closure triggered to propagate form events (e.g., validation changes, completion) to the parent view.

    Return Value

    A view for card details entry.

View: Apple Pay Button

  • Provides a Apple Pay button

    Declaration

    Swift

    @ViewBuilder
    public static func applePayButton(
    onTapAction: @escaping () -> Void) -> some View

    Parameters

    onFormAction

    A closure triggered to propagate tap gesture action

    Return Value

    A view for Apple Pay button