use of com.braintreepayments.api.interfaces.PaymentMethodNonceCreatedListener in project braintree_android by braintree.
the class ThreeDSecureVerificationTest method performVerification_doesALookupAndReturnsACardWhenThereIsAMPILookupError.
@Test(timeout = 10000)
public void performVerification_doesALookupAndReturnsACardWhenThereIsAMPILookupError() throws InterruptedException {
BraintreeFragment fragment = getFragment();
fragment.addListener(new PaymentMethodNonceCreatedListener() {
@Override
public void onPaymentMethodNonceCreated(PaymentMethodNonce paymentMethodNonce) {
assertIsANonce(paymentMethodNonce.getNonce());
CardNonce cardNonce = (CardNonce) paymentMethodNonce;
assertEquals("85", cardNonce.getLastTwo());
assertFalse(cardNonce.getThreeDSecureInfo().isLiabilityShifted());
assertFalse(cardNonce.getThreeDSecureInfo().isLiabilityShiftPossible());
assertTrue(((CardNonce) paymentMethodNonce).getThreeDSecureInfo().wasVerified());
mCountDownLatch.countDown();
}
});
CardBuilder cardBuilder = new CardBuilder().cardNumber(THREE_D_SECURE_MPI_LOOKUP_ERROR).expirationDate("12/20");
ThreeDSecure.performVerification(fragment, cardBuilder, TEST_AMOUNT);
mCountDownLatch.await();
}
Aggregations