GiniHealth
@objc
public final class GiniHealth : NSObject
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 -
Undocumented
Declaration
Swift
public weak var delegate: GiniHealthDelegate? -
Returns a GiniHealth instance
Declaration
Swift
public init(with giniApiLib: GiniHealthAPI)Parameters
giniApiLibGiniHealthAPI initialized with client’s credentials
-
Getting a list of the banking apps supported by SDK
Declaration
Swift
public func fetchBankingApps(completion: @escaping (Result<PaymentProviders, GiniHealthError>) -> Void)Parameters
completionAn 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
configurationThe 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
docIdId of uploaded document.
completionAn 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, GiniHealthError>) -> Void)Parameters
docIdId of uploaded document.
completionAn 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
docIdId of the uploaded document.
completionAn 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, GiniHealthError>) -> Void)Parameters
paymentInfoModel object for payment information.
completionAn 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
Parameters
requestIDId of the created payment request.
universalLinkUniversal 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
documentIdId of uploaded document.
completionAn 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
documentIdId of uploaded document.
completionAn 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 .
View on GitHub
GiniHealth Class Reference