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
giniApiLib
GiniHealthAPI initialized with client’s credentials
-
Checks if there are any banking app which support Gini Pay Connect functionality installed.
Declaration
Swift
public func checkIfAnyPaymentProviderAvailable(completion: @escaping (Result<PaymentProviders, GiniHealthError>) -> 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 Connect 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 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 which 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 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
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.
-
Creates a payment request
Declaration
Swift
public func createPaymentRequest(paymentInfo: PaymentInfo, completion: @escaping (Result<String, GiniHealthError>) -> 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], 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 .