GiniHealth

@objc
public final class GiniHealth : NSObject
extension GiniHealth: PaymentComponentsConfigurationProvider
extension GiniHealth: PaymentComponentsStringsProvider
extension GiniHealth: PaymentComponentsControllerProtocol

Core class for Gini Health SDK.

  • reponsible for interaction with Gini Health backend .

    Declaration

    Swift

    public var giniApiLib: GiniHealthAPI
  • reponsible for the whole document processing.

    Declaration

    Swift

    public var documentService: DefaultDocumentService
  • reponsible for the payment processing.

    Declaration

    Swift

    public var paymentService: PaymentService
  • delegate to inform about the current status of the Gini Health SDK.

    Declaration

    Swift

    public weak var delegate: GiniHealthDelegate?
  • delegate to inform about the changes into PaymentComponentsController

    Declaration

    Swift

    public weak var paymentDelegate: PaymentComponentsControllerProtocol?
  • Configuration for the payment component, controlling its branding and display options.

    Declaration

    Swift

    public var paymentComponentConfiguration: PaymentComponentConfiguration
  • Undocumented

    Declaration

    Swift

    public var paymentComponentsController: PaymentComponentsController!
  • Initializes a new instance of GiniHealth.

    This initializer creates a GiniHealth instance by first constructing a Client object with the provided client credentials (id, secret, domain)

    • id: The client ID provided by Gini when you register your application. This is a unique identifier for your application.
    • secret: The client secret provided by Gini alongside the client ID. This is used to authenticate your application to the Gini API.
    • domain: The domain associated with your client credentials. This is used to scope the client credentials to a specific domain.
    • logLevel: The log level. LogLevel.none by default.

    Declaration

    Swift

    public init(id: String,
                secret: String,
                domain: String,
                apiVersion: Int = Constants.defaultVersionAPI,
                logLevel: LogLevel = .none)
  • Initializes a new instance of GiniHealth.

    This initializer creates a GiniHealth instance by first constructing a Client object with the provided client credentials (id, secret, domain)

    • id: The client ID provided by Gini when you register your application. This is a unique identifier for your application.
    • secret: The client secret provided by Gini alongside the client ID. This is used to authenticate your application to the Gini API.
    • domain: The domain associated with your client credentials. This is used to scope the client credentials to a specific domain.
    • pinningConfig: Configuration for certificate pinning. Format [“PinnedDomains” : [“PublicKeyHashes”]]
    • logLevel: The log level. LogLevel.none by default.

    Declaration

    Swift

    public init(id: String,
                secret: String,
                domain: String,
                apiVersion: Int = Constants.defaultVersionAPI,
                pinningConfig: [String: [String]],
                logLevel: LogLevel = .none)
  • Initializes a new instance of GiniHealth.

    Declaration

    Swift

    public init(giniApiLib: GiniHealthAPI)

    Parameters

    giniApiLib

    The GiniHealthAPI instance used for document and payment services.

  • Initiates the payment flow for a specified document and payment information.

    This method sets up the payment flow by storing the provided document ID, payment information, and navigation controller. If a selectedPaymentProvider is available, it either presents the payment review screen or the payment view bottom sheet, depending on the configuration. If no payment provider is selected, it directly presents the payment view bottom sheet.

    Declaration

    Swift

    public func startPaymentFlow(documentId: String?, paymentInfo: GiniHealthSDK.PaymentInfo?, navigationController: UINavigationController, trackingDelegate: GiniHealthTrackingDelegate?)

    Parameters

    documentId

    An optional identifier for the document associated id with the payment flow.

    paymentInfo

    An optional PaymentInfo object containing the payment details.

    navigationController

    The UINavigationController used to present subsequent view controllers in the payment flow.

    trackingDelegate

    The GiniHealthTrackingDelegate provides event information that happens on PaymentReviewScreen.

  • Fetches bank logos for the available payment providers.

    Declaration

    Swift

    public func fetchBankLogos() -> (logos: [Data]?, additionalBankCount: Int?)

    Return Value

    A tuple containing an array of logo data and the count of additional banks, if any.

  • Getting a list of the banking apps supported by SDK

    Declaration

    Swift

    public func fetchBankingApps(completion: @escaping (Result<PaymentProviders, GiniError>) -> Void)

    Parameters

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. In success case it includes array of payment providers supported by SDK. In case of failure error provided by API.

  • Sets a configuration which is used to customize the look of the Gini Health SDK, for example to change texts and colors displayed to the user.

    Declaration

    Swift

    public func setConfiguration(_ configuration: GiniHealthConfiguration)

    Parameters

    configuration

    The configuration to set.

  • Checks if the document is payable, looks for iban extraction.

    Declaration

    Swift

    public func checkIfDocumentIsPayable(docId: String, completion: @escaping (Result<Bool, GiniHealthError>) -> Void)

    Parameters

    docId

    Id of uploaded document.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success case it includes a boolean value and returns true if paymentState is payable. In case of failure in case of failure error from the server side.

  • Checks if the document contains multiple invoices.

    Declaration

    Swift

    public func checkIfDocumentContainsMultipleInvoices(docId: String, completion: @escaping (Result<Bool, GiniHealthError>) -> Void)

    Parameters

    docId

    Id of uploaded document.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success case it includes a boolean value and returns true if contains multiple documents is true or false In case of failure in case of failure error from the server side.

  • Polls the document via document id.

    Declaration

    Swift

    public func pollDocument(docId: String, completion: @escaping (Result<Document, GiniHealthError>) -> Void)

    Parameters

    docId

    Id of uploaded document.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success returns the polled document. In case of failure error from the server side.

  • Get extractions for the document.

    Declaration

    Swift

    public func getExtractions(docId: String, completion: @escaping (Result<[Extraction], GiniHealthError>) -> Void)

    Parameters

    docId

    Id of the uploaded document.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success case it includes array of extractions. In case of failure in case of failure error from the server side.

  • Get all extractions for the document. Medical information included.

    Declaration

    Swift

    public func getAllExtractions(docId: String, completion: @escaping (Result<[Extraction], GiniHealthError>) -> Void)

    Parameters

    docId

    Id of the uploaded document.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success case it includes array of extractions. In case of failure in case of failure error from the server side.

  • Creates a payment request

    Declaration

    Swift

    public func createPaymentRequest(paymentInfo: GiniInternalPaymentSDK.PaymentInfo, completion: @escaping (Result<String, GiniError>) -> Void)

    Parameters

    paymentInfo

    Model object for payment information.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success it includes the id of created payment request. In case of failure error from the server side.

  • Opens an app of selected payment provider. openUrl called on main thread.

    Declaration

    Swift

    public func openPaymentProviderApp(requestID: String, universalLink: String, urlOpener: URLOpener = URLOpener(UIApplication.shared), completion: GiniOpenLinkCompletionBlock? = nil)

    Parameters

    requestId

    Id of the created payment request.

    universalLink

    Universal link for the selected payment provider

  • Sets a data for payment review screen

    Declaration

    Swift

    public func setDocumentForReview(documentId: String, completion: @escaping (Result<[Extraction], GiniHealthError>) -> Void)

    Parameters

    documentId

    Id of uploaded document.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success it includes array of extractions. In case of failure error from the server side.

  • Fetches document and extractions for payment review screen

    Declaration

    Swift

    public func fetchDataForReview(documentId: String, completion: @escaping (Result<DataForReview, GiniHealthError>) -> Void)

    Parameters

    documentId

    Id of uploaded document.

    completion

    An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. Completion block called on main thread. In success returns DataForReview structure. It includes document and array of extractions. In case of failure error from the server side and nil instead of document .

  • Retrieves a payment request by ID.
    

    Declaration

    Swift

    public func getPaymentRequest(by id: String,
                                  completion: @escaping (Result<PaymentRequest, GiniError>) -> Void)
  • A static string representing the current version of the Gini Health SDK.

    Declaration

    Swift

    public static var versionString: String { get }
  • Undocumented

    Declaration

    Swift

    public var defaultStyleInputFieldConfiguration: TextFieldConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var errorStyleInputFieldConfiguration: TextFieldConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var selectionStyleInputFieldConfiguration: TextFieldConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var showPaymentReviewCloseButton: Bool { get }
  • Undocumented

    Declaration

    Swift

    public var paymentComponentButtonsHeight: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    public var paymentReviewContainerConfiguration: PaymentReviewContainerConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var installAppConfiguration: InstallAppConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var bottomSheetConfiguration: BottomSheetConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var shareInvoiceConfiguration: ShareInvoiceConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var paymentInfoConfiguration: PaymentInfoConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var bankSelectionConfiguration: BankSelectionConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var paymentComponentsConfiguration: PaymentComponentsConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var paymentReviewConfiguration: PaymentReviewConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var poweredByGiniConfiguration: PoweredByGiniConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var moreInformationConfiguration: MoreInformationConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var primaryButtonConfiguration: GiniInternalPaymentSDK.ButtonConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var secondaryButtonConfiguration: GiniInternalPaymentSDK.ButtonConfiguration { get }
  • Undocumented

    Declaration

    Swift

    public var paymentReviewContainerStrings: PaymentReviewContainerStrings { get }
  • Undocumented

    Declaration

    Swift

    public var paymentComponentsStrings: PaymentComponentsStrings { get }
  • Undocumented

    Declaration

    Swift

    public var installAppStrings: InstallAppStrings { get }
  • Undocumented

    Declaration

    Swift

    public var shareInvoiceStrings: ShareInvoiceStrings { get }
  • Undocumented

    Declaration

    Swift

    public var paymentInfoStrings: PaymentInfoStrings { get }
  • Undocumented

    Declaration

    Swift

    public var banksBottomStrings: BanksBottomStrings { get }
  • Undocumented

    Declaration

    Swift

    public var paymentReviewStrings: PaymentReviewStrings { get }
  • Undocumented

    Declaration

    Swift

    public var poweredByGiniStrings: PoweredByGiniStrings { get }
  • Undocumented

    Declaration

    Swift

    public var moreInformationStrings: MoreInformationStrings { get }
  • Undocumented

    Declaration

    Swift

    public func isLoadingStateChanged(isLoading: Bool)
  • Undocumented

    Declaration

    Swift

    public func didFetchedPaymentProviders()
  • Undocumented

    See more

    Declaration

    Swift

    public enum Constants