Class CheckOutPresenter<T extends CheckOutView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.uikit.architecture.lce.LcePresenter<T>
-
- com.cheetahdigital.products.ui.checkout.CheckOutPresenter<T>
-
- All Implemented Interfaces:
MvpPresenter<T>
public class CheckOutPresenter<T extends CheckOutView> extends LcePresenter<T>
TheLcePresenter
class forCheckOutActivity
-
-
Constructor Summary
Constructors Constructor Description CheckOutPresenter(Order order)
Create the presenter with a givenOrder
CheckOutPresenter(Order order, PaymentParams paymentParams)
Create the presenter with a givenOrder
CheckOutPresenter(Order order, PaymentParams paymentParams, TransactionsParams transactionParams)
Create the presenter with a givenOrder
CheckOutPresenter(Order order, TransactionsParams transactionParams)
Create the presenter with a givenOrder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<TransactionCoupon>
filterCoupons(java.util.List<TransactionCoupon> coupons, java.util.List<TransactionCoupon> couponsToRemove)
Remove unwanted coupons by passing a list of coupons to removevoid
getClientPaymentToken()
Request the token used for the client payment.java.lang.String
getMemberId()
protected void
getMemberProfile(ProfileParams profileParams)
Part ofCheckOutPresenter
load process.java.lang.String
getPaymentToken()
void
loadData()
Load initial view data.protected void
onPaymentClientReceivedSuccess(Payments data)
Part ofCheckOutPresenter
load process.protected void
onProfileDownloadSuccess(Profile data)
Part ofCheckOutPresenter
load process.protected void
onTransactionDiscountsSuccess(TransactionResult data)
Part ofCheckOutPresenter
load process.void
setStoreId(java.lang.String storeId)
Register the store id for this check out transactionvoid
submitTransaction()
Submit transaction using current storedOrder
to generate an instance ofTransaction
-
Methods inherited from class com.cheetahdigital.uikit.architecture.lce.LcePresenter
onLoadFailed, onLoadSuccess
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
CheckOutPresenter
public CheckOutPresenter(@NonNull Order order)
Create the presenter with a givenOrder
- Parameters:
order
- used to generate the transaction
-
CheckOutPresenter
public CheckOutPresenter(@NonNull Order order, @NonNull PaymentParams paymentParams)
Create the presenter with a givenOrder
- Parameters:
order
- used to generate the transactionpaymentParams
- instance ofPaymentParams
used onPaymentAPI
calls
-
CheckOutPresenter
public CheckOutPresenter(@NonNull Order order, @NonNull TransactionsParams transactionParams)
Create the presenter with a givenOrder
- Parameters:
order
- used to generate the transactiontransactionParams
- instance ofTransactionsParams
used onTransactionsAPI
calls
-
CheckOutPresenter
public CheckOutPresenter(@NonNull Order order, PaymentParams paymentParams, TransactionsParams transactionParams)
Create the presenter with a givenOrder
- Parameters:
order
- used to generate the transactionpaymentParams
- instance ofPaymentParams
used onPaymentAPI
callstransactionParams
- instance ofTransactionsParams
used onTransactionsAPI
calls
-
-
Method Detail
-
loadData
public void loadData()
Description copied from class:LcePresenter
Load initial view data.- Specified by:
loadData
in classLcePresenter<T extends CheckOutView>
-
submitTransaction
public void submitTransaction()
Submit transaction using current storedOrder
to generate an instance ofTransaction
-
getMemberProfile
protected void getMemberProfile(ProfileParams profileParams)
Part ofCheckOutPresenter
load process. This is called after successfully receiving client token- Parameters:
profileParams
- query params used for Profile API
-
onProfileDownloadSuccess
protected void onProfileDownloadSuccess(Profile data)
Part ofCheckOutPresenter
load process. This is called after a successful profile download request- Parameters:
data
- instance ofProfile
-
onTransactionDiscountsSuccess
protected void onTransactionDiscountsSuccess(TransactionResult data)
Part ofCheckOutPresenter
load process. This is called after a successful Transaction request- Parameters:
data
- instance ofTransactionResult
-
getClientPaymentToken
public void getClientPaymentToken()
Request the token used for the client payment. Note that calling this will follow default load data ofCheckOutPresenter
-
onPaymentClientReceivedSuccess
protected void onPaymentClientReceivedSuccess(Payments data)
Part ofCheckOutPresenter
load process. This is called after successfully receiving payment client request- Parameters:
data
- instance ofPayments
-
getPaymentToken
public java.lang.String getPaymentToken()
- Returns:
- current payment token of the client
-
setStoreId
public void setStoreId(java.lang.String storeId)
Register the store id for this check out transaction- Parameters:
storeId
- id to be registered on the current transaction
-
getMemberId
public java.lang.String getMemberId()
- Returns:
- the current memberId used
-
filterCoupons
protected java.util.List<TransactionCoupon> filterCoupons(java.util.List<TransactionCoupon> coupons, java.util.List<TransactionCoupon> couponsToRemove)
Remove unwanted coupons by passing a list of coupons to remove- Parameters:
coupons
- list ofTransactionCoupon
that serves as the original listcouponsToRemove
- list of unwantedTransactionCoupon
to be removed from the original list- Returns:
- filtered coupon without the unwanted
TransactionCoupon
-
-