-
public final class PaymentComponentThe PaymentComponent manages the data and state used by every PaymentComponentView, the MoreInformationFragment, and the BankSelectionBottomSheet.
It requires a GiniMerchant instance and a Context (application or activity) to be created.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfacePaymentComponent.ListenerA listener for the PaymentComponent. It exposes the user interactions with all of the PaymentComponentViews.
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<PaymentProviderAppsState>paymentProviderAppsFlowprivate final StateFlow<SelectedPaymentProviderAppState>selectedPaymentProviderAppFlowprivate PaymentComponent.Listenerlistenerprivate BankPickerRowsbankPickerRowsprivate BooleanshouldCheckReturningUserprivate final GiniInternalPaymentModulepaymentModule
-
Constructor Summary
Constructors Constructor Description PaymentComponent(Context context, GiniInternalPaymentModule paymentModule)
-
Method Summary
Modifier and Type Method Description final StateFlow<PaymentProviderAppsState>getPaymentProviderAppsFlow()A StateFlow which emits the state of the payment provider apps. final StateFlow<SelectedPaymentProviderAppState>getSelectedPaymentProviderAppFlow()A StateFlow which emits the state of the selected payment provider app. final PaymentComponent.ListenergetListener()A listener for the payment component. final UnitsetListener(PaymentComponent.Listener listener)A listener for the payment component. final BankPickerRowsgetBankPickerRows()Holds information about which layout to use for the bank picker: single line or two lines. final UnitsetBankPickerRows(BankPickerRows bankPickerRows)Holds information about which layout to use for the bank picker: single line or two lines. final BooleangetShouldCheckReturningUser()Whether we need to check for returning user and hide Select your bank to paylabel.final UnitsetShouldCheckReturningUser(Boolean shouldCheckReturningUser)Whether we need to check for returning user and hide Select your bank to paylabel.final GiniInternalPaymentModulegetPaymentModule()final LocalegetGiniPaymentLanguage(Context context)final UnitloadPaymentProviderApps()Loads the payment provider apps and selects the first installed payment provider app or nothing if no payment provider app is installed. final UnitrecheckWhichPaymentProviderAppsAreInstalled()final UnitonPayInvoiceClicked(String documentId)final BooleancheckReturningUser()-
-
Constructor Detail
-
PaymentComponent
PaymentComponent(Context context, GiniInternalPaymentModule paymentModule)
-
-
Method Detail
-
getPaymentProviderAppsFlow
final StateFlow<PaymentProviderAppsState> getPaymentProviderAppsFlow()
A StateFlow which emits the state of the payment provider apps. See PaymentProviderAppsState for the possible states.
-
getSelectedPaymentProviderAppFlow
final StateFlow<SelectedPaymentProviderAppState> getSelectedPaymentProviderAppFlow()
A StateFlow which emits the state of the selected payment provider app. See SelectedPaymentProviderAppState for the possible states.
-
getListener
final PaymentComponent.Listener getListener()
A listener for the payment component. It exposes the user interactions with all of the PaymentComponentViews. See Listener for the methods you need to implement.
-
setListener
final Unit setListener(PaymentComponent.Listener listener)
A listener for the payment component. It exposes the user interactions with all of the PaymentComponentViews. See Listener for the methods you need to implement.
-
getBankPickerRows
final BankPickerRows getBankPickerRows()
Holds information about which layout to use for the bank picker: single line or two lines.
-
setBankPickerRows
final Unit setBankPickerRows(BankPickerRows bankPickerRows)
Holds information about which layout to use for the bank picker: single line or two lines.
-
getShouldCheckReturningUser
final Boolean getShouldCheckReturningUser()
Whether we need to check for returning user and hide
Select your bank to paylabel.
-
setShouldCheckReturningUser
final Unit setShouldCheckReturningUser(Boolean shouldCheckReturningUser)
Whether we need to check for returning user and hide
Select your bank to paylabel.
-
getPaymentModule
final GiniInternalPaymentModule getPaymentModule()
-
getGiniPaymentLanguage
final Locale getGiniPaymentLanguage(Context context)
-
loadPaymentProviderApps
final Unit loadPaymentProviderApps()
Loads the payment provider apps and selects the first installed payment provider app or nothing if no payment provider app is installed. The selection (or lack of selection) will be visible once a PaymentComponentView is shown.
By collecting the paymentProviderAppsFlow and selectedPaymentProviderAppFlow you can observe the state of the loading process.
-
recheckWhichPaymentProviderAppsAreInstalled
final Unit recheckWhichPaymentProviderAppsAreInstalled()
-
onPayInvoiceClicked
final Unit onPayInvoiceClicked(String documentId)
-
checkReturningUser
final Boolean checkReturningUser()
-
-
-
-