use of com.braintreepayments.api.test.TestClientTokenBuilder in project braintree_android by braintree.
the class CardTest method tokenize_tokenizesACardWithoutACustomer.
@Test(timeout = 10000)
public void tokenize_tokenizesACardWithoutACustomer() throws Exception {
CardBuilder cardBuilder = new CardBuilder().cardNumber(VISA).expirationDate("08/20");
assertTokenizationSuccessful(new TestClientTokenBuilder().withoutCustomer().build(), cardBuilder);
}
use of com.braintreepayments.api.test.TestClientTokenBuilder in project braintree_android by braintree.
the class CardTest method tokenize_tokenizesACardWithACompleteBillingAddress.
@Test(timeout = 10000)
public void tokenize_tokenizesACardWithACompleteBillingAddress() throws Exception {
CardBuilder cardBuilder = new CardBuilder().cardNumber(VISA).expirationDate("08/20").cvv("123").cardholderName("Joe Smith").firstName("Joe").lastName("Smith").company("Company").streetAddress("1 Main St").extendedAddress("Unit 1").locality("Some Town").postalCode("12345").region("Some Region").countryName("United States").countryCodeAlpha2("US").countryCodeAlpha3("USA").countryCodeNumeric("840");
assertTokenizationSuccessful(new TestClientTokenBuilder().build(), cardBuilder);
}
use of com.braintreepayments.api.test.TestClientTokenBuilder in project braintree_android by braintree.
the class IdealTest method setUp.
@Before
public void setUp() throws InvalidArgumentException {
mCountDownLatch = new CountDownLatch(1);
mBraintreeFragment = getFragmentWithAuthorization(mActivityTestRule.getActivity(), new TestClientTokenBuilder().withIdeal().withoutCustomer().build());
}
use of com.braintreepayments.api.test.TestClientTokenBuilder in project braintree_android by braintree.
the class ThreeDSecureVerificationTest method performVerification_failsWithATokenizationKey.
@Test(timeout = 10000)
public void performVerification_failsWithATokenizationKey() throws InterruptedException {
String clientToken = new TestClientTokenBuilder().withThreeDSecure().build();
BraintreeFragment fragment = getFragment(TOKENIZATION_KEY, clientToken);
fragment.addListener(new BraintreeErrorListener() {
@Override
public void onError(Exception error) {
assertTrue(error instanceof AuthorizationException);
assertEquals("Tokenization key authorization not allowed for this endpoint. Please use an authentication method with upgraded permissions", error.getMessage());
mCountDownLatch.countDown();
}
});
CardBuilder cardBuilder = new CardBuilder().cardNumber(THREE_D_SECURE_VERIFICATON).expirationDate("12/20");
ThreeDSecure.performVerification(fragment, cardBuilder, TEST_AMOUNT);
mCountDownLatch.await();
}
use of com.braintreepayments.api.test.TestClientTokenBuilder in project braintree_android by braintree.
the class CardTest method tokenize_tokenizesACardWithValidateTrue.
@Test(timeout = 10000)
public void tokenize_tokenizesACardWithValidateTrue() throws Exception {
CardBuilder cardBuilder = new CardBuilder().cardNumber(VISA).expirationDate("08/20").validate(true);
assertTokenizationSuccessful(new TestClientTokenBuilder().build(), cardBuilder);
}
Aggregations