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>
TheLcePresenterclass forCheckOutActivity
-
-
Constructor Summary
Constructors Constructor Description CheckOutPresenter(Order order)Create the presenter with a givenOrderCheckOutPresenter(Order order, PaymentParams paymentParams)Create the presenter with a givenOrderCheckOutPresenter(Order order, PaymentParams paymentParams, TransactionsParams transactionParams)Create the presenter with a givenOrderCheckOutPresenter(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 removevoidgetClientPaymentToken()Request the token used for the client payment.java.lang.StringgetMemberId()protected voidgetMemberProfile(ProfileParams profileParams)Part ofCheckOutPresenterload process.java.lang.StringgetPaymentToken()voidloadData()Load initial view data.protected voidonPaymentClientReceivedSuccess(Payments data)Part ofCheckOutPresenterload process.protected voidonProfileDownloadSuccess(Profile data)Part ofCheckOutPresenterload process.protected voidonTransactionDiscountsSuccess(TransactionResult data)Part ofCheckOutPresenterload process.voidsetStoreId(java.lang.String storeId)Register the store id for this check out transactionvoidsubmitTransaction()Submit transaction using current storedOrderto 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 ofPaymentParamsused onPaymentAPIcalls
-
CheckOutPresenter
public CheckOutPresenter(@NonNull Order order, @NonNull TransactionsParams transactionParams)Create the presenter with a givenOrder- Parameters:
order- used to generate the transactiontransactionParams- instance ofTransactionsParamsused onTransactionsAPIcalls
-
CheckOutPresenter
public CheckOutPresenter(@NonNull Order order, PaymentParams paymentParams, TransactionsParams transactionParams)Create the presenter with a givenOrder- Parameters:
order- used to generate the transactionpaymentParams- instance ofPaymentParamsused onPaymentAPIcallstransactionParams- instance ofTransactionsParamsused onTransactionsAPIcalls
-
-
Method Detail
-
loadData
public void loadData()
Description copied from class:LcePresenterLoad initial view data.- Specified by:
loadDatain classLcePresenter<T extends CheckOutView>
-
submitTransaction
public void submitTransaction()
Submit transaction using current storedOrderto generate an instance ofTransaction
-
getMemberProfile
protected void getMemberProfile(ProfileParams profileParams)
Part ofCheckOutPresenterload process. This is called after successfully receiving client token- Parameters:
profileParams- query params used for Profile API
-
onProfileDownloadSuccess
protected void onProfileDownloadSuccess(Profile data)
Part ofCheckOutPresenterload process. This is called after a successful profile download request- Parameters:
data- instance ofProfile
-
onTransactionDiscountsSuccess
protected void onTransactionDiscountsSuccess(TransactionResult data)
Part ofCheckOutPresenterload 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 ofCheckOutPresenterload 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 ofTransactionCouponthat serves as the original listcouponsToRemove- list of unwantedTransactionCouponto be removed from the original list- Returns:
- filtered coupon without the unwanted
TransactionCoupon
-
-