Class GiftcardsPagerFragment<V extends GiftcardsPagerView,​P extends GiftcardsPagerPresenter<V>>

    • Constructor Detail

      • GiftcardsPagerFragment

        public GiftcardsPagerFragment()
    • Method Detail

      • onAddGiftcard

        public void onAddGiftcard​(java.lang.String cardNumber,
                                  java.lang.String pin)
        Description copied from interface: OnAddGiftcardListener
        Handles adding of gift card
        Specified by:
        onAddGiftcard in interface OnAddGiftcardListener
        Parameters:
        cardNumber - code of gift card
        pin - pin of gift card
      • onActivityResult

        public void onActivityResult​(int requestCode,
                                     int resultCode,
                                     android.content.Intent data)
        Overrides:
        onActivityResult in class androidx.fragment.app.Fragment
      • onResume

        public void onResume()
        Overrides:
        onResume in class androidx.fragment.app.Fragment
      • onCreateOptionsMenu

        public void onCreateOptionsMenu​(android.view.Menu menu,
                                        android.view.MenuInflater inflater)
        Overrides:
        onCreateOptionsMenu in class androidx.fragment.app.Fragment
      • onOptionsItemSelected

        public boolean onOptionsItemSelected​(android.view.MenuItem item)
        Overrides:
        onOptionsItemSelected in class androidx.fragment.app.Fragment
      • getAutoReloadState

        public boolean getAutoReloadState()
        Get the state of auto-reload
        Returns:
        state of auto-reload
      • showGiftcards

        public void showGiftcards​(java.util.List<Giftcard> giftcards,
                                  java.util.Date responseReceivedDate)
        Description copied from interface: GiftcardsPagerView
        This notifies the view to show the list of Giftcard
        Specified by:
        showGiftcards in interface GiftcardsPagerView
        Parameters:
        giftcards - list of Giftcard
        responseReceivedDate - date the response is received
      • showErrorDialog

        public void showErrorDialog​(java.lang.String error)
        Description copied from interface: GiftcardsPagerView
        This notifies the view to show the dialog with error message
        Specified by:
        showErrorDialog in interface GiftcardsPagerView
        Parameters:
        error - error message
      • showLinkSuccessMessage

        public void showLinkSuccessMessage()
        Description copied from interface: GiftcardsPagerView
        This notifies the view to show a message informing the user that adding a gift card to the member's account was successful.
        Specified by:
        showLinkSuccessMessage in interface GiftcardsPagerView
      • onReloadGiftcard

        public abstract void onReloadGiftcard​(java.lang.String clientToken,
                                              java.lang.String cardNumber,
                                              float amount)
        Abstract method to launch Braintree Drop-in UI to Reload a Gift Card. See https://developers.braintreepayments.com.

        Sample code: String currency = getString(R.string.currency); String currencyAndAmount = currency + " " + amount; // Create Braintree Payment Request DropInRequest dropInRequest = new DropInRequest() .clientToken(clientToken) .amount(currencyAndAmount); startActivityForResult(dropInRequest.getIntent(getActivity()), RELOAD_REQUEST_CODE);

        Parameters:
        clientToken - the client token required for the Braintree SDK
        cardNumber - the gift card code needed for doing the Reload API call
        amount - the amount to be reloaded
      • onPurchaseGiftcard

        public abstract void onPurchaseGiftcard​(java.lang.String clientToken,
                                                float amount)
        Abstract method to launch Braintree Drop-in UI to Purchase a Gift Card. See https://developers.braintreepayments.com/.

        Sample code: String currency = getString(R.string.currency); String currencyAndAmount = currency + " " + amount; // Create Braintree Payment Request DropInRequest paymentRequest = createPaymentRequest( clientToken, currencyAndAmount); startActivityForResult(paymentRequest.getIntent(getActivity()), PURCHASE_REQUEST_CODE);

        Parameters:
        clientToken - the client token required for the Braintree SDK
        amount - the amount to be reloaded
      • onPurchaseGiftcardTriggered

        protected void onPurchaseGiftcardTriggered()
        Displays an Amount Dialog w/c allows custom values (from user-input) and pre-defined values from mFixedReloadAmounts.