use of com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse in project connect-sdk-client-android by Ingenico-ePayments.
the class GcSessionPreparePaymentRequestTest method validateValidPreparedPaymentRequestTokenization.
/**
* Test that the encrypted blob that will be used for the payment has been created successfully
*/
private void validateValidPreparedPaymentRequestTokenization(PreparedPaymentRequest preparedPaymentRequest) {
assertNotNull(preparedPaymentRequest);
assertNotNull(preparedPaymentRequest.getEncodedClientMetaInfo());
assertNotNull(preparedPaymentRequest.getEncryptedFields());
CreatePaymentRequest createPaymentRequest = constructCreatePaymentRequest(preparedPaymentRequest);
CreatePaymentResponse response = createPayment(createPaymentRequest);
assertNotNull(response);
assertNotNull(response.getCreationOutput());
assertNotNull(response.getCreationOutput().getToken());
deleteToken(response.getCreationOutput().getToken());
}
use of com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse in project connect-sdk-java by Ingenico-ePayments.
the class PaymentsClientTest method testCreateSuccess.
/**
* Tests that a non-failure response will not throw an exception.
*/
@Test
@SuppressWarnings("resource")
public void testCreateSuccess() {
Client client = Factory.createClient(session);
String responseBody = getResource("pending_approval.json");
whenPost().thenReturn(new Response(201, responseBody, null));
CreatePaymentRequest body = createRequest();
CreatePaymentResponse response = client.merchant("merchantId").payments().create(body);
Assert.assertEquals("000002000020142549460000100001", response.getPayment().getId());
Assert.assertEquals("PENDING_APPROVAL", response.getPayment().getStatus());
}
Aggregations