AndroidPayQuickstart.WalletUtil.CreateStripeMaskedWalletRequest C# (CSharp) Method

CreateStripeMaskedWalletRequest() public static method

public static CreateStripeMaskedWalletRequest ( ItemInfo itemInfo, PaymentMethodTokenizationParameters parameters ) : MaskedWalletRequest
itemInfo ItemInfo
parameters PaymentMethodTokenizationParameters
return MaskedWalletRequest
        public static MaskedWalletRequest CreateStripeMaskedWalletRequest (ItemInfo itemInfo, PaymentMethodTokenizationParameters parameters) 
        {
            return CreateMaskedWalletRequest (itemInfo, parameters);
        }

Usage Example

        private void createAndAddWalletFragment()
        {
            var walletFragmentStyle = new WalletFragmentStyle()
                                      .SetBuyButtonText(BuyButtonText.BuyWithGoogle)
                                      .SetBuyButtonAppearance(BuyButtonAppearance.Classic)
                                      .SetBuyButtonWidth(Dimension.MatchParent);

            var walletFragmentOptions = WalletFragmentOptions.NewBuilder()
                                        .SetEnvironment(Constants.WALLET_ENVIRONMENT)
                                        .SetFragmentStyle(walletFragmentStyle)
                                        .SetTheme(WalletConstants.ThemeLight)
                                        .SetMode(WalletFragmentMode.BuyButton)
                                        .Build();

            mWalletFragment = SupportWalletFragment.NewInstance(walletFragmentOptions);

            // Now initialize the Wallet Fragment
            var accountName = ((BikestoreApplication)Application).AccountName;
            MaskedWalletRequest maskedWalletRequest;

            if (mPaymentMethodParameters != null)
            {
                maskedWalletRequest = WalletUtil.CreateStripeMaskedWalletRequest(Constants.ITEMS_FOR_SALE[mItemId],
                                                                                 mPaymentMethodParameters);
            }
            else
            {
                maskedWalletRequest = WalletUtil.CreateMaskedWalletRequest(Constants.ITEMS_FOR_SALE[mItemId]);
            }

            var startParamsBuilder = WalletFragmentInitParams.NewBuilder()
                                     .SetMaskedWalletRequest(maskedWalletRequest)
                                     .SetMaskedWalletRequestCode(REQUEST_CODE_MASKED_WALLET)
                                     .SetAccountName(accountName);

            mWalletFragment.Initialize(startParamsBuilder.Build());

            // add Wallet fragment to the UI
            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.dynamic_wallet_button_fragment, mWalletFragment)
            .Commit();
        }