public class PaymentOptionsDataManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
PaymentOptionsDataManager.PaymentOptionsDataListener
The interface Payment options data listener.
|
private class |
PaymentOptionsDataManager.ViewModelsHandler |
Modifier and Type | Field and Description |
---|---|
private int |
availableHeight |
private int |
cardSwitchHeight |
private int |
focusedPosition |
private java.lang.String |
lastFilteredCurrency |
private PaymentOptionsDataManager.PaymentOptionsDataListener |
listener |
private PaymentOptionsDataManager.ViewModelsHandler |
modelsHandler |
private PaymentOptionsResponse |
paymentOptionsResponse |
private int |
saveCardHeight |
private AmountedCurrency |
selectedCurrency |
private java.util.ArrayList<PaymentOptionViewModel> |
viewModels |
private java.util.ArrayList<PaymentOptionViewModel> |
visibleViewModels |
Constructor and Description |
---|
PaymentOptionsDataManager(PaymentOptionsResponse paymentOptionsResponse)
Instantiates a new Payment options data manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addressOnCardClicked()
Address on card clicked.
|
private void |
applyEmptyHolderHeight() |
void |
binNumberEntered(java.lang.String binNumber)
Bin number entered.
|
void |
cancelItemClicked()
this method will be called if user clicks on cancel saved card
|
void |
cardDetailsFilled(boolean isFilled,
CardCredentialsViewModel cardCredentialsViewModel)
Card details filled.
|
void |
cardExpirationDateClicked()
Card expiration date clicked.
|
void |
cardExpirationDateSelected(java.lang.String month,
java.lang.String year)
Card expiration date selected.
|
void |
cardScanned(io.card.payment.CreditCard card)
Card scanned.
|
void |
cardScannerButtonClicked()
Card scanner button clicked.
|
void |
checkShakingStatus() |
void |
clearFocus()
Clear focus.
|
private void |
clearPaymentOptionsResponseCards() |
void |
currencyHolderClicked(int position)
Currency holder clicked.
|
void |
currencySelectedByUser(AmountedCurrency selectedCurrency)
Currency selected by user.
|
void |
deleteCard(java.lang.String cardId) |
void |
disablePayButton() |
void |
editItemClicked(GroupViewHolder groupViewHolderListener)
this method will be called if user clicks on edit saved card
|
void |
filterViewModelsWithAmountedCurrency(AmountedCurrency amountedCurrency)
Filter view models with amounted currency.
|
PaymentOption |
findPaymentOption(java.lang.String paymentOptionIdentifier)
Find payment option payment option.
|
int |
getItemViewType(int position)
Gets item view type.
|
PaymentOptionsDataManager.ViewModelsHandler |
getModelsHandler()
Gets models handler.
|
PaymentOptionsResponse |
getPaymentOptionsResponse()
Gets payment options response.
|
AmountedCurrency |
getSelectedCurrency()
Gets selected currency.
|
int |
getSize()
Gets size.
|
private AmountedCurrency |
getTransactionCurrency() |
PaymentOptionViewModel |
getViewModel(int position)
Gets view model.
|
private java.util.ArrayList<PaymentOptionViewModel> |
getViewModels() |
private java.util.ArrayList<PaymentOptionViewModel> |
getVisibleViewModels() |
boolean |
isPositionInFocus(int position)
Is position in focus boolean.
|
void |
recentPaymentItemClicked(int position,
SavedCard recentItem,
RecentSectionViewModel recentSectionViewModel)
Recent payment item clicked.
|
void |
saveCardSwitchCheckedChanged(boolean isChecked,
int saveCardBlockPosition)
Save card switch checked changed.
|
void |
saveState()
Save state.
|
void |
setAvailableHeight(int availableHeight)
Sets available height.
|
void |
setCardSwitchHeight(int cardSwitchHeight)
Sets card switch height.
|
void |
setCurrentBINData(BINLookupResponse currentBINData)
Set current bin data.
|
private void |
setFocused(int position) |
PaymentOptionsDataManager |
setListener(PaymentOptionsDataManager.PaymentOptionsDataListener listener)
Sets listener.
|
void |
setRecentPaymentFocusedCard(int position)
Sets recent payment focused card.
|
void |
setSaveCardHeight(int neededHeight)
Sets save card height.
|
void |
setSelectedCurrency(AmountedCurrency selectedCurrency)
Sets selected currency.
|
void |
showAddressOnCardCell(boolean isShow)
Show address on card cell.
|
void |
updateCurrencySection()
Update currency section.
|
void |
updatePayButtonWithExtraFees(PaymentOption paymentOption)
Update pay button with extra fees.
|
void |
updateSavedCards(java.lang.String cardId)
Update saved Cards after deletion
|
void |
webPaymentSystemViewHolderClicked(WebPaymentViewModel sender,
int position)
Web payment system view holder clicked.
|
private int availableHeight
private int saveCardHeight
private int cardSwitchHeight
private AmountedCurrency selectedCurrency
private PaymentOptionsDataManager.PaymentOptionsDataListener listener
private PaymentOptionsResponse paymentOptionsResponse
private PaymentOptionsDataManager.ViewModelsHandler modelsHandler
private java.util.ArrayList<PaymentOptionViewModel> viewModels
private java.util.ArrayList<PaymentOptionViewModel> visibleViewModels
private java.lang.String lastFilteredCurrency
private int focusedPosition
public PaymentOptionsDataManager(PaymentOptionsResponse paymentOptionsResponse)
paymentOptionsResponse
- the payment options responsepublic PaymentOptionsResponse getPaymentOptionsResponse()
public PaymentOption findPaymentOption(java.lang.String paymentOptionIdentifier)
paymentOptionIdentifier
- the payment option identifierpublic void filterViewModelsWithAmountedCurrency(AmountedCurrency amountedCurrency)
amountedCurrency
- the amounted currencypublic void disablePayButton()
public PaymentOptionsDataManager.ViewModelsHandler getModelsHandler()
private java.util.ArrayList<PaymentOptionViewModel> getViewModels()
private java.util.ArrayList<PaymentOptionViewModel> getVisibleViewModels()
public int getSize()
public AmountedCurrency getSelectedCurrency()
private AmountedCurrency getTransactionCurrency()
public void setSelectedCurrency(AmountedCurrency selectedCurrency)
selectedCurrency
- the selected currencypublic int getItemViewType(int position)
position
- the positionpublic PaymentOptionViewModel getViewModel(int position)
position
- the positionpublic PaymentOptionsDataManager setListener(PaymentOptionsDataManager.PaymentOptionsDataListener listener)
listener
- the listenerpublic void currencyHolderClicked(int position)
position
- the positionpublic void recentPaymentItemClicked(int position, SavedCard recentItem, RecentSectionViewModel recentSectionViewModel)
position
- the positionrecentItem
- the recent itemrecentSectionViewModel
- the recent section view modelpublic void editItemClicked(GroupViewHolder groupViewHolderListener)
groupViewHolderListener
- public void cancelItemClicked()
public void webPaymentSystemViewHolderClicked(WebPaymentViewModel sender, int position)
sender
- the senderposition
- the positionpublic void cardScannerButtonClicked()
public void saveCardSwitchCheckedChanged(boolean isChecked, int saveCardBlockPosition)
isChecked
- the is checkedsaveCardBlockPosition
- the save card block positionpublic void cardDetailsFilled(boolean isFilled, CardCredentialsViewModel cardCredentialsViewModel)
isFilled
- the is filledcardCredentialsViewModel
- the card credentials view modelpublic void addressOnCardClicked()
public void binNumberEntered(java.lang.String binNumber)
binNumber
- the bin numberpublic void cardExpirationDateClicked()
public void setAvailableHeight(int availableHeight)
availableHeight
- the available heightpublic void setCardSwitchHeight(int cardSwitchHeight)
cardSwitchHeight
- the card switch heightpublic void setSaveCardHeight(int neededHeight)
neededHeight
- the needed heightprivate void applyEmptyHolderHeight()
public void currencySelectedByUser(AmountedCurrency selectedCurrency)
selectedCurrency
- the selected currencypublic void updateCurrencySection()
public void updateSavedCards(java.lang.String cardId)
cardId
- private void clearPaymentOptionsResponseCards()
public void cardExpirationDateSelected(java.lang.String month, java.lang.String year)
month
- the monthyear
- the yearpublic void cardScanned(io.card.payment.CreditCard card)
card
- the cardpublic void updatePayButtonWithExtraFees(PaymentOption paymentOption)
paymentOption
- the payment optionpublic void checkShakingStatus()
public void deleteCard(@NonNull java.lang.String cardId)
public void showAddressOnCardCell(boolean isShow)
isShow
- the is showpublic void setCurrentBINData(BINLookupResponse currentBINData)
currentBINData
- the current bin dataprivate void setFocused(int position)
public void setRecentPaymentFocusedCard(int position)
position
- the positionpublic void clearFocus()
public boolean isPositionInFocus(int position)
position
- the positionpublic void saveState()