Search in sources :

Example 11 with UnionPayCapabilities

use of com.braintreepayments.api.models.UnionPayCapabilities in project braintree_android by braintree.

the class UnionPayTest method fetchCapabilities_whenCredit_isDebitIsFalse.

@Test(timeout = 10000)
public void fetchCapabilities_whenCredit_isDebitIsFalse() throws InterruptedException {
    mBraintreeFragment.addListener(new UnionPayListener() {

        @Override
        public void onCapabilitiesFetched(UnionPayCapabilities unionPayCapabilities) {
            assertTrue(unionPayCapabilities.supportsTwoStepAuthAndCapture());
            assertFalse(unionPayCapabilities.isDebit());
            assertTrue(unionPayCapabilities.isUnionPay());
            mCountDownLatch.countDown();
        }

        @Override
        public void onSmsCodeSent(String enrollmentId, boolean smsCodeRequired) {
            fail("Not expecting onSmsCodeSent");
        }
    });
    UnionPay.fetchCapabilities(mBraintreeFragment, UNIONPAY_CREDIT);
    mCountDownLatch.await();
}
Also used : UnionPayListener(com.braintreepayments.api.interfaces.UnionPayListener) UnionPayCapabilities(com.braintreepayments.api.models.UnionPayCapabilities) Test(org.junit.Test)

Aggregations

UnionPayCapabilities (com.braintreepayments.api.models.UnionPayCapabilities)11 UnionPayListener (com.braintreepayments.api.interfaces.UnionPayListener)10 Test (org.junit.Test)10 UnionPayCardBuilder (com.braintreepayments.api.models.UnionPayCardBuilder)5 InvalidArgumentException (com.braintreepayments.api.exceptions.InvalidArgumentException)3 BraintreeErrorListener (com.braintreepayments.api.interfaces.BraintreeErrorListener)3 PaymentMethodNonceCreatedListener (com.braintreepayments.api.interfaces.PaymentMethodNonceCreatedListener)3 PaymentMethodNonce (com.braintreepayments.api.models.PaymentMethodNonce)3 CardNonce (com.braintreepayments.api.models.CardNonce)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 ErrorWithResponse (com.braintreepayments.api.exceptions.ErrorWithResponse)1 AmericanExpressListener (com.braintreepayments.api.interfaces.AmericanExpressListener)1 BraintreeCancelListener (com.braintreepayments.api.interfaces.BraintreeCancelListener)1 BraintreePaymentResultListener (com.braintreepayments.api.interfaces.BraintreePaymentResultListener)1 ConfigurationListener (com.braintreepayments.api.interfaces.ConfigurationListener)1 PaymentMethodNoncesUpdatedListener (com.braintreepayments.api.interfaces.PaymentMethodNoncesUpdatedListener)1 AmericanExpressRewardsBalance (com.braintreepayments.api.models.AmericanExpressRewardsBalance)1 BraintreePaymentResult (com.braintreepayments.api.models.BraintreePaymentResult)1 Configuration (com.braintreepayments.api.models.Configuration)1