use of net.petafuel.styx.api.v1.payment.entity.BulkPaymentInitiation in project styx by petafuel.
the class SinglePaymentInitiationResourceTest method initiateBulkPayment_Targo.
@Test
@Category(IntegrationTest.class)
public void initiateBulkPayment_Targo() {
Jsonb jsonb = JsonbBuilder.create();
BulkPaymentInitiation bulkPaymentInitiation = jsonb.fromJson("{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE60760300800500123456\"},\"requestedExecutionDate\":\"" + currentDate + "\",\"payments\":[{\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"520.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE15500105172295759744\"},\"creditorName\":\"WBG\",\"remittanceInformationUnstructured\":\"Ref.NumberWBG-1222\",\"requestedExecutionDate\":\"" + currentDate + "\"},{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE60760300800500123456\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"520.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE15500105172295759744\"},\"creditorName\":\"WBG\",\"remittanceInformationUnstructured\":\"Ref.NumberWBG-1222\",\"requestedExecutionDate\":\"" + currentDate + "\"}]}", BulkPaymentInitiation.class);
Invocation.Builder invocationBuilder = target("/v1/bulk-payments/sepa-credit-transfers").request();
invocationBuilder.header("token", pisAccessToken);
invocationBuilder.header("PSU-ID", "PSU-Successful");
invocationBuilder.header("PSU-BIC", "CMCIDEDD");
invocationBuilder.header("PSU-IP-Address", "192.168.8.78");
invocationBuilder.header("redirectPreferred", true);
invocationBuilder.header("X-STYX-X-bvpsd2-test-apikey", "tUfZ5KOHRTFrikZUsmSMUabKw09UIzGE");
Invocation invocation = invocationBuilder.buildPost(Entity.entity(bulkPaymentInitiation, MediaType.APPLICATION_JSON));
Response response = invocation.invoke(Response.class);
Assert.assertEquals(201, response.getStatus());
}
use of net.petafuel.styx.api.v1.payment.entity.BulkPaymentInitiation in project styx by petafuel.
the class FetchSinglePaymentResourceTest method fetchBulkPayment.
@Test
@Category(IntegrationTest.class)
public void fetchBulkPayment() throws IOException {
Invocation.Builder invocationBuilder = target("/v1/bulk-payments/sepa-credit-transfers").request();
invocationBuilder.header("token", pisAccessToken);
invocationBuilder.header("PSU-ID", "PSU-1234");
invocationBuilder.header("PSU-BIC", "GENODEF1M03");
invocationBuilder.header("PSU-IP-Address", "192.168.8.78");
invocationBuilder.header("redirectPreferred", true);
Jsonb jsonb = JsonbBuilder.create();
BulkPaymentInitiation bulkPaymentInitiation = jsonb.fromJson("{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE87200500001234567890\"},\"payments\":[{\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"520.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE23100120020123456789\"},\"creditorName\":\"WBG\",\"remittanceInformationUnstructured\":\"Ref.NumberWBG-1222\"},{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE87200500001234567890\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"32.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE23100120020123456789\"},\"creditorName\":\"Gimmeyourmoney\",\"remittanceInformationUnstructured\":\"Myothervwz\"}]}", BulkPaymentInitiation.class);
Invocation invocation = invocationBuilder.buildPost(Entity.entity(bulkPaymentInitiation, MediaType.APPLICATION_JSON));
Response response = invocation.invoke(Response.class);
Assertions.assertEquals(201, response.getStatus());
PaymentResponse paymentResponse = jsonb.fromJson(IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8), PaymentResponse.class);
Invocation getPayment = target("/v1/bulk-payments/sepa-credit-transfers/" + paymentResponse.getPaymentId()).request().header("token", pisAccessToken).header("PSU-ID", "PSU-1234").header("PSU-BIC", "GENODEF1M03").header("PSU-IP-Address", "192.168.8.78").header("redirectPreferred", true).buildGet();
response = getPayment.invoke(Response.class);
Assertions.assertEquals(200, response.getStatus());
}
use of net.petafuel.styx.api.v1.payment.entity.BulkPaymentInitiation in project styx by petafuel.
the class SinglePaymentStatusResourceTest method getSparkasseBulkPaymentId.
private String getSparkasseBulkPaymentId() {
if (sparkasseBulkPaymentId == null) {
Invocation.Builder invocationBuilder = target("/v1/bulk-payments/sepa-credit-transfers").request();
invocationBuilder.header("token", pisAccessToken);
invocationBuilder.header("PSU-ID", "PSU-Successful");
invocationBuilder.header("PSU-BIC", SPARKASSE_BIC);
invocationBuilder.header("PSU-IP-Address", "192.168.8.78");
invocationBuilder.header("redirectPreferred", true);
Jsonb jsonb = JsonbBuilder.create();
BulkPaymentInitiation bulkPaymentInitiation = jsonb.fromJson("{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE86999999990000001000\", \"name\":\"NOTPROVIDED\"},\"payments\":[{\"endToEndIdentification\": \"endToEndId\", \"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"520.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE75999999990000001004\"},\"creditorName\":\"WBG\",\"remittanceInformationUnstructured\":\"Ref.NumberWBG-1222\"},{\"endToEndIdentification\": \"endToEndId\", \"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE86999999990000001000\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"32.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE75999999990000001004\"},\"creditorName\":\"Gimmeyourmoney\",\"remittanceInformationUnstructured\":\"Myothervwz\"}]}", BulkPaymentInitiation.class);
Invocation invocation = invocationBuilder.buildPost(Entity.entity(bulkPaymentInitiation, MediaType.APPLICATION_JSON));
Response response = invocation.invoke(Response.class);
try {
PaymentResponse paymentResponse = jsonb.fromJson(IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8), PaymentResponse.class);
sparkasseBulkPaymentId = paymentResponse.getPaymentId();
} catch (IOException e) {
return "";
}
}
return sparkasseBulkPaymentId;
}
use of net.petafuel.styx.api.v1.payment.entity.BulkPaymentInitiation in project styx by petafuel.
the class FetchSinglePaymentResourceTest method fetchPaymentInvalidPaymentService.
@Test
@Category(IntegrationTest.class)
public void fetchPaymentInvalidPaymentService() throws IOException {
Invocation.Builder invocationBuilder = target("/v1/bulk-payments/sepa-credit-transfers").request();
invocationBuilder.header("token", pisAccessToken);
invocationBuilder.header("PSU-ID", "PSU-1234");
invocationBuilder.header("PSU-BIC", "GENODEF1M03");
invocationBuilder.header("PSU-IP-Address", "192.168.8.78");
invocationBuilder.header("redirectPreferred", true);
Jsonb jsonb = JsonbBuilder.create();
BulkPaymentInitiation bulkPaymentInitiation = jsonb.fromJson("{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE87200500001234567890\"}, \"payments\":[{\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"520.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE23100120020123456789\"},\"creditorName\":\"WBG\",\"remittanceInformationUnstructured\":\"Ref.NumberWBG-1222\"},{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE87200500001234567890\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"32.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE23100120020123456789\"},\"creditorName\":\"Gimmeyourmoney\",\"remittanceInformationUnstructured\":\"Myothervwz\"}]}", BulkPaymentInitiation.class);
Invocation invocation = invocationBuilder.buildPost(Entity.entity(bulkPaymentInitiation, MediaType.APPLICATION_JSON));
Response response = invocation.invoke(Response.class);
Assertions.assertEquals(201, response.getStatus());
PaymentResponse paymentResponse = jsonb.fromJson(IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8), PaymentResponse.class);
Invocation getPayment = target("/v1/periodic-payments/sepa-credit-transfers/" + paymentResponse.getPaymentId()).request().header("token", pisAccessToken).header("PSU-ID", "PSU-1234").header("PSU-BIC", "GENODEF1M03").header("PSU-IP-Address", "192.168.8.78").header("redirectPreferred", true).buildGet();
response = getPayment.invoke(Response.class);
Assertions.assertEquals(500, response.getStatus());
}
use of net.petafuel.styx.api.v1.payment.entity.BulkPaymentInitiation in project styx by petafuel.
the class SinglePaymentInitiationResourceTest method initiateBulkPayment_Fiducia.
@Test
@Category(IntegrationTest.class)
public void initiateBulkPayment_Fiducia() {
Invocation.Builder invocationBuilder = target("/v1/bulk-payments/sepa-credit-transfers").request();
invocationBuilder.header("token", pisAccessToken);
invocationBuilder.header("PSU-ID", "PSU-1234");
invocationBuilder.header("PSU-BIC", "GENODEF1M03");
invocationBuilder.header("PSU-IP-Address", "192.168.8.78");
invocationBuilder.header("redirectPreferred", true);
Jsonb jsonb = JsonbBuilder.create();
BulkPaymentInitiation bulkPaymentInitiation = jsonb.fromJson("{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE87200500001234567890\"},\"payments\":[{\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"520.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE23100120020123456789\"},\"creditorName\":\"WBG\",\"remittanceInformationUnstructured\":\"Ref.NumberWBG-1222\"},{\"debtorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE87200500001234567890\"},\"instructedAmount\":{\"currency\":\"EUR\",\"amount\":\"32.00\"},\"creditorAccount\":{\"currency\":\"EUR\",\"iban\":\"DE23100120020123456789\"},\"creditorName\":\"Gimmeyourmoney\",\"remittanceInformationUnstructured\":\"Myothervwz\"}]}", BulkPaymentInitiation.class);
Invocation invocation = invocationBuilder.buildPost(Entity.entity(bulkPaymentInitiation, MediaType.APPLICATION_JSON));
Response response = invocation.invoke(Response.class);
Assert.assertEquals(201, response.getStatus());
}
Aggregations