GiniBusiness

public final class GiniBusiness

GiniBusiness is the main class for interacting with Gini Pay Business SDK. It provides a way to submit a document for reviewing its extracted payment details and let's the user make the payment with one of the payment providers.

The recommended flow is:

  1. Call checkRequirements to make sure that the flow can be completed.

  2. Call one of the overloads of setDocumentForReview, to submit a document.

  3. Display ReviewFragment.

setDocumentForReview can be called with:

  1. Document instance in the case the upload was performed with Gini Pay Api lib (Gini).

  2. Document id, this will probably be the case when there's backend integration between the Business Client and Gini. This method will make a network call to obtain a Document instance so the other one is preferred if you have the Document instance.

documentFlow, paymentFlow, openBankState are used by the ReviewFragment to observe their state, but they are public so that they can be observed anywhere, the main purpose for this is to observe errors.

Constructors

GiniBusiness
Link copied to clipboard
GiniBusiness GiniBusiness(Gini giniApi)

Types

Companion
Link copied to clipboard
public class Companion
PaymentState
Link copied to clipboard
public class PaymentState

Functions

checkIfDocumentIsPayable
Link copied to clipboard
final Boolean checkIfDocumentIsPayable(String documentId)
Checks whether the document is payable by fetching the document and its extractions from the Gini Pay API and verifying that the extractions contain an IBAN.
checkRequirements
Link copied to clipboard
final List<RequirementcheckRequirements(PackageManager packageManager)
Checks the required conditions needed to finish the payment flow to avoid unnecessary document upload.
getDocumentFlow
Link copied to clipboard
final StateFlow<ResultWrapper<Document>> getDocumentFlow()
A flow for getting the Document set for review setDocumentForReview.
getGiniApi
Link copied to clipboard
final Gini getGiniApi()
getOpenBankState
Link copied to clipboard
final StateFlow<GiniBusiness.PaymentStategetOpenBankState()
A flow that exposes the state of opening the bank.
getPaymentFlow
Link copied to clipboard
final StateFlow<ResultWrapper<PaymentDetails>> getPaymentFlow()
A flow for getting extracted PaymentDetails for the document set for review (see setDocumentForReview).
setDocumentForReview
Link copied to clipboard
final Unit setDocumentForReview(Document document)
Sets a Document for review.
final Unit setDocumentForReview(String documentId, PaymentDetails paymentDetails)
Sets a Document for review.
setSavedStateRegistryOwner
Link copied to clipboard
final Unit setSavedStateRegistryOwner(SavedStateRegistryOwner registryOwner, CoroutineScope retryScope)
Sets a lifecycle observer to handle state restoration after the system kills the app.

Properties

documentFlow
Link copied to clipboard
private final StateFlow<ResultWrapper<Document>> documentFlow
A flow for getting the Document set for review setDocumentForReview.
giniApi
Link copied to clipboard
private final Gini giniApi
openBankState
Link copied to clipboard
private final StateFlow<GiniBusiness.PaymentStateopenBankState
A flow that exposes the state of opening the bank.
paymentFlow
Link copied to clipboard
private final StateFlow<ResultWrapper<PaymentDetails>> paymentFlow
A flow for getting extracted PaymentDetails for the document set for review (see setDocumentForReview).