GiniMerchant
@objc
public final class GiniMerchant : NSObject
Core class for Gini Merchant 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 Merchant SDK.
Declaration
Swift
public weak var delegate: GiniMerchantDelegate?
-
Initializes a new instance of GiniMerchant.
This initializer creates a GiniMerchant 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.
-
Initializes a new instance of GiniMerchant.
This initializer creates a GiniMerchant 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.
-
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 Merchant SDK, for example to change texts and colors displayed to the user.
Declaration
Swift
public func setConfiguration(_ configuration: GiniMerchantConfiguration)
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, GiniMerchantError>) -> 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, GiniMerchantError>) -> 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], GiniMerchantError>) -> 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, 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: ((Bool) -> Void)? = 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], GiniMerchantError>) -> 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, GiniMerchantError>) -> 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 .
-
Undocumented
Declaration
Swift
public static var versionString: String { get }
-
Undocumented
See moreDeclaration
Swift
public enum Constants