@Test public void getPaymentMethodTokenizationParameters_whenApiKeyIsNotNull_returnsExpectedObject() { PaymentMethodTokenizationParameters params = mAndroidPayConfiguration.getPaymentMethodTokenizationParameters(); assertNotNull(params); assertEquals(PaymentMethodTokenizationType.PAYMENT_GATEWAY, params.getPaymentMethodTokenizationType()); Bundle bundle = params.getParameters(); assertNotNull(bundle); assertEquals("pk_test_abc123", bundle.getString("stripe:publishableKey")); assertEquals("stripe", bundle.getString("gateway")); assertEquals(com.stripe.android.BuildConfig.VERSION_NAME, bundle.getString("stripe:version")); }
@Nullable public PaymentMethodTokenizationParameters getPaymentMethodTokenizationParameters() { if (TextUtils.isEmpty(mPublicApiKey)) { return null; } return PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PAYMENT_GATEWAY) .addParameter("gateway", "stripe") .addParameter("stripe:publishableKey", mPublicApiKey) .addParameter("stripe:version", com.stripe.android.BuildConfig.VERSION_NAME) .build(); }
AndroidPayConfiguration { @Nullable public PaymentMethodTokenizationParameters getPaymentMethodTokenizationParameters() { if (TextUtils.isEmpty(mPublicApiKey)) { return null; } return PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PAYMENT_GATEWAY) .addParameter("gateway", "stripe") .addParameter("stripe:publishableKey", mPublicApiKey) .addParameter("stripe:version", com.stripe.android.BuildConfig.VERSION_NAME) .build(); } }
AndroidPayConfiguration { @Nullable public PaymentMethodTokenizationParameters getPaymentMethodTokenizationParameters() { if (TextUtils.isEmpty(mPublicApiKey)) { return null; } return PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PAYMENT_GATEWAY) .addParameter("gateway", "stripe") .addParameter("stripe:publishableKey", mPublicApiKey) .addParameter("stripe:version", com.stripe.android.BuildConfig.VERSION_NAME) .build(); } @VisibleForTesting  AndroidPayConfiguration(
            @NonNull String publicApiKey,
            @NonNull Currency currency,
            boolean shouldUseSources); }
AndroidPayConfiguration { @Nullable public PaymentMethodTokenizationParameters getPaymentMethodTokenizationParameters() { if (TextUtils.isEmpty(mPublicApiKey)) { return null; } return PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PAYMENT_GATEWAY) .addParameter("gateway", "stripe") .addParameter("stripe:publishableKey", mPublicApiKey) .addParameter("stripe:version", com.stripe.android.BuildConfig.VERSION_NAME) .build(); } @VisibleForTesting  AndroidPayConfiguration(
            @NonNull String publicApiKey,
            @NonNull Currency currency,
            boolean shouldUseSources); @NonNull static AndroidPayConfiguration getInstance(); static AndroidPayConfiguration init(
            @NonNull @Size(min = 5) String publicApiKey,
            @NonNull String currencyCode,
            boolean shouldUseSources); static AndroidPayConfiguration init(
            @NonNull @Size(min = 5) String publicApiKey,
            @NonNull String currencyCode); static AndroidPayConfiguration init(
            @NonNull @Size(min = 5) String publicApiKey,
            @NonNull Currency currency); void addAllowedCardNetworks(@WalletConstants.CardNetwork Integer... networks); void addAllowedShippingCountries(@NonNull String... countrySpecifications); void addAllowedShippingCountries(
            @NonNull CountrySpecification... countrySpecifications); @Nullable PaymentMethodTokenizationParameters getPaymentMethodTokenizationParameters(); @Nullable MaskedWalletRequest generateMaskedWalletRequest(@Nullable Cart cart); @NonNull static FullWalletRequest generateFullWalletRequest(
            @NonNull String googleTransactionId,
            @NonNull Cart cart); @Nullable MaskedWalletRequest generateMaskedWalletRequest(
            @Nullable Cart cart,
            boolean isPhoneNumberRequired,
            boolean isShippingAddressRequired,
            @Nullable String currencyCode); @NonNull Currency getCurrency(); @Nullable String getCountryCode(); @NonNull String getCurrencyCode(); @NonNull AndroidPayConfiguration setCurrency(@NonNull Currency currency); @NonNull AndroidPayConfiguration setCurrencyCode(@NonNull String currencyCode); @NonNull AndroidPayConfiguration setCountryCode(@Nullable String countryCode); boolean isPhoneNumberRequired(); AndroidPayConfiguration setPhoneNumberRequired(boolean phoneNumberRequired); boolean isShippingAddressRequired(); AndroidPayConfiguration setShippingAddressRequired(boolean shippingAddressRequired); String getMerchantName(); AndroidPayConfiguration setMerchantName(String merchantName); String getPublicApiKey(); AndroidPayConfiguration setPublicApiKey(String publicApiKey); boolean getUsesSources(); }
AndroidPayConfiguration { @Nullable public PaymentMethodTokenizationParameters getPaymentMethodTokenizationParameters() { if (TextUtils.isEmpty(mPublicApiKey)) { return null; } return PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PAYMENT_GATEWAY) .addParameter("gateway", "stripe") .addParameter("stripe:publishableKey", mPublicApiKey) .addParameter("stripe:version", com.stripe.android.BuildConfig.VERSION_NAME) .build(); } @VisibleForTesting  AndroidPayConfiguration(
            @NonNull String publicApiKey,
            @NonNull Currency currency,
            boolean shouldUseSources); @NonNull static AndroidPayConfiguration getInstance(); static AndroidPayConfiguration init(
            @NonNull @Size(min = 5) String publicApiKey,
            @NonNull String currencyCode,
            boolean shouldUseSources); static AndroidPayConfiguration init(
            @NonNull @Size(min = 5) String publicApiKey,
            @NonNull String currencyCode); static AndroidPayConfiguration init(
            @NonNull @Size(min = 5) String publicApiKey,
            @NonNull Currency currency); void addAllowedCardNetworks(@WalletConstants.CardNetwork Integer... networks); void addAllowedShippingCountries(@NonNull String... countrySpecifications); void addAllowedShippingCountries(
            @NonNull CountrySpecification... countrySpecifications); @Nullable PaymentMethodTokenizationParameters getPaymentMethodTokenizationParameters(); @Nullable MaskedWalletRequest generateMaskedWalletRequest(@Nullable Cart cart); @NonNull static FullWalletRequest generateFullWalletRequest(
            @NonNull String googleTransactionId,
            @NonNull Cart cart); @Nullable MaskedWalletRequest generateMaskedWalletRequest(
            @Nullable Cart cart,
            boolean isPhoneNumberRequired,
            boolean isShippingAddressRequired,
            @Nullable String currencyCode); @NonNull Currency getCurrency(); @Nullable String getCountryCode(); @NonNull String getCurrencyCode(); @NonNull AndroidPayConfiguration setCurrency(@NonNull Currency currency); @NonNull AndroidPayConfiguration setCurrencyCode(@NonNull String currencyCode); @NonNull AndroidPayConfiguration setCountryCode(@Nullable String countryCode); boolean isPhoneNumberRequired(); AndroidPayConfiguration setPhoneNumberRequired(boolean phoneNumberRequired); boolean isShippingAddressRequired(); AndroidPayConfiguration setShippingAddressRequired(boolean shippingAddressRequired); String getMerchantName(); AndroidPayConfiguration setMerchantName(String merchantName); String getPublicApiKey(); AndroidPayConfiguration setPublicApiKey(String publicApiKey); boolean getUsesSources();  }