Search in sources :

Example 1 with AuthCardDetailsFixture.anAuthCardDetails

use of uk.gov.pay.connector.model.domain.AuthCardDetailsFixture.anAuthCardDetails in project pay-connector by alphagov.

the class StripePaymentProviderTest method shouldAuthoriseSuccessfully_WithCanadaAddress.

@Test
public void shouldAuthoriseSuccessfully_WithCanadaAddress() {
    Address canadaAddress = new Address();
    canadaAddress.setLine1("125 Kingsway");
    canadaAddress.setLine2("Aviation House");
    canadaAddress.setPostcode("X0A0A0");
    canadaAddress.setCity("Arctic Bay");
    canadaAddress.setCountry("CA");
    AuthCardDetails authCardDetails = AuthCardDetailsFixture.anAuthCardDetails().withAddress(canadaAddress).withEndDate(CardExpiryDate.valueOf("01/30")).build();
    CardAuthorisationGatewayRequest request = CardAuthorisationGatewayRequest.valueOf(getCharge(), authCardDetails);
    GatewayResponse gatewayResponse = stripePaymentProvider.authorise(request);
    assertTrue(gatewayResponse.isSuccessful());
}
Also used : GatewayResponse(uk.gov.pay.connector.gateway.model.response.GatewayResponse) Address(uk.gov.pay.connector.common.model.domain.Address) AuthCardDetailsFixture.anAuthCardDetails(uk.gov.pay.connector.model.domain.AuthCardDetailsFixture.anAuthCardDetails) AuthCardDetails(uk.gov.pay.connector.gateway.model.AuthCardDetails) CardAuthorisationGatewayRequest(uk.gov.pay.connector.gateway.model.request.CardAuthorisationGatewayRequest) Test(org.junit.Test)

Example 2 with AuthCardDetailsFixture.anAuthCardDetails

use of uk.gov.pay.connector.model.domain.AuthCardDetailsFixture.anAuthCardDetails in project pay-connector by alphagov.

the class StripePaymentProviderTest method shouldAuthoriseSuccessfully_WithNoBillingAddress.

@Test
public void shouldAuthoriseSuccessfully_WithNoBillingAddress() {
    AuthCardDetails authCardDetails = AuthCardDetailsFixture.anAuthCardDetails().withAddress(null).withEndDate(CardExpiryDate.valueOf("01/30")).build();
    CardAuthorisationGatewayRequest request = CardAuthorisationGatewayRequest.valueOf(getCharge(), authCardDetails);
    GatewayResponse gatewayResponse = stripePaymentProvider.authorise(request);
    assertTrue(gatewayResponse.isSuccessful());
}
Also used : GatewayResponse(uk.gov.pay.connector.gateway.model.response.GatewayResponse) AuthCardDetailsFixture.anAuthCardDetails(uk.gov.pay.connector.model.domain.AuthCardDetailsFixture.anAuthCardDetails) AuthCardDetails(uk.gov.pay.connector.gateway.model.AuthCardDetails) CardAuthorisationGatewayRequest(uk.gov.pay.connector.gateway.model.request.CardAuthorisationGatewayRequest) Test(org.junit.Test)

Example 3 with AuthCardDetailsFixture.anAuthCardDetails

use of uk.gov.pay.connector.model.domain.AuthCardDetailsFixture.anAuthCardDetails in project pay-connector by alphagov.

the class StripePaymentProviderTest method shouldAuthoriseSuccessfully_WithUsAddress.

@Test
public void shouldAuthoriseSuccessfully_WithUsAddress() {
    Address usAddress = new Address();
    usAddress.setLine1("125 Kingsway");
    usAddress.setLine2("Aviation House");
    usAddress.setCity("Washington D.C.");
    usAddress.setPostcode("20500");
    usAddress.setCountry("US");
    AuthCardDetails authCardDetails = AuthCardDetailsFixture.anAuthCardDetails().withAddress(usAddress).withEndDate(CardExpiryDate.valueOf("01/30")).build();
    CardAuthorisationGatewayRequest request = CardAuthorisationGatewayRequest.valueOf(getCharge(), authCardDetails);
    GatewayResponse gatewayResponse = stripePaymentProvider.authorise(request);
    assertTrue(gatewayResponse.isSuccessful());
}
Also used : GatewayResponse(uk.gov.pay.connector.gateway.model.response.GatewayResponse) Address(uk.gov.pay.connector.common.model.domain.Address) AuthCardDetailsFixture.anAuthCardDetails(uk.gov.pay.connector.model.domain.AuthCardDetailsFixture.anAuthCardDetails) AuthCardDetails(uk.gov.pay.connector.gateway.model.AuthCardDetails) CardAuthorisationGatewayRequest(uk.gov.pay.connector.gateway.model.request.CardAuthorisationGatewayRequest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 AuthCardDetails (uk.gov.pay.connector.gateway.model.AuthCardDetails)3 CardAuthorisationGatewayRequest (uk.gov.pay.connector.gateway.model.request.CardAuthorisationGatewayRequest)3 GatewayResponse (uk.gov.pay.connector.gateway.model.response.GatewayResponse)3 AuthCardDetailsFixture.anAuthCardDetails (uk.gov.pay.connector.model.domain.AuthCardDetailsFixture.anAuthCardDetails)3 Address (uk.gov.pay.connector.common.model.domain.Address)2