GiniPayBusiness

@objc
public final class GiniPayBusiness : NSObject

Core class for GiniPayBusiness SDK.

  • reponsible for interaction with Gini Pay backend .

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

    public var paymentService: PaymentService
  • Undocumented

    Declaration

    Swift

    public weak var delegate: GiniPayBusinessDelegate?
  • Returns a GiniPayBusiness instance

    Declaration

    Swift

    public init(with giniApiLib: GiniApiLib)

    Parameters

    giniApiLib

    GiniApiLib initialized with client’s credentials

  • Checks if there are any banking app which support Gini Pay functionality installed.

    Declaration

    Swift

    public func checkIfAnyPaymentProviderAvailiable(completion: @escaping (Result<PaymentProviders, GiniPayBusinessError>) -> 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. Completion block called on main thread. In success case it includes array of payment providers. In case of failure error that there are no supported banking apps installed.

  • Checks if there is any banking app which can support Gini Pay functionality installed.

    Declaration

    Swift

    public func isAnyBankingAppInstalled(appSchemes: [String]) -> Bool

    Parameters

    appSchemes

    A list of [LSApplicationQueriesSchemes] added in Info.plist. Scheme format: ginipay-bank://

    Return Value

    a boolean value.

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

    Declaration

    Swift

    public func setConfiguration(_ configuration: GiniPayBusinessConfiguration)

    Parameters

    configuration

    The configuration to set.

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

    Declaration

    Swift

    public func checkIfDocumentIsPayable(docId: String, completion: @escaping (Result<Bool, GiniPayBusinessError>) -> 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 iban was extracted. 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, GiniPayBusinessError>) -> 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], GiniPayBusinessError>) -> 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: PaymentInfo, completion: @escaping (Result<String, GiniPayBusinessError>) -> 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, appScheme: String)

    Parameters

    requestID

    Id of the created payment request.

    appScheme

    App scheme for the selected payment provider

  • Sets a data for payment review screen

    Declaration

    Swift

    public func setDocumentForReview(documentId: String, completion: @escaping (Result<[Extraction], GiniPayBusinessError>) -> 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, GiniPayBusinessError>) -> 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 .