Class GiftcardsAPI
- java.lang.Object
-
- com.cheetahdigital.corekit.models.module.Controller
-
- com.cheetahdigital.giftcards.core.api.GiftcardsAPI
-
- All Implemented Interfaces:
RestController
public class GiftcardsAPI extends Controller
Class for setting the query parameters of Giftcards API. AllNullableparameters means you can remove the parameter by passing anullvalue.
-
-
Field Summary
-
Fields inherited from class com.cheetahdigital.corekit.models.module.Controller
STANDARD_DATE_FORMAT, TIMEZONE_DATE_FORMAT
-
-
Constructor Summary
Constructors Constructor Description GiftcardsAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgetClasses(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<CardClasses>,CardClasses> listener)Gets the list of giftcard classesvoidgetGiftcard(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)Gets the details of the gift card.voidgetGiftcards(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<Giftcards>,Giftcards> listener)Gets the list of gift cardsvoidgetGiftcardsClientToken(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<ClientToken>,ClientToken> listener)Gets the client token required for the Braintree SDKvoidgetTransactions(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<Transactions>,Transactions> listener)Gets the history of activities.voidlinkGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)Add a gift card to the account of the member Remember to set the following: card number usingBaseParams.setId(String)pin usingGiftcardFields.setPin(String)voidpurchaseGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<PurchaseResponse>,PurchaseResponse> listener)Purchase a digital gift card Remember to set the following: amount usingGiftcardFields.setAmount(Float)payment method nonce usingGiftcardFields.setPaymentMethodNonce(String)voidreloadGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<GiftcardReload>,GiftcardReload> listener)Reload a gift card with a specified amount.voidunlinkGiftcard(GiftcardParams queryParams, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)Remove a gift card from the account of the member.voidupdateGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)Update details of a specific giftcard.-
Methods inherited from class com.cheetahdigital.corekit.models.module.Controller
createCache, createHttpClient, createRetrofitInterface, evictAllCache, getGsonConfiguration, getRestAdapter, getTimeoutConnectionInSeconds, getTimeoutSocketInSeconds, initialize, removeResponsesFromCache
-
-
-
-
Method Detail
-
getGiftcardsClientToken
public void getGiftcardsClientToken(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<ClientToken>,ClientToken> listener)
Gets the client token required for the Braintree SDK- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIclearCache- clear previously stored cachelistener- callback to handle the results
-
getGiftcards
public void getGiftcards(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<Giftcards>,Giftcards> listener)
Gets the list of gift cards- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIclearCache- clear previously stored cachelistener- callback to handle the results
-
getGiftcard
public void getGiftcard(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)
Gets the details of the gift card. Remember to set the card number byBaseParams.setId(String)- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIclearCache- clear previously stored cachelistener- callback to handle the results
-
reloadGiftcard
public void reloadGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<GiftcardReload>,GiftcardReload> listener)
Reload a gift card with a specified amount. Remember to set the following:- card number using
BaseParams.setId(String) - amount using
GiftcardFields.setAmount(Float) - payment method nonce using
GiftcardFields.setPaymentMethodNonce(String)
- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIfieldParams- theGiftcardFieldsfor Giftcards APIlistener- callback to handle the results
- card number using
-
purchaseGiftcard
public void purchaseGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<PurchaseResponse>,PurchaseResponse> listener)
Purchase a digital gift card Remember to set the following:- amount using
GiftcardFields.setAmount(Float) - payment method nonce using
GiftcardFields.setPaymentMethodNonce(String)
- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIfieldParams- theGiftcardFieldsfor Giftcards APIlistener- callback to handle the results
- amount using
-
linkGiftcard
public void linkGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)
Add a gift card to the account of the member Remember to set the following:- card number using
BaseParams.setId(String) - pin using
GiftcardFields.setPin(String)
- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIfieldParams- theGiftcardFieldsfor Giftcards APIlistener- callback to handle the results
- card number using
-
unlinkGiftcard
public void unlinkGiftcard(GiftcardParams queryParams, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)
Remove a gift card from the account of the member. Remember to set the card number byBaseParams.setId(String)- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIlistener- callback to handle the results
-
getTransactions
public void getTransactions(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<Transactions>,Transactions> listener)
Gets the history of activities. Remember to set the card number byBaseParams.setId(String)- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIclearCache- clear previously stored cachelistener- callback to handle the results
-
updateGiftcard
public void updateGiftcard(GiftcardParams queryParams, GiftcardFields fieldParams, ListenerModel<BaseModel<Giftcard>,Giftcard> listener)
Update details of a specific giftcard. Remember to set the card number byBaseParams.setId(String)When setting auto-reload to true, remember to set the following:- nonce using
GiftcardFields.setPaymentMethodNonce(String) - auto-reload using
GiftcardFields.setIsAutoReload(Boolean) - threshold amount using
GiftcardFields.setReloadThreshold(String) - reload amount using
GiftcardFields.setReloadAmount(String)
- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIfieldParams- theGiftcardFieldsfor Giftcards APIlistener- callback to handle the results
- nonce using
-
getClasses
public void getClasses(GiftcardParams queryParams, boolean clearCache, ListenerModel<BaseModel<CardClasses>,CardClasses> listener)
Gets the list of giftcard classes- Parameters:
queryParams- theGiftcardParamsfor Giftcards APIclearCache- clear previously stored cachelistener- callback to handle the results
-
-