Class GiftcardManagePresenter<V extends GiftcardManageView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
-
- com.cheetahdigital.giftcards.ui.manage.GiftcardManagePresenter<V>
-
- Type Parameters:
V
- an interface which extendsGiftcardManageView
- All Implemented Interfaces:
com.cheetahdigital.uikit.architecture.mvp.MvpPresenter<V>
public class GiftcardManagePresenter<V extends GiftcardManageView> extends com.cheetahdigital.uikit.architecture.mvp.Presenter<V>
This presenter class contains API calls for managing the Gift Card. This is a child class ofPresenter
which is bound to theGiftcardManageView
, which means that this will be used to display theGiftcard
object to a view of typeGiftcardManageView
-
-
Constructor Summary
Constructors Constructor Description GiftcardManagePresenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard>
getGiftcardLinkReceivedListener()
Create a listener forGiftcardsAPI
protected GiftcardsAPI
getGiftcardsAPI()
Get current instance ofGiftcardsAPI
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard>
getGiftcardUnLinkReceivedListener()
Create a listener forGiftcardsAPI
void
linkGiftcard(java.lang.String cardNumber, java.lang.String pin)
Adds a gift card to the account of the member.void
linkGiftcard(java.lang.String cardNumber, java.lang.String pin, GiftcardFields fieldParams, GiftcardParams queryParams)
Adds a gift card to the account of the member.protected void
onGiftcardLinkFailed(java.lang.String error)
Called after receiving a failed response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)
protected void
onGiftcardLinkSuccess(Giftcard data)
Called after receiving a success response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)
protected void
onGiftcardUnLinkFailed(java.lang.String error)
Called after receiving a failed response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)
protected void
onGiftcardUnLinkSuccess(Giftcard data)
Called after receiving a success response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)
void
unlinkGiftcard(java.lang.String cardNumber)
Removes a gift card from the account of the membervoid
unlinkGiftcard(java.lang.String cardNumber, GiftcardParams queryParams)
Removes a gift card from the account of the member
-
-
-
Method Detail
-
getGiftcardLinkReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard> getGiftcardLinkReceivedListener()
Create a listener forGiftcardsAPI
- Returns:
- listener to handle
GiftcardsAPI
requests
-
getGiftcardUnLinkReceivedListener
protected com.cheetahdigital.corekit.models.module.ListenerModel<com.cheetahdigital.corekit.models.BaseModel<Giftcard>,Giftcard> getGiftcardUnLinkReceivedListener()
Create a listener forGiftcardsAPI
- Returns:
- listener to handle
GiftcardsAPI
requests
-
getGiftcardsAPI
protected GiftcardsAPI getGiftcardsAPI()
Get current instance ofGiftcardsAPI
- Returns:
GiftcardsAPI
used on this presenter
-
linkGiftcard
public void linkGiftcard(java.lang.String cardNumber, @NonNull java.lang.String pin)
Adds a gift card to the account of the member. Remember to set the pin of the gift card by usingGiftcardFields.setPin(String)
.- Parameters:
cardNumber
- the code of gift cardpin
- theGiftcardFields
to link a gift card to an account
-
linkGiftcard
public void linkGiftcard(java.lang.String cardNumber, @NonNull java.lang.String pin, GiftcardFields fieldParams, GiftcardParams queryParams)
Adds a gift card to the account of the member. Remember to set the pin of the gift card by usingGiftcardFields.setPin(String)
.- Parameters:
cardNumber
- the code of gift cardpin
- theGiftcardFields
to link a gift card to an accountfieldParams
- theGiftcardFields
to link a gift card to an accountqueryParams
- theGiftcardParams
to use for linking a gift card
-
unlinkGiftcard
public void unlinkGiftcard(java.lang.String cardNumber)
Removes a gift card from the account of the member- Parameters:
cardNumber
- the code of the gift card to remove
-
unlinkGiftcard
public void unlinkGiftcard(java.lang.String cardNumber, GiftcardParams queryParams)
Removes a gift card from the account of the member- Parameters:
cardNumber
- the code of the gift card to removequeryParams
-GiftcardParams
to use for unlinking giftcard
-
onGiftcardLinkSuccess
protected void onGiftcardLinkSuccess(Giftcard data)
Called after receiving a success response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)
- Parameters:
data
-Giftcard
received
-
onGiftcardLinkFailed
protected void onGiftcardLinkFailed(java.lang.String error)
Called after receiving a failed response forGiftcardsAPI.linkGiftcard(GiftcardParams, GiftcardFields, ListenerModel)
- Parameters:
error
- contains the message of the error
-
onGiftcardUnLinkFailed
protected void onGiftcardUnLinkFailed(java.lang.String error)
Called after receiving a failed response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)
- Parameters:
error
- contains the message of the error
-
onGiftcardUnLinkSuccess
protected void onGiftcardUnLinkSuccess(Giftcard data)
Called after receiving a success response forGiftcardsAPI.unlinkGiftcard(GiftcardParams, ListenerModel)
- Parameters:
data
-Giftcard
received
-
-