use of uk.gov.pay.connector.gateway.model.AuthCardDetails in project pay-connector by alphagov.
the class EpdqPaymentProviderTest method shouldAuthoriseWith3dsOnAndNoAddressInRequestSuccessfully.
@Test
public void shouldAuthoriseWith3dsOnAndNoAddressInRequestSuccessfully() throws Exception {
setUpFor3dsAndCheckThatEpdqIsUp();
AuthCardDetails authCardDetails = authCardDetailsFixture().withCardNo(VISA_CARD_NUMBER_RECOGNISED_AS_REQUIRING_3DS1_BY_EPDQ).withAddress(null).build();
var request = new CardAuthorisationGatewayRequest(chargeEntity, authCardDetails);
GatewayResponse<BaseAuthoriseResponse> response = paymentProvider.authorise(request);
assertThat(response.isSuccessful(), is(true));
assertThat(response.getBaseResponse().get().authoriseStatus(), is(REQUIRES_3DS));
}
use of uk.gov.pay.connector.gateway.model.AuthCardDetails in project pay-connector by alphagov.
the class EpdqPaymentProviderTest method shouldAuthoriseSuccessfullyWhenCardholderNameContainsRightSingleQuotationMark.
@Test
public void shouldAuthoriseSuccessfullyWhenCardholderNameContainsRightSingleQuotationMark() throws Exception {
setUpAndCheckThatEpdqIsUp();
// That’s a U+2019 RIGHT SINGLE QUOTATION MARK, not a U+0027 APOSTROPHE
String cardholderName = "John O’Connor";
AuthCardDetails authCardDetails = authCardDetailsFixture().withCardHolder(cardholderName).build();
var request = new CardAuthorisationGatewayRequest(chargeEntity, authCardDetails);
GatewayResponse<BaseAuthoriseResponse> response = paymentProvider.authorise(request);
assertThat(response.isSuccessful(), is(true));
}
use of uk.gov.pay.connector.gateway.model.AuthCardDetails in project pay-connector by alphagov.
the class EpdqPaymentProviderTest method shouldAuthoriseSuccessfullyWithNoAddressInRequest.
@Test
public void shouldAuthoriseSuccessfullyWithNoAddressInRequest() throws Exception {
setUpAndCheckThatEpdqIsUp();
AuthCardDetails authCardDetails = authCardDetailsFixture().withAddress(null).build();
var request = new CardAuthorisationGatewayRequest(chargeEntity, authCardDetails);
GatewayResponse<BaseAuthoriseResponse> response = paymentProvider.authorise(request);
assertThat(response.isSuccessful(), is(true));
}
use of uk.gov.pay.connector.gateway.model.AuthCardDetails in project pay-connector by alphagov.
the class SmartpayPaymentProviderTest method shouldSendSuccessfullyAnOrderForMerchantWithNoAddressInRequest.
@Test
public void shouldSendSuccessfullyAnOrderForMerchantWithNoAddressInRequest() throws Exception {
PaymentProvider paymentProvider = getSmartpayPaymentProvider();
AuthCardDetails authCardDetails = AuthCardDetailsFixture.anAuthCardDetails().withCardNo(VALID_SMARTPAY_CARD_NUMBER).withAddress(null).build();
CardAuthorisationGatewayRequest request = new CardAuthorisationGatewayRequest(chargeEntity, authCardDetails);
GatewayResponse response = paymentProvider.authorise(request);
assertTrue(response.isSuccessful());
}
use of uk.gov.pay.connector.gateway.model.AuthCardDetails in project pay-connector by alphagov.
the class SmartpayPaymentProviderTest method shouldSendSuccessfullyAnOrderForMerchantWithUsAddressInRequest.
@Test
public void shouldSendSuccessfullyAnOrderForMerchantWithUsAddressInRequest() throws Exception {
PaymentProvider paymentProvider = getSmartpayPaymentProvider();
Address usAddress = new Address();
usAddress.setLine1("125 Kingsway");
usAddress.setLine2("Aviation House");
usAddress.setPostcode("90210");
usAddress.setCity("Washington D.C.");
usAddress.setCountry("US");
AuthCardDetails authCardDetails = AuthCardDetailsFixture.anAuthCardDetails().withCardNo(VALID_SMARTPAY_CARD_NUMBER).withAddress(usAddress).build();
CardAuthorisationGatewayRequest request = new CardAuthorisationGatewayRequest(chargeEntity, authCardDetails);
GatewayResponse response = paymentProvider.authorise(request);
assertTrue(response.isSuccessful());
}
Aggregations