GiniBank

@objc
public final class GiniBank : NSObject

Core class for Gini Bank SDK.

  • reponsible for interaction with Gini Bank backend.

    Declaration

    Swift

    public var giniApiLib: GiniBankAPI
  • reponsible for the payment processing.

    Declaration

    Swift

    public var paymentService: PaymentService
  • Returns a GiniBank instance

    Declaration

    Swift

    public init(with giniApiLib: GiniBankAPI)

    Parameters

    giniApiLib

    GiniBankAPI initialized with client’s credentials

  • Fetches the payment request via payment request id.

    Declaration

    Swift

    public func receivePaymentRequest(paymentRequestId: String, completion: @escaping (Result<PaymentRequest, GiniBankError>) -> Void)

    Parameters

    paymentRequestId

    Id of payment request.

    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 payment request structure. In case of failure error from the server side.

  • Resolves the payment via payment request id. Important: The amount string in the PaymentInfo must be convertible to a Double. * For ex. “12.39” is valid, but “12.39 €” or “12,39” are not valid.

    Declaration

    Swift

    public func resolvePaymentRequest(paymentRequesId: String, paymentInfo: PaymentInfo, completion: @escaping (Result<ResolvedPaymentRequest, GiniBankError>) -> Void)

    Parameters

    paymentRequesId

    Id of payment request.

    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 resolved payment request structure. In case of failure error from the server side. If the amount string could not be parsed throws amountParsingError

  • Returns back to the business app.

    Declaration

    Swift

    public func returnBackToBusinessAppHandler(resolvedPaymentRequest: ResolvedPaymentRequest)

    Parameters

    resolvedPaymentRequest

    resolved payment request returned by method ‘resolvePaymentRequest’

  • Returns a view controller which will handle the analysis process.

    Note

    Screen API only.

    Declaration

    Swift

    @objc
    public class func viewController(withDelegate delegate: GiniCaptureDelegate,
                                     importedDocuments: [GiniCaptureDocument]? = nil) -> UIViewController

    Parameters

    delegate

    An instance conforming to the GiniCaptureDelegate protocol.

    importedDocuments

    Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.

    Return Value

    A presentable view controller.

  • Returns a view controller which will handle the analysis process.

    Note

    Screen API only.

    Declaration

    Swift

    public class func viewController(withDelegate delegate: GiniCaptureDelegate,
                                           importedDocuments: [GiniCaptureDocument]? = nil,
                                           trackingDelegate: GiniCaptureTrackingDelegate? = nil) -> UIViewController

    Parameters

    delegate

    An instance conforming to the GiniCaptureDelegate protocol.

    importedDocuments

    Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.

    trackingDelegate

    A delegate object to receive user events

    Return Value

    A presentable view controller.

  • Returns a view controller which will handle the analysis process.

    Note

    Screen API only.

    Declaration

    Swift

    @objc
    public class func viewController(withDelegate delegate: GiniCaptureDelegate,
                                     importedDocument: GiniCaptureDocument? = nil) -> UIViewController

    Parameters

    delegate

    An instance conforming to the GiniCaptureDelegate protocol.

    importedDocument

    Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.

    Return Value

    A presentable view controller.

  • Returns a view controller which will handle the analysis process.

    Note

    Screen API only.

    Declaration

    Swift

    public class func viewController(withDelegate delegate: GiniCaptureDelegate,
                                           importedDocument: GiniCaptureDocument? = nil,
                                           trackingDelegate: GiniCaptureTrackingDelegate? = nil) -> UIViewController

    Parameters

    delegate

    An instance conforming to the GiniCaptureDelegate protocol.

    importedDocument

    Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.

    trackingDelegate

    A delegate object to receive user events

    Return Value

    A presentable view controller.

  • Returns a view controller which will handle the analysis process. Allows to set a custom configuration to change the look and feel of the Gini Bank SDK.

    Note

    Screen API only.

    Declaration

    Swift

    @objc
    public class func viewController(withDelegate delegate: GiniCaptureDelegate,
                                     withConfiguration configuration: GiniBankConfiguration,
                                     importedDocument: GiniCaptureDocument? = nil) -> UIViewController

    Parameters

    delegate

    An instance conforming to the GiniCaptureDelegate protocol.

    configuration

    The bank configuration to set.

    importedDocument

    Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.

    Return Value

    A presentable view controller.

  • Returns a view controller which will handle the analysis process. Allows to set a custom configuration to change the look and feel of the Gini Bank SDK.

    Note

    Screen API only.

    Declaration

    Swift

    public class func viewController(withDelegate delegate: GiniCaptureDelegate,
                                           withConfiguration configuration: GiniBankConfiguration,
                                           importedDocument: GiniCaptureDocument? = nil,
                                           trackingDelegate: GiniCaptureTrackingDelegate? = nil) -> UIViewController

    Parameters

    delegate

    An instance conforming to the GiniCaptureDelegate protocol.

    configuration

    The configuration to set.

    importedDocument

    Documents that come from a source different than CameraViewController. There should be either images or one PDF, and they should be validated before calling this method.

    trackingDelegate

    A delegate object to receive user events

    Return Value

    A presentable view controller.

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

    Declaration

    Swift

    @objc
    public class func setConfiguration(_ configuration: GiniBankConfiguration)

    Parameters

    configuration

    The bank configuration to set.

  • Returns a view controller which will handle the analysis process. It’s the easiest way to get started with the Gini Bank SDK as it comes pre-configured and handles all screens and transitions out of the box, including the networking.

    Note

    Screen API only.

    Declaration

    Swift

    public class func viewController(withClient client: Client,
                                     importedDocuments: [GiniCaptureDocument]? = nil,
                                     configuration: GiniBankConfiguration,
                                     resultsDelegate: GiniCaptureResultsDelegate,
                                     documentMetadata: Document.Metadata? = nil,
                                     api: APIDomain = .default,
                                     userApi: UserDomain = .default,
                                     trackingDelegate: GiniCaptureTrackingDelegate? = nil) -> UIViewController

    Parameters

    client

    GiniClient with the information needed to enable document analysis

    resultsDelegate

    Results delegate object where you can get the results of the analysis.

    configuration

    The configuration to set.

    documentMetadata

    Additional HTTP headers to send when uploading documents

    api

    The Gini backend API to use. Supply .custom(“domain”) in order to specify a custom domain.

    userApi

    The Gini user backend API to use. Supply .custom(“domain”) in order to specify a custom domain.

    trackingDelegate

    A delegate object to receive user events

    Return Value

    A presentable view controller.

  • Returns a view controller which will handle the analysis process. It’s the easiest way to get started with the Gini Bank SDK as it comes pre-configured and handles all screens and transitions out of the box with the custom networking.

    Note

    Screen API with custom networking only.

    Declaration

    Swift

    public class func viewController(importedDocuments: [GiniCaptureDocument]? = nil,
                                     configuration: GiniBankConfiguration,
                                     resultsDelegate: GiniCaptureResultsDelegate,
                                     documentMetadata: Document.Metadata? = nil,
                                     trackingDelegate: GiniCaptureTrackingDelegate? = nil,
                                     networkingService: GiniCaptureNetworkService) -> UIViewController

    Parameters

    importedDocuments

    There should be either images or one PDF, and they should be validated before calling this method.

    resultsDelegate

    Results delegate object where you can get the results of the analysis.

    configuration

    The gini bank configuration to set.

    documentMetadata

    Additional HTTP headers to send when uploading documents.

    trackingDelegate

    A delegate object to receive user events.

    networkingService

    A delegate object which implement protocol for the document processing events.

    Return Value

    A presentable view controller.

  • Undocumented

    Declaration

    Swift

    public class func removeStoredCredentials(for client: Client) throws