target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void shouldIconShowBrand_whenAmexAndCvCStringLengthNotFour_isFalse() { assertFalse(shouldIconShowBrand(Card.AMERICAN_EXPRESS, true, "")); assertFalse(shouldIconShowBrand(Card.AMERICAN_EXPRESS, true, "1")); assertFalse(shouldIconShowBrand(Card.AMERICAN_EXPRESS, true, "22")); assertFalse(shouldIconShowBrand(...
@VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
@Test public void shouldIconShowBrand_whenAmexAndCvcStringLengthIsFour_isTrue() { assertTrue(shouldIconShowBrand(Card.AMERICAN_EXPRESS, true, "1234")); }
@VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
@Test public void shouldIconShowBrand_whenNotAmexAndCvcStringLengthIsNotThree_isFalse() { assertFalse(shouldIconShowBrand(Card.VISA, true, "")); assertFalse(shouldIconShowBrand(Card.DISCOVER, true, "12")); assertFalse(shouldIconShowBrand(Card.JCB, true, "55")); assertFalse(shouldIconShowBrand(Card.MASTERCARD, true, "9"...
@VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
@Test public void shouldIconShowBrand_whenNotAmexAndCvcStringLengthIsThree_isTrue() { assertTrue(shouldIconShowBrand(Card.VISA, true, "999")); assertTrue(shouldIconShowBrand(Card.DISCOVER, true, "123")); assertTrue(shouldIconShowBrand(Card.JCB, true, "555")); assertTrue(shouldIconShowBrand(Card.MASTERCARD, true, "919")...
@VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context); CardInputWidg...
@Test public void init_addsPaymentSessionToken_andFetchesCustomer() { PaymentSession.PaymentSessionListener mockListener = mock(PaymentSession.PaymentSessionListener.class); PaymentSession paymentSession = new PaymentSession(mActivityController.get()); paymentSession.init(mockListener, new PaymentSessionConfig.Builder(...
public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
@Test public void init_whenEphemeralKeyProviderContinues_fetchesCustomerAndNotifiesListener() { EphemeralKey firstKey = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(firstKey); mEphemeralKeyProvider.setNextRawEphemeralKey(FIRST_SAMPLE_KEY_RAW); CustomerSession.initCustomerSession( mEphemeralKeyProvider, ...
public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
@Test public void fromJsonString_backToJson_createsIdenticalElement() { try { JSONObject rawConversion = new JSONObject(EXAMPLE_JSON_ADDRESS); assertJsonEquals(rawConversion, mAddress.toJson()); } catch (JSONException jsonException) { fail("Test Data failure: " + jsonException.getLocalizedMessage()); } }
@NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_CITY, mCity); putStringIfNotNull(jsonObject, FIELD_COUNTRY, mCountry); putStringIfNotNull(jsonObject, FIELD_LINE_1, mLine1); putStringIfNotNull(jsonObject, FIELD_LINE_2, mLine2); putStringIfNot...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_CITY, mCity); putStringIfNotNull(jsonObject, FIELD_COUNTRY, mCountry); putStringIfNotNull(jsonObject, FIELD_LINE_1, mLine1); putStringIfN...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_CITY, mCity); putStringIfNotNull(jsonObject, FIELD_COUNTRY, mCountry); putStringIfNotNull(jsonObject, FIELD_LINE_1, mLine1); putStringIfN...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_CITY, mCity); putStringIfNotNull(jsonObject, FIELD_COUNTRY, mCountry); putStringIfNotNull(jsonObject, FIELD_LINE_1, mLine1); putStringIfN...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_CITY, mCity); putStringIfNotNull(jsonObject, FIELD_COUNTRY, mCountry); putStringIfNotNull(jsonObject, FIELD_LINE_1, mLine1); putStringIfN...
@Test public void init_withoutSavedState_clearsLoggingTokensAndStartsWithPaymentSession() { EphemeralKey firstKey = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(firstKey); mEphemeralKeyProvider.setNextRawEphemeralKey(FIRST_SAMPLE_KEY_RAW); CustomerSession.initCustomerSession( mEphemeralKeyProvider, mStr...
public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
@Test public void init_withSavedStateBundle_doesNotClearLoggingTokens() { EphemeralKey firstKey = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(firstKey); mEphemeralKeyProvider.setNextRawEphemeralKey(FIRST_SAMPLE_KEY_RAW); CustomerSession.initCustomerSession( mEphemeralKeyProvider, mStripeApiProxy, null)...
public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePayme...
@Test public void testGetApiUrl() { String tokensApi = StripeApiHandler.getApiUrl(); assertEquals("https: }
@VisibleForTesting static String getApiUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, TOKENS); }
StripeApiHandler { @VisibleForTesting static String getApiUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, TOKENS); } }
StripeApiHandler { @VisibleForTesting static String getApiUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, TOKENS); } }
StripeApiHandler { @VisibleForTesting static String getApiUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, TOKENS); } }
StripeApiHandler { @VisibleForTesting static String getApiUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, TOKENS); } }
@Test public void testGetSourcesUrl() { String sourcesUrl = StripeApiHandler.getSourcesUrl(); assertEquals("https: }
@VisibleForTesting static String getSourcesUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, SOURCES); }
StripeApiHandler { @VisibleForTesting static String getSourcesUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, SOURCES); } }
StripeApiHandler { @VisibleForTesting static String getSourcesUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, SOURCES); } }
StripeApiHandler { @VisibleForTesting static String getSourcesUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, SOURCES); } }
StripeApiHandler { @VisibleForTesting static String getSourcesUrl() { return String.format(Locale.ENGLISH, "%s/v1/%s", LIVE_API_BASE, SOURCES); } }
@Test public void testGetRetrieveSourceUrl() { String sourceUrlWithId = StripeApiHandler.getRetrieveSourceApiUrl("abc123"); assertEquals("https: }
@VisibleForTesting static String getRetrieveSourceApiUrl(@NonNull String sourceId) { return String.format(Locale.ENGLISH, "%s/%s", getSourcesUrl(), sourceId); }
StripeApiHandler { @VisibleForTesting static String getRetrieveSourceApiUrl(@NonNull String sourceId) { return String.format(Locale.ENGLISH, "%s/%s", getSourcesUrl(), sourceId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveSourceApiUrl(@NonNull String sourceId) { return String.format(Locale.ENGLISH, "%s/%s", getSourcesUrl(), sourceId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveSourceApiUrl(@NonNull String sourceId) { return String.format(Locale.ENGLISH, "%s/%s", getSourcesUrl(), sourceId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveSourceApiUrl(@NonNull String sourceId) { return String.format(Locale.ENGLISH, "%s/%s", getSourcesUrl(), sourceId); } }
@Test public void testGetRequestTokenApiUrl() { String tokenId = "tok_sample"; String requestApi = StripeApiHandler.getRetrieveTokenApiUrl(tokenId); assertEquals("https: }
@VisibleForTesting static String getRetrieveTokenApiUrl(@NonNull String tokenId) { return String.format("%s/%s", getApiUrl(), tokenId); }
StripeApiHandler { @VisibleForTesting static String getRetrieveTokenApiUrl(@NonNull String tokenId) { return String.format("%s/%s", getApiUrl(), tokenId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveTokenApiUrl(@NonNull String tokenId) { return String.format("%s/%s", getApiUrl(), tokenId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveTokenApiUrl(@NonNull String tokenId) { return String.format("%s/%s", getApiUrl(), tokenId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveTokenApiUrl(@NonNull String tokenId) { return String.format("%s/%s", getApiUrl(), tokenId); } }
@Test public void testGetRetrieveCustomerUrl() { String customerId = "cus_123abc"; String customerRequestUrl = StripeApiHandler.getRetrieveCustomerUrl(customerId); assertEquals("https: }
@VisibleForTesting static String getRetrieveCustomerUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getCustomersUrl(), customerId); }
StripeApiHandler { @VisibleForTesting static String getRetrieveCustomerUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getCustomersUrl(), customerId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveCustomerUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getCustomersUrl(), customerId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveCustomerUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getCustomersUrl(), customerId); } }
StripeApiHandler { @VisibleForTesting static String getRetrieveCustomerUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getCustomersUrl(), customerId); } }
@Test public void testGetAddCustomerSourceUrl() { String customerId = "cus_123abc"; String addSourceUrl = StripeApiHandler.getAddCustomerSourceUrl(customerId); assertEquals("https: addSourceUrl); }
@VisibleForTesting static String getAddCustomerSourceUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getRetrieveCustomerUrl(customerId), SOURCES); }
StripeApiHandler { @VisibleForTesting static String getAddCustomerSourceUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getRetrieveCustomerUrl(customerId), SOURCES); } }
StripeApiHandler { @VisibleForTesting static String getAddCustomerSourceUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getRetrieveCustomerUrl(customerId), SOURCES); } }
StripeApiHandler { @VisibleForTesting static String getAddCustomerSourceUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getRetrieveCustomerUrl(customerId), SOURCES); } }
StripeApiHandler { @VisibleForTesting static String getAddCustomerSourceUrl(@NonNull String customerId) { return String.format(Locale.ENGLISH, "%s/%s", getRetrieveCustomerUrl(customerId), SOURCES); } }
@Test public void getHeaders_withAllRequestOptions_properlyMapsRequestOptions() { String fakePublicKey = "fake_public_key"; String idempotencyKey = "idempotency_rules"; String stripeAccount = "acct_123abc"; String apiVersion = "2011-11-11"; RequestOptions requestOptions = RequestOptions.builder(fakePublicKey) .setIdemp...
static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (options != null) { hea...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
@Test public void getHeaders_withOnlyRequiredOptions_doesNotAddEmptyOptions() { RequestOptions requestOptions = RequestOptions.builder("some_key").build(); Map<String, String> headerMap = StripeApiHandler.getHeaders(requestOptions); assertNotNull(headerMap); assertFalse(headerMap.containsKey("Idempotency-Key")); assert...
static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (options != null) { hea...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
@Test public void fromJsonString_toMap_createsExpectedMap() { assertMapEquals(EXAMPLE_MAP_ADDRESS, mAddress.toMap()); }
@NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_CITY, mCity); hashMap.put(FIELD_COUNTRY, mCountry); hashMap.put(FIELD_LINE_1, mLine1); hashMap.put(FIELD_LINE_2, mLine2); hashMap.put(FIELD_POSTAL_CODE, mPostalCode); hashMap.put(FIELD_STATE, mState)...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_CITY, mCity); hashMap.put(FIELD_COUNTRY, mCountry); hashMap.put(FIELD_LINE_1, mLine1); hashMap.put(FIELD_LINE_2, mLine2); hashMap.put(FIELD_POS...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_CITY, mCity); hashMap.put(FIELD_COUNTRY, mCountry); hashMap.put(FIELD_LINE_1, mLine1); hashMap.put(FIELD_LINE_2, mLine2); hashMap.put(FIELD_POS...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_CITY, mCity); hashMap.put(FIELD_COUNTRY, mCountry); hashMap.put(FIELD_LINE_1, mLine1); hashMap.put(FIELD_LINE_2, mLine2); hashMap.put(FIELD_POS...
Address extends StripeJsonModel implements Parcelable { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_CITY, mCity); hashMap.put(FIELD_COUNTRY, mCountry); hashMap.put(FIELD_LINE_1, mLine1); hashMap.put(FIELD_LINE_2, mLine2); hashMap.put(FIELD_POS...
@Test public void getHeaders_containsPropertyMapValues() { RequestOptions requestOptions = RequestOptions.builder("some_key").build(); Map<String, String> headerMap = StripeApiHandler.getHeaders(requestOptions); assertNotNull(headerMap); String userAgentRawString = headerMap.get("X-Stripe-Client-User-Agent"); try { JSO...
static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (options != null) { hea...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
@Test public void getHeaders_correctlyAddsExpectedAdditionalParameters() { RequestOptions requestOptions = RequestOptions.builder("some_key").build(); Map<String, String> headerMap = StripeApiHandler.getHeaders(requestOptions); assertNotNull(headerMap); final String expectedUserAgent = String.format("Stripe/v1 AndroidB...
static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (options != null) { hea...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
StripeApiHandler { static Map<String, String> getHeaders(RequestOptions options) { Map<String, String> headers = new HashMap<>(); headers.put("Accept-Charset", CHARSET); headers.put("Accept", "application/json"); headers.put("User-Agent", String.format("Stripe/v1 AndroidBindings/%s", BuildConfig.VERSION_NAME)); if (opt...
@Test public void createQuery_withCardData_createsProperQueryString() { Card card = new Card.Builder("4242424242424242", 8, 2019, "123").build(); Map<String, Object> cardMap = StripeNetworkUtils.hashMapFromCard( RuntimeEnvironment.application, card); String expectedValue = "product_usage=&card%5Bnumber%5D=4242424242424...
static String createQuery(Map<String, Object> params) throws UnsupportedEncodingException, InvalidRequestException { StringBuilder queryStringBuffer = new StringBuilder(); List<Parameter> flatParams = flattenParams(params); Iterator<Parameter> it = flatParams.iterator(); while (it.hasNext()) { if (queryStringBuffer.len...
StripeApiHandler { static String createQuery(Map<String, Object> params) throws UnsupportedEncodingException, InvalidRequestException { StringBuilder queryStringBuffer = new StringBuilder(); List<Parameter> flatParams = flattenParams(params); Iterator<Parameter> it = flatParams.iterator(); while (it.hasNext()) { if (qu...
StripeApiHandler { static String createQuery(Map<String, Object> params) throws UnsupportedEncodingException, InvalidRequestException { StringBuilder queryStringBuffer = new StringBuilder(); List<Parameter> flatParams = flattenParams(params); Iterator<Parameter> it = flatParams.iterator(); while (it.hasNext()) { if (qu...
StripeApiHandler { static String createQuery(Map<String, Object> params) throws UnsupportedEncodingException, InvalidRequestException { StringBuilder queryStringBuffer = new StringBuilder(); List<Parameter> flatParams = flattenParams(params); Iterator<Parameter> it = flatParams.iterator(); while (it.hasNext()) { if (qu...
StripeApiHandler { static String createQuery(Map<String, Object> params) throws UnsupportedEncodingException, InvalidRequestException { StringBuilder queryStringBuffer = new StringBuilder(); List<Parameter> flatParams = flattenParams(params); Iterator<Parameter> it = flatParams.iterator(); while (it.hasNext()) { if (qu...
@Test public void createSource_shouldLogSourceCreation_andReturnSource() { try { TestLoggingListener testLoggingListener = new TestLoggingListener(true); StripeNetworkUtils.UidProvider provider = new StripeNetworkUtils.UidProvider() { @Override public String getUid() { return "abc123"; } @Override public String getPack...
@Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequ...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
@Test public void createSource_withConnectAccount_keepsHeaderInAccount() { try { TestLoggingListener testLoggingListener = new TestLoggingListener(true); TestStripeResponseListener testStripeResponseListener = new TestStripeResponseListener(); StripeNetworkUtils.UidProvider provider = new StripeNetworkUtils.UidProvider...
@Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequ...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
@Test public void createSource_withNonLoggingListener_doesNotLogButDoesCreateSource() { try { TestLoggingListener testLoggingListener = new TestLoggingListener(false); Card card = new Card("4242424242424242", 1, 2050, "123"); Source source = StripeApiHandler.createSource( null, RuntimeEnvironment.application.getApplica...
@Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationException, InvalidRequ...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
StripeApiHandler { @Nullable static Source createSource( @Nullable StripeNetworkUtils.UidProvider uidProvider, @NonNull Context context, @NonNull SourceParams sourceParams, @NonNull String publishableKey, @Nullable String stripeAccount, @Nullable LoggingResponseListener loggingResponseListener) throws AuthenticationExc...
@Test public void shouldRefreshKey_whenKeyIsNullAndTimeIsInFuture_returnsTrue() { Calendar futureCalendar = Calendar.getInstance(); futureCalendar.add(Calendar.YEAR, 1); futureCalendar.getTimeInMillis(); assertTrue(EphemeralKeyManager.shouldRefreshKey(null, TEST_SECONDS_BUFFER, futureCalendar)); }
static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInMillis()); long nowPlus...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
@Test public void shouldRefreshKey_whenKeyIsNullAndTimeIsInPast_returnsTrue() { Calendar pastCalendar = Calendar.getInstance(); pastCalendar.add(Calendar.YEAR, -1); pastCalendar.getTimeInMillis(); assertTrue(EphemeralKeyManager.shouldRefreshKey(null, TEST_SECONDS_BUFFER, pastCalendar)); }
static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInMillis()); long nowPlus...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
@Test public void shouldRefreshKey_whenKeyExpiryIsAfterBufferFromPresent_returnsFalse() { Calendar fixedCalendar = Calendar.getInstance(); EphemeralKey key = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(key); long expiryTimeInSeconds = key.getExpires(); long sufficientBufferTime = 2*TEST_SECONDS_BUFFER;...
static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInMillis()); long nowPlus...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
@Test public void shouldRefreshKey_whenKeyExpiryIsInThePast_returnsTrue() { Calendar fixedCalendar = Calendar.getInstance(); EphemeralKey key = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(key); long currentTimeInMillis = fixedCalendar.getTimeInMillis(); long timeAgoInMillis = currentTimeInMillis - 100L...
static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInMillis()); long nowPlus...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
@Test public void fromJsonString_backToJson_createsIdenticalElement() { try { JSONObject rawConversion = new JSONObject(EXAMPLE_JSON_REDIRECT); assertJsonEquals(rawConversion, mSourceRedirect.toJson()); } catch (JSONException jsonException) { fail("Test Data failure: " + jsonException.getLocalizedMessage()); } }
@NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_RETURN_URL, mReturnUrl); putStringIfNotNull(jsonObject, FIELD_STATUS, mStatus); putStringIfNotNull(jsonObject, FIELD_URL, mUrl); return jsonObject; }
SourceRedirect extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_RETURN_URL, mReturnUrl); putStringIfNotNull(jsonObject, FIELD_STATUS, mStatus); putStringIfNotNull(jsonObject, FIELD_URL, mUrl); return jsonObject; } }
SourceRedirect extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_RETURN_URL, mReturnUrl); putStringIfNotNull(jsonObject, FIELD_STATUS, mStatus); putStringIfNotNull(jsonObject, FIELD_URL, mUrl); return jsonObject; } So...
SourceRedirect extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_RETURN_URL, mReturnUrl); putStringIfNotNull(jsonObject, FIELD_STATUS, mStatus); putStringIfNotNull(jsonObject, FIELD_URL, mUrl); return jsonObject; } So...
SourceRedirect extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); putStringIfNotNull(jsonObject, FIELD_RETURN_URL, mReturnUrl); putStringIfNotNull(jsonObject, FIELD_STATUS, mStatus); putStringIfNotNull(jsonObject, FIELD_URL, mUrl); return jsonObject; } So...
@Test public void shouldRefreshKey_whenKeyExpiryIsInFutureButWithinBuffer_returnsTrue() { Calendar fixedCalendar = Calendar.getInstance(); EphemeralKey key = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(key); long parsedExpiryTimeInMillis = TimeUnit.SECONDS.toMillis(key.getExpires()); long bufferTimeInM...
static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInMillis()); long nowPlus...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
EphemeralKeyManager { static boolean shouldRefreshKey( @Nullable EphemeralKey key, long bufferInSeconds, @Nullable Calendar proxyCalendar) { if (key == null) { return true; } Calendar now = proxyCalendar == null ? Calendar.getInstance() : proxyCalendar; long nowInSeconds = TimeUnit.MILLISECONDS.toSeconds(now.getTimeInM...
@Test @SuppressWarnings("unchecked") public void createKeyManager_updatesEphemeralKey_notifiesListener() { EphemeralKey testKey = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(testKey); mTestEphemeralKeyProvider.setNextRawEphemeralKey(FIRST_SAMPLE_KEY_RAW); EphemeralKeyManager keyManager = new EphemeralK...
@Nullable @VisibleForTesting EphemeralKey getEphemeralKey() { return mEphemeralKey; }
EphemeralKeyManager { @Nullable @VisibleForTesting EphemeralKey getEphemeralKey() { return mEphemeralKey; } }
EphemeralKeyManager { @Nullable @VisibleForTesting EphemeralKey getEphemeralKey() { return mEphemeralKey; } EphemeralKeyManager( @NonNull EphemeralKeyProvider ephemeralKeyProvider, @NonNull KeyManagerListener keyManagerListener, long timeBufferInSeconds, @Nullable Calenda...
EphemeralKeyManager { @Nullable @VisibleForTesting EphemeralKey getEphemeralKey() { return mEphemeralKey; } EphemeralKeyManager( @NonNull EphemeralKeyProvider ephemeralKeyProvider, @NonNull KeyManagerListener keyManagerListener, long timeBufferInSeconds, @Nullable Calenda...
EphemeralKeyManager { @Nullable @VisibleForTesting EphemeralKey getEphemeralKey() { return mEphemeralKey; } EphemeralKeyManager( @NonNull EphemeralKeyProvider ephemeralKeyProvider, @NonNull KeyManagerListener keyManagerListener, long timeBufferInSeconds, @Nullable Calenda...
@Test @SuppressWarnings("unchecked") public void retrieveEphemeralKey_whenUpdateNecessary_returnsUpdateAndArguments() { EphemeralKey testKey = EphemeralKey.fromString(FIRST_SAMPLE_KEY_RAW); assertNotNull(testKey); Calendar fixedCalendar = Calendar.getInstance(); long currentTimeInMillis = fixedCalendar.getTimeInMillis(...
void retrieveEphemeralKey(@Nullable String actionString, Map<String, Object> arguments) { if (shouldRefreshKey( mEphemeralKey, mTimeBufferInSeconds, mOverrideCalendar)) { mEphemeralKeyProvider.createEphemeralKey( StripeApiHandler.API_VERSION, new ClientKeyUpdateListener(this, actionString, arguments)); } else { mListen...
EphemeralKeyManager { void retrieveEphemeralKey(@Nullable String actionString, Map<String, Object> arguments) { if (shouldRefreshKey( mEphemeralKey, mTimeBufferInSeconds, mOverrideCalendar)) { mEphemeralKeyProvider.createEphemeralKey( StripeApiHandler.API_VERSION, new ClientKeyUpdateListener(this, actionString, argumen...
EphemeralKeyManager { void retrieveEphemeralKey(@Nullable String actionString, Map<String, Object> arguments) { if (shouldRefreshKey( mEphemeralKey, mTimeBufferInSeconds, mOverrideCalendar)) { mEphemeralKeyProvider.createEphemeralKey( StripeApiHandler.API_VERSION, new ClientKeyUpdateListener(this, actionString, argumen...
EphemeralKeyManager { void retrieveEphemeralKey(@Nullable String actionString, Map<String, Object> arguments) { if (shouldRefreshKey( mEphemeralKey, mTimeBufferInSeconds, mOverrideCalendar)) { mEphemeralKeyProvider.createEphemeralKey( StripeApiHandler.API_VERSION, new ClientKeyUpdateListener(this, actionString, argumen...
EphemeralKeyManager { void retrieveEphemeralKey(@Nullable String actionString, Map<String, Object> arguments) { if (shouldRefreshKey( mEphemeralKey, mTimeBufferInSeconds, mOverrideCalendar)) { mEphemeralKeyProvider.createEphemeralKey( StripeApiHandler.API_VERSION, new ClientKeyUpdateListener(this, actionString, argumen...
@Test(expected = IllegalArgumentException.class) public void setDefaultPublishableKeyShouldFailWhenNull() throws AuthenticationException { Stripe stripe = new Stripe(mContext); stripe.setDefaultPublishableKey(null); }
public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankA...
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankA...
@Test(expected = IllegalArgumentException.class) public void setDefaultPublishableKeyShouldFailWhenEmpty() throws AuthenticationException { Stripe stripe = new Stripe(mContext); stripe.setDefaultPublishableKey(""); }
public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankA...
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankA...
@Test(expected = IllegalArgumentException.class) public void setDefaultPublishableKeyShouldFailWithSecretKey() throws AuthenticationException { Stripe stripe = new Stripe(mContext); stripe.setDefaultPublishableKey(DEFAULT_SECRET_KEY); }
public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankA...
Stripe { public void setDefaultPublishableKey(@NonNull @Size(min = 1) String publishableKey) { validateKey(publishableKey); mDefaultPublishableKey = publishableKey; } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankA...
@Test(expected = RuntimeException.class) public void createTokenShouldFailWithNull() { Stripe stripe = new Stripe(mContext); stripe.createToken(null, null); }
public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
@Test(expected = RuntimeException.class) public void createTokenShouldFailWithNullCard() { Stripe stripe = new Stripe(mContext); stripe.createToken(null, DEFAULT_TOKEN_CALLBACK); }
public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
@Test(expected = RuntimeException.class) public void createTokenShouldFailWithNullTokenCallback() { Stripe stripe = new Stripe(mContext); stripe.createToken(DEFAULT_CARD, null); }
public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
@Test(expected = IllegalArgumentException.class) public void createTokenShouldFailWithNullPublishableKey() { Stripe stripe = new Stripe(mContext); stripe.createToken(DEFAULT_CARD, new TokenCallback() { @Override public void onError(Exception error) { fail("Should not call method"); } @Override public void onSuccess(Tok...
public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
@Test public void fromJsonString_toMap_createsExpectedMap() { assertMapEquals(EXAMPLE_MAP_REDIRECT, mSourceRedirect.toMap()); }
@NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_RETURN_URL, mReturnUrl); hashMap.put(FIELD_STATUS, mStatus); hashMap.put(FIELD_URL, mUrl); removeNullAndEmptyParams(hashMap); return hashMap; }
SourceRedirect extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_RETURN_URL, mReturnUrl); hashMap.put(FIELD_STATUS, mStatus); hashMap.put(FIELD_URL, mUrl); removeNullAndEmptyParams(hashMap); return hashMap; } }
SourceRedirect extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_RETURN_URL, mReturnUrl); hashMap.put(FIELD_STATUS, mStatus); hashMap.put(FIELD_URL, mUrl); removeNullAndEmptyParams(hashMap); return hashMap; } SourceRedirect...
SourceRedirect extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_RETURN_URL, mReturnUrl); hashMap.put(FIELD_STATUS, mStatus); hashMap.put(FIELD_URL, mUrl); removeNullAndEmptyParams(hashMap); return hashMap; } SourceRedirect...
SourceRedirect extends StripeJsonModel { @NonNull @Override public Map<String, Object> toMap() { Map<String, Object> hashMap = new HashMap<>(); hashMap.put(FIELD_RETURN_URL, mReturnUrl); hashMap.put(FIELD_STATUS, mStatus); hashMap.put(FIELD_URL, mUrl); removeNullAndEmptyParams(hashMap); return hashMap; } SourceRedirect...
@Test public void createTokenShouldCallTokenCreator() { final boolean[] tokenCreatorCalled = { false }; Stripe stripe = getNonLoggingStripe(mContext, DEFAULT_PUBLISHABLE_KEY); stripe.mTokenCreator = new Stripe.TokenCreator() { @Override public void create(Map<String, Object> tokenParams, String publishableKey, String s...
public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
@Test public void createTokenShouldUseExecutor() { final Executor expectedExecutor = new Executor() { @Override public void execute(Runnable command) { } }; Stripe stripe = getNonLoggingStripe(mContext, DEFAULT_PUBLISHABLE_KEY); stripe.mTokenCreator = new Stripe.TokenCreator() { @Override public void create(Map<String,...
public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
@Test public void createTokenShouldUseProvidedKey() { final String expectedPublishableKey = "pk_this_one"; Stripe stripe = getNonLoggingStripe(mContext, DEFAULT_PUBLISHABLE_KEY); stripe.mTokenCreator = new Stripe.TokenCreator() { @Override public void create(Map<String, Object> tokenParams, String publishableKey, Strin...
public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); }
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
Stripe { public void createToken(@NonNull final Card card, @NonNull final TokenCallback callback) { createToken(card, mDefaultPublishableKey, callback); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishableKey); void createBankAccountToken( @NonNull final BankAccount bankA...
@Test public void createBankAccountTokenSynchronous_withValidBankAccount_returnsToken() { try { Stripe stripe = getNonLoggingStripe(mContext, FUNCTIONAL_PUBLISHABLE_KEY); Token token = stripe.createBankAccountTokenSynchronous(mBankAccount); assertNotNull(token); assertEquals(Token.TYPE_BANK_ACCOUNT, token.getType()); a...
public Token createBankAccountTokenSynchronous(final BankAccount bankAccount) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createBankAccountTokenSynchronous(bankAccount, mDefaultPublishableKey); }
Stripe { public Token createBankAccountTokenSynchronous(final BankAccount bankAccount) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createBankAccountTokenSynchronous(bankAccount, mDefaultPublishableKey); } }
Stripe { public Token createBankAccountTokenSynchronous(final BankAccount bankAccount) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createBankAccountTokenSynchronous(bankAccount, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe...
Stripe { public Token createBankAccountTokenSynchronous(final BankAccount bankAccount) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createBankAccountTokenSynchronous(bankAccount, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe...
Stripe { public Token createBankAccountTokenSynchronous(final BankAccount bankAccount) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createBankAccountTokenSynchronous(bankAccount, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe...
@Test public void createSourceSynchronous_withAlipayReusableParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams alipayParams = SourceParams.createAlipayReusableParams( "usd", "Example Payer", "abc@def.com", "stripe: try { Source alipaySource = stripe.createSourceSynchronous(alip...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_withAlipaySingleUseParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams alipayParams = SourceParams.createAlipaySingleUseParams( 1000L, "usd", "Example Payer", "abc@def.com", "stripe: try { Source alipaySource = stripe.createSourceSynchro...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_withBitcoinParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams bitcoinParams = SourceParams.createBitcoinParams(1000L, "usd", "abc@def.com"); Map<String, String> metamap = new HashMap<String, String>() {{ put("site", "google"); put("mood...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_withCustomBitcoinParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams customParams = SourceParams.createCustomParams(); Map<String, Object> ownerMap = new HashMap<>(); ownerMap.put("email", "abc@def.com"); customParams.setTypeRaw("bitcoin...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_withBancontactParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams bancontactParams = SourceParams.createBancontactParams( 1000L, "John Doe", "example: Map<String, String> metamap = new HashMap<String, String>() {{ put("flavor", "strawber...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_with3DSParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); Card card = new Card(CardInputTestActivity.VALID_VISA_NO_SPACES, 12, 2050, "123"); SourceParams params = SourceParams.createCardParams(card); try { Source cardSource = stripe.createSourceSync...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void hashCode_whenEquals_returnsSameValue() { assertTrue(StripeJsonModel.class.isAssignableFrom(Card.class)); Card firstCard = Card.fromString(CardTest.JSON_CARD); Card secondCard = Card.fromString(CardTest.JSON_CARD); assertNotNull(firstCard); assertNotNull(secondCard); assertEquals(firstCard.hashCode(), ...
@Override public int hashCode() { return this.toString().hashCode(); }
StripeJsonModel { @Override public int hashCode() { return this.toString().hashCode(); } }
StripeJsonModel { @Override public int hashCode() { return this.toString().hashCode(); } }
StripeJsonModel { @Override public int hashCode() { return this.toString().hashCode(); } @NonNull abstract Map<String, Object> toMap(); @NonNull abstract JSONObject toJson(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
StripeJsonModel { @Override public int hashCode() { return this.toString().hashCode(); } @NonNull abstract Map<String, Object> toMap(); @NonNull abstract JSONObject toJson(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
@Test public void createSourceSynchronous_withP24Params_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams p24Params = SourceParams.createP24Params( 100, "eur", "Example Payer", "abc@def.com", "stripe: try { Source p24Source = stripe.createSourceSynchronous(p24Params, FUNCTIONAL_SOURC...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_withSepaDebitParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); String validIban = "DE89370400440532013000"; SourceParams params = SourceParams.createSepaDebitParams( "Sepa Account Holder", validIban, "123 Main St", "Eureka", "90210", "EI"); Map<Str...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSepaDebitSource_withNoAddress_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); String validIban = "DE89370400440532013000"; SourceParams params = SourceParams.createSepaDebitParams( "Sepa Account Holder", validIban, null, "Eureka", "90210", "EI"); try { Source sepaDebitSo...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_withIDealParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams params = SourceParams.createIdealParams( 5500L, "Bond", "example: "A statement description", "rabobank"); Map<String, String> metamap = new HashMap<String, String>() {{ put("st...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createSourceSynchronous_withSofortParams_passesIntegrationTest() { Stripe stripe = getNonLoggingStripe(mContext); SourceParams params = SourceParams.createSofortParams( 70000L, "example: "NL", "a description"); Map<String, String> metamap = new HashMap<String, String>() {{ put("state", "soforting"); p...
@Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } }
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
Stripe { @Nullable public Source createSourceSynchronous(@NonNull SourceParams params) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createSourceSynchronous(params, null); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String...
@Test public void createTokenSynchronous_withValidDataAndBadKey_throwsAuthenticationException() { try { Stripe stripe = getNonLoggingStripe(mContext, DEFAULT_PUBLISHABLE_KEY); stripe.createTokenSynchronous(mCard); fail("Expecting an error, but did not get one."); } catch (AuthenticationException authEx) { String messag...
public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); }
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } }
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
@Test public void createTokenSynchronous_withInvalidCardNumber_throwsCardException() { try { Card card = new Card("42424242", 12, mYear, "123"); Stripe stripe = getNonLoggingStripe(mContext, FUNCTIONAL_PUBLISHABLE_KEY); Token token = stripe.createTokenSynchronous(card); fail("Expecting an exception, but created a token...
public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); }
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } }
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
@Test public void createTokenSynchronous_withExpiredCard_throwsCardException() { try { Card card = new Card("4242424242424242", 11, 2015, "123"); Stripe stripe = getNonLoggingStripe(mContext); Token token = stripe.createTokenSynchronous(card, FUNCTIONAL_PUBLISHABLE_KEY); fail("Expecting an exception, but created a toke...
public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); }
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } }
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
Stripe { public Token createTokenSynchronous(final Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException { return createTokenSynchronous(card, mDefaultPublishableKey); } Stripe(@NonNull Context context); Stripe(@NonNull Context context, String publishab...
@Test(expected = IllegalStateException.class) public void getInstance_beforeInit_throwsRuntimeException() { PaymentConfiguration.getInstance(); fail("Should not be able to get a payment configuration before it has been initialized."); }
@NonNull public static PaymentConfiguration getInstance() { if (mInstance == null) { throw new IllegalStateException( "Attempted to get instance of PaymentConfiguration without initialization."); } return mInstance; }
PaymentConfiguration { @NonNull public static PaymentConfiguration getInstance() { if (mInstance == null) { throw new IllegalStateException( "Attempted to get instance of PaymentConfiguration without initialization."); } return mInstance; } }
PaymentConfiguration { @NonNull public static PaymentConfiguration getInstance() { if (mInstance == null) { throw new IllegalStateException( "Attempted to get instance of PaymentConfiguration without initialization."); } return mInstance; } private PaymentConfiguration(@NonNull String publishableKey); }
PaymentConfiguration { @NonNull public static PaymentConfiguration getInstance() { if (mInstance == null) { throw new IllegalStateException( "Attempted to get instance of PaymentConfiguration without initialization."); } return mInstance; } private PaymentConfiguration(@NonNull String publishableKey); @NonNull static ...
PaymentConfiguration { @NonNull public static PaymentConfiguration getInstance() { if (mInstance == null) { throw new IllegalStateException( "Attempted to get instance of PaymentConfiguration without initialization."); } return mInstance; } private PaymentConfiguration(@NonNull String publishableKey); @NonNull static ...
@Test public void hasAnyPrefixShouldFailIfNull() { assertFalse(StripeTextUtils.hasAnyPrefix(null)); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void putStripeJsonModelListIfNotNull_forMapsWhenNull_doesNothing() { Map<String, Object> sampleMap = new HashMap<>(); StripeJsonModel.putStripeJsonModelListIfNotNull(sampleMap, "mapkey", null); assertTrue(sampleMap.isEmpty()); }
static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < jsonModelList.size(); ...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
@Test public void hasAnyPrefixShouldFailIfEmpty() { assertFalse(StripeTextUtils.hasAnyPrefix("")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void hasAnyPrefixShouldFailWithNullAndEmptyPrefix() { assertFalse(StripeTextUtils.hasAnyPrefix(null, "")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void hasAnyPrefixShouldFailWithNullAndSomePrefix() { assertFalse(StripeTextUtils.hasAnyPrefix(null, "1")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void hasAnyPrefixShouldMatch() { assertTrue(StripeTextUtils.hasAnyPrefix("1234", "12")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void hasAnyPrefixShouldMatchMultiple() { assertTrue(StripeTextUtils.hasAnyPrefix("1234", "12", "1")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void hasAnyPrefixShouldMatchSome() { assertTrue(StripeTextUtils.hasAnyPrefix("abcd", "bc", "ab")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void hasAnyPrefixShouldNotMatch() { assertFalse(StripeTextUtils.hasAnyPrefix("1234", "23")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void hasAnyPrefixShouldNotMatchWithSpace() { assertFalse(StripeTextUtils.hasAnyPrefix("xyz", " x")); }
static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } }
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { static boolean hasAnyPrefix(String number, String... prefixes) { if (number == null) { return false; } for (String prefix : prefixes) { if (number.startsWith(prefix)) { return true; } } return false; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void testNullIfBlankNullShouldBeNull() { assertEquals(null, StripeTextUtils.nullIfBlank(null)); }
@Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
@Test public void testNullIfBlankEmptyShouldBeNull() { assertEquals(null, StripeTextUtils.nullIfBlank("")); }
@Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
@Test public void putStripeJsonModelListIfNotNull_forJsonWhenNull_doesNothing() { JSONObject jsonObject = new JSONObject(); StripeJsonModel.putStripeJsonModelListIfNotNull(jsonObject, "jsonkey", null); assertFalse(jsonObject.has("jsonkey")); }
static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < jsonModelList.size(); ...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
StripeJsonModel { static void putStripeJsonModelListIfNotNull( @NonNull Map<String, Object> upperLevelMap, @NonNull @Size(min = 1) String key, @Nullable List<? extends StripeJsonModel> jsonModelList) { if (jsonModelList == null) { return; } List<Map<String, Object>> mapList = new ArrayList<>(); for (int i = 0; i < json...
@Test public void testNullIfBlankSpaceShouldBeNull() { assertEquals(null, StripeTextUtils.nullIfBlank(" ")); }
@Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
@Test public void testNullIfBlankSpacesShouldBeNull() { assertEquals(null, StripeTextUtils.nullIfBlank(" ")); }
@Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
@Test public void testNullIfBlankTabShouldBeNull() { assertEquals(null, StripeTextUtils.nullIfBlank(" ")); }
@Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
@Test public void testNullIfBlankNumbersShouldNotBeNull() { assertEquals("0", StripeTextUtils.nullIfBlank("0")); }
@Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
@Test public void testNullIfBlankLettersShouldNotBeNull() { assertEquals("abc", StripeTextUtils.nullIfBlank("abc")); }
@Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } }
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
StripeTextUtils { @Nullable public static String nullIfBlank(@Nullable String value) { if (isBlank(value)) { return null; } return value; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNu...
@Test public void isBlankShouldPassIfNull() { assertTrue(StripeTextUtils.isBlank(null)); }
public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
@Test public void isBlankShouldPassIfEmpty() { assertTrue(StripeTextUtils.isBlank("")); }
public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
@Test public void isBlankShouldPassIfSpace() { assertTrue(StripeTextUtils.isBlank(" ")); }
public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
@Test public void isBlankShouldPassIfSpaces() { assertTrue(StripeTextUtils.isBlank(" ")); }
public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
@Test public void isBlankShouldPassIfTab() { assertTrue(StripeTextUtils.isBlank(" ")); }
public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
@Test public void fromJsonStringWithoutNulls_backToJson_createsIdenticalElement() { try { JSONObject rawConversion = new JSONObject(EXAMPLE_JSON_OWNER_WITHOUT_NULLS); assertJsonEquals(rawConversion, mSourceOwner.toJson()); } catch (JSONException jsonException) { fail("Test Data failure: " + jsonException.getLocalizedMe...
@NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); JSONObject jsonAddressObject = mAddress == null ? null : mAddress.toJson(); JSONObject jsonVerifiedAddressObject = mVerifiedAddress == null ? null : mVerifiedAddress.toJson(); try { if (jsonAddressObject != null && jsonAddressObje...
SourceOwner extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); JSONObject jsonAddressObject = mAddress == null ? null : mAddress.toJson(); JSONObject jsonVerifiedAddressObject = mVerifiedAddress == null ? null : mVerifiedAddress.toJson(); try { if (jsonAd...
SourceOwner extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); JSONObject jsonAddressObject = mAddress == null ? null : mAddress.toJson(); JSONObject jsonVerifiedAddressObject = mVerifiedAddress == null ? null : mVerifiedAddress.toJson(); try { if (jsonAd...
SourceOwner extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); JSONObject jsonAddressObject = mAddress == null ? null : mAddress.toJson(); JSONObject jsonVerifiedAddressObject = mVerifiedAddress == null ? null : mVerifiedAddress.toJson(); try { if (jsonAd...
SourceOwner extends StripeJsonModel { @NonNull @Override public JSONObject toJson() { JSONObject jsonObject = new JSONObject(); JSONObject jsonAddressObject = mAddress == null ? null : mAddress.toJson(); JSONObject jsonVerifiedAddressObject = mVerifiedAddress == null ? null : mVerifiedAddress.toJson(); try { if (jsonAd...
@Test public void isBlankShouldFailIfNumber() { assertFalse(StripeTextUtils.isBlank("0")); }
public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
@Test public void isBlankShouldFailIfLetters() { assertFalse(StripeTextUtils.isBlank("abc")); }
public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } }
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
StripeTextUtils { public static boolean isBlank(@Nullable String value) { return value == null || value.trim().length() == 0; } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable String value); @Nullable static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpac...
@Test public void removeSpacesAndHyphens_withSpacesInInterior_returnsSpacelessNumber() { String testCardNumber = "4242 4242 4242 4242"; assertEquals("4242424242424242", StripeTextUtils.removeSpacesAndHyphens(testCardNumber)); }
@Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void removeSpacesAndHyphens_withExcessiveSpacesInInterior_returnsSpacelessNumber() { String testCardNumber = "4 242 4 242 4 242 42 4 2"; assertEquals("4242424242424242", StripeTextUtils.removeSpacesAndHyphens(testCardNumber)); }
@Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void removeSpacesAndHyphens_withSpacesOnExterior_returnsSpacelessNumber() { String testCardNumber = " 42424242 4242 4242 "; assertEquals("4242424242424242", StripeTextUtils.removeSpacesAndHyphens(testCardNumber)); }
@Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void removeSpacesAndHyphens_whenEmpty_returnsNull () { assertNull(StripeTextUtils.removeSpacesAndHyphens(" ")); }
@Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void removeSpacesAndHyphens_whenNull_returnsNull() { assertNull(StripeTextUtils.removeSpacesAndHyphens(null)); }
@Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void removeSpacesAndHyphens_withHyphenatedCardNumber_returnsCardNumber() { assertEquals("4242424242424242", StripeTextUtils.removeSpacesAndHyphens("4242-4242-4242-4242")); }
@Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void removeSpacesAndHyphens_removesMultipleSpacesAndHyphens() { assertEquals("123", StripeTextUtils.removeSpacesAndHyphens(" - 1- --- 2 3- - - -------- ")); }
@Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } }
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
StripeTextUtils { @Nullable public static String removeSpacesAndHyphens(@Nullable String cardNumberWithSpaces) { if (isBlank(cardNumberWithSpaces)) { return null; } return cardNumberWithSpaces.replaceAll("\\s|-", ""); } @Nullable static String nullIfBlank(@Nullable String value); static boolean isBlank(@Nullable Strin...
@Test public void shaHashInput_withNullInput_returnsNull() { assertNull(StripeTextUtils.shaHashInput(" ")); }
@Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); hash = bytesToHex(b...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
@Test public void asCardBrand_whenBlank_returnsNull() { assertNull(asCardBrand(" ")); assertNull(asCardBrand(null)); }
@Nullable @CardBrand public static String asCardBrand(@Nullable String possibleCardType) { if (possibleCardType == null || TextUtils.isEmpty(possibleCardType.trim())) { return null; } if (Card.AMERICAN_EXPRESS.equalsIgnoreCase(possibleCardType)) { return Card.AMERICAN_EXPRESS; } else if (Card.MASTERCARD.equalsIgnoreCas...
Card extends StripeJsonModel implements StripePaymentSource { @Nullable @CardBrand public static String asCardBrand(@Nullable String possibleCardType) { if (possibleCardType == null || TextUtils.isEmpty(possibleCardType.trim())) { return null; } if (Card.AMERICAN_EXPRESS.equalsIgnoreCase(possibleCardType)) { return Car...
Card extends StripeJsonModel implements StripePaymentSource { @Nullable @CardBrand public static String asCardBrand(@Nullable String possibleCardType) { if (possibleCardType == null || TextUtils.isEmpty(possibleCardType.trim())) { return null; } if (Card.AMERICAN_EXPRESS.equalsIgnoreCase(possibleCardType)) { return Car...
Card extends StripeJsonModel implements StripePaymentSource { @Nullable @CardBrand public static String asCardBrand(@Nullable String possibleCardType) { if (possibleCardType == null || TextUtils.isEmpty(possibleCardType.trim())) { return null; } if (Card.AMERICAN_EXPRESS.equalsIgnoreCase(possibleCardType)) { return Car...
Card extends StripeJsonModel implements StripePaymentSource { @Nullable @CardBrand public static String asCardBrand(@Nullable String possibleCardType) { if (possibleCardType == null || TextUtils.isEmpty(possibleCardType.trim())) { return null; } if (Card.AMERICAN_EXPRESS.equalsIgnoreCase(possibleCardType)) { return Car...
@Test public void shaHashInput_withText_returnsDifferentText() { String unhashedText = "iamtheverymodelofamodernmajorgeneral"; String hashedText = StripeTextUtils.shaHashInput(unhashedText); assertNotEquals(unhashedText, hashedText); }
@Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); hash = bytesToHex(b...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
StripeTextUtils { @Nullable static String shaHashInput(@Nullable String toHash) { if (StripeTextUtils.isBlank(toHash)) { return null; } String hash; try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); byte[] bytes = toHash.getBytes("UTF-8"); digest.update(bytes, 0, bytes.length); bytes = digest.digest(); h...
@Test public void removeNullAndEmptyParams_removesNullParams() { Map<String, Object> testMap = new HashMap<>(); testMap.put("a", null); testMap.put("b", "not null"); StripeNetworkUtils.removeNullAndEmptyParams(testMap); assertEquals(1, testMap.size()); assertTrue(testMap.containsKey("b")); }
@SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence sequence = (CharSequence) ...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
@Test public void removeNullAndEmptyParams_removesEmptyStringParams() { Map<String, Object> testMap = new HashMap<>(); testMap.put("a", "fun param"); testMap.put("b", "not null"); testMap.put("c", ""); StripeNetworkUtils.removeNullAndEmptyParams(testMap); assertEquals(2, testMap.size()); assertTrue(testMap.containsKey(...
@SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence sequence = (CharSequence) ...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
@Test public void removeNullAndEmptyParams_removesNestedEmptyParams() { Map<String, Object> testMap = new HashMap<>(); Map<String, Object> firstNestedMap = new HashMap<>(); Map<String, Object> secondNestedMap = new HashMap<>(); testMap.put("a", "fun param"); testMap.put("b", "not null"); firstNestedMap.put("1a", "somet...
@SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence sequence = (CharSequence) ...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
StripeNetworkUtils { @SuppressWarnings("unchecked") public static void removeNullAndEmptyParams(@NonNull Map<String, Object> mapToEdit) { for (String key : new HashSet<>(mapToEdit.keySet())) { if (mapToEdit.get(key) == null) { mapToEdit.remove(key); } if (mapToEdit.get(key) instanceof CharSequence) { CharSequence seque...
@Test public void addUidParams_addsParams() { Map<String, Object> existingMap = new HashMap<>(); StripeNetworkUtils.UidProvider provider = new StripeNetworkUtils.UidProvider() { @Override public String getUid() { return "abc123"; } @Override public String getPackageName() { return "com.example.main"; } }; StripeNetwork...
@SuppressWarnings("HardwareIds") static void addUidParams( @Nullable UidProvider provider, @NonNull Context context, @NonNull Map<String, Object> params) { String guid = provider == null ? Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID) : provider.getUid(); if (StripeTextUtils.isBlan...
StripeNetworkUtils { @SuppressWarnings("HardwareIds") static void addUidParams( @Nullable UidProvider provider, @NonNull Context context, @NonNull Map<String, Object> params) { String guid = provider == null ? Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID) : provider.getUid(); if (S...
StripeNetworkUtils { @SuppressWarnings("HardwareIds") static void addUidParams( @Nullable UidProvider provider, @NonNull Context context, @NonNull Map<String, Object> params) { String guid = provider == null ? Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID) : provider.getUid(); if (S...
StripeNetworkUtils { @SuppressWarnings("HardwareIds") static void addUidParams( @Nullable UidProvider provider, @NonNull Context context, @NonNull Map<String, Object> params) { String guid = provider == null ? Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID) : provider.getUid(); if (S...
StripeNetworkUtils { @SuppressWarnings("HardwareIds") static void addUidParams( @Nullable UidProvider provider, @NonNull Context context, @NonNull Map<String, Object> params) { String guid = provider == null ? Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID) : provider.getUid(); if (S...