use of com.stripe.exception.AuthenticationException in project alf.io by alfio-event.
the class StripeManagerTest method stripeError.
@Test
void stripeError() {
BaseStripeManager baseStripeManager = new BaseStripeManager(configurationManager, configurationRepository, ticketRepository, mock(Environment.class)) {
@Override
protected Optional<Charge> charge(PaymentSpecification spec, Map<String, Object> chargeParams) throws StripeException {
throw new AuthenticationException("401", "42", "401", 401);
}
};
StripeCreditCardManager stripeCreditCardManager = new StripeCreditCardManager(transactionRepository, baseStripeManager, TestUtil.clockProvider());
PaymentSpecification spec = new PaymentSpecification("", new StripeCreditCardToken(""), 100, event, "", customerName);
PaymentResult result = stripeCreditCardManager.doPayment(spec);
assertEquals(result, PaymentResult.failed("error.STEP2_STRIPE_abort"));
}
Aggregations