diff --git a/README.md b/README.md index 3c675f526..4872b0faa 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Introduction -The Java SDK helps you to communicate with the [Ingenico Connect](http://www.globalcollect.com/) Server API. It's primary features are: +The Java SDK helps you to communicate with the [Ingenico Connect](http://www.ingenico.com/epayments) Server API. It's primary features are: * convenient Java wrapper around the API calls and responses * marshalls Java request objects to HTTP requests diff --git a/pom.xml b/pom.xml index 488ce49bf..724efefdb 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.ingenico.connect.gateway connect-sdk-java - 3.0.0 + 4.0.0 jar connect-sdk-java @@ -14,7 +14,7 @@ Ingenico ePayments - http://www.globalcollect.com/ + http://http://www.ingenico.com/epayments/ @@ -29,7 +29,7 @@ Ingenico ePayments github@epay.ingenico.com Ingenico ePayments - http://www.globalcollect.com/ + http://http://www.ingenico.com/epayments/ @@ -235,7 +235,7 @@ 2.19.1 - /com/globalcollect/gateway/sdk/it/**/* + /com/ingenico/connect/gateway/sdk/it/**/* @@ -270,6 +270,13 @@ test + + org.hamcrest + hamcrest-library + 1.3 + test + + org.mockito mockito-all diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/ExampleBase.java b/src/examples/java/com/globalcollect/gateway/sdk/java/ExampleBase.java deleted file mode 100644 index e38a88a4a..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/ExampleBase.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.net.URISyntaxException; -import java.net.URL; - -import com.globalcollect.gateway.sdk.java.gc.GcClient; - -public abstract class ExampleBase { - - public GcClient getGcClient() throws URISyntaxException { - URL propertiesUrl = getClass().getResource("/example-configuration.properties"); - GcDefaultConfiguration defaultConfiguration = GcFactory.createDefaultConfiguration(propertiesUrl.toURI(), "d8b5c5c457d80349", "KbaFESwwqgwidbbhf2GECxGFayerrnbT2bPznc3Vfdg="); - return GcFactory.createClient(defaultConfiguration); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/hostedcheckouts/CreateHostedCheckoutExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/hostedcheckouts/CreateHostedCheckoutExample.java deleted file mode 100644 index e0cac003c..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/hostedcheckouts/CreateHostedCheckoutExample.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.globalcollect.gateway.sdk.java.hostedcheckouts; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.CreateHostedCheckoutRequest; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.CreateHostedCheckoutResponse; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.definitions.HostedCheckoutSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Customer; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; - -public class CreateHostedCheckoutExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - CreateHostedCheckoutRequest body = new CreateHostedCheckoutRequest(); - Order order = new Order(); - - AmountOfMoney amountOfMoney = new AmountOfMoney(); - amountOfMoney.setCurrencyCode("USD"); - amountOfMoney.setAmount(2345L); - order.setAmountOfMoney(amountOfMoney); - - Customer customer = new Customer(); - - Address billingAddress = new Address(); - billingAddress.setCountryCode("US"); - customer.setBillingAddress(billingAddress); - - order.setCustomer(customer); - - body.setOrder(order); - - HostedCheckoutSpecificInput hostedCheckoutSpecificInput = new HostedCheckoutSpecificInput(); - hostedCheckoutSpecificInput.setLocale("en_GB"); - hostedCheckoutSpecificInput.setVariant("testVariant"); - body.setHostedCheckoutSpecificInput(hostedCheckoutSpecificInput); - - CreateHostedCheckoutResponse response = client.merchant("merchantId").hostedcheckouts().create(body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/hostedcheckouts/GetHostedCheckoutExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/hostedcheckouts/GetHostedCheckoutExample.java deleted file mode 100644 index ced517c1f..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/hostedcheckouts/GetHostedCheckoutExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.hostedcheckouts; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.GetHostedCheckoutResponse; - -public class GetHostedCheckoutExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - GetHostedCheckoutResponse response = client.merchant("merchantId").hostedcheckouts().get("hostedCheckoutId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/ApprovePaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/ApprovePaymentExample.java deleted file mode 100644 index 9c7708afe..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/ApprovePaymentExample.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payment.ApprovePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentApprovalResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderApprovePayment; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderReferencesApprovePayment; - -public class ApprovePaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - ApprovePaymentRequest body = new ApprovePaymentRequest(); - - ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput directDebitPaymentMethodSpecificInput = new ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput(); - directDebitPaymentMethodSpecificInput.setDateCollect("20150201"); - directDebitPaymentMethodSpecificInput.setToken("bfa8a7e4-4530-455a-858d-204ba2afb77e"); - body.setDirectDebitPaymentMethodSpecificInput(directDebitPaymentMethodSpecificInput); - - OrderApprovePayment order = new OrderApprovePayment(); - OrderReferencesApprovePayment references = new OrderReferencesApprovePayment(); - references.setMerchantReference("AcmeOrder0001"); - order.setReferences(references); - body.setOrder(order); - - body.setAmount(2980L); - - PaymentApprovalResponse response = client.merchant("merchantId").payments().approve("paymentId", body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CancelApprovalPaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CancelApprovalPaymentExample.java deleted file mode 100644 index af7c4fd0e..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CancelApprovalPaymentExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payment.CancelApprovalPaymentResponse; - -public class CancelApprovalPaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - CancelApprovalPaymentResponse response = client.merchant("merchantId").payments().cancelapproval("paymentId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CancelPaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CancelPaymentExample.java deleted file mode 100644 index a0fa06aaa..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CancelPaymentExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payment.CancelPaymentResponse; - -public class CancelPaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - CancelPaymentResponse response = client.merchant("merchantId").payments().cancel("paymentId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CreatePaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CreatePaymentExample.java deleted file mode 100644 index 9126c2538..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/CreatePaymentExample.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcDeclinedPaymentException; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Card; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CompanyInformation; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AddressPersonal; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ContactDetails; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CreatePaymentResult; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Customer; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.LineItem; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.LineItemInvoiceData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderInvoiceData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderReferences; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalInformation; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalName; - -public class CreatePaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - CreatePaymentRequest body = new CreatePaymentRequest(); - - Order order = new Order(); - - AmountOfMoney amountOfMoney = new AmountOfMoney(); - amountOfMoney.setAmount(2980L); - amountOfMoney.setCurrencyCode("EUR"); - order.setAmountOfMoney(amountOfMoney); - - Customer customer = new Customer(); - customer.setMerchantCustomerId("1234"); - customer.setLocale("en_GB"); - customer.setVatNumber("1234AB5678CD"); - - PersonalInformation personalInformation = new PersonalInformation(); - - PersonalName name = new PersonalName(); - name.setTitle("Mr."); - name.setFirstName("Wile"); - name.setSurnamePrefix("E."); - name.setSurname("Coyote"); - personalInformation.setName(name); - - personalInformation.setGender("male"); - personalInformation.setDateOfBirth("19490917"); - customer.setPersonalInformation(personalInformation); - - CompanyInformation companyInformation = new CompanyInformation(); - companyInformation.setName("Acme Labs"); - customer.setCompanyInformation(companyInformation); - - Address billingAddress = new Address(); - billingAddress.setStreet("Desertroad"); - billingAddress.setHouseNumber("13"); - billingAddress.setAdditionalInfo("b"); - billingAddress.setZip("84536"); - billingAddress.setCity("Monument Valley"); - billingAddress.setState("Utah"); - billingAddress.setCountryCode("US"); - customer.setBillingAddress(billingAddress); - - AddressPersonal shippingAddress = new AddressPersonal(); - - PersonalName shippingName = new PersonalName(); - shippingName.setTitle("Miss"); - shippingName.setFirstName("Road"); - shippingName.setSurname("Runner"); - shippingAddress.setName(shippingName);; - - shippingAddress.setStreet("Desertroad"); - shippingAddress.setHouseNumber("1"); - shippingAddress.setAdditionalInfo("Suite II"); - shippingAddress.setZip("84536"); - shippingAddress.setCity("Monument Valley"); - shippingAddress.setState("Utah"); - shippingAddress.setCountryCode("US"); - customer.setShippingAddress(shippingAddress); - - ContactDetails contactDetails = new ContactDetails(); - contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com"); - contactDetails.setEmailMessageType("html"); - contactDetails.setPhoneNumber("+1234567890"); - contactDetails.setFaxNumber("+1234567891"); - customer.setContactDetails(contactDetails); - - order.setCustomer(customer); - - OrderReferences references = new OrderReferences(); - references.setMerchantOrderId(123456L); - references.setMerchantReference("AcmeOrder0001"); - references.setDescriptor("Fast and Furry-ous"); - - OrderInvoiceData invoiceData = new OrderInvoiceData(); - invoiceData.setInvoiceNumber("000000123"); - invoiceData.setInvoiceDate("20140306191500"); - references.setInvoiceData(invoiceData); - - order.setReferences(references); - - List items = new ArrayList(); - - LineItem item1 = new LineItem(); - - AmountOfMoney item1AmountOfMoney = new AmountOfMoney(); - item1AmountOfMoney.setAmount(2500L); - item1AmountOfMoney.setCurrencyCode("EUR"); - item1.setAmountOfMoney(item1AmountOfMoney); - - LineItemInvoiceData item1InvoiceData = new LineItemInvoiceData(); - item1InvoiceData.setNrOfItems("1"); - item1InvoiceData.setDescription("ACME Super Outfit"); - item1InvoiceData.setPricePerItem(2500L); - item1.setInvoiceData(item1InvoiceData); - - items.add(item1); - - LineItem item2 = new LineItem(); - - AmountOfMoney item2AmountOfMoney = new AmountOfMoney(); - item2AmountOfMoney.setCurrencyCode("EUR"); - item2AmountOfMoney.setAmount(480L); - item2.setAmountOfMoney(item2AmountOfMoney); - - LineItemInvoiceData item2InvoiceData = new LineItemInvoiceData(); - item2InvoiceData.setNrOfItems("12"); - item2InvoiceData.setDescription("Aspirin"); - item2InvoiceData.setPricePerItem(40L); - item2.setInvoiceData(item2InvoiceData); - - items.add(item2); - - order.setItems(items); - - body.setOrder(order); - - CardPaymentMethodSpecificInput cardPaymentMethodSpecificInput = new CardPaymentMethodSpecificInput(); - cardPaymentMethodSpecificInput.setPaymentProductId(1); - cardPaymentMethodSpecificInput.setSkipAuthentication(false); - - Card card = new Card(); - card.setCvv("123"); - card.setCardNumber("4567350000427977"); - card.setExpiryDate("1220"); - card.setCardholderName("Wile E. Coyote"); - cardPaymentMethodSpecificInput.setCard(card); - - body.setCardPaymentMethodSpecificInput(cardPaymentMethodSpecificInput); - - try { - CreatePaymentResponse response = client.merchant("merchantId").payments().create(body); - } catch (GcDeclinedPaymentException e) { - handleDeclinedPayment(e.getCreatePaymentResult()); - } catch (GcApiException e) { - handleApiErrors(e.getErrors()); - } - } - - private void handleDeclinedPayment(CreatePaymentResult createPaymentResult) { - // handle the result here - } - - private void handleApiErrors(List errors) { - // handle the errors here - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/GetPaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/GetPaymentExample.java deleted file mode 100644 index f0969b38a..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/GetPaymentExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentResponse; - -public class GetPaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - PaymentResponse response = client.merchant("merchantId").payments().get("paymentId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/ProcessChallengedPaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/ProcessChallengedPaymentExample.java deleted file mode 100644 index 1d6243925..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/ProcessChallengedPaymentExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentResponse; - -public class ProcessChallengedPaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - PaymentResponse response = client.merchant("merchantId").payments().processchallenged("paymentId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/RefundPaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/RefundPaymentExample.java deleted file mode 100644 index def564703..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/RefundPaymentExample.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; -import java.util.List; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcDeclinedRefundException; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ContactDetailsBase; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AddressPersonal; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalName; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundRequest; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundResponse; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.BankRefundMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundCustomer; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundReferences; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundResult; - -public class RefundPaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - RefundRequest body = new RefundRequest(); - - RefundReferences refundReferences = new RefundReferences(); - refundReferences.setMerchantReference("AcmeOrder0001"); - body.setRefundReferences(refundReferences); - - AmountOfMoney amountOfMoney = new AmountOfMoney(); - amountOfMoney.setAmount(1L); - amountOfMoney.setCurrencyCode("EUR"); - body.setAmountOfMoney(amountOfMoney); - - RefundCustomer customer = new RefundCustomer(); - - AddressPersonal address = new AddressPersonal(); - address.setCountryCode("US"); - - PersonalName name = new PersonalName(); - name.setSurname("Coyote"); - address.setName(name); - - customer.setAddress(address); - - ContactDetailsBase contactDetails = new ContactDetailsBase(); - contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com"); - contactDetails.setEmailMessageType("html"); - customer.setContactDetails(contactDetails); - - body.setCustomer(customer); - - body.setRefundDate("20140306"); - - BankRefundMethodSpecificInput bankRefundMethodSpecificInput = new BankRefundMethodSpecificInput(); - BankAccountIban bankAccountIban = new BankAccountIban(); - bankAccountIban.setIban("NL53INGB0000000036"); - bankRefundMethodSpecificInput.setBankAccountIban(bankAccountIban); - - body.setBankRefundMethodSpecificInput(bankRefundMethodSpecificInput); - - try { - RefundResponse response = client.merchant("merchantId").payments().refund("paymentId", body); - } catch (GcDeclinedRefundException e) { - handleDeclinedRefund(e.getRefundResult()); - } catch (GcApiException e) { - handleApiErrors(e.getErrors()); - } - } - - private void handleDeclinedRefund(RefundResult refundResult) { - // handle the result here - } - - private void handleApiErrors(List errors) { - // handle the errors here - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/TokenizePaymentExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payments/TokenizePaymentExample.java deleted file mode 100644 index ad2572eed..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payments/TokenizePaymentExample.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payments; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payment.TokenizePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenResponse; - -public class TokenizePaymentExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - TokenizePaymentRequest body = new TokenizePaymentRequest(); - body.setAlias("Some alias"); - - CreateTokenResponse response = client.merchant("merchantId").payments().tokenize("paymentId", body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/ApprovePayoutExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/ApprovePayoutExample.java deleted file mode 100644 index 581f99204..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/ApprovePayoutExample.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payouts; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payout.ApprovePayoutRequest; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutResponse; - -public class ApprovePayoutExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - ApprovePayoutRequest body = new ApprovePayoutRequest(); - - body.setDatePayout("20150102"); - - PayoutResponse response = client.merchant("merchantId").payouts().approve("payoutId", body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CancelApprovalPayoutExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CancelApprovalPayoutExample.java deleted file mode 100644 index 79db7ad05..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CancelApprovalPayoutExample.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payouts; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; - -public class CancelApprovalPayoutExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - client.merchant("merchantId").payouts().cancelapproval("payoutId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CancelPayoutExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CancelPayoutExample.java deleted file mode 100644 index 958e78406..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CancelPayoutExample.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payouts; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; - -public class CancelPayoutExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - client.merchant("merchantId").payouts().cancel("payoutId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CreatePayoutExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CreatePayoutExample.java deleted file mode 100644 index d195f0ca0..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/CreatePayoutExample.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payouts; - -import java.net.URISyntaxException; -import java.util.List; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcDeclinedPayoutException; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CompanyInformation; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ContactDetailsBase; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalName; -import com.globalcollect.gateway.sdk.java.gc.payout.CreatePayoutRequest; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutResponse; -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutCustomer; -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutReferences; -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutResult; - -public class CreatePayoutExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - CreatePayoutRequest body = new CreatePayoutRequest(); - - body.setPayoutText("Payout Acme"); - body.setPayoutDate("20150102"); - body.setSwiftCode("swift"); - - AmountOfMoney amountOfMoney = new AmountOfMoney(); - amountOfMoney.setAmount(2345L); - amountOfMoney.setCurrencyCode("EUR"); - body.setAmountOfMoney(amountOfMoney); - - BankAccountIban bankAccountIban = new BankAccountIban(); - bankAccountIban.setIban("IT60X0542811101000000123456"); - bankAccountIban.setAccountHolderName("Wile E. Coyote"); - body.setBankAccountIban(bankAccountIban); - - PayoutReferences references = new PayoutReferences(); - references.setMerchantReference("AcmeOrder0001"); - body.setReferences(references); - - PayoutCustomer customer = new PayoutCustomer(); - - ContactDetailsBase contactDetails = new ContactDetailsBase(); - contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com"); - customer.setContactDetails(contactDetails); - - CompanyInformation companyInformation = new CompanyInformation(); - companyInformation.setName("Acme Labs"); - customer.setCompanyInformation(companyInformation); - - Address address = new Address(); - address.setCountryCode("US"); - address.setStreet("N Hollywood Way"); - address.setHouseNumber("411"); - address.setZip("91505"); - address.setCity("Burbank"); - address.setState("California"); - customer.setAddress(address); - - PersonalName name = new PersonalName(); - name.setTitle("Mr."); - name.setFirstName("Wile"); - name.setSurnamePrefix("E."); - name.setSurname("Coyote"); - customer.setName(name); - - body.setCustomer(customer); - - try { - PayoutResponse response = client.merchant("merchantId").payouts().create(body); - } catch (GcDeclinedPayoutException e) { - handleDeclinedPayout(e.getPayoutResult()); - } catch (GcApiException e) { - handleApiErrors(e.getErrors()); - } - } - - private void handleDeclinedPayout(PayoutResult payoutResult) { - // handle the result here - } - - private void handleApiErrors(List errors) { - // handle the errors here - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/GetPayoutExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/GetPayoutExample.java deleted file mode 100644 index 4e6879104..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/payouts/GetPayoutExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.payouts; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutResponse; - -public class GetPayoutExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - PayoutResponse response = client.merchant("merchantId").payouts().get("payoutId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/productgroups/GetPaymentProductGroupExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/productgroups/GetPaymentProductGroupExample.java deleted file mode 100644 index 031364ecc..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/productgroups/GetPaymentProductGroupExample.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.globalcollect.gateway.sdk.java.productgroups; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.productgroups.GetParams; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductGroupResponse; - -public class GetPaymentProductGroupExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - GetParams queryParameters = new GetParams(); - - queryParameters.setAmount(1000L); - queryParameters.setCurrencyCode("USD"); - queryParameters.setLocale("en_US"); - queryParameters.setCountryCode("US"); - queryParameters.setIsRecurring(true); - - PaymentProductGroupResponse response = client.merchant("merchantId").productgroups().get("cards", queryParameters); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/productgroups/GetPaymentProductGroupsExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/productgroups/GetPaymentProductGroupsExample.java deleted file mode 100644 index 368e9707b..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/productgroups/GetPaymentProductGroupsExample.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.productgroups; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.productgroups.FindParams; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductGroups; - -public class GetPaymentProductGroupsExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - FindParams queryParameters = new FindParams(); - - queryParameters.setAmount(1000L); - queryParameters.setCountryCode("US"); - queryParameters.setCurrencyCode("USD"); - queryParameters.setHide("fields"); - queryParameters.setIsRecurring(true); - queryParameters.setLocale("en_US"); - - PaymentProductGroups response = client.merchant("merchantId").productgroups().find(queryParameters); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetDirectoryExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetDirectoryExample.java deleted file mode 100644 index 172fe29b9..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetDirectoryExample.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.globalcollect.gateway.sdk.java.products; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.DirectoryParams; -import com.globalcollect.gateway.sdk.java.gc.product.Directory; - -public class GetDirectoryExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - DirectoryParams queryParameters = new DirectoryParams(); - - queryParameters.setCurrencyCode("USD"); - queryParameters.setCountryCode("US"); - - Directory response = client.merchant("merchantId").products().directory(809, queryParameters); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetPaymentProductExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetPaymentProductExample.java deleted file mode 100644 index ba85d5147..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetPaymentProductExample.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.globalcollect.gateway.sdk.java.products; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.GetParams; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductResponse; - -public class GetPaymentProductExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - GetParams queryParameters = new GetParams(); - - queryParameters.setAmount(1000L); - queryParameters.setCurrencyCode("USD"); - queryParameters.setLocale("en_US"); - queryParameters.setCountryCode("US"); - queryParameters.setIsRecurring(true); - - PaymentProductResponse response = client.merchant("merchantId").products().get(1, queryParameters); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetPaymentProductsExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetPaymentProductsExample.java deleted file mode 100644 index 593c8362e..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/products/GetPaymentProductsExample.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.products; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.FindParams; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProducts; - -public class GetPaymentProductsExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - FindParams queryParameters = new FindParams(); - - queryParameters.setAmount(1000L); - queryParameters.setCountryCode("US"); - queryParameters.setCurrencyCode("USD"); - queryParameters.setHide("fields"); - queryParameters.setIsRecurring(true); - queryParameters.setLocale("en_US"); - - PaymentProducts response = client.merchant("merchantId").products().find(queryParameters); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/ApproveRefundExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/ApproveRefundExample.java deleted file mode 100644 index 9e2360eaa..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/ApproveRefundExample.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java.refunds; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.refund.ApproveRefundRequest; - -public class ApproveRefundExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - ApproveRefundRequest body = new ApproveRefundRequest(); - - body.setAmount(1000L); - - client.merchant("merchantId").refunds().approve("refundId", body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/CancelApprovalRefundExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/CancelApprovalRefundExample.java deleted file mode 100644 index 23aa5d0f3..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/CancelApprovalRefundExample.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.refunds; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; - -public class CancelApprovalRefundExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - client.merchant("merchantId").refunds().cancelapproval("refundId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/CancelRefundExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/CancelRefundExample.java deleted file mode 100644 index 3291022cd..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/CancelRefundExample.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.refunds; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; - -public class CancelRefundExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - client.merchant("merchantId").refunds().cancel("refundId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/GetRefundExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/GetRefundExample.java deleted file mode 100644 index cefb160d6..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/refunds/GetRefundExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.refunds; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundResponse; - -public class GetRefundExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - RefundResponse response = client.merchant("merchantId").refunds().get("refundId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/riskassessments/RiskAssessmentBankAccountExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/riskassessments/RiskAssessmentBankAccountExample.java deleted file mode 100644 index 0582fa7b7..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/riskassessments/RiskAssessmentBankAccountExample.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.globalcollect.gateway.sdk.java.riskassessments; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentBankAccount; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentResponse; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.CustomerRiskAssessment; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.OrderRiskAssessment; - -public class RiskAssessmentBankAccountExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - RiskAssessmentBankAccount body = new RiskAssessmentBankAccount(); - - BankAccountBban bankAccountBban = new BankAccountBban(); - bankAccountBban.setCountryCode("DE"); - bankAccountBban.setAccountNumber("0532013000"); - bankAccountBban.setBankCode("37040044"); - body.setBankAccountBban(bankAccountBban); - - OrderRiskAssessment order = new OrderRiskAssessment(); - - AmountOfMoney amountOfMoney = new AmountOfMoney(); - amountOfMoney.setAmount(100L); - amountOfMoney.setCurrencyCode("EUR"); - order.setAmountOfMoney(amountOfMoney); - - CustomerRiskAssessment customer = new CustomerRiskAssessment(); - customer.setLocale("en_GB"); - - Address billingAddress = new Address(); - billingAddress.setCountryCode("US"); - customer.setBillingAddress(billingAddress); - - order.setCustomer(customer); - - body.setOrder(order); - - RiskAssessmentResponse response = client.merchant("merchantId").riskassessments().bankaccounts(body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/riskassessments/RiskAssessmentCardsExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/riskassessments/RiskAssessmentCardsExample.java deleted file mode 100644 index 2eabfab62..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/riskassessments/RiskAssessmentCardsExample.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.globalcollect.gateway.sdk.java.riskassessments; - -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AdditionalOrderInputAirlineData; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AirlineData; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AirlineFlightLeg; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Card; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentCard; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentResponse; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.CustomerRiskAssessment; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.OrderRiskAssessment; - -public class RiskAssessmentCardsExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - RiskAssessmentCard body = new RiskAssessmentCard(); - - Card card = new Card(); - card.setExpiryDate("0820"); - card.setCardNumber("4567350000427977"); - card.setCvv("123"); - body.setCard(card); - - OrderRiskAssessment order = new OrderRiskAssessment(); - - AmountOfMoney amountOfMoney = new AmountOfMoney(); - amountOfMoney.setAmount(100L); - amountOfMoney.setCurrencyCode("EUR"); - order.setAmountOfMoney(amountOfMoney); - - CustomerRiskAssessment customer = new CustomerRiskAssessment(); - customer.setLocale("en_GB"); - - Address billingAddress = new Address(); - billingAddress.setCountryCode("US"); - customer.setBillingAddress(billingAddress); - - order.setCustomer(customer); - - AdditionalOrderInputAirlineData additionalInput = new AdditionalOrderInputAirlineData(); - - AirlineData airlineData = new AirlineData(); - airlineData.setCode("123"); - airlineData.setName("Air France KLM"); - airlineData.setInvoiceNumber("123456"); - airlineData.setAgentNumericCode("123321"); - airlineData.setTicketNumber("KLM20050000"); - airlineData.setPnr("4JTGKT"); - airlineData.setIsETicket(true); - airlineData.setTicketDeliveryMethod("e-ticket"); - airlineData.setPassengerName("WECOYOTE"); - airlineData.setPointOfSale("IATA point of sale name"); - airlineData.setPlaceOfIssue("Utah"); - airlineData.setFlightDate("20150102"); - airlineData.setIsThirdParty(true); - airlineData.setIsRegisteredCustomer(true); - airlineData.setPosCityCode("AMS"); - airlineData.setMerchantCustomerId("14"); - airlineData.setIssueDate("20150101"); - airlineData.setIsRestrictedTicket(true); - - List flightLegs = new ArrayList(); - - AirlineFlightLeg flightLeg1 = new AirlineFlightLeg(); - flightLeg1.setNumber(1); - flightLeg1.setDate("20150102"); - flightLeg1.setOriginAirport("BCN"); - flightLeg1.setArrivalAirport("AMS"); - flightLeg1.setStopoverCode("non-permitted"); - flightLeg1.setAirlineClass("1"); - flightLeg1.setCarrierCode("14"); - flightLeg1.setFareBasis("INTERNET"); - flightLeg1.setFlightNumber("KL791"); - flightLeg1.setDepartureTime("17:59"); - flightLeg1.setFare("fare"); - - flightLegs.add(flightLeg1); - - AirlineFlightLeg flightLeg2 = new AirlineFlightLeg(); - flightLeg2.setNumber(2); - flightLeg2.setDate("20150102"); - flightLeg2.setOriginAirport("AMS"); - flightLeg2.setArrivalAirport("BCN"); - flightLeg2.setStopoverCode("non-permitted"); - flightLeg2.setAirlineClass("1"); - flightLeg2.setCarrierCode("14"); - flightLeg2.setFareBasis("INTERNET"); - flightLeg2.setFlightNumber("KL792"); - flightLeg2.setDepartureTime("23:59"); - flightLeg2.setFare("fare"); - - flightLegs.add(flightLeg2); - - airlineData.setFlightLegs(flightLegs); - - additionalInput.setAirlineData(airlineData); - - order.setAdditionalInput(additionalInput); - - body.setOrder(order); - - RiskAssessmentResponse response = client.merchant("merchantId").riskassessments().cards(body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/services/ConvertAmountExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/services/ConvertAmountExample.java deleted file mode 100644 index ac8ba2782..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/services/ConvertAmountExample.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.globalcollect.gateway.sdk.java.services; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ConvertAmountParams; -import com.globalcollect.gateway.sdk.java.gc.services.ConvertAmount; - -public class ConvertAmountExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - ConvertAmountParams queryParameters = new ConvertAmountParams(); - - queryParameters.setAmount(1000L); - queryParameters.setSource("USD"); - queryParameters.setTarget("EUR"); - - ConvertAmount response = client.merchant("merchantId").services().convertAmount(queryParameters); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/services/ConvertBankAccountExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/services/ConvertBankAccountExample.java deleted file mode 100644 index 0146ac375..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/services/ConvertBankAccountExample.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.services; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.services.BankDetailsRequest; -import com.globalcollect.gateway.sdk.java.gc.services.BankDetailsResponse; - -public class ConvertBankAccountExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - BankDetailsRequest body = new BankDetailsRequest(); - - BankAccountBban bankAccountBban = new BankAccountBban(); - bankAccountBban.setCountryCode("DE"); - bankAccountBban.setAccountNumber("053201300"); - bankAccountBban.setBankCode("37040044"); - body.setBankAccountBban(bankAccountBban); - - BankDetailsResponse response = client.merchant("merchantId").services().bankaccount(body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/services/IINDetailsExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/services/IINDetailsExample.java deleted file mode 100644 index 90a61943b..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/services/IINDetailsExample.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.globalcollect.gateway.sdk.java.services; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.services.GetIINDetailsRequest; -import com.globalcollect.gateway.sdk.java.gc.services.GetIINDetailsResponse; - -public class IINDetailsExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - GetIINDetailsRequest body = new GetIINDetailsRequest(); - - body.setBin("4567350000427977"); - - GetIINDetailsResponse response = client.merchant("merchantId").services().getIINdetails(body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/services/TestConnectionExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/services/TestConnectionExample.java deleted file mode 100644 index 9c93a1aea..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/services/TestConnectionExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.services; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.services.TestConnection; - -public class TestConnectionExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - TestConnection response = client.merchant("merchantId").services().testconnection(); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/sessions/CreateSessionExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/sessions/CreateSessionExample.java deleted file mode 100644 index 81cf5182c..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/sessions/CreateSessionExample.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.globalcollect.gateway.sdk.java.sessions; - -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.sessions.SessionRequest; -import com.globalcollect.gateway.sdk.java.gc.sessions.SessionResponse; - -public class CreateSessionExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - SessionRequest body = new SessionRequest(); - - List tokens = new ArrayList(); - - tokens.add("122c5b4d-dd40-49f0-b7c9-3594212167a9"); - tokens.add("126166b16ed04b3ab85fb06da1d7a167"); - tokens.add("226166b16ed04b3ab85fb06da1d7a167"); - tokens.add("326166b16ed04b3ab85fb06da1d7a167"); - tokens.add("426166b16ed04b3ab85fb06da1d7a167"); - - body.setTokens(tokens); - - SessionResponse response = client.merchant("merchantId").sessions().create(body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/ApproveSepaDirectDebitTokenExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/ApproveSepaDirectDebitTokenExample.java deleted file mode 100644 index 3f212ac84..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/ApproveSepaDirectDebitTokenExample.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.globalcollect.gateway.sdk.java.tokens; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.token.ApproveTokenRequest; - -public class ApproveSepaDirectDebitTokenExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - ApproveTokenRequest body = new ApproveTokenRequest(); - - body.setMandateSignaturePlace("Monument Valley"); - body.setMandateSignatureDate("20150201"); - body.setMandateSigned(true); - - client.merchant("merchantId").tokens().approvesepadirectdebit("tokenId", body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/CreateTokenExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/CreateTokenExample.java deleted file mode 100644 index dce536bc0..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/CreateTokenExample.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.globalcollect.gateway.sdk.java.tokens; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CompanyInformation; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenRequest; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenResponse; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateNonSepaDirectDebit; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.PersonalInformationToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.PersonalNameToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenNonSepaDirectDebit; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenNonSepaDirectDebitPaymentProduct705SpecificData; - -public class CreateTokenExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - CreateTokenRequest body = new CreateTokenRequest(); - body.setPaymentProductId(705); - - TokenNonSepaDirectDebit nonSepaDirectDebit = new TokenNonSepaDirectDebit(); - - MandateNonSepaDirectDebit mandate = new MandateNonSepaDirectDebit(); - - TokenNonSepaDirectDebitPaymentProduct705SpecificData paymentProduct705SpecificData = new TokenNonSepaDirectDebitPaymentProduct705SpecificData(); - paymentProduct705SpecificData.setAuthorisationId("123456"); - - BankAccountBban bankAccountBban = new BankAccountBban(); - bankAccountBban.setAccountNumber("000000123456"); - bankAccountBban.setBankCode("05428"); - bankAccountBban.setBranchCode("11101"); - bankAccountBban.setCheckDigit("X"); - bankAccountBban.setCountryCode("IT"); - paymentProduct705SpecificData.setBankAccountBban(bankAccountBban); - - mandate.setPaymentProduct705SpecificData(paymentProduct705SpecificData); - - nonSepaDirectDebit.setMandate(mandate); - - CustomerToken customer = new CustomerToken(); - customer.setMerchantCustomerId("1234"); - - CompanyInformation companyInformation = new CompanyInformation(); - companyInformation.setName("Acme Labs"); - customer.setCompanyInformation(companyInformation); - - PersonalInformationToken personalInformation = new PersonalInformationToken(); - - PersonalNameToken name = new PersonalNameToken(); - name.setFirstName("Wile"); - name.setSurnamePrefix("E."); - name.setSurname("Coyote"); - personalInformation.setName(name); - - customer.setPersonalInformation(personalInformation); - - Address billingAddress = new Address(); - billingAddress.setCity("Monument Valley"); - billingAddress.setCountryCode("US"); - billingAddress.setHouseNumber("1"); - billingAddress.setAdditionalInfo("Suite II"); - billingAddress.setState("Utah"); - billingAddress.setStreet("Desertroad"); - billingAddress.setZip("84536"); - customer.setBillingAddress(billingAddress); - - nonSepaDirectDebit.setCustomer(customer); - - body.setNonSepaDirectDebit(nonSepaDirectDebit); - - CreateTokenResponse response = client.merchant("merchantId").tokens().create(body); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/DeleteTokenExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/DeleteTokenExample.java deleted file mode 100644 index b6d5d57e9..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/DeleteTokenExample.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.globalcollect.gateway.sdk.java.tokens; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.tokens.DeleteParams; - -public class DeleteTokenExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - DeleteParams queryParameters = new DeleteParams(); - queryParameters.setMandateCancelDate("20150102"); - - client.merchant("merchantId").tokens().delete("tokenId", queryParameters); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/GetTokenExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/GetTokenExample.java deleted file mode 100644 index c3a7fd4c8..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/GetTokenExample.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.tokens; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.token.TokenResponse; - -public class GetTokenExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - TokenResponse response = client.merchant("merchantId").tokens().get("tokenId"); - } -} diff --git a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/UpdateTokenExample.java b/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/UpdateTokenExample.java deleted file mode 100644 index 3665be9db..000000000 --- a/src/examples/java/com/globalcollect/gateway/sdk/java/tokens/UpdateTokenExample.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.globalcollect.gateway.sdk.java.tokens; - -import java.net.URISyntaxException; - -import com.globalcollect.gateway.sdk.java.ExampleBase; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CardWithoutCvv; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CompanyInformation; -import com.globalcollect.gateway.sdk.java.gc.token.UpdateTokenRequest; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.PersonalInformationToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.PersonalNameToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCard; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCardData; - -public class UpdateTokenExample extends ExampleBase { - - public void example() throws URISyntaxException { - GcClient client = getGcClient(); - - UpdateTokenRequest body = new UpdateTokenRequest(); - - body.setPaymentProductId(1); - - TokenCard card = new TokenCard(); - - TokenCardData data = new TokenCardData(); - - CardWithoutCvv cardWithoutCvv = new CardWithoutCvv(); - cardWithoutCvv.setCardholderName("Wile E. Coyote"); - cardWithoutCvv.setIssueNumber("12"); - cardWithoutCvv.setExpiryDate("0820"); - cardWithoutCvv.setCardNumber("4567350000427977"); - data.setCardWithoutCvv(cardWithoutCvv); - - card.setData(data); - - CustomerToken customer = new CustomerToken(); - customer.setMerchantCustomerId("1234"); - - CompanyInformation companyInformation = new CompanyInformation(); - companyInformation.setName("Acme Labs"); - customer.setCompanyInformation(companyInformation); - - PersonalInformationToken personalInformation = new PersonalInformationToken(); - - PersonalNameToken name = new PersonalNameToken(); - name.setFirstName("Wile"); - name.setSurnamePrefix("E."); - name.setSurname("Coyote"); - personalInformation.setName(name); - - customer.setPersonalInformation(personalInformation); - - Address billingAddress = new Address(); - billingAddress.setCity("Monument Valley"); - billingAddress.setCountryCode("US"); - billingAddress.setHouseNumber("13"); - billingAddress.setAdditionalInfo("b"); - billingAddress.setState("Utah"); - billingAddress.setStreet("Desertroad"); - billingAddress.setZip("84536"); - customer.setBillingAddress(billingAddress); - - card.setCustomer(customer); - - client.merchant("merchantId").tokens().update("tokenId", body); - } -} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/CreateHostedCheckoutExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/CreateHostedCheckoutExample.java new file mode 100644 index 000000000..01216e1a2 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/CreateHostedCheckoutExample.java @@ -0,0 +1,63 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.hostedcheckouts; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.CreateHostedCheckoutRequest; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.CreateHostedCheckoutResponse; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions.HostedCheckoutSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CreateHostedCheckoutExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + HostedCheckoutSpecificInput hostedCheckoutSpecificInput = new HostedCheckoutSpecificInput(); + hostedCheckoutSpecificInput.setLocale("en_GB"); + hostedCheckoutSpecificInput.setVariant("testVariant"); + + AmountOfMoney amountOfMoney = new AmountOfMoney(); + amountOfMoney.setAmount(2345L); + amountOfMoney.setCurrencyCode("USD"); + + Address billingAddress = new Address(); + billingAddress.setCountryCode("US"); + + Customer customer = new Customer(); + customer.setBillingAddress(billingAddress); + + Order order = new Order(); + order.setAmountOfMoney(amountOfMoney); + order.setCustomer(customer); + + CreateHostedCheckoutRequest body = new CreateHostedCheckoutRequest(); + body.setHostedCheckoutSpecificInput(hostedCheckoutSpecificInput); + body.setOrder(order); + + CreateHostedCheckoutResponse response = client.merchant("merchantId").hostedcheckouts().create(body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/GetHostedCheckoutExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/GetHostedCheckoutExample.java new file mode 100644 index 000000000..baa7bb54a --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/GetHostedCheckoutExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.hostedcheckouts; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.GetHostedCheckoutResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetHostedCheckoutExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + GetHostedCheckoutResponse response = client.merchant("merchantId").hostedcheckouts().get("hostedCheckoutId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/ApprovePaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/ApprovePaymentExample.java new file mode 100644 index 000000000..16d3af7e6 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/ApprovePaymentExample.java @@ -0,0 +1,54 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payment.ApprovePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentApprovalResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderApprovePayment; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderReferencesApprovePayment; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class ApprovePaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput directDebitPaymentMethodSpecificInput = new ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput(); + directDebitPaymentMethodSpecificInput.setDateCollect("20150201"); + directDebitPaymentMethodSpecificInput.setToken("bfa8a7e4-4530-455a-858d-204ba2afb77e"); + + OrderReferencesApprovePayment references = new OrderReferencesApprovePayment(); + references.setMerchantReference("AcmeOrder0001"); + + OrderApprovePayment order = new OrderApprovePayment(); + order.setReferences(references); + + ApprovePaymentRequest body = new ApprovePaymentRequest(); + body.setAmount(2980L); + body.setDirectDebitPaymentMethodSpecificInput(directDebitPaymentMethodSpecificInput); + body.setOrder(order); + + PaymentApprovalResponse response = client.merchant("merchantId").payments().approve("paymentId", body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CancelApprovalPaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CancelApprovalPaymentExample.java new file mode 100644 index 000000000..641021143 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CancelApprovalPaymentExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CancelApprovalPaymentResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CancelApprovalPaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + CancelApprovalPaymentResponse response = client.merchant("merchantId").payments().cancelapproval("paymentId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CancelPaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CancelPaymentExample.java new file mode 100644 index 000000000..8fa8e6db0 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CancelPaymentExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CancelPaymentResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CancelPaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + CancelPaymentResponse response = client.merchant("merchantId").payments().cancel("paymentId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CreatePaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CreatePaymentExample.java new file mode 100644 index 000000000..ff734392d --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/CreatePaymentExample.java @@ -0,0 +1,192 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.DeclinedPaymentException; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Card; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AddressPersonal; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ContactDetails; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CreatePaymentResult; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.LineItem; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.LineItemInvoiceData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderInvoiceData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderReferences; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalInformation; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +public class CreatePaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + Card card = new Card(); + card.setCardNumber("4567350000427977"); + card.setCardholderName("Wile E. Coyote"); + card.setCvv("123"); + card.setExpiryDate("1220"); + + CardPaymentMethodSpecificInput cardPaymentMethodSpecificInput = new CardPaymentMethodSpecificInput(); + cardPaymentMethodSpecificInput.setCard(card); + cardPaymentMethodSpecificInput.setPaymentProductId(1); + cardPaymentMethodSpecificInput.setSkipAuthentication(false); + + AmountOfMoney amountOfMoney = new AmountOfMoney(); + amountOfMoney.setAmount(2980L); + amountOfMoney.setCurrencyCode("EUR"); + + Address billingAddress = new Address(); + billingAddress.setAdditionalInfo("b"); + billingAddress.setCity("Monument Valley"); + billingAddress.setCountryCode("US"); + billingAddress.setHouseNumber("13"); + billingAddress.setState("Utah"); + billingAddress.setStreet("Desertroad"); + billingAddress.setZip("84536"); + + CompanyInformation companyInformation = new CompanyInformation(); + companyInformation.setName("Acme Labs"); + + ContactDetails contactDetails = new ContactDetails(); + contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com"); + contactDetails.setEmailMessageType("html"); + contactDetails.setFaxNumber("+1234567891"); + contactDetails.setPhoneNumber("+1234567890"); + + PersonalName name = new PersonalName(); + name.setFirstName("Wile"); + name.setSurname("Coyote"); + name.setSurnamePrefix("E."); + name.setTitle("Mr."); + + PersonalInformation personalInformation = new PersonalInformation(); + personalInformation.setDateOfBirth("19490917"); + personalInformation.setGender("M"); + personalInformation.setName(name); + + PersonalName shippingName = new PersonalName(); + shippingName.setFirstName("Road"); + shippingName.setSurname("Runner"); + shippingName.setTitle("Miss"); + + AddressPersonal shippingAddress = new AddressPersonal(); + shippingAddress.setAdditionalInfo("Suite II"); + shippingAddress.setCity("Monument Valley"); + shippingAddress.setCountryCode("US"); + shippingAddress.setHouseNumber("1"); + shippingAddress.setName(shippingName); + shippingAddress.setState("Utah"); + shippingAddress.setStreet("Desertroad"); + shippingAddress.setZip("84536"); + + Customer customer = new Customer(); + customer.setBillingAddress(billingAddress); + customer.setCompanyInformation(companyInformation); + customer.setContactDetails(contactDetails); + customer.setLocale("en_US"); + customer.setMerchantCustomerId("1234"); + customer.setPersonalInformation(personalInformation); + customer.setShippingAddress(shippingAddress); + customer.setVatNumber("1234AB5678CD"); + + List items = new ArrayList(); + + AmountOfMoney item1AmountOfMoney = new AmountOfMoney(); + item1AmountOfMoney.setAmount(2500L); + item1AmountOfMoney.setCurrencyCode("EUR"); + + LineItemInvoiceData item1InvoiceData = new LineItemInvoiceData(); + item1InvoiceData.setDescription("ACME Super Outfit"); + item1InvoiceData.setNrOfItems("1"); + item1InvoiceData.setPricePerItem(2500L); + + LineItem item1 = new LineItem(); + item1.setAmountOfMoney(item1AmountOfMoney); + item1.setInvoiceData(item1InvoiceData); + + items.add(item1); + + AmountOfMoney item2AmountOfMoney = new AmountOfMoney(); + item2AmountOfMoney.setAmount(480L); + item2AmountOfMoney.setCurrencyCode("EUR"); + + LineItemInvoiceData item2InvoiceData = new LineItemInvoiceData(); + item2InvoiceData.setDescription("Asperin"); + item2InvoiceData.setNrOfItems("12"); + item2InvoiceData.setPricePerItem(40L); + + LineItem item2 = new LineItem(); + item2.setAmountOfMoney(item2AmountOfMoney); + item2.setInvoiceData(item2InvoiceData); + + items.add(item2); + + OrderInvoiceData invoiceData = new OrderInvoiceData(); + invoiceData.setInvoiceDate("20140306191500"); + invoiceData.setInvoiceNumber("000000123"); + + OrderReferences references = new OrderReferences(); + references.setDescriptor("Fast and Furry-ous"); + references.setInvoiceData(invoiceData); + references.setMerchantOrderId(123456L); + references.setMerchantReference("AcmeOrder0001"); + + Order order = new Order(); + order.setAmountOfMoney(amountOfMoney); + order.setCustomer(customer); + order.setItems(items); + order.setReferences(references); + + CreatePaymentRequest body = new CreatePaymentRequest(); + body.setCardPaymentMethodSpecificInput(cardPaymentMethodSpecificInput); + body.setOrder(order); + + try { + CreatePaymentResponse response = client.merchant("merchantId").payments().create(body); + } catch (DeclinedPaymentException e) { + handleDeclinedPayment(e.getCreatePaymentResult()); + } catch (ApiException e) { + handleApiErrors(e.getErrors()); + } + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } + + private void handleDeclinedPayment(CreatePaymentResult createPaymentResult) { + // handle the result here + } + + private void handleApiErrors(List errors) { + // handle the errors here + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/GetPaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/GetPaymentExample.java new file mode 100644 index 000000000..9f16fbbc6 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/GetPaymentExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetPaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + PaymentResponse response = client.merchant("merchantId").payments().get("paymentId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/ProcessChallengedPaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/ProcessChallengedPaymentExample.java new file mode 100644 index 000000000..597342644 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/ProcessChallengedPaymentExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class ProcessChallengedPaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + PaymentResponse response = client.merchant("merchantId").payments().processchallenged("paymentId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/RefundPaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/RefundPaymentExample.java new file mode 100644 index 000000000..f5afe12ac --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/RefundPaymentExample.java @@ -0,0 +1,98 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.DeclinedRefundException; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AddressPersonal; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundRequest; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundResponse; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.BankRefundMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundCustomer; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundReferences; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundResult; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.List; + +public class RefundPaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + AmountOfMoney amountOfMoney = new AmountOfMoney(); + amountOfMoney.setAmount(1L); + amountOfMoney.setCurrencyCode("EUR"); + + BankAccountIban bankAccountIban = new BankAccountIban(); + bankAccountIban.setIban("NL53INGB0000000036"); + + BankRefundMethodSpecificInput bankRefundMethodSpecificInput = new BankRefundMethodSpecificInput(); + bankRefundMethodSpecificInput.setBankAccountIban(bankAccountIban); + + PersonalName name = new PersonalName(); + name.setSurname("Coyote"); + + AddressPersonal address = new AddressPersonal(); + address.setCountryCode("US"); + address.setName(name); + + ContactDetailsBase contactDetails = new ContactDetailsBase(); + contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com"); + contactDetails.setEmailMessageType("html"); + + RefundCustomer customer = new RefundCustomer(); + customer.setAddress(address); + customer.setContactDetails(contactDetails); + + RefundReferences refundReferences = new RefundReferences(); + refundReferences.setMerchantReference("AcmeOrder0001"); + + RefundRequest body = new RefundRequest(); + body.setAmountOfMoney(amountOfMoney); + body.setBankRefundMethodSpecificInput(bankRefundMethodSpecificInput); + body.setCustomer(customer); + body.setRefundDate("20140306"); + body.setRefundReferences(refundReferences); + + try { + RefundResponse response = client.merchant("merchantId").payments().refund("paymentId", body); + } catch (DeclinedRefundException e) { + handleDeclinedRefund(e.getRefundResult()); + } catch (ApiException e) { + handleApiErrors(e.getErrors()); + } + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } + + private void handleDeclinedRefund(RefundResult refundResult) { + // handle the result here + } + + private void handleApiErrors(List errors) { + // handle the errors here + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/TokenizePaymentExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/TokenizePaymentExample.java new file mode 100644 index 000000000..36fa5cf7d --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/TokenizePaymentExample.java @@ -0,0 +1,39 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payment.TokenizePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class TokenizePaymentExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + TokenizePaymentRequest body = new TokenizePaymentRequest(); + body.setAlias("Some alias"); + + CreateTokenResponse response = client.merchant("merchantId").payments().tokenize("paymentId", body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/ApprovePayoutExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/ApprovePayoutExample.java new file mode 100644 index 000000000..5089a1a24 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/ApprovePayoutExample.java @@ -0,0 +1,39 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payouts; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payout.ApprovePayoutRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class ApprovePayoutExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + ApprovePayoutRequest body = new ApprovePayoutRequest(); + body.setDatePayout("20150102"); + + PayoutResponse response = client.merchant("merchantId").payouts().approve("payoutId", body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CancelApprovalPayoutExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CancelApprovalPayoutExample.java new file mode 100644 index 000000000..964514bdc --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CancelApprovalPayoutExample.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payouts; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CancelApprovalPayoutExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + client.merchant("merchantId").payouts().cancelapproval("payoutId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CancelPayoutExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CancelPayoutExample.java new file mode 100644 index 000000000..4618e0d13 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CancelPayoutExample.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payouts; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CancelPayoutExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + client.merchant("merchantId").payouts().cancel("payoutId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CreatePayoutExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CreatePayoutExample.java new file mode 100644 index 000000000..fe2c963d4 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/CreatePayoutExample.java @@ -0,0 +1,109 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payouts; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.DeclinedPayoutException; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName; +import com.ingenico.connect.gateway.sdk.java.domain.payout.CreatePayoutRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutCustomer; +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutReferences; +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutResult; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.List; + +public class CreatePayoutExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + AmountOfMoney amountOfMoney = new AmountOfMoney(); + amountOfMoney.setAmount(2345L); + amountOfMoney.setCurrencyCode("EUR"); + + BankAccountIban bankAccountIban = new BankAccountIban(); + bankAccountIban.setAccountHolderName("Wile E. Coyote"); + bankAccountIban.setIban("IT60X0542811101000000123456"); + + Address address = new Address(); + address.setCity("Burbank"); + address.setCountryCode("US"); + address.setHouseNumber("411"); + address.setState("California"); + address.setStreet("N Hollywood Way"); + address.setZip("91505"); + + CompanyInformation companyInformation = new CompanyInformation(); + companyInformation.setName("Acme Labs"); + + ContactDetailsBase contactDetails = new ContactDetailsBase(); + contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com"); + + PersonalName name = new PersonalName(); + name.setFirstName("Wile"); + name.setSurname("Coyote"); + name.setSurnamePrefix("E."); + name.setTitle("Mr."); + + PayoutCustomer customer = new PayoutCustomer(); + customer.setAddress(address); + customer.setCompanyInformation(companyInformation); + customer.setContactDetails(contactDetails); + customer.setName(name); + + PayoutReferences references = new PayoutReferences(); + references.setMerchantReference("AcmeOrder001"); + + CreatePayoutRequest body = new CreatePayoutRequest(); + body.setAmountOfMoney(amountOfMoney); + body.setBankAccountIban(bankAccountIban); + body.setCustomer(customer); + body.setPayoutDate("20150102"); + body.setPayoutText("Payout Acme"); + body.setReferences(references); + body.setSwiftCode("swift"); + + try { + PayoutResponse response = client.merchant("merchantId").payouts().create(body); + } catch (DeclinedPayoutException e) { + handleDeclinedPayout(e.getPayoutResult()); + } catch (ApiException e) { + handleApiErrors(e.getErrors()); + } + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } + + private void handleDeclinedPayout(PayoutResult payoutResult) { + // handle the result here + } + + private void handleApiErrors(List errors) { + // handle the errors here + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/GetPayoutExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/GetPayoutExample.java new file mode 100644 index 000000000..b792824e1 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/payouts/GetPayoutExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payouts; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetPayoutExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + PayoutResponse response = client.merchant("merchantId").payouts().get("payoutId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetPaymentProductGroupExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetPaymentProductGroupExample.java new file mode 100644 index 000000000..a975c6dd9 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetPaymentProductGroupExample.java @@ -0,0 +1,44 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.productgroups; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProductGroupResponse; +import com.ingenico.connect.gateway.sdk.java.merchant.productgroups.GetProductgroupParams; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetPaymentProductGroupExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + GetProductgroupParams query = new GetProductgroupParams(); + query.setAmount(1000L); + query.setIsRecurring(true); + query.setCountryCode("NL"); + query.setLocale("en_US"); + query.setCurrencyCode("EUR"); + query.addHide("fields"); + + PaymentProductGroupResponse response = client.merchant("merchantId").productgroups().get("cards", query); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetPaymentProductGroupsExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetPaymentProductGroupsExample.java new file mode 100644 index 000000000..c41d6a725 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetPaymentProductGroupsExample.java @@ -0,0 +1,44 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.productgroups; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProductGroups; +import com.ingenico.connect.gateway.sdk.java.merchant.productgroups.FindProductgroupsParams; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetPaymentProductGroupsExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + FindProductgroupsParams query = new FindProductgroupsParams(); + query.setAmount(1000L); + query.setIsRecurring(true); + query.setCountryCode("NL"); + query.setLocale("en_US"); + query.setCurrencyCode("EUR"); + query.addHide("fields"); + + PaymentProductGroups response = client.merchant("merchantId").productgroups().find(query); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetDirectoryExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetDirectoryExample.java new file mode 100644 index 000000000..e76b4d890 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetDirectoryExample.java @@ -0,0 +1,40 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.product.Directory; +import com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetDirectoryExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + DirectoryParams query = new DirectoryParams(); + query.setCurrencyCode("EUR"); + query.setCountryCode("NL"); + + Directory response = client.merchant("merchantId").products().directory(809, query); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetPaymentProductExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetPaymentProductExample.java new file mode 100644 index 000000000..6d5021738 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetPaymentProductExample.java @@ -0,0 +1,44 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProductResponse; +import com.ingenico.connect.gateway.sdk.java.merchant.products.GetProductParams; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetPaymentProductExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + GetProductParams query = new GetProductParams(); + query.setAmount(1000L); + query.setIsRecurring(true); + query.setCountryCode("US"); + query.setLocale("en_US"); + query.setCurrencyCode("USD"); + query.addHide("fields"); + + PaymentProductResponse response = client.merchant("merchantId").products().get(1, query); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetPaymentProductsExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetPaymentProductsExample.java new file mode 100644 index 000000000..734d389ec --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetPaymentProductsExample.java @@ -0,0 +1,44 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProducts; +import com.ingenico.connect.gateway.sdk.java.merchant.products.FindProductsParams; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetPaymentProductsExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + FindProductsParams query = new FindProductsParams(); + query.setAmount(1000L); + query.setIsRecurring(true); + query.setCountryCode("US"); + query.setLocale("en_US"); + query.setCurrencyCode("USD"); + query.addHide("fields"); + + PaymentProducts response = client.merchant("merchantId").products().find(query); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/ApproveRefundExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/ApproveRefundExample.java new file mode 100644 index 000000000..66d0e2038 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/ApproveRefundExample.java @@ -0,0 +1,37 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.refunds; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.refund.ApproveRefundRequest; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class ApproveRefundExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + ApproveRefundRequest body = new ApproveRefundRequest(); + body.setAmount(199L); + + client.merchant("merchantId").refunds().approve("refundId", body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/CancelApprovalRefundExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/CancelApprovalRefundExample.java new file mode 100644 index 000000000..807165f6a --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/CancelApprovalRefundExample.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.refunds; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CancelApprovalRefundExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + client.merchant("merchantId").refunds().cancelapproval("refundId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/CancelRefundExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/CancelRefundExample.java new file mode 100644 index 000000000..74f6c5b3e --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/CancelRefundExample.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.refunds; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CancelRefundExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + client.merchant("merchantId").refunds().cancel("refundId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/GetRefundExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/GetRefundExample.java new file mode 100644 index 000000000..47f684f04 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/refunds/GetRefundExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.refunds; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetRefundExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + RefundResponse response = client.merchant("merchantId").refunds().get("refundId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskAssessmentBankAccountExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskAssessmentBankAccountExample.java new file mode 100644 index 000000000..b0cb0c9c4 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskAssessmentBankAccountExample.java @@ -0,0 +1,65 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.riskassessments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentBankAccount; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.CustomerRiskAssessment; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class RiskAssessmentBankAccountExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + BankAccountBban bankAccountBban = new BankAccountBban(); + bankAccountBban.setAccountNumber("0532013000"); + bankAccountBban.setBankCode("37040044"); + bankAccountBban.setCountryCode("DE"); + + AmountOfMoney amountOfMoney = new AmountOfMoney(); + amountOfMoney.setAmount(100L); + amountOfMoney.setCurrencyCode("EUR"); + + Address billingAddress = new Address(); + billingAddress.setCountryCode("US"); + + CustomerRiskAssessment customer = new CustomerRiskAssessment(); + customer.setBillingAddress(billingAddress); + customer.setLocale("en_US"); + + OrderRiskAssessment order = new OrderRiskAssessment(); + order.setAmountOfMoney(amountOfMoney); + order.setCustomer(customer); + + RiskAssessmentBankAccount body = new RiskAssessmentBankAccount(); + body.setBankAccountBban(bankAccountBban); + body.setOrder(order); + + RiskAssessmentResponse response = client.merchant("merchantId").riskassessments().bankaccounts(body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskAssessmentCardsExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskAssessmentCardsExample.java new file mode 100644 index 000000000..ebf492160 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskAssessmentCardsExample.java @@ -0,0 +1,127 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.riskassessments; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AdditionalOrderInputAirlineData; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineData; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineFlightLeg; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Card; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentCard; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.CustomerRiskAssessment; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +public class RiskAssessmentCardsExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + Card card = new Card(); + card.setCardNumber("4567350000427977"); + card.setCvv("123"); + card.setExpiryDate("0820"); + + List flightLegs = new ArrayList(); + + AirlineFlightLeg flightLeg1 = new AirlineFlightLeg(); + flightLeg1.setAirlineClass("1"); + flightLeg1.setArrivalAirport("AMS"); + flightLeg1.setCarrierCode("14"); + flightLeg1.setDate("20150102"); + flightLeg1.setDepartureTime("17:59"); + flightLeg1.setFare("fare"); + flightLeg1.setFareBasis("INTERNET"); + flightLeg1.setFlightNumber("KL791"); + flightLeg1.setNumber(1); + flightLeg1.setOriginAirport("BCN"); + flightLeg1.setStopoverCode("non-permitted"); + + flightLegs.add(flightLeg1); + + AirlineFlightLeg flightLeg2 = new AirlineFlightLeg(); + flightLeg2.setAirlineClass("1"); + flightLeg2.setArrivalAirport("BCN"); + flightLeg2.setCarrierCode("14"); + flightLeg2.setDate("20150102"); + flightLeg2.setDepartureTime("23:59"); + flightLeg2.setFare("fare"); + flightLeg2.setFareBasis("INTERNET"); + flightLeg2.setFlightNumber("KL792"); + flightLeg2.setNumber(2); + flightLeg2.setOriginAirport("AMS"); + flightLeg2.setStopoverCode("non-permitted"); + + flightLegs.add(flightLeg2); + + AirlineData airlineData = new AirlineData(); + airlineData.setAgentNumericCode("123321"); + airlineData.setCode("123"); + airlineData.setFlightDate("20150102"); + airlineData.setFlightLegs(flightLegs); + airlineData.setInvoiceNumber("123456"); + airlineData.setIsETicket(true); + airlineData.setIsRegisteredCustomer(true); + airlineData.setIsRestrictedTicket(true); + airlineData.setIsThirdParty(true); + airlineData.setIssueDate("20150101"); + airlineData.setMerchantCustomerId("14"); + airlineData.setName("Air France KLM"); + airlineData.setPassengerName("WECOYOTE"); + airlineData.setPlaceOfIssue("Utah"); + airlineData.setPnr("4JTGKT"); + airlineData.setPointOfSale("IATA point of sale name"); + airlineData.setPosCityCode("AMS"); + airlineData.setTicketDeliveryMethod("e-ticket"); + airlineData.setTicketNumber("KLM20050000"); + + AdditionalOrderInputAirlineData additionalInput = new AdditionalOrderInputAirlineData(); + additionalInput.setAirlineData(airlineData); + + AmountOfMoney amountOfMoney = new AmountOfMoney(); + amountOfMoney.setAmount(100L); + amountOfMoney.setCurrencyCode("EUR"); + + Address billingAddress = new Address(); + billingAddress.setCountryCode("US"); + + CustomerRiskAssessment customer = new CustomerRiskAssessment(); + customer.setBillingAddress(billingAddress); + customer.setLocale("en_US"); + + OrderRiskAssessment order = new OrderRiskAssessment(); + order.setAdditionalInput(additionalInput); + order.setAmountOfMoney(amountOfMoney); + order.setCustomer(customer); + + RiskAssessmentCard body = new RiskAssessmentCard(); + body.setCard(card); + body.setOrder(order); + + RiskAssessmentResponse response = client.merchant("merchantId").riskassessments().cards(body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountExample.java new file mode 100644 index 000000000..1bf85d0db --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountExample.java @@ -0,0 +1,41 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.services; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ConvertAmountParams; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class ConvertAmountExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + ConvertAmountParams query = new ConvertAmountParams(); + query.setSource("EUR"); + query.setAmount(100L); + query.setTarget("USD"); + + ConvertAmount response = client.merchant("merchantId").services().convertAmount(query); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertBankAccountExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertBankAccountExample.java new file mode 100644 index 000000000..f2e729ce8 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertBankAccountExample.java @@ -0,0 +1,45 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.services; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.services.BankDetailsRequest; +import com.ingenico.connect.gateway.sdk.java.domain.services.BankDetailsResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class ConvertBankAccountExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + BankAccountBban bankAccountBban = new BankAccountBban(); + bankAccountBban.setAccountNumber("0532013000"); + bankAccountBban.setBankCode("37040044"); + bankAccountBban.setCountryCode("DE"); + + BankDetailsRequest body = new BankDetailsRequest(); + body.setBankAccountBban(bankAccountBban); + + BankDetailsResponse response = client.merchant("merchantId").services().bankaccount(body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/IINDetailsExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/IINDetailsExample.java new file mode 100644 index 000000000..ac8935916 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/IINDetailsExample.java @@ -0,0 +1,39 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.services; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.services.GetIINDetailsRequest; +import com.ingenico.connect.gateway.sdk.java.domain.services.GetIINDetailsResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class IINDetailsExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + GetIINDetailsRequest body = new GetIINDetailsRequest(); + body.setBin("4567350000427977"); + + GetIINDetailsResponse response = client.merchant("merchantId").services().getIINdetails(body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/TestConnectionExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/TestConnectionExample.java new file mode 100644 index 000000000..1ff7f2d19 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/services/TestConnectionExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.services; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.services.TestConnection; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class TestConnectionExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + TestConnection response = client.merchant("merchantId").services().testconnection(); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/sessions/CreateSessionExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/sessions/CreateSessionExample.java new file mode 100644 index 000000000..0e58976f4 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/sessions/CreateSessionExample.java @@ -0,0 +1,48 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.sessions; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionRequest; +import com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +public class CreateSessionExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + List tokens = new ArrayList(); + tokens.add("126166b16ed04b3ab85fb06da1d7a167"); + tokens.add("226166b16ed04b3ab85fb06da1d7a167"); + tokens.add("122c5b4d-dd40-49f0-b7c9-3594212167a9"); + tokens.add("326166b16ed04b3ab85fb06da1d7a167"); + tokens.add("426166b16ed04b3ab85fb06da1d7a167"); + + SessionRequest body = new SessionRequest(); + body.setTokens(tokens); + + SessionResponse response = client.merchant("merchantId").sessions().create(body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/ApproveSepaDirectDebitTokenExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/ApproveSepaDirectDebitTokenExample.java new file mode 100644 index 000000000..048c08fb1 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/ApproveSepaDirectDebitTokenExample.java @@ -0,0 +1,39 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.token.ApproveTokenRequest; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class ApproveSepaDirectDebitTokenExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + ApproveTokenRequest body = new ApproveTokenRequest(); + body.setMandateSignatureDate("20150201"); + body.setMandateSignaturePlace("Monument Valley"); + body.setMandateSigned(true); + + client.merchant("merchantId").tokens().approvesepadirectdebit("tokenId", body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/CreateTokenExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/CreateTokenExample.java new file mode 100644 index 000000000..e685e805e --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/CreateTokenExample.java @@ -0,0 +1,93 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenRequest; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenResponse; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateNonSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalInformationToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalNameToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenNonSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenNonSepaDirectDebitPaymentProduct705SpecificData; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class CreateTokenExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + Address billingAddress = new Address(); + billingAddress.setAdditionalInfo("Suite II"); + billingAddress.setCity("Monument Valley"); + billingAddress.setCountryCode("US"); + billingAddress.setHouseNumber("1"); + billingAddress.setState("Utah"); + billingAddress.setStreet("Desertroad"); + billingAddress.setZip("84536"); + + CompanyInformation companyInformation = new CompanyInformation(); + companyInformation.setName("Acme Labs"); + + PersonalNameToken name = new PersonalNameToken(); + name.setFirstName("Wile"); + name.setSurname("Coyote"); + name.setSurnamePrefix("E."); + + PersonalInformationToken personalInformation = new PersonalInformationToken(); + personalInformation.setName(name); + + CustomerToken customer = new CustomerToken(); + customer.setBillingAddress(billingAddress); + customer.setCompanyInformation(companyInformation); + customer.setMerchantCustomerId("1234"); + customer.setPersonalInformation(personalInformation); + + BankAccountBban bankAccountBban = new BankAccountBban(); + bankAccountBban.setAccountNumber("000000123456"); + bankAccountBban.setBankCode("05428"); + bankAccountBban.setBranchCode("11101"); + bankAccountBban.setCheckDigit("X"); + bankAccountBban.setCountryCode("IT"); + + TokenNonSepaDirectDebitPaymentProduct705SpecificData paymentProduct705SpecificData = new TokenNonSepaDirectDebitPaymentProduct705SpecificData(); + paymentProduct705SpecificData.setAuthorisationId("123456"); + paymentProduct705SpecificData.setBankAccountBban(bankAccountBban); + + MandateNonSepaDirectDebit mandate = new MandateNonSepaDirectDebit(); + mandate.setPaymentProduct705SpecificData(paymentProduct705SpecificData); + + TokenNonSepaDirectDebit nonSepaDirectDebit = new TokenNonSepaDirectDebit(); + nonSepaDirectDebit.setCustomer(customer); + nonSepaDirectDebit.setMandate(mandate); + + CreateTokenRequest body = new CreateTokenRequest(); + body.setNonSepaDirectDebit(nonSepaDirectDebit); + body.setPaymentProductId(705); + + CreateTokenResponse response = client.merchant("merchantId").tokens().create(body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenExample.java new file mode 100644 index 000000000..98d137f71 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenExample.java @@ -0,0 +1,37 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.merchant.tokens.DeleteTokenParams; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class DeleteTokenExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + DeleteTokenParams query = new DeleteTokenParams(); + query.setMandateCancelDate("20150102"); + + client.merchant("merchantId").tokens().delete("tokenId", query); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/GetTokenExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/GetTokenExample.java new file mode 100644 index 000000000..bb96654d3 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/GetTokenExample.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.token.TokenResponse; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class GetTokenExample { + + @SuppressWarnings("unused") + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + TokenResponse response = client.merchant("merchantId").tokens().get("tokenId"); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/UpdateTokenExample.java b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/UpdateTokenExample.java new file mode 100644 index 000000000..86ea9b3f9 --- /dev/null +++ b/src/examples/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/UpdateTokenExample.java @@ -0,0 +1,85 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CardWithoutCvv; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation; +import com.ingenico.connect.gateway.sdk.java.domain.token.UpdateTokenRequest; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalInformationToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalNameToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCard; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCardData; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; + +public class UpdateTokenExample { + + public void example() throws URISyntaxException, IOException { + Client client = getClient(); + try { + Address billingAddress = new Address(); + billingAddress.setAdditionalInfo("b"); + billingAddress.setCity("Monument Valley"); + billingAddress.setCountryCode("US"); + billingAddress.setHouseNumber("13"); + billingAddress.setState("Utah"); + billingAddress.setStreet("Desertroad"); + billingAddress.setZip("84536"); + + CompanyInformation companyInformation = new CompanyInformation(); + companyInformation.setName("Acme Labs"); + + PersonalNameToken name = new PersonalNameToken(); + name.setFirstName("Wile"); + name.setSurname("Coyote"); + name.setSurnamePrefix("E."); + + PersonalInformationToken personalInformation = new PersonalInformationToken(); + personalInformation.setName(name); + + CustomerToken customer = new CustomerToken(); + customer.setBillingAddress(billingAddress); + customer.setCompanyInformation(companyInformation); + customer.setMerchantCustomerId("1234"); + customer.setPersonalInformation(personalInformation); + + CardWithoutCvv cardWithoutCvv = new CardWithoutCvv(); + cardWithoutCvv.setCardNumber("4567350000427977"); + cardWithoutCvv.setCardholderName("Wile E. Coyote"); + cardWithoutCvv.setExpiryDate("0820"); + cardWithoutCvv.setIssueNumber("12"); + + TokenCardData data = new TokenCardData(); + data.setCardWithoutCvv(cardWithoutCvv); + + TokenCard card = new TokenCard(); + card.setCustomer(customer); + card.setData(data); + + UpdateTokenRequest body = new UpdateTokenRequest(); + body.setCard(card); + body.setPaymentProductId(1); + + client.merchant("merchantId").tokens().update("tokenId", body); + } finally { + client.close(); + } + } + + private Client getClient() throws URISyntaxException { + String apiKeyId = System.getProperty("connect.api.apiKeyId", "someKey"); + String secretApiKey = System.getProperty("connect.api.secretApiKey", "someSecret"); + + URL propertiesUrl = getClass().getResource("/example-configuration.properties"); + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), apiKeyId, secretApiKey); + return Factory.createClient(configuration); + } +} diff --git a/src/examples/resources/example-configuration.properties b/src/examples/resources/example-configuration.properties index d49b73281..c886f7576 100644 --- a/src/examples/resources/example-configuration.properties +++ b/src/examples/resources/example-configuration.properties @@ -1,5 +1,6 @@ # GlobalCollect platform connection settings -gcs.api.endpoint.host=api-sandbox.globalcollect.com -gcs.api.authorizationType=V1HMAC -gcs.api.connectTimeout=-1 -gcs.api.socketTimeout=-1 +connect.api.endpoint.host=api-sandbox.globalcollect.com +connect.api.authorizationType=V1HMAC +connect.api.connectTimeout=-1 +connect.api.socketTimeout=-1 +connect.api.integrator=Ingenico diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/ItTest.java b/src/it/java/com/globalcollect/gateway/sdk/it/ItTest.java deleted file mode 100644 index 796b487e2..000000000 --- a/src/it/java/com/globalcollect/gateway/sdk/it/ItTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.globalcollect.gateway.sdk.it; - -import java.net.URISyntaxException; -import java.net.URL; - -import com.globalcollect.gateway.sdk.java.GcDefaultConfiguration; -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.gc.GcClient; - -abstract class ItTest { - - private static final String PROPERTIES_URL = "/itconfiguration.properties"; - private static final String PROPERTIES_URL_PROXY = "/itconfiguration.proxy.properties"; - private static final String API_KEY_ID = "d8b5c5c457d80349"; - private static final String SECRET_API_KEY = "KbaFESwwqgwidbbhf2GECxGFayerrnbT2bPznc3Vfdg="; - - protected GcDefaultConfiguration getDefaultConfiguration() throws URISyntaxException { - URL propertiesUrl = getClass().getResource(PROPERTIES_URL); - return GcFactory.createDefaultConfiguration(propertiesUrl.toURI(), API_KEY_ID, SECRET_API_KEY); - } - - protected GcDefaultConfiguration getDefaultConfigurationWithProxy() throws URISyntaxException { - URL propertiesUrl = getClass().getResource(PROPERTIES_URL_PROXY); - return GcFactory.createDefaultConfiguration(propertiesUrl.toURI(), API_KEY_ID, SECRET_API_KEY); - } - - protected GcClient getGcClient() throws URISyntaxException { - URL propertiesUrl = getClass().getResource(PROPERTIES_URL); - return GcFactory - .createClient(propertiesUrl.toURI(), API_KEY_ID, SECRET_API_KEY) - .withClientMetaInfo("{\"test\":\"test\"}"); - } - - protected GcClient getGcClientWithProxy() throws URISyntaxException { - URL propertiesUrl = getClass().getResource(PROPERTIES_URL_PROXY); - return GcFactory - .createClient(propertiesUrl.toURI(), API_KEY_ID, SECRET_API_KEY) - .withClientMetaInfo("{\"test\":\"test\"}"); - } -} diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/MultiLineHeaderTest.java b/src/it/java/com/globalcollect/gateway/sdk/it/MultiLineHeaderTest.java deleted file mode 100644 index 9bf6a50f5..000000000 --- a/src/it/java/com/globalcollect/gateway/sdk/it/MultiLineHeaderTest.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.globalcollect.gateway.sdk.it; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Arrays; -import java.util.Collection; - -import org.junit.Assert; -import org.junit.Test; - -import com.globalcollect.gateway.sdk.java.GcDefaultConfiguration; -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.GcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.GcSession; -import com.globalcollect.gateway.sdk.java.RequestHeader; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.DirectoryParams; -import com.globalcollect.gateway.sdk.java.gc.product.Directory; - -public class MultiLineHeaderTest extends ItTest { - - /** - * Smoke test for products service. - */ - @Test - public void test() throws URISyntaxException, IOException { - - GcDefaultConfiguration configuration = getDefaultConfiguration(); - GcMetaDataProvider metaDataProvider = new GcMetaDataProvider() { - @Override - public Collection getServerMetaDataHeaders() { - String multiLineHeader = " some value \r\n \n with some \r\n spaces "; - return Arrays.asList(new RequestHeader("X-GCS-MultiLineHeader", multiLineHeader)); - } - }; - - DirectoryParams params = new DirectoryParams(); - params.setCountryCode("NL"); - params.setCurrencyCode("EUR"); - - GcSession session = GcFactory.createSessionBuilder(configuration) - .using(metaDataProvider) - .build(); - GcClient client = GcFactory.createClient(session); - try { - Directory response = client.merchant("8500").products().directory(809, params); - - Assert.assertTrue(response.getEntries().size() > 0); - - } finally { - client.close(); - } - } -} diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/ConnectionPoolingTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/ConnectionPoolingTest.java similarity index 79% rename from src/it/java/com/globalcollect/gateway/sdk/it/ConnectionPoolingTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/ConnectionPoolingTest.java index 74b564e84..66abe76a6 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/ConnectionPoolingTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/ConnectionPoolingTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.util.ArrayList; import java.util.List; @@ -10,10 +10,10 @@ import org.junit.Test; -import com.globalcollect.gateway.sdk.java.GcCommunicator; -import com.globalcollect.gateway.sdk.java.GcDefaultConfiguration; -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ConvertAmountParams; +import com.ingenico.connect.gateway.sdk.java.Communicator; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ConvertAmountParams; public class ConnectionPoolingTest extends ItTest { @@ -37,9 +37,9 @@ private void testConnectionPooling(int requestCount, int maxConnections) throws ExecutorService executorService = Executors.newFixedThreadPool(requestCount); try { - GcDefaultConfiguration defaultConfiguration = getDefaultConfiguration() + CommunicatorConfiguration configuration = getCommunicatorConfiguration() .withMaxConnections(maxConnections); - GcCommunicator communicator = GcFactory.createCommunicator(defaultConfiguration); + Communicator communicator = Factory.createCommunicator(configuration); try { testConnectionPooling(executorService, communicator, requestCount); @@ -53,7 +53,7 @@ private void testConnectionPooling(int requestCount, int maxConnections) throws } } - private void testConnectionPooling(ExecutorService executorService, GcCommunicator communicator, int requestCount) throws Exception { + private void testConnectionPooling(ExecutorService executorService, Communicator communicator, int requestCount) throws Exception { List> futures = new ArrayList>(requestCount); CountDownLatch barrier = new CountDownLatch(1); @@ -73,10 +73,10 @@ private void testConnectionPooling(ExecutorService executorService, GcCommunicat private static final class ConvertAmountAction implements Callable { private final CountDownLatch barrier; - private final GcCommunicator communicator; + private final Communicator communicator; private final ConvertAmountParams request; - private ConvertAmountAction(CountDownLatch barrier, int index, GcCommunicator communicator) { + private ConvertAmountAction(CountDownLatch barrier, int index, Communicator communicator) { this.barrier = barrier; this.communicator = communicator; @@ -92,7 +92,7 @@ public ConvertAmountResult call() throws Exception { barrier.await(); long startTime = System.currentTimeMillis(); - GcFactory.createClient(communicator).withClientMetaInfo("").merchant("9991").services().convertAmount(request).getConvertedAmount(); + Factory.createClient(communicator).withClientMetaInfo("").merchant("9991").services().convertAmount(request).getConvertedAmount(); long endTime = System.currentTimeMillis(); return new ConvertAmountResult(startTime, endTime); diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/ConvertAmountTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/ConvertAmountTest.java similarity index 70% rename from src/it/java/com/globalcollect/gateway/sdk/it/ConvertAmountTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/ConvertAmountTest.java index e40fe198c..c6b40727f 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/ConvertAmountTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/ConvertAmountTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.net.URISyntaxException; @@ -6,9 +6,9 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ConvertAmountParams; -import com.globalcollect.gateway.sdk.java.gc.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ConvertAmountParams; public class ConvertAmountTest extends ItTest { @@ -23,7 +23,7 @@ public void test() throws URISyntaxException, IOException { request.setSource("USD"); request.setTarget("EUR"); - GcClient client = getGcClient(); + Client client = getClient(); try { ConvertAmount response = client.merchant("9991").services().convertAmount(request); diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/IdempotenceTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/IdempotenceTest.java similarity index 70% rename from src/it/java/com/globalcollect/gateway/sdk/it/IdempotenceTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/IdempotenceTest.java index 23578df71..fa3a627ec 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/IdempotenceTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/IdempotenceTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.net.URISyntaxException; @@ -7,16 +7,16 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Customer; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentProduct809SpecificInput; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentProduct809SpecificInput; public class IdempotenceTest extends ItTest { @@ -58,7 +58,7 @@ public void test() throws URISyntaxException, IOException { String idempotenceKey = UUID.randomUUID().toString(); CallContext context = new CallContext().withIdempotenceKey(idempotenceKey); - GcClient client = getGcClient(); + Client client = getClient(); try { CreatePaymentResponse response = client.merchant("20000").payments().create(body, context); String paymentId = response.getPayment().getId(); diff --git a/src/it/java/com/ingenico/connect/gateway/sdk/it/ItTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/ItTest.java new file mode 100644 index 000000000..9e5c52d1f --- /dev/null +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/ItTest.java @@ -0,0 +1,64 @@ +package com.ingenico.connect.gateway.sdk.it; + +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; + +abstract class ItTest { + + private static final String PROPERTIES_URL = "/itconfiguration.properties"; + private static final String PROPERTIES_URL_PROXY = "/itconfiguration.proxy.properties"; + private static final String API_KEY_ID; + private static final String SECRET_API_KEY; + + static { + API_KEY_ID = System.getProperty("connect.api.apiKeyId"); + SECRET_API_KEY = System.getProperty("connect.api.secretApiKey"); + if (API_KEY_ID == null || SECRET_API_KEY == null) { + throw new IllegalStateException("System properties 'connect.api.apiKeyId' and 'connect.api.secretApiKey' must be set"); + } + } + + private CommunicatorConfiguration getCommunicatorConfiguration(URL propertiesUrl) throws URISyntaxException { + CommunicatorConfiguration configuration = Factory.createConfiguration(propertiesUrl.toURI(), API_KEY_ID, SECRET_API_KEY); + + String host = System.getProperty("connect.api.endpoint.host"); + if (host != null) { + String scheme = System.getProperty("connect.api.endpoint.scheme", "https"); + int port = Integer.parseInt(System.getProperty("connect.api.endpoint.port", "-1")); + URI apiEndpoint = new URI(scheme, null, host, port, null, null, null); + configuration = configuration.withApiEndpoint(apiEndpoint); + } + return configuration; + } + + protected CommunicatorConfiguration getCommunicatorConfiguration() throws URISyntaxException { + URL propertiesUrl = getClass().getResource(PROPERTIES_URL); + return getCommunicatorConfiguration(propertiesUrl); + } + + protected CommunicatorConfiguration getCommunicatorConfigurationWithProxy() throws URISyntaxException { + URL propertiesUrl = getClass().getResource(PROPERTIES_URL_PROXY); + return getCommunicatorConfiguration(propertiesUrl); + } + + protected Client getClient() throws URISyntaxException { + URL propertiesUrl = getClass().getResource(PROPERTIES_URL); + CommunicatorConfiguration configuration = getCommunicatorConfiguration(propertiesUrl); + return Factory + .createClient(configuration) + .withClientMetaInfo("{\"test\":\"test\"}"); + } + + protected Client getClientWithProxy() throws URISyntaxException { + URL propertiesUrl = getClass().getResource(PROPERTIES_URL_PROXY); + CommunicatorConfiguration configuration = getCommunicatorConfiguration(propertiesUrl); + return Factory + .createClient(configuration) + .withClientMetaInfo("{\"test\":\"test\"}"); + } +} diff --git a/src/it/java/com/ingenico/connect/gateway/sdk/it/MultiLineHeaderTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/MultiLineHeaderTest.java new file mode 100644 index 000000000..1fe3bf727 --- /dev/null +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/MultiLineHeaderTest.java @@ -0,0 +1,51 @@ +package com.ingenico.connect.gateway.sdk.it; + +import java.io.IOException; +import java.net.URISyntaxException; + +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.MetaDataProvider; +import com.ingenico.connect.gateway.sdk.java.MetaDataProviderBuilder; +import com.ingenico.connect.gateway.sdk.java.RequestHeader; +import com.ingenico.connect.gateway.sdk.java.Session; +import com.ingenico.connect.gateway.sdk.java.domain.product.Directory; +import com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams; + +public class MultiLineHeaderTest extends ItTest { + + /** + * Smoke test for products service. + */ + @Test + public void test() throws URISyntaxException, IOException { + + CommunicatorConfiguration configuration = getCommunicatorConfiguration(); + + String multiLineHeader = " some value \r\n \n with some \r\n spaces "; + MetaDataProvider metaDataProvider = new MetaDataProviderBuilder("Ingenico") + .withAdditionalRequestHeader(new RequestHeader("X-GCS-MultiLineHeader", multiLineHeader)) + .build(); + + DirectoryParams params = new DirectoryParams(); + params.setCountryCode("NL"); + params.setCurrencyCode("EUR"); + + Session session = Factory.createSessionBuilder(configuration) + .withMetaDataProvider(metaDataProvider) + .build(); + Client client = Factory.createClient(session); + try { + Directory response = client.merchant("8500").products().directory(809, params); + + Assert.assertTrue(response.getEntries().size() > 0); + + } finally { + client.close(); + } + } +} diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/PaymentProductGroupsTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/PaymentProductGroupsTest.java similarity index 55% rename from src/it/java/com/globalcollect/gateway/sdk/it/PaymentProductGroupsTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/PaymentProductGroupsTest.java index ef92fc481..70dee1c9f 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/PaymentProductGroupsTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/PaymentProductGroupsTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.net.URISyntaxException; @@ -6,23 +6,23 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.productgroups.GetParams; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductGroupResponse; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProductGroupResponse; +import com.ingenico.connect.gateway.sdk.java.merchant.productgroups.GetProductgroupParams; public class PaymentProductGroupsTest extends ItTest { /** - * Smoke test for products service. + * Smoke test for product groups service. */ @Test public void test() throws URISyntaxException, IOException { - GetParams params = new GetParams(); + GetProductgroupParams params = new GetProductgroupParams(); params.setCountryCode("NL"); params.setCurrencyCode("EUR"); - GcClient client = getGcClient(); + Client client = getClient(); try { PaymentProductGroupResponse response = client.merchant("8500").productgroups().get("cards", params); diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/PaymentProductsTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/PaymentProductsTest.java similarity index 69% rename from src/it/java/com/globalcollect/gateway/sdk/it/PaymentProductsTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/PaymentProductsTest.java index 18a1a59c9..bd4818f08 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/PaymentProductsTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/PaymentProductsTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.net.URISyntaxException; @@ -6,9 +6,9 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.DirectoryParams; -import com.globalcollect.gateway.sdk.java.gc.product.Directory; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.domain.product.Directory; +import com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams; public class PaymentProductsTest extends ItTest { @@ -22,7 +22,7 @@ public void test() throws URISyntaxException, IOException { params.setCountryCode("NL"); params.setCurrencyCode("EUR"); - GcClient client = getGcClient(); + Client client = getClient(); try { Directory response = client.merchant("8500").products().directory(809, params); diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/RiskAssessmentsTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/RiskAssessmentsTest.java similarity index 64% rename from src/it/java/com/globalcollect/gateway/sdk/it/RiskAssessmentsTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/RiskAssessmentsTest.java index 89755af95..897611562 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/RiskAssessmentsTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/RiskAssessmentsTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.net.URISyntaxException; @@ -6,13 +6,13 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentBankAccount; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentResponse; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.CustomerRiskAssessment; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.OrderRiskAssessment; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentBankAccount; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.CustomerRiskAssessment; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment; public class RiskAssessmentsTest extends ItTest { @@ -43,7 +43,7 @@ public void test() throws URISyntaxException, IOException { body.setOrder(order); - GcClient client = getGcClient(); + Client client = getClient(); try { RiskAssessmentResponse riskAssessmentResponse = client.merchant("8500").riskassessments().bankaccounts(body); Assert.assertTrue(riskAssessmentResponse.getResults().size() > 0); diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/SDKProxyTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/SDKProxyTest.java similarity index 66% rename from src/it/java/com/globalcollect/gateway/sdk/it/SDKProxyTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/SDKProxyTest.java index 5c7af4de9..bb68fab84 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/SDKProxyTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/SDKProxyTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.lang.reflect.Field; @@ -14,17 +14,16 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcDefaultConfiguration; -import com.globalcollect.gateway.sdk.java.GcProxyConfiguration; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcCommunicator; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcConnection; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcSession; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ConvertAmountParams; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ServicesClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ServicesClientImpl; -import com.globalcollect.gateway.sdk.java.gc.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.Communicator; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.ProxyConfiguration; +import com.ingenico.connect.gateway.sdk.java.Session; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultConnection; +import com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ConvertAmountParams; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ServicesClient; public class SDKProxyTest extends ItTest { @@ -39,14 +38,14 @@ public void test() throws URISyntaxException, IOException { request.setSource("USD"); request.setTarget("EUR"); - GcClient client = getGcClientWithProxy(); + Client client = getClientWithProxy(); try { ServicesClient services = client.merchant("9991").services(); - Assert.assertTrue(services instanceof ServicesClientImpl); - GcDefaultConfiguration configuration = getDefaultConfigurationWithProxy(); + Assert.assertTrue(services instanceof ServicesClient); + CommunicatorConfiguration configuration = getCommunicatorConfigurationWithProxy(); Assert.assertNotNull(configuration.getProxyConfiguration()); - assertProxySet((ServicesClientImpl) services, configuration.getProxyConfiguration()); + assertProxySet(services, configuration.getProxyConfiguration()); ConvertAmount response = services.convertAmount(request); @@ -58,10 +57,10 @@ public void test() throws URISyntaxException, IOException { } @SuppressWarnings("resource") - private void assertProxySet(GcApiResource resource, GcProxyConfiguration proxyConfiguration) { - DefaultGcCommunicator communicator = getField(resource, "communicator", DefaultGcCommunicator.class); - DefaultGcSession session = getField(communicator, "session", DefaultGcSession.class); - DefaultGcConnection connection = getField(session, "connection", DefaultGcConnection.class); + private void assertProxySet(ApiResource resource, ProxyConfiguration proxyConfiguration) { + Communicator communicator = getField(resource, "communicator", Communicator.class); + Session session = getField(communicator, "session", Session.class); + DefaultConnection connection = getField(session, "connection", DefaultConnection.class); CloseableHttpClient httpClient = getField(connection, "httpClient", CloseableHttpClient.class); DefaultProxyRoutePlanner routePlanner = getField(httpClient, "routePlanner", DefaultProxyRoutePlanner.class); HttpHost proxy = getField(routePlanner, "proxy", HttpHost.class); diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/SystemProxyTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/SystemProxyTest.java similarity index 76% rename from src/it/java/com/globalcollect/gateway/sdk/it/SystemProxyTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/SystemProxyTest.java index b6f2b49d9..489cbdeb3 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/SystemProxyTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/SystemProxyTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.net.Authenticator; @@ -8,11 +8,11 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.GcDefaultConfiguration; -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ConvertAmountParams; -import com.globalcollect.gateway.sdk.java.gc.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ConvertAmountParams; public class SystemProxyTest extends ItTest { @@ -54,10 +54,10 @@ protected PasswordAuthentication getPasswordAuthentication() { request.setSource("USD"); request.setTarget("EUR"); - GcDefaultConfiguration defaultConfiguration = getDefaultConfiguration() + CommunicatorConfiguration configuration = getCommunicatorConfiguration() .withProxyConfiguration(null); - GcClient client = GcFactory.createClient(defaultConfiguration); + Client client = Factory.createClient(configuration); try { ConvertAmount response = client.merchant("9991").services().convertAmount(request); @@ -68,7 +68,7 @@ protected PasswordAuthentication getPasswordAuthentication() { } // for https, authentication may not be required - if ("http".equalsIgnoreCase(defaultConfiguration.getApiEndpoint().getScheme())) { + if ("http".equalsIgnoreCase(configuration.getApiEndpoint().getScheme())) { Assert.assertTrue("getPasswordAuthentication() should have been called", authenticationCalled[0]); } } diff --git a/src/it/java/com/globalcollect/gateway/sdk/it/TokenTest.java b/src/it/java/com/ingenico/connect/gateway/sdk/it/TokenTest.java similarity index 61% rename from src/it/java/com/globalcollect/gateway/sdk/it/TokenTest.java rename to src/it/java/com/ingenico/connect/gateway/sdk/it/TokenTest.java index fa2947f7a..1fd7c89bc 100644 --- a/src/it/java/com/globalcollect/gateway/sdk/it/TokenTest.java +++ b/src/it/java/com/ingenico/connect/gateway/sdk/it/TokenTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.it; +package com.ingenico.connect.gateway.sdk.it; import java.io.IOException; import java.net.URISyntaxException; @@ -6,15 +6,15 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CardWithoutCvv; -import com.globalcollect.gateway.sdk.java.gc.merchant.tokens.DeleteParams; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenRequest; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenResponse; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCard; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCardData; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CardWithoutCvv; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenRequest; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenResponse; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCard; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCardData; +import com.ingenico.connect.gateway.sdk.java.merchant.tokens.DeleteTokenParams; public class TokenTest extends ItTest { @@ -42,13 +42,13 @@ public void test() throws URISyntaxException, IOException { cardWithoutCvv.setCardNumber("4567350000427977"); cardWithoutCvv.setExpiryDate("0820"); - GcClient client = getGcClient(); + Client client = getClient(); try { CreateTokenResponse createTokenResponse = client.merchant("9991").tokens().create(createTokenRequest); Assert.assertNotNull(createTokenResponse.getToken()); - DeleteParams deleteTokenRequest = new DeleteParams(); + DeleteTokenParams deleteTokenRequest = new DeleteTokenParams(); client.merchant("9991").tokens().delete(createTokenResponse.getToken(), deleteTokenRequest); diff --git a/src/it/resources/itconfiguration.properties b/src/it/resources/itconfiguration.properties index d49b73281..c886f7576 100644 --- a/src/it/resources/itconfiguration.properties +++ b/src/it/resources/itconfiguration.properties @@ -1,5 +1,6 @@ # GlobalCollect platform connection settings -gcs.api.endpoint.host=api-sandbox.globalcollect.com -gcs.api.authorizationType=V1HMAC -gcs.api.connectTimeout=-1 -gcs.api.socketTimeout=-1 +connect.api.endpoint.host=api-sandbox.globalcollect.com +connect.api.authorizationType=V1HMAC +connect.api.connectTimeout=-1 +connect.api.socketTimeout=-1 +connect.api.integrator=Ingenico diff --git a/src/it/resources/itconfiguration.proxy.properties b/src/it/resources/itconfiguration.proxy.properties index 134cacd2c..d78622e80 100644 --- a/src/it/resources/itconfiguration.proxy.properties +++ b/src/it/resources/itconfiguration.proxy.properties @@ -1,8 +1,9 @@ # GlobalCollect platform connection settings -gcs.api.endpoint.host=api-sandbox.globalcollect.com -gcs.api.authorizationType=V1HMAC -gcs.api.connectTimeout=-1 -gcs.api.socketTimeout=-1 -gcs.api.proxy.uri=http://proxy.isaac.local:3128 -gcs.api.proxy.username=global-collect -gcs.api.proxy.password=global-collect +connect.api.endpoint.host=api-sandbox.globalcollect.com +connect.api.authorizationType=V1HMAC +connect.api.connectTimeout=-1 +connect.api.socketTimeout=-1 +connect.api.integrator=Ingenico +connect.api.proxy.uri=http://proxy.isaac.local:3128 +connect.api.proxy.username=global-collect +connect.api.proxy.password=global-collect diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/GcClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/GcClient.java deleted file mode 100644 index 9615ece41..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/GcClient.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc; - -import com.globalcollect.gateway.sdk.java.GcMarshallerSyntaxException; -import com.globalcollect.gateway.sdk.java.gc.merchant.MerchantClient; -import com.globalcollect.gateway.sdk.java.logging.LoggingCapable; -import java.io.Closeable; -import java.io.IOException; - -/** - * GlobalCollect platform client. - *

- * This client and all its child clients are bound to one specific value for the X-GCS-ClientMetaInfo header. - * To get a new client with a different header value, use {@link #withClientMetaInfo(String)}. - *

- * Thread-safe. - */ -public interface GcClient extends Closeable, LoggingCapable { - - public static final String API_VERSION = "v1"; - - /** - * Returns a new {@link GcClient} which uses the passed meta data for the - * X-GCS-ClientMetaInfo header. - * - * @param clientMetaInfo - * JSON string containing the meta data for the client - * @throws GcMarshallerSyntaxException - * if the given clientMetaInfo is not a valid JSON string - */ - GcClient withClientMetaInfo(String clientMetaInfo); - - /** - * Releases any system resources associated with this object. - */ - @Override - void close() throws IOException; - - /** - * Resource /{merchantId} - * - * @param merchantId String - * @return Merchant - */ - MerchantClient merchant(String merchantId); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/GcClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/GcClientImpl.java deleted file mode 100644 index b6279d18a..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/GcClientImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc; - -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcCommunicator; -import com.globalcollect.gateway.sdk.java.gc.merchant.MerchantClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.MerchantClientImpl; -import com.globalcollect.gateway.sdk.java.logging.GcCommunicatorLogger; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Collections; -import java.util.Map; -import java.util.TreeMap; -import org.apache.commons.codec.binary.Base64; - -public class GcClientImpl extends GcApiResource implements GcClient { - - private static final Charset CHARSET = Charset.forName("UTF-8"); - - public GcClientImpl(GcCommunicator communicator) { - this(communicator, null); - } - - private GcClientImpl(GcCommunicator communicator, String clientMetaInfo) { - super(communicator, clientMetaInfo, Collections.singletonMap("apiVersion", API_VERSION)); - } - - @Override - public GcClient withClientMetaInfo(String clientMetaInfo) { - - if (this.clientMetaInfo == null && clientMetaInfo == null) { - return this; - } else if (clientMetaInfo == null) { - return new GcClientImpl(communicator, null); - } else { - // Checking to see if this is valid JSON (no JSON parse exceptions) - communicator.getMarshaller().unmarshal(clientMetaInfo, Object.class); - - clientMetaInfo = Base64.encodeBase64String(clientMetaInfo.getBytes(CHARSET)); - - if (clientMetaInfo.equals(this.clientMetaInfo)) { - return this; - } else { - return new GcClientImpl(communicator, clientMetaInfo); - } - } - } - - @Override - public void enableLogging(GcCommunicatorLogger communicatorLogger) { - // delegate to the communicator - communicator.enableLogging(communicatorLogger); - } - - @Override - public void disableLogging() { - // delegate to the communicator - communicator.disableLogging(); - } - - @Override - public void close() throws IOException { - communicator.close(); - } - - @Override - public MerchantClient merchant(String merchantId) { - Map subContext = new TreeMap(); - subContext.put("merchantId", merchantId); - return new MerchantClientImpl(this, subContext); - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/errors/ErrorResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/errors/ErrorResponse.java deleted file mode 100644 index 265a986ba..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/errors/ErrorResponse.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.errors; - -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import java.util.List; - -/** - * class ErrorResponse - */ -public class ErrorResponse { - - private String errorId = null; - - private List errors = null; - - public String getErrorId() { - return errorId; - } - - public void setErrorId(String value) { - this.errorId = value; - } - - public List getErrors() { - return errors; - } - - public void setErrors(List value) { - this.errors = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AbstractOrderStatus.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AbstractOrderStatus.java deleted file mode 100644 index 5ebf92a51..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AbstractOrderStatus.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - - -public class AbstractOrderStatus { - - private String id = null; - - public String getId() { - return id; - } - - public void setId(String value) { - this.id = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AbstractPaymentMethodSpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AbstractPaymentMethodSpecificInput.java deleted file mode 100644 index c022d1367..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AbstractPaymentMethodSpecificInput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - - -public class AbstractPaymentMethodSpecificInput { - - private Integer paymentProductId = null; - - public Integer getPaymentProductId() { - return paymentProductId; - } - - public void setPaymentProductId(Integer value) { - this.paymentProductId = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AdditionalOrderInputAirlineData.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AdditionalOrderInputAirlineData.java deleted file mode 100644 index 06b1a7e67..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AdditionalOrderInputAirlineData.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AirlineData; - -public class AdditionalOrderInputAirlineData { - - private AirlineData airlineData = null; - - public AirlineData getAirlineData() { - return airlineData; - } - - public void setAirlineData(AirlineData value) { - this.airlineData = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccount.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccount.java deleted file mode 100644 index 62acb0b81..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccount.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - - -public class BankAccount { - - private String accountHolderName = null; - - public String getAccountHolderName() { - return accountHolderName; - } - - public void setAccountHolderName(String value) { - this.accountHolderName = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccountIban.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccountIban.java deleted file mode 100644 index 05a444abc..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccountIban.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccount; - -public class BankAccountIban extends BankAccount { - - private String iban = null; - - public String getIban() { - return iban; - } - - public void setIban(String value) { - this.iban = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/Card.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/Card.java deleted file mode 100644 index 300c69bd0..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/Card.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CardWithoutCvv; - -public class Card extends CardWithoutCvv { - - private String cvv = null; - - public String getCvv() { - return cvv; - } - - public void setCvv(String value) { - this.cvv = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CompanyInformation.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CompanyInformation.java deleted file mode 100644 index 775c7c5ec..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CompanyInformation.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - - -public class CompanyInformation { - - private String name = null; - - public String getName() { - return name; - } - - public void setName(String value) { - this.name = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudResults.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudResults.java deleted file mode 100644 index 6ebf9a199..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudResults.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - - -public class FraudResults { - - private String fraudServiceResult = null; - - public String getFraudServiceResult() { - return fraudServiceResult; - } - - public void setFraudServiceResult(String value) { - this.fraudServiceResult = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/KeyValuePair.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/KeyValuePair.java deleted file mode 100644 index c0a445ee4..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/KeyValuePair.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - - -public class KeyValuePair { - - private String key = null; - - private String value = null; - - public String getKey() { - return key; - } - - public void setKey(String value) { - this.key = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/MerchantClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/MerchantClient.java deleted file mode 100644 index 8ef5fb376..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/MerchantClient.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant; - -import com.globalcollect.gateway.sdk.java.gc.merchant.hostedcheckouts.HostedcheckoutsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.payments.PaymentsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.payouts.PayoutsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.productgroups.ProductgroupsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.ProductsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.refunds.RefundsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.riskassessments.RiskassessmentsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ServicesClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.sessions.SessionsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.tokens.TokensClient; - -/** - * Merchant client. Thread-safe. - */ -public interface MerchantClient { - - /** - * Resource /{merchantId}/payouts - * Create, cancel and approve payouts - * - * @return Payouts - */ - PayoutsClient payouts(); - - /** - * Resource /{merchantId}/refunds - * Create, cancel and approve refunds - * - * @return Refunds - */ - RefundsClient refunds(); - - /** - * Resource /{merchantId}/sessions - * Create new Session for Client2Server API calls - * - * @return Sessions - */ - SessionsClient sessions(); - - /** - * Resource /{merchantId}/tokens - * Create, delete and update tokens - * - * @return Tokens - */ - TokensClient tokens(); - - /** - * Resource /{merchantId}/services - * Several services to help you - * - * @return Services - */ - ServicesClient services(); - - /** - * Resource /{merchantId}/hostedcheckouts - * Create new hosted checkout - * - * @return Hostedcheckouts - */ - HostedcheckoutsClient hostedcheckouts(); - - /** - * Resource /{merchantId}/products - * Get information about payment products - * - * @return Products - */ - ProductsClient products(); - - /** - * Resource /{merchantId}/payments - * Create, cancel and approve payments - * - * @return Payments - */ - PaymentsClient payments(); - - /** - * Resource /{merchantId}/productgroups - * Get information about payment product groups - * - * @return Productgroups - */ - ProductgroupsClient productgroups(); - - /** - * Resource /{merchantId}/riskassessments - * Perform risk assessments on your customer data - * - * @return Riskassessments - */ - RiskassessmentsClient riskassessments(); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/MerchantClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/MerchantClientImpl.java deleted file mode 100644 index 398fee4d1..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/MerchantClientImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant; - -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.gc.merchant.hostedcheckouts.HostedcheckoutsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.hostedcheckouts.HostedcheckoutsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.payments.PaymentsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.payments.PaymentsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.payouts.PayoutsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.payouts.PayoutsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.productgroups.ProductgroupsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.productgroups.ProductgroupsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.ProductsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.products.ProductsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.refunds.RefundsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.refunds.RefundsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.riskassessments.RiskassessmentsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.riskassessments.RiskassessmentsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ServicesClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ServicesClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.sessions.SessionsClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.sessions.SessionsClientImpl; -import com.globalcollect.gateway.sdk.java.gc.merchant.tokens.TokensClient; -import com.globalcollect.gateway.sdk.java.gc.merchant.tokens.TokensClientImpl; -import java.util.Map; - -public class MerchantClientImpl extends GcApiResource implements MerchantClient { - - public MerchantClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public PayoutsClient payouts() { - return new PayoutsClientImpl(this, null); - } - - @Override - public RefundsClient refunds() { - return new RefundsClientImpl(this, null); - } - - @Override - public SessionsClient sessions() { - return new SessionsClientImpl(this, null); - } - - @Override - public TokensClient tokens() { - return new TokensClientImpl(this, null); - } - - @Override - public ServicesClient services() { - return new ServicesClientImpl(this, null); - } - - @Override - public HostedcheckoutsClient hostedcheckouts() { - return new HostedcheckoutsClientImpl(this, null); - } - - @Override - public ProductsClient products() { - return new ProductsClientImpl(this, null); - } - - @Override - public PaymentsClient payments() { - return new PaymentsClientImpl(this, null); - } - - @Override - public ProductgroupsClient productgroups() { - return new ProductgroupsClientImpl(this, null); - } - - @Override - public RiskassessmentsClient riskassessments() { - return new RiskassessmentsClientImpl(this, null); - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/hostedcheckouts/HostedcheckoutsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/hostedcheckouts/HostedcheckoutsClient.java deleted file mode 100644 index fd26f2e38..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/hostedcheckouts/HostedcheckoutsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.hostedcheckouts; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.CreateHostedCheckoutRequest; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.CreateHostedCheckoutResponse; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.GetHostedCheckoutResponse; - -/** - * Hostedcheckouts client. Thread-safe. - */ -public interface HostedcheckoutsClient { - - /** - * Resource /{merchantId}/hostedcheckouts - * Create hosted checkout - * - * @param body CreateHostedCheckoutRequest - * @return CreateHostedCheckoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreateHostedCheckoutResponse create(CreateHostedCheckoutRequest body); - - /** - * Resource /{merchantId}/hostedcheckouts - * Create hosted checkout - * - * @param body CreateHostedCheckoutRequest - * @param context CallContext - * @return CreateHostedCheckoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreateHostedCheckoutResponse create(CreateHostedCheckoutRequest body, CallContext context); - - /** - * Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} - * Get hosted checkout status - * - * @param hostedCheckoutId String - * @return GetHostedCheckoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - GetHostedCheckoutResponse get(String hostedCheckoutId); - - /** - * Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} - * Get hosted checkout status - * - * @param hostedCheckoutId String - * @param context CallContext - * @return GetHostedCheckoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - GetHostedCheckoutResponse get(String hostedCheckoutId, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/hostedcheckouts/HostedcheckoutsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/hostedcheckouts/HostedcheckoutsClientImpl.java deleted file mode 100644 index edad4d7fe..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/hostedcheckouts/HostedcheckoutsClientImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.hostedcheckouts; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.CreateHostedCheckoutRequest; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.CreateHostedCheckoutResponse; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.GetHostedCheckoutResponse; -import java.util.Map; -import java.util.TreeMap; - -public class HostedcheckoutsClientImpl extends GcApiResource implements HostedcheckoutsClient { - - public HostedcheckoutsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public CreateHostedCheckoutResponse create(CreateHostedCheckoutRequest body) { - return create(body, null); - } - - @Override - public CreateHostedCheckoutResponse create(CreateHostedCheckoutRequest body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/hostedcheckouts", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - CreateHostedCheckoutResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public GetHostedCheckoutResponse get(String hostedCheckoutId) { - return get(hostedCheckoutId, null); - } - - @Override - public GetHostedCheckoutResponse get(String hostedCheckoutId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("hostedCheckoutId", hostedCheckoutId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/hostedcheckouts/{hostedCheckoutId}", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - null, - GetHostedCheckoutResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClient.java deleted file mode 100644 index b85241720..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClient.java +++ /dev/null @@ -1,326 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.payments; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcDeclinedPaymentException; -import com.globalcollect.gateway.sdk.java.GcDeclinedRefundException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.payment.ApprovePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CancelApprovalPaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.CancelPaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentApprovalResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.TokenizePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundRequest; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundResponse; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenResponse; - -/** - * Payments client. Thread-safe. - */ -public interface PaymentsClient { - - /** - * Resource /{merchantId}/payments/{paymentId}/refund - * Create refund - * - * @param paymentId String - * @param body RefundRequest - * @return RefundResponse - * @throws GcDeclinedRefundException if the GlobalCollect platform declined / rejected the refund. The refund result will be available from the exception. - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RefundResponse refund(String paymentId, RefundRequest body); - - /** - * Resource /{merchantId}/payments/{paymentId}/refund - * Create refund - * - * @param paymentId String - * @param body RefundRequest - * @param context CallContext - * @return RefundResponse - * @throws GcDeclinedRefundException if the GlobalCollect platform declined / rejected the refund. The refund result will be available from the exception. - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RefundResponse refund(String paymentId, RefundRequest body, CallContext context); - - /** - * Resource /{merchantId}/payments/{paymentId}/processchallenged - * Approves challenged payment - * - * @param paymentId String - * @return PaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentResponse processchallenged(String paymentId); - - /** - * Resource /{merchantId}/payments/{paymentId}/processchallenged - * Approves challenged payment - * - * @param paymentId String - * @param context CallContext - * @return PaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentResponse processchallenged(String paymentId, CallContext context); - - /** - * Resource /{merchantId}/payments/{paymentId} - * Get payment - * - * @param paymentId String - * @return PaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentResponse get(String paymentId); - - /** - * Resource /{merchantId}/payments/{paymentId} - * Get payment - * - * @param paymentId String - * @param context CallContext - * @return PaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentResponse get(String paymentId, CallContext context); - - /** - * Resource /{merchantId}/payments - * Create payment - * - * @param body CreatePaymentRequest - * @return CreatePaymentResponse - * @throws GcDeclinedPaymentException if the GlobalCollect platform declined / rejected the payment. The payment result will be available from the exception. - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreatePaymentResponse create(CreatePaymentRequest body); - - /** - * Resource /{merchantId}/payments - * Create payment - * - * @param body CreatePaymentRequest - * @param context CallContext - * @return CreatePaymentResponse - * @throws GcDeclinedPaymentException if the GlobalCollect platform declined / rejected the payment. The payment result will be available from the exception. - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreatePaymentResponse create(CreatePaymentRequest body, CallContext context); - - /** - * Resource /{merchantId}/payments/{paymentId}/tokenize - * Create a token from payment - * - * @param paymentId String - * @param body TokenizePaymentRequest - * @return CreateTokenResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreateTokenResponse tokenize(String paymentId, TokenizePaymentRequest body); - - /** - * Resource /{merchantId}/payments/{paymentId}/tokenize - * Create a token from payment - * - * @param paymentId String - * @param body TokenizePaymentRequest - * @param context CallContext - * @return CreateTokenResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreateTokenResponse tokenize(String paymentId, TokenizePaymentRequest body, CallContext context); - - /** - * Resource /{merchantId}/payments/{paymentId}/cancel - * Cancel payment - * - * @param paymentId String - * @return CancelPaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CancelPaymentResponse cancel(String paymentId); - - /** - * Resource /{merchantId}/payments/{paymentId}/cancel - * Cancel payment - * - * @param paymentId String - * @param context CallContext - * @return CancelPaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CancelPaymentResponse cancel(String paymentId, CallContext context); - - /** - * Resource /{merchantId}/payments/{paymentId}/approve - * Capture payment - * - * @param paymentId String - * @param body ApprovePaymentRequest - * @return PaymentApprovalResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentApprovalResponse approve(String paymentId, ApprovePaymentRequest body); - - /** - * Resource /{merchantId}/payments/{paymentId}/approve - * Capture payment - * - * @param paymentId String - * @param body ApprovePaymentRequest - * @param context CallContext - * @return PaymentApprovalResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentApprovalResponse approve(String paymentId, ApprovePaymentRequest body, CallContext context); - - /** - * Resource /{merchantId}/payments/{paymentId}/cancelapproval - * Undo capture payment request - * - * @param paymentId String - * @return CancelApprovalPaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CancelApprovalPaymentResponse cancelapproval(String paymentId); - - /** - * Resource /{merchantId}/payments/{paymentId}/cancelapproval - * Undo capture payment request - * - * @param paymentId String - * @param context CallContext - * @return CancelApprovalPaymentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CancelApprovalPaymentResponse cancelapproval(String paymentId, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClientImpl.java deleted file mode 100644 index 731157594..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClientImpl.java +++ /dev/null @@ -1,307 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.payments; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.ApprovePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CancelApprovalPaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.CancelPaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentApprovalResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.TokenizePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundRequest; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundResponse; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenResponse; -import java.util.Map; -import java.util.TreeMap; - -public class PaymentsClientImpl extends GcApiResource implements PaymentsClient { - - public PaymentsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public RefundResponse refund(String paymentId, RefundRequest body) { - return refund(paymentId, body, null); - } - - @Override - public RefundResponse refund(String paymentId, RefundRequest body, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentId", paymentId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/refund", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - RefundResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 400 : - errorType = RefundErrorResponse.class; - break; - case 404 : - errorType = RefundErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PaymentResponse processchallenged(String paymentId) { - return processchallenged(paymentId, null); - } - - @Override - public PaymentResponse processchallenged(String paymentId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentId", paymentId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/processchallenged", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - null, - PaymentResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - case 405 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PaymentResponse get(String paymentId) { - return get(paymentId, null); - } - - @Override - public PaymentResponse get(String paymentId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentId", paymentId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - null, - PaymentResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public CreatePaymentResponse create(CreatePaymentRequest body) { - return create(body, null); - } - - @Override - public CreatePaymentResponse create(CreatePaymentRequest body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - CreatePaymentResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 400 : - errorType = PaymentErrorResponse.class; - break; - case 402 : - errorType = PaymentErrorResponse.class; - break; - case 403 : - errorType = PaymentErrorResponse.class; - break; - case 502 : - errorType = PaymentErrorResponse.class; - break; - case 503 : - errorType = PaymentErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public CreateTokenResponse tokenize(String paymentId, TokenizePaymentRequest body) { - return tokenize(paymentId, body, null); - } - - @Override - public CreateTokenResponse tokenize(String paymentId, TokenizePaymentRequest body, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentId", paymentId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/tokenize", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - CreateTokenResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public CancelPaymentResponse cancel(String paymentId) { - return cancel(paymentId, null); - } - - @Override - public CancelPaymentResponse cancel(String paymentId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentId", paymentId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/cancel", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - null, - CancelPaymentResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 402 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PaymentApprovalResponse approve(String paymentId, ApprovePaymentRequest body) { - return approve(paymentId, body, null); - } - - @Override - public PaymentApprovalResponse approve(String paymentId, ApprovePaymentRequest body, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentId", paymentId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/approve", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - PaymentApprovalResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 402 : - errorType = ErrorResponse.class; - break; - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public CancelApprovalPaymentResponse cancelapproval(String paymentId) { - return cancelapproval(paymentId, null); - } - - @Override - public CancelApprovalPaymentResponse cancelapproval(String paymentId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentId", paymentId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/cancelapproval", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - null, - CancelApprovalPaymentResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payouts/PayoutsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payouts/PayoutsClient.java deleted file mode 100644 index def09a4bc..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payouts/PayoutsClient.java +++ /dev/null @@ -1,203 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.payouts; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcDeclinedPayoutException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.payout.ApprovePayoutRequest; -import com.globalcollect.gateway.sdk.java.gc.payout.CreatePayoutRequest; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutResponse; - -/** - * Payouts client. Thread-safe. - */ -public interface PayoutsClient { - - /** - * Resource /{merchantId}/payouts/{payoutId}/cancel - * Cancel payout - * - * @param payoutId String - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancel(String payoutId); - - /** - * Resource /{merchantId}/payouts/{payoutId}/cancel - * Cancel payout - * - * @param payoutId String - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancel(String payoutId, CallContext context); - - /** - * Resource /{merchantId}/payouts - * Create payout - * - * @param body CreatePayoutRequest - * @return PayoutResponse - * @throws GcDeclinedPayoutException if the GlobalCollect platform declined / rejected the payout. The payout result will be available from the exception. - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PayoutResponse create(CreatePayoutRequest body); - - /** - * Resource /{merchantId}/payouts - * Create payout - * - * @param body CreatePayoutRequest - * @param context CallContext - * @return PayoutResponse - * @throws GcDeclinedPayoutException if the GlobalCollect platform declined / rejected the payout. The payout result will be available from the exception. - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PayoutResponse create(CreatePayoutRequest body, CallContext context); - - /** - * Resource /{merchantId}/payouts/{payoutId}/approve - * Approve payout - * - * @param payoutId String - * @param body ApprovePayoutRequest - * @return PayoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PayoutResponse approve(String payoutId, ApprovePayoutRequest body); - - /** - * Resource /{merchantId}/payouts/{payoutId}/approve - * Approve payout - * - * @param payoutId String - * @param body ApprovePayoutRequest - * @param context CallContext - * @return PayoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PayoutResponse approve(String payoutId, ApprovePayoutRequest body, CallContext context); - - /** - * Resource /{merchantId}/payouts/{payoutId}/cancelapproval - * Undo approve payout - * - * @param payoutId String - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancelapproval(String payoutId); - - /** - * Resource /{merchantId}/payouts/{payoutId}/cancelapproval - * Undo approve payout - * - * @param payoutId String - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancelapproval(String payoutId, CallContext context); - - /** - * Resource /{merchantId}/payouts/{payoutId} - * Get payout - * - * @param payoutId String - * @return PayoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PayoutResponse get(String payoutId); - - /** - * Resource /{merchantId}/payouts/{payoutId} - * Get payout - * - * @param payoutId String - * @param context CallContext - * @return PayoutResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PayoutResponse get(String payoutId, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payouts/PayoutsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payouts/PayoutsClientImpl.java deleted file mode 100644 index ce7d69cfd..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/payouts/PayoutsClientImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.payouts; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.payout.ApprovePayoutRequest; -import com.globalcollect.gateway.sdk.java.gc.payout.CreatePayoutRequest; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutResponse; -import java.util.Map; -import java.util.TreeMap; - -public class PayoutsClientImpl extends GcApiResource implements PayoutsClient { - - public PayoutsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public Void cancel(String payoutId) { - return cancel(payoutId, null); - } - - @Override - public Void cancel(String payoutId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("payoutId", payoutId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}/cancel", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - null, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 402 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PayoutResponse create(CreatePayoutRequest body) { - return create(body, null); - } - - @Override - public PayoutResponse create(CreatePayoutRequest body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - PayoutResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 400 : - errorType = PayoutErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PayoutResponse approve(String payoutId, ApprovePayoutRequest body) { - return approve(payoutId, body, null); - } - - @Override - public PayoutResponse approve(String payoutId, ApprovePayoutRequest body, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("payoutId", payoutId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}/approve", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - PayoutResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 402 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public Void cancelapproval(String payoutId) { - return cancelapproval(payoutId, null); - } - - @Override - public Void cancelapproval(String payoutId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("payoutId", payoutId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}/cancelapproval", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - null, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 405 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PayoutResponse get(String payoutId) { - return get(payoutId, null); - } - - @Override - public PayoutResponse get(String payoutId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("payoutId", payoutId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - null, - PayoutResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/ProductgroupsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/ProductgroupsClient.java deleted file mode 100644 index a5165491c..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/ProductgroupsClient.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.productgroups; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductGroupResponse; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductGroups; - -/** - * Productgroups client. Thread-safe. - */ -public interface ProductgroupsClient { - - /** - * Resource /{merchantId}/productgroups - * Get payment product groups - * - * @param query FindParams - * @return PaymentProductGroups - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProductGroups find(FindParams query); - - /** - * Resource /{merchantId}/productgroups - * Get payment product groups - * - * @param query FindParams - * @param context CallContext - * @return PaymentProductGroups - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProductGroups find(FindParams query, CallContext context); - - /** - * Resource /{merchantId}/productgroups/{paymentProductGroupId} - * Get payment product group - * - * @param paymentProductGroupId String - * @param query GetParams - * @return PaymentProductGroupResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProductGroupResponse get(String paymentProductGroupId, GetParams query); - - /** - * Resource /{merchantId}/productgroups/{paymentProductGroupId} - * Get payment product group - * - * @param paymentProductGroupId String - * @param query GetParams - * @param context CallContext - * @return PaymentProductGroupResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProductGroupResponse get(String paymentProductGroupId, GetParams query, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/ProductgroupsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/ProductgroupsClientImpl.java deleted file mode 100644 index 2df274b22..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/ProductgroupsClientImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.productgroups; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductGroupResponse; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductGroups; -import java.util.Map; -import java.util.TreeMap; - -public class ProductgroupsClientImpl extends GcApiResource implements ProductgroupsClient { - - public ProductgroupsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public PaymentProductGroups find(FindParams query) { - return find(query, null); - } - - @Override - public PaymentProductGroups find(FindParams query, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/productgroups", null); - try { - return communicator.get( - uri, - getClientHeaders(), - query, - PaymentProductGroups.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PaymentProductGroupResponse get(String paymentProductGroupId, GetParams query) { - return get(paymentProductGroupId, query, null); - } - - @Override - public PaymentProductGroupResponse get(String paymentProductGroupId, GetParams query, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentProductGroupId", paymentProductGroupId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/productgroups/{paymentProductGroupId}", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - query, - PaymentProductGroupResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/DirectoryParams.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/DirectoryParams.java deleted file mode 100644 index 1279f8b25..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/DirectoryParams.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.products; - -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.RequestParam; -import java.util.LinkedList; -import java.util.List; - -public class DirectoryParams implements GcParamRequest { - - private String currencyCode; - - private String countryCode; - - public String getCurrencyCode() { - return currencyCode; - } - - public void setCurrencyCode(String value) { - this.currencyCode = value; - } - - public String getCountryCode() { - return countryCode; - } - - public void setCountryCode(String value) { - this.countryCode = value; - } - - @Override - public List toRequestParameters() { - List result = new LinkedList(); - if (currencyCode != null) { - result.add(new RequestParam("currencyCode", currencyCode.toString())); - } - if (countryCode != null) { - result.add(new RequestParam("countryCode", countryCode.toString())); - } - return result; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/ProductsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/ProductsClient.java deleted file mode 100644 index ec8a31c8f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/ProductsClient.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.products; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.product.Directory; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductResponse; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProducts; - -/** - * Products client. Thread-safe. - */ -public interface ProductsClient { - - /** - * Resource /{merchantId}/products/{paymentProductId}/directory - * Get payment product directory - * - * @param paymentProductId Integer - * @param query DirectoryParams - * @return Directory - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Directory directory(Integer paymentProductId, DirectoryParams query); - - /** - * Resource /{merchantId}/products/{paymentProductId}/directory - * Get payment product directory - * - * @param paymentProductId Integer - * @param query DirectoryParams - * @param context CallContext - * @return Directory - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Directory directory(Integer paymentProductId, DirectoryParams query, CallContext context); - - /** - * Resource /{merchantId}/products - * Get payment products - * - * @param query FindParams - * @return PaymentProducts - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProducts find(FindParams query); - - /** - * Resource /{merchantId}/products - * Get payment products - * - * @param query FindParams - * @param context CallContext - * @return PaymentProducts - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProducts find(FindParams query, CallContext context); - - /** - * Resource /{merchantId}/products/{paymentProductId} - * Get payment product - * - * @param paymentProductId Integer - * @param query GetParams - * @return PaymentProductResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProductResponse get(Integer paymentProductId, GetParams query); - - /** - * Resource /{merchantId}/products/{paymentProductId} - * Get payment product - * - * @param paymentProductId Integer - * @param query GetParams - * @param context CallContext - * @return PaymentProductResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - PaymentProductResponse get(Integer paymentProductId, GetParams query, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/ProductsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/ProductsClientImpl.java deleted file mode 100644 index 792bc81e7..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/ProductsClientImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.products; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.product.Directory; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProductResponse; -import com.globalcollect.gateway.sdk.java.gc.product.PaymentProducts; -import java.util.Map; -import java.util.TreeMap; - -public class ProductsClientImpl extends GcApiResource implements ProductsClient { - - public ProductsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public Directory directory(Integer paymentProductId, DirectoryParams query) { - return directory(paymentProductId, query, null); - } - - @Override - public Directory directory(Integer paymentProductId, DirectoryParams query, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentProductId", paymentProductId.toString()); - String uri = instantiateUri("/{apiVersion}/{merchantId}/products/{paymentProductId}/directory", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - query, - Directory.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PaymentProducts find(FindParams query) { - return find(query, null); - } - - @Override - public PaymentProducts find(FindParams query, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/products", null); - try { - return communicator.get( - uri, - getClientHeaders(), - query, - PaymentProducts.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public PaymentProductResponse get(Integer paymentProductId, GetParams query) { - return get(paymentProductId, query, null); - } - - @Override - public PaymentProductResponse get(Integer paymentProductId, GetParams query, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("paymentProductId", paymentProductId.toString()); - String uri = instantiateUri("/{apiVersion}/{merchantId}/products/{paymentProductId}", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - query, - PaymentProductResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/refunds/RefundsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/refunds/RefundsClient.java deleted file mode 100644 index 939d5ed47..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/refunds/RefundsClient.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.refunds; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.refund.ApproveRefundRequest; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundResponse; - -/** - * Refunds client. Thread-safe. - */ -public interface RefundsClient { - - /** - * Resource /{merchantId}/refunds/{refundId}/cancel - * Cancel refund - * - * @param refundId String - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancel(String refundId); - - /** - * Resource /{merchantId}/refunds/{refundId}/cancel - * Cancel refund - * - * @param refundId String - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancel(String refundId, CallContext context); - - /** - * Resource /{merchantId}/refunds/{refundId}/approve - * Approve refund - * - * @param refundId String - * @param body ApproveRefundRequest - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void approve(String refundId, ApproveRefundRequest body); - - /** - * Resource /{merchantId}/refunds/{refundId}/approve - * Approve refund - * - * @param refundId String - * @param body ApproveRefundRequest - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void approve(String refundId, ApproveRefundRequest body, CallContext context); - - /** - * Resource /{merchantId}/refunds/{refundId}/cancelapproval - * Undo approve refund - * - * @param refundId String - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancelapproval(String refundId); - - /** - * Resource /{merchantId}/refunds/{refundId}/cancelapproval - * Undo approve refund - * - * @param refundId String - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void cancelapproval(String refundId, CallContext context); - - /** - * Resource /{merchantId}/refunds/{refundId} - * Get refund - * - * @param refundId String - * @return RefundResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RefundResponse get(String refundId); - - /** - * Resource /{merchantId}/refunds/{refundId} - * Get refund - * - * @param refundId String - * @param context CallContext - * @return RefundResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RefundResponse get(String refundId, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/refunds/RefundsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/refunds/RefundsClientImpl.java deleted file mode 100644 index ad8e8095e..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/refunds/RefundsClientImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.refunds; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.refund.ApproveRefundRequest; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundResponse; -import java.util.Map; -import java.util.TreeMap; - -public class RefundsClientImpl extends GcApiResource implements RefundsClient { - - public RefundsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public Void cancel(String refundId) { - return cancel(refundId, null); - } - - @Override - public Void cancel(String refundId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("refundId", refundId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}/cancel", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - null, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public Void approve(String refundId, ApproveRefundRequest body) { - return approve(refundId, body, null); - } - - @Override - public Void approve(String refundId, ApproveRefundRequest body, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("refundId", refundId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}/approve", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public Void cancelapproval(String refundId) { - return cancelapproval(refundId, null); - } - - @Override - public Void cancelapproval(String refundId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("refundId", refundId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}/cancelapproval", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - null, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public RefundResponse get(String refundId) { - return get(refundId, null); - } - - @Override - public RefundResponse get(String refundId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("refundId", refundId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - null, - RefundResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/riskassessments/RiskassessmentsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/riskassessments/RiskassessmentsClient.java deleted file mode 100644 index 9b2d83fe8..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/riskassessments/RiskassessmentsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.riskassessments; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentBankAccount; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentCard; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentResponse; - -/** - * Riskassessments client. Thread-safe. - */ -public interface RiskassessmentsClient { - - /** - * Resource /{merchantId}/riskassessments/cards - * Risk-assess card - * - * @param body RiskAssessmentCard - * @return RiskAssessmentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RiskAssessmentResponse cards(RiskAssessmentCard body); - - /** - * Resource /{merchantId}/riskassessments/cards - * Risk-assess card - * - * @param body RiskAssessmentCard - * @param context CallContext - * @return RiskAssessmentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RiskAssessmentResponse cards(RiskAssessmentCard body, CallContext context); - - /** - * Resource /{merchantId}/riskassessments/bankaccounts - * Risk-assess bank account - * - * @param body RiskAssessmentBankAccount - * @return RiskAssessmentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RiskAssessmentResponse bankaccounts(RiskAssessmentBankAccount body); - - /** - * Resource /{merchantId}/riskassessments/bankaccounts - * Risk-assess bank account - * - * @param body RiskAssessmentBankAccount - * @param context CallContext - * @return RiskAssessmentResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - RiskAssessmentResponse bankaccounts(RiskAssessmentBankAccount body, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/riskassessments/RiskassessmentsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/riskassessments/RiskassessmentsClientImpl.java deleted file mode 100644 index d5649b958..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/riskassessments/RiskassessmentsClientImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.riskassessments; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentBankAccount; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentCard; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.RiskAssessmentResponse; -import java.util.Map; - -public class RiskassessmentsClientImpl extends GcApiResource implements RiskassessmentsClient { - - public RiskassessmentsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public RiskAssessmentResponse cards(RiskAssessmentCard body) { - return cards(body, null); - } - - @Override - public RiskAssessmentResponse cards(RiskAssessmentCard body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/riskassessments/cards", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - RiskAssessmentResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public RiskAssessmentResponse bankaccounts(RiskAssessmentBankAccount body) { - return bankaccounts(body, null); - } - - @Override - public RiskAssessmentResponse bankaccounts(RiskAssessmentBankAccount body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/riskassessments/bankaccounts", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - RiskAssessmentResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ConvertAmountParams.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ConvertAmountParams.java deleted file mode 100644 index eb7f89496..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ConvertAmountParams.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.services; - -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.RequestParam; -import java.util.LinkedList; -import java.util.List; - -public class ConvertAmountParams implements GcParamRequest { - - private String source; - - private Long amount; - - private String target; - - public String getSource() { - return source; - } - - public void setSource(String value) { - this.source = value; - } - - public Long getAmount() { - return amount; - } - - public void setAmount(Long value) { - this.amount = value; - } - - public String getTarget() { - return target; - } - - public void setTarget(String value) { - this.target = value; - } - - @Override - public List toRequestParameters() { - List result = new LinkedList(); - if (source != null) { - result.add(new RequestParam("source", source.toString())); - } - if (amount != null) { - result.add(new RequestParam("amount", amount.toString())); - } - if (target != null) { - result.add(new RequestParam("target", target.toString())); - } - return result; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ServicesClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ServicesClient.java deleted file mode 100644 index 4bebae43f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ServicesClient.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.services; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.services.BankDetailsRequest; -import com.globalcollect.gateway.sdk.java.gc.services.BankDetailsResponse; -import com.globalcollect.gateway.sdk.java.gc.services.ConvertAmount; -import com.globalcollect.gateway.sdk.java.gc.services.GetIINDetailsRequest; -import com.globalcollect.gateway.sdk.java.gc.services.GetIINDetailsResponse; -import com.globalcollect.gateway.sdk.java.gc.services.TestConnection; - -/** - * Services client. Thread-safe. - */ -public interface ServicesClient { - - /** - * Resource /{merchantId}/services/convert/bankaccount - * Convert Bankaccount - * - * @param body BankDetailsRequest - * @return BankDetailsResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - BankDetailsResponse bankaccount(BankDetailsRequest body); - - /** - * Resource /{merchantId}/services/convert/bankaccount - * Convert Bankaccount - * - * @param body BankDetailsRequest - * @param context CallContext - * @return BankDetailsResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - BankDetailsResponse bankaccount(BankDetailsRequest body, CallContext context); - - /** - * Resource /{merchantId}/services/testconnection - * Test connection - * - * @return TestConnection - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - TestConnection testconnection(); - - /** - * Resource /{merchantId}/services/testconnection - * Test connection - * - * @param context CallContext - * @return TestConnection - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - TestConnection testconnection(CallContext context); - - /** - * Resource /{merchantId}/services/getIINdetails - * Get IIN details - * - * @param body GetIINDetailsRequest - * @return GetIINDetailsResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - GetIINDetailsResponse getIINdetails(GetIINDetailsRequest body); - - /** - * Resource /{merchantId}/services/getIINdetails - * Get IIN details - * - * @param body GetIINDetailsRequest - * @param context CallContext - * @return GetIINDetailsResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - GetIINDetailsResponse getIINdetails(GetIINDetailsRequest body, CallContext context); - - /** - * Resource /{merchantId}/services/convert/amount - * Convert amount - * - * @param query ConvertAmountParams - * @return ConvertAmount - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - ConvertAmount convertAmount(ConvertAmountParams query); - - /** - * Resource /{merchantId}/services/convert/amount - * Convert amount - * - * @param query ConvertAmountParams - * @param context CallContext - * @return ConvertAmount - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - ConvertAmount convertAmount(ConvertAmountParams query, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ServicesClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ServicesClientImpl.java deleted file mode 100644 index 36ded5614..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/services/ServicesClientImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.services; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.services.BankDetailsRequest; -import com.globalcollect.gateway.sdk.java.gc.services.BankDetailsResponse; -import com.globalcollect.gateway.sdk.java.gc.services.ConvertAmount; -import com.globalcollect.gateway.sdk.java.gc.services.GetIINDetailsRequest; -import com.globalcollect.gateway.sdk.java.gc.services.GetIINDetailsResponse; -import com.globalcollect.gateway.sdk.java.gc.services.TestConnection; -import java.util.Map; - -public class ServicesClientImpl extends GcApiResource implements ServicesClient { - - public ServicesClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public BankDetailsResponse bankaccount(BankDetailsRequest body) { - return bankaccount(body, null); - } - - @Override - public BankDetailsResponse bankaccount(BankDetailsRequest body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/services/convert/bankaccount", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - BankDetailsResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public TestConnection testconnection() { - return testconnection(null); - } - - @Override - public TestConnection testconnection(CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/services/testconnection", null); - try { - return communicator.get( - uri, - getClientHeaders(), - null, - TestConnection.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 403 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public GetIINDetailsResponse getIINdetails(GetIINDetailsRequest body) { - return getIINdetails(body, null); - } - - @Override - public GetIINDetailsResponse getIINdetails(GetIINDetailsRequest body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/services/getIINdetails", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - GetIINDetailsResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public ConvertAmount convertAmount(ConvertAmountParams query) { - return convertAmount(query, null); - } - - @Override - public ConvertAmount convertAmount(ConvertAmountParams query, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/services/convert/amount", null); - try { - return communicator.get( - uri, - getClientHeaders(), - query, - ConvertAmount.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/sessions/SessionsClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/sessions/SessionsClient.java deleted file mode 100644 index f4eb49572..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/sessions/SessionsClient.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.sessions; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.sessions.SessionRequest; -import com.globalcollect.gateway.sdk.java.gc.sessions.SessionResponse; - -/** - * Sessions client. Thread-safe. - */ -public interface SessionsClient { - - /** - * Resource /{merchantId}/sessions - * Create Session - * - * @param body SessionRequest - * @return SessionResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - SessionResponse create(SessionRequest body); - - /** - * Resource /{merchantId}/sessions - * Create Session - * - * @param body SessionRequest - * @param context CallContext - * @return SessionResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - SessionResponse create(SessionRequest body, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/sessions/SessionsClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/sessions/SessionsClientImpl.java deleted file mode 100644 index adf7cb9f7..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/sessions/SessionsClientImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.sessions; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.sessions.SessionRequest; -import com.globalcollect.gateway.sdk.java.gc.sessions.SessionResponse; -import java.util.Map; - -public class SessionsClientImpl extends GcApiResource implements SessionsClient { - - public SessionsClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public SessionResponse create(SessionRequest body) { - return create(body, null); - } - - @Override - public SessionResponse create(SessionRequest body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/sessions", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - SessionResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/DeleteParams.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/DeleteParams.java deleted file mode 100644 index 2078bbd0b..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/DeleteParams.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.tokens; - -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.RequestParam; -import java.util.LinkedList; -import java.util.List; - -public class DeleteParams implements GcParamRequest { - - private String mandateCancelDate; - - public String getMandateCancelDate() { - return mandateCancelDate; - } - - public void setMandateCancelDate(String value) { - this.mandateCancelDate = value; - } - - @Override - public List toRequestParameters() { - List result = new LinkedList(); - if (mandateCancelDate != null) { - result.add(new RequestParam("mandateCancelDate", mandateCancelDate.toString())); - } - return result; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/TokensClient.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/TokensClient.java deleted file mode 100644 index c8de26e6d..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/TokensClient.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.tokens; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcAuthorizationException; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.token.ApproveTokenRequest; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenRequest; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenResponse; -import com.globalcollect.gateway.sdk.java.gc.token.TokenResponse; -import com.globalcollect.gateway.sdk.java.gc.token.UpdateTokenRequest; - -/** - * Tokens client. Thread-safe. - */ -public interface TokensClient { - - /** - * Resource /{merchantId}/tokens - * Create token - * - * @param body CreateTokenRequest - * @return CreateTokenResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreateTokenResponse create(CreateTokenRequest body); - - /** - * Resource /{merchantId}/tokens - * Create token - * - * @param body CreateTokenRequest - * @param context CallContext - * @return CreateTokenResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - CreateTokenResponse create(CreateTokenRequest body, CallContext context); - - /** - * Resource /{merchantId}/tokens/{tokenId}/approvesepadirectdebit - * Approve SEPA DD mandate - * - * @param tokenId String - * @param body ApproveTokenRequest - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void approvesepadirectdebit(String tokenId, ApproveTokenRequest body); - - /** - * Resource /{merchantId}/tokens/{tokenId}/approvesepadirectdebit - * Approve SEPA DD mandate - * - * @param tokenId String - * @param body ApproveTokenRequest - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void approvesepadirectdebit(String tokenId, ApproveTokenRequest body, CallContext context); - - /** - * Resource /{merchantId}/tokens/{tokenId} - * Update token - * - * @param tokenId String - * @param body UpdateTokenRequest - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void update(String tokenId, UpdateTokenRequest body); - - /** - * Resource /{merchantId}/tokens/{tokenId} - * Update token - * - * @param tokenId String - * @param body UpdateTokenRequest - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void update(String tokenId, UpdateTokenRequest body, CallContext context); - - /** - * Resource /{merchantId}/tokens/{tokenId} - * Get token - * - * @param tokenId String - * @return TokenResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - TokenResponse get(String tokenId); - - /** - * Resource /{merchantId}/tokens/{tokenId} - * Get token - * - * @param tokenId String - * @param context CallContext - * @return TokenResponse - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - TokenResponse get(String tokenId, CallContext context); - - /** - * Resource /{merchantId}/tokens/{tokenId} - * Delete token - * - * @param tokenId String - * @param query DeleteParams - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void delete(String tokenId, DeleteParams query); - - /** - * Resource /{merchantId}/tokens/{tokenId} - * Delete token - * - * @param tokenId String - * @param query DeleteParams - * @param context CallContext - * @return Void - * @throws GcValidationException if the request was not correct and couldn't be processed (HTTP status code 400) - * @throws GcAuthorizationException if the request was not allowed (HTTP status code 403) - * @throws GcIdempotenceException if an idempotent request caused a conflict (HTTP status code 409) - * @throws GcReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, - * or there was a conflict (HTTP status code 404, 409 or 410) - * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, - * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, - * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) - * @throws GcApiException if the GlobalCollect platform returned any other error - */ - Void delete(String tokenId, DeleteParams query, CallContext context); -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/TokensClientImpl.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/TokensClientImpl.java deleted file mode 100644 index da23ade3f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/tokens/TokensClientImpl.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.tokens; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiResource; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.token.ApproveTokenRequest; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenRequest; -import com.globalcollect.gateway.sdk.java.gc.token.CreateTokenResponse; -import com.globalcollect.gateway.sdk.java.gc.token.TokenResponse; -import com.globalcollect.gateway.sdk.java.gc.token.UpdateTokenRequest; -import java.util.Map; -import java.util.TreeMap; - -public class TokensClientImpl extends GcApiResource implements TokensClient { - - public TokensClientImpl(GcApiResource parent, Map pathContext) { - super(parent, pathContext); - } - - @Override - public CreateTokenResponse create(CreateTokenRequest body) { - return create(body, null); - } - - @Override - public CreateTokenResponse create(CreateTokenRequest body, CallContext context) { - String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens", null); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - CreateTokenResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 403 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public Void approvesepadirectdebit(String tokenId, ApproveTokenRequest body) { - return approvesepadirectdebit(tokenId, body, null); - } - - @Override - public Void approvesepadirectdebit(String tokenId, ApproveTokenRequest body, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("tokenId", tokenId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}/approvesepadirectdebit", pathContext); - try { - return communicator.post( - uri, - getClientHeaders(), - null, - body, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public Void update(String tokenId, UpdateTokenRequest body) { - return update(tokenId, body, null); - } - - @Override - public Void update(String tokenId, UpdateTokenRequest body, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("tokenId", tokenId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}", pathContext); - try { - return communicator.put( - uri, - getClientHeaders(), - null, - body, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public TokenResponse get(String tokenId) { - return get(tokenId, null); - } - - @Override - public TokenResponse get(String tokenId, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("tokenId", tokenId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}", pathContext); - try { - return communicator.get( - uri, - getClientHeaders(), - null, - TokenResponse.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } - - @Override - public Void delete(String tokenId, DeleteParams query) { - return delete(tokenId, query, null); - } - - @Override - public Void delete(String tokenId, DeleteParams query, CallContext context) { - Map pathContext = new TreeMap(); - pathContext.put("tokenId", tokenId); - String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}", pathContext); - try { - return communicator.delete( - uri, - getClientHeaders(), - query, - Void.class, - context); - } catch (GcResponseException e) { - final Class errorType; - switch (e.getStatusCode()) { - case 404 : - errorType = ErrorResponse.class; - break; - default: - errorType = ErrorResponse.class; - break; - } - final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), e.getStatusCode(), uri, errorType); - throw createException(e.getStatusCode(), e.getBody(), errorObject, context); - } - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CancelApprovalPaymentResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CancelApprovalPaymentResponse.java deleted file mode 100644 index 2c64e7da7..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CancelApprovalPaymentResponse.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Payment; - -/** - * class CancelApprovalPaymentResponse - */ -public class CancelApprovalPaymentResponse { - - private Payment payment = null; - - public Payment getPayment() { - return payment; - } - - public void setPayment(Payment value) { - this.payment = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CreatePaymentResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CreatePaymentResponse.java deleted file mode 100644 index 1a8b45cc5..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CreatePaymentResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CreatePaymentResult; - -/** - * class CreatePaymentResponse - */ -public class CreatePaymentResponse extends CreatePaymentResult { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentResponse.java deleted file mode 100644 index b6df2de00..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Payment; - -/** - * class PaymentResponse - */ -public class PaymentResponse extends Payment { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/TokenizePaymentRequest.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/TokenizePaymentRequest.java deleted file mode 100644 index 444eb6a35..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/TokenizePaymentRequest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; - - -/** - * class TokenizePaymentRequest - */ -public class TokenizePaymentRequest { - - private String alias = null; - - public String getAlias() { - return alias; - } - - public void setAlias(String value) { - this.alias = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AbstractPaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AbstractPaymentMethodSpecificOutput.java deleted file mode 100644 index 2836e7136..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AbstractPaymentMethodSpecificOutput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class AbstractPaymentMethodSpecificOutput { - - private Integer paymentProductId = null; - - public Integer getPaymentProductId() { - return paymentProductId; - } - - public void setPaymentProductId(Integer value) { - this.paymentProductId = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AddressPersonal.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AddressPersonal.java deleted file mode 100644 index a265c690a..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AddressPersonal.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalName; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; - -public class AddressPersonal extends Address { - - private PersonalName name = null; - - public PersonalName getName() { - return name; - } - - public void setName(PersonalName value) { - this.name = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentCardPaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentCardPaymentMethodSpecificOutput.java deleted file mode 100644 index cb1db0e94..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentCardPaymentMethodSpecificOutput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class ApprovePaymentCardPaymentMethodSpecificOutput { - - private String voidResponseId = null; - - public String getVoidResponseId() { - return voidResponseId; - } - - public void setVoidResponseId(String value) { - this.voidResponseId = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput.java deleted file mode 100644 index 0efb38298..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ApprovePaymentPaymentMethodSpecificInput; - -public class ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput extends ApprovePaymentPaymentMethodSpecificInput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentPaymentMethodSpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentPaymentMethodSpecificInput.java deleted file mode 100644 index 486c510ed..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentPaymentMethodSpecificInput.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class ApprovePaymentPaymentMethodSpecificInput { - - private String dateCollect = null; - - private String token = null; - - public String getDateCollect() { - return dateCollect; - } - - public void setDateCollect(String value) { - this.dateCollect = value; - } - - public String getToken() { - return token; - } - - public void setToken(String value) { - this.token = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.java deleted file mode 100644 index 7a2ec0cc3..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ApprovePaymentPaymentMethodSpecificInput; - -public class ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput extends ApprovePaymentPaymentMethodSpecificInput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificInput.java deleted file mode 100644 index 7f201384c..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificInput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.BankTransferPaymentMethodSpecificInputBase; - -public class BankTransferPaymentMethodSpecificInput extends BankTransferPaymentMethodSpecificInputBase { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificInputBase.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificInputBase.java deleted file mode 100644 index f3f3133be..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificInputBase.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractPaymentMethodSpecificInput; - -public class BankTransferPaymentMethodSpecificInputBase extends AbstractPaymentMethodSpecificInput { - - private String additionalReference = null; - - public String getAdditionalReference() { - return additionalReference; - } - - public void setAdditionalReference(String value) { - this.additionalReference = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificOutput.java deleted file mode 100644 index f276cd7ec..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/BankTransferPaymentMethodSpecificOutput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AbstractPaymentMethodSpecificOutput; - -public class BankTransferPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CancelPaymentCardPaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CancelPaymentCardPaymentMethodSpecificOutput.java deleted file mode 100644 index e2144ce21..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CancelPaymentCardPaymentMethodSpecificOutput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class CancelPaymentCardPaymentMethodSpecificOutput { - - private String voidResponseId = null; - - public String getVoidResponseId() { - return voidResponseId; - } - - public void setVoidResponseId(String value) { - this.voidResponseId = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificInputBase.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificInputBase.java deleted file mode 100644 index c59ddf4a2..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificInputBase.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractPaymentMethodSpecificInput; - -public class CashPaymentMethodSpecificInputBase extends AbstractPaymentMethodSpecificInput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificOutput.java deleted file mode 100644 index 32afedfb4..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificOutput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AbstractPaymentMethodSpecificOutput; - -public class CashPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentProduct1503SpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentProduct1503SpecificInput.java deleted file mode 100644 index 6ba364b74..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentProduct1503SpecificInput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class CashPaymentProduct1503SpecificInput { - - private String returnUrl = null; - - public String getReturnUrl() { - return returnUrl; - } - - public void setReturnUrl(String value) { - this.returnUrl = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentProduct1504SpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentProduct1504SpecificInput.java deleted file mode 100644 index b9d33a9da..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentProduct1504SpecificInput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class CashPaymentProduct1504SpecificInput { - - private String returnUrl = null; - - public String getReturnUrl() { - return returnUrl; - } - - public void setReturnUrl(String value) { - this.returnUrl = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ContactDetails.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ContactDetails.java deleted file mode 100644 index 0396371f2..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ContactDetails.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ContactDetailsBase; - -public class ContactDetails extends ContactDetailsBase { - - private String faxNumber = null; - - private String phoneNumber = null; - - public String getFaxNumber() { - return faxNumber; - } - - public void setFaxNumber(String value) { - this.faxNumber = value; - } - - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String value) { - this.phoneNumber = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/InvoicePaymentMethodSpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/InvoicePaymentMethodSpecificInput.java deleted file mode 100644 index 3d4838094..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/InvoicePaymentMethodSpecificInput.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractPaymentMethodSpecificInput; - -public class InvoicePaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput { - - private String additionalReference = null; - - public String getAdditionalReference() { - return additionalReference; - } - - public void setAdditionalReference(String value) { - this.additionalReference = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/InvoicePaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/InvoicePaymentMethodSpecificOutput.java deleted file mode 100644 index 03121ae15..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/InvoicePaymentMethodSpecificOutput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AbstractPaymentMethodSpecificOutput; - -public class InvoicePaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificOutput.java deleted file mode 100644 index 28916bb2a..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificOutput.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.FraudResults; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AbstractPaymentMethodSpecificOutput; - -public class NonSepaDirectDebitPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { - - private FraudResults fraudResults = null; - - public FraudResults getFraudResults() { - return fraudResults; - } - - public void setFraudResults(FraudResults value) { - this.fraudResults = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderApprovePayment.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderApprovePayment.java deleted file mode 100644 index 5d43f382c..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderApprovePayment.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AdditionalOrderInputAirlineData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderReferencesApprovePayment; - -public class OrderApprovePayment { - - private AdditionalOrderInputAirlineData additionalInput = null; - - private OrderReferencesApprovePayment references = null; - - public AdditionalOrderInputAirlineData getAdditionalInput() { - return additionalInput; - } - - public void setAdditionalInput(AdditionalOrderInputAirlineData value) { - this.additionalInput = value; - } - - public OrderReferencesApprovePayment getReferences() { - return references; - } - - public void setReferences(OrderReferencesApprovePayment value) { - this.references = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderOutput.java deleted file mode 100644 index 48e5c326f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderOutput.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentReferences; - -public class OrderOutput { - - private AmountOfMoney amountOfMoney = null; - - private PaymentReferences references = null; - - public AmountOfMoney getAmountOfMoney() { - return amountOfMoney; - } - - public void setAmountOfMoney(AmountOfMoney value) { - this.amountOfMoney = value; - } - - public PaymentReferences getReferences() { - return references; - } - - public void setReferences(PaymentReferences value) { - this.references = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderReferencesApprovePayment.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderReferencesApprovePayment.java deleted file mode 100644 index b0576e96b..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderReferencesApprovePayment.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class OrderReferencesApprovePayment { - - private String merchantReference = null; - - public String getMerchantReference() { - return merchantReference; - } - - public void setMerchantReference(String value) { - this.merchantReference = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentCreationOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentCreationOutput.java deleted file mode 100644 index 14cc76d22..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentCreationOutput.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentCreationReferences; - -public class PaymentCreationOutput extends PaymentCreationReferences { - - private Boolean isNewToken = null; - - private String token = null; - - public Boolean getIsNewToken() { - return isNewToken; - } - - public void setIsNewToken(Boolean value) { - this.isNewToken = value; - } - - public String getToken() { - return token; - } - - public void setToken(String value) { - this.token = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct836SpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct836SpecificOutput.java deleted file mode 100644 index 906790314..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct836SpecificOutput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class PaymentProduct836SpecificOutput { - - private String securityIndicator = null; - - public String getSecurityIndicator() { - return securityIndicator; - } - - public void setSecurityIndicator(String value) { - this.securityIndicator = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct840SpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct840SpecificOutput.java deleted file mode 100644 index f33e8b8c6..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct840SpecificOutput.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentProduct840CustomerAccount; - -public class PaymentProduct840SpecificOutput { - - private PaymentProduct840CustomerAccount customerAccount = null; - - private Address customerAddress = null; - - public PaymentProduct840CustomerAccount getCustomerAccount() { - return customerAccount; - } - - public void setCustomerAccount(PaymentProduct840CustomerAccount value) { - this.customerAccount = value; - } - - public Address getCustomerAddress() { - return customerAddress; - } - - public void setCustomerAddress(Address value) { - this.customerAddress = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentStatusOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentStatusOutput.java deleted file mode 100644 index c6eb73043..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentStatusOutput.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.OrderStatusOutput; - -public class PaymentStatusOutput extends OrderStatusOutput { - - private Boolean isAuthorized = null; - - public Boolean getIsAuthorized() { - return isAuthorized; - } - - public void setIsAuthorized(Boolean value) { - this.isAuthorized = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PersonalName.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PersonalName.java deleted file mode 100644 index b90d2b0d8..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PersonalName.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.PersonalNameBase; - -public class PersonalName extends PersonalNameBase { - - private String title = null; - - public String getTitle() { - return title; - } - - public void setTitle(String value) { - this.title = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct816SpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct816SpecificInput.java deleted file mode 100644 index 0a794272d..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct816SpecificInput.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; - -public class RedirectPaymentProduct816SpecificInput { - - private BankAccountIban bankAccountIban = null; - - public BankAccountIban getBankAccountIban() { - return bankAccountIban; - } - - public void setBankAccountIban(BankAccountIban value) { - this.bankAccountIban = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct882SpecificInput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct882SpecificInput.java deleted file mode 100644 index 959140711..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct882SpecificInput.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - - -public class RedirectPaymentProduct882SpecificInput { - - private String issuerId = null; - - public String getIssuerId() { - return issuerId; - } - - public void setIssuerId(String value) { - this.issuerId = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundBankMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundBankMethodSpecificOutput.java deleted file mode 100644 index b7820f656..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundBankMethodSpecificOutput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundMethodSpecificOutput; - -public class RefundBankMethodSpecificOutput extends RefundMethodSpecificOutput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundCardMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundCardMethodSpecificOutput.java deleted file mode 100644 index 185bbf49f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundCardMethodSpecificOutput.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundMethodSpecificOutput; - -public class RefundCardMethodSpecificOutput extends RefundMethodSpecificOutput { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundEWalletMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundEWalletMethodSpecificOutput.java deleted file mode 100644 index 2b76a9ab0..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundEWalletMethodSpecificOutput.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundPaymentProduct840SpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundMethodSpecificOutput; - -public class RefundEWalletMethodSpecificOutput extends RefundMethodSpecificOutput { - - private RefundPaymentProduct840SpecificOutput paymentProduct840SpecificOutput = null; - - public RefundPaymentProduct840SpecificOutput getPaymentProduct840SpecificOutput() { - return paymentProduct840SpecificOutput; - } - - public void setPaymentProduct840SpecificOutput(RefundPaymentProduct840SpecificOutput value) { - this.paymentProduct840SpecificOutput = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundPaymentProduct840SpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundPaymentProduct840SpecificOutput.java deleted file mode 100644 index 5209ee4e2..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundPaymentProduct840SpecificOutput.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundPaymentProduct840CustomerAccount; - -public class RefundPaymentProduct840SpecificOutput { - - private RefundPaymentProduct840CustomerAccount customerAccount = null; - - public RefundPaymentProduct840CustomerAccount getCustomerAccount() { - return customerAccount; - } - - public void setCustomerAccount(RefundPaymentProduct840CustomerAccount value) { - this.customerAccount = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/SepaDirectDebitPaymentMethodSpecificOutput.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/SepaDirectDebitPaymentMethodSpecificOutput.java deleted file mode 100644 index 7f8079954..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/SepaDirectDebitPaymentMethodSpecificOutput.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.FraudResults; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AbstractPaymentMethodSpecificOutput; - -public class SepaDirectDebitPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { - - private FraudResults fraudResults = null; - - public FraudResults getFraudResults() { - return fraudResults; - } - - public void setFraudResults(FraudResults value) { - this.fraudResults = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/ApprovePayoutRequest.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/ApprovePayoutRequest.java deleted file mode 100644 index 1a96f3643..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/ApprovePayoutRequest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payout; - - -/** - * class ApprovePayoutRequest - */ -public class ApprovePayoutRequest { - - private String datePayout = null; - - public String getDatePayout() { - return datePayout; - } - - public void setDatePayout(String value) { - this.datePayout = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/PayoutResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/PayoutResponse.java deleted file mode 100644 index f442efb2d..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/PayoutResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.payout; - -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutResult; - -/** - * class PayoutResponse - */ -public class PayoutResponse extends PayoutResult { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/Directory.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/Directory.java deleted file mode 100644 index f12a6cdb6..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/Directory.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.DirectoryEntry; -import java.util.List; - -/** - * class Directory - */ -public class Directory { - - private List entries = null; - - public List getEntries() { - return entries; - } - - public void setEntries(List value) { - this.entries = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductGroupResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductGroupResponse.java deleted file mode 100644 index 79e429b11..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductGroupResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductGroup; - -/** - * class PaymentProductGroupResponse - */ -public class PaymentProductGroupResponse extends PaymentProductGroup { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductGroups.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductGroups.java deleted file mode 100644 index fb95ed616..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductGroups.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductGroup; -import java.util.List; - -/** - * class PaymentProductGroups - */ -public class PaymentProductGroups { - - private List paymentProductGroups = null; - - public List getPaymentProductGroups() { - return paymentProductGroups; - } - - public void setPaymentProductGroups(List value) { - this.paymentProductGroups = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductResponse.java deleted file mode 100644 index b3dff6e7a..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProductResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProduct; - -/** - * class PaymentProductResponse - */ -public class PaymentProductResponse extends PaymentProduct { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProducts.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProducts.java deleted file mode 100644 index 3fc4c3a84..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/PaymentProducts.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProduct; -import java.util.List; - -/** - * class PaymentProducts - */ -public class PaymentProducts { - - private List paymentProducts = null; - - public List getPaymentProducts() { - return paymentProducts; - } - - public void setPaymentProducts(List value) { - this.paymentProducts = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFileAttribute.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFileAttribute.java deleted file mode 100644 index 309f744cc..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFileAttribute.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.KeyValuePair; - -public class AccountOnFileAttribute extends KeyValuePair { - - private String mustWriteReason = null; - - private String status = null; - - public String getMustWriteReason() { - return mustWriteReason; - } - - public void setMustWriteReason(String value) { - this.mustWriteReason = value; - } - - public String getStatus() { - return status; - } - - public void setStatus(String value) { - this.status = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFileDisplayHints.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFileDisplayHints.java deleted file mode 100644 index 7850f9b6e..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFileDisplayHints.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.LabelTemplateElement; -import java.util.List; - -public class AccountOnFileDisplayHints { - - private List labelTemplate = null; - - private String logo = null; - - public List getLabelTemplate() { - return labelTemplate; - } - - public void setLabelTemplate(List value) { - this.labelTemplate = value; - } - - public String getLogo() { - return logo; - } - - public void setLogo(String value) { - this.logo = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/EmptyValidator.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/EmptyValidator.java deleted file mode 100644 index 1633ed048..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/EmptyValidator.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - - -public class EmptyValidator { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/FixedListValidator.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/FixedListValidator.java deleted file mode 100644 index de4a9062a..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/FixedListValidator.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import java.util.List; - -public class FixedListValidator { - - private List allowedValues = null; - - public List getAllowedValues() { - return allowedValues; - } - - public void setAllowedValues(List value) { - this.allowedValues = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldDataRestrictions.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldDataRestrictions.java deleted file mode 100644 index 079405f93..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldDataRestrictions.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductFieldValidators; - -public class PaymentProductFieldDataRestrictions { - - private Boolean isRequired = null; - - private PaymentProductFieldValidators validators = null; - - public Boolean getIsRequired() { - return isRequired; - } - - public void setIsRequired(Boolean value) { - this.isRequired = value; - } - - public PaymentProductFieldValidators getValidators() { - return validators; - } - - public void setValidators(PaymentProductFieldValidators value) { - this.validators = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldFormElement.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldFormElement.java deleted file mode 100644 index 418f85a47..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldFormElement.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.ValueMappingElement; -import java.util.List; - -public class PaymentProductFieldFormElement { - - private String type = null; - - private List valueMapping = null; - - public String getType() { - return type; - } - - public void setType(String value) { - this.type = value; - } - - public List getValueMapping() { - return valueMapping; - } - - public void setValueMapping(List value) { - this.valueMapping = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldTooltip.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldTooltip.java deleted file mode 100644 index 7c8261ba0..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldTooltip.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - - -public class PaymentProductFieldTooltip { - - private String image = null; - - private String label = null; - - public String getImage() { - return image; - } - - public void setImage(String value) { - this.image = value; - } - - public String getLabel() { - return label; - } - - public void setLabel(String value) { - this.label = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/RegularExpressionValidator.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/RegularExpressionValidator.java deleted file mode 100644 index ed23773a5..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/RegularExpressionValidator.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - - -public class RegularExpressionValidator { - - private String regularExpression = null; - - public String getRegularExpression() { - return regularExpression; - } - - public void setRegularExpression(String value) { - this.regularExpression = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/ApproveRefundRequest.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/ApproveRefundRequest.java deleted file mode 100644 index 154b566ad..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/ApproveRefundRequest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.refund; - - -/** - * class ApproveRefundRequest - */ -public class ApproveRefundRequest { - - private Long amount = null; - - public Long getAmount() { - return amount; - } - - public void setAmount(Long value) { - this.amount = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundResponse.java deleted file mode 100644 index 1b577c567..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundResponse.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.refund; - -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundResult; - -/** - * class RefundResponse - */ -public class RefundResponse extends RefundResult { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/BankAccountBbanRefund.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/BankAccountBbanRefund.java deleted file mode 100644 index 9635f85d0..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/BankAccountBbanRefund.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.refund.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; - -public class BankAccountBbanRefund extends BankAccountBban { - - private String bankCity = null; - - private String swiftCode = null; - - public String getBankCity() { - return bankCity; - } - - public void setBankCity(String value) { - this.bankCity = value; - } - - public String getSwiftCode() { - return swiftCode; - } - - public void setSwiftCode(String value) { - this.swiftCode = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundReferences.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundReferences.java deleted file mode 100644 index 9f75f9fa6..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundReferences.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.refund.definitions; - - -public class RefundReferences { - - private String merchantReference = null; - - public String getMerchantReference() { - return merchantReference; - } - - public void setMerchantReference(String value) { - this.merchantReference = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentBankAccount.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentBankAccount.java deleted file mode 100644 index e584b9a2b..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentBankAccount.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.RiskAssessment; - -/** - * class RiskAssessmentBankAccount - */ -public class RiskAssessmentBankAccount extends RiskAssessment { - - private BankAccountBban bankAccountBban = null; - - private BankAccountIban bankAccountIban = null; - - public BankAccountBban getBankAccountBban() { - return bankAccountBban; - } - - public void setBankAccountBban(BankAccountBban value) { - this.bankAccountBban = value; - } - - public BankAccountIban getBankAccountIban() { - return bankAccountIban; - } - - public void setBankAccountIban(BankAccountIban value) { - this.bankAccountIban = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentCard.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentCard.java deleted file mode 100644 index 6310f484f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentCard.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Card; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.RiskAssessment; - -/** - * class RiskAssessmentCard - */ -public class RiskAssessmentCard extends RiskAssessment { - - private Card card = null; - - public Card getCard() { - return card; - } - - public void setCard(Card value) { - this.card = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentResponse.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentResponse.java deleted file mode 100644 index 03c4c4d49..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/RiskAssessmentResponse.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ResultDoRiskAssessment; -import java.util.List; - -/** - * class RiskAssessmentResponse - */ -public class RiskAssessmentResponse { - - private List results = null; - - public List getResults() { - return results; - } - - public void setResults(List value) { - this.results = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/PersonalInformationRiskAssessment.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/PersonalInformationRiskAssessment.java deleted file mode 100644 index 03b2028b9..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/PersonalInformationRiskAssessment.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions; - -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.PersonalNameRiskAssessment; - -public class PersonalInformationRiskAssessment { - - private PersonalNameRiskAssessment name = null; - - public PersonalNameRiskAssessment getName() { - return name; - } - - public void setName(PersonalNameRiskAssessment value) { - this.name = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/PersonalNameRiskAssessment.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/PersonalNameRiskAssessment.java deleted file mode 100644 index ce3925355..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/PersonalNameRiskAssessment.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.PersonalNameBase; - -public class PersonalNameRiskAssessment extends PersonalNameBase { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/BankDetailsRequest.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/BankDetailsRequest.java deleted file mode 100644 index 10176c774..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/BankDetailsRequest.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.services; - -import com.globalcollect.gateway.sdk.java.gc.services.definitions.BankDetails; - -/** - * class BankDetailsRequest - */ -public class BankDetailsRequest extends BankDetails { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/ConvertAmount.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/ConvertAmount.java deleted file mode 100644 index 8493617f9..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/ConvertAmount.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.services; - - -/** - * class ConvertAmount - */ -public class ConvertAmount { - - private Long convertedAmount = null; - - public Long getConvertedAmount() { - return convertedAmount; - } - - public void setConvertedAmount(Long value) { - this.convertedAmount = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/GetIINDetailsRequest.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/GetIINDetailsRequest.java deleted file mode 100644 index afbb9b3ae..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/GetIINDetailsRequest.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.services; - -import com.globalcollect.gateway.sdk.java.gc.services.definitions.PaymentContext; - -/** - * class GetIINDetailsRequest - */ -public class GetIINDetailsRequest { - - private String bin = null; - - private PaymentContext paymentContext = null; - - public String getBin() { - return bin; - } - - public void setBin(String value) { - this.bin = value; - } - - public PaymentContext getPaymentContext() { - return paymentContext; - } - - public void setPaymentContext(PaymentContext value) { - this.paymentContext = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/TestConnection.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/TestConnection.java deleted file mode 100644 index 08774aa09..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/TestConnection.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.services; - - -/** - * class TestConnection - */ -public class TestConnection { - - private String result = null; - - public String getResult() { - return result; - } - - public void setResult(String value) { - this.result = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/BankDetails.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/BankDetails.java deleted file mode 100644 index 75ce9dcf8..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/BankDetails.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.services.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; - -public class BankDetails { - - private BankAccountBban bankAccountBban = null; - - private BankAccountIban bankAccountIban = null; - - public BankAccountBban getBankAccountBban() { - return bankAccountBban; - } - - public void setBankAccountBban(BankAccountBban value) { - this.bankAccountBban = value; - } - - public BankAccountIban getBankAccountIban() { - return bankAccountIban; - } - - public void setBankAccountIban(BankAccountIban value) { - this.bankAccountIban = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/sessions/SessionRequest.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/sessions/SessionRequest.java deleted file mode 100644 index fe5b84eb8..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/sessions/SessionRequest.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.sessions; - -import java.util.List; - -/** - * class SessionRequest - */ -public class SessionRequest { - - private List tokens = null; - - public List getTokens() { - return tokens; - } - - public void setTokens(List value) { - this.tokens = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/ApproveTokenRequest.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/ApproveTokenRequest.java deleted file mode 100644 index 7b7ac1bd1..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/ApproveTokenRequest.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateApproval; - -/** - * class ApproveTokenRequest - */ -public class ApproveTokenRequest extends MandateApproval { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/AbstractToken.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/AbstractToken.java deleted file mode 100644 index f733af2cf..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/AbstractToken.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - - -public class AbstractToken { - - private String alias = null; - - public String getAlias() { - return alias; - } - - public void setAlias(String value) { - this.alias = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/ContactDetailsToken.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/ContactDetailsToken.java deleted file mode 100644 index d895c2431..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/ContactDetailsToken.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ContactDetailsBase; - -public class ContactDetailsToken extends ContactDetailsBase { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/CustomerToken.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/CustomerToken.java deleted file mode 100644 index 992a45ced..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/CustomerToken.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.PersonalInformationToken; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CustomerBase; - -public class CustomerToken extends CustomerBase { - - private Address billingAddress = null; - - private PersonalInformationToken personalInformation = null; - - public Address getBillingAddress() { - return billingAddress; - } - - public void setBillingAddress(Address value) { - this.billingAddress = value; - } - - public PersonalInformationToken getPersonalInformation() { - return personalInformation; - } - - public void setPersonalInformation(PersonalInformationToken value) { - this.personalInformation = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/CustomerTokenWithContactDetails.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/CustomerTokenWithContactDetails.java deleted file mode 100644 index c80e2c0ca..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/CustomerTokenWithContactDetails.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.ContactDetailsToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerToken; - -public class CustomerTokenWithContactDetails extends CustomerToken { - - private ContactDetailsToken contactDetails = null; - - public ContactDetailsToken getContactDetails() { - return contactDetails; - } - - public void setContactDetails(ContactDetailsToken value) { - this.contactDetails = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebit.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebit.java deleted file mode 100644 index 14362da29..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebit.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.Creditor; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateSepaDirectDebitWithMandateId; - -public class MandateSepaDirectDebit extends MandateSepaDirectDebitWithMandateId { - - private Creditor creditor = null; - - public Creditor getCreditor() { - return creditor; - } - - public void setCreditor(Creditor value) { - this.creditor = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebitWithMandateId.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebitWithMandateId.java deleted file mode 100644 index 32c87e83b..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebitWithMandateId.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateSepaDirectDebitWithoutCreditor; - -public class MandateSepaDirectDebitWithMandateId extends MandateSepaDirectDebitWithoutCreditor { - - private String mandateId = null; - - public String getMandateId() { - return mandateId; - } - - public void setMandateId(String value) { - this.mandateId = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/PersonalInformationToken.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/PersonalInformationToken.java deleted file mode 100644 index 995adeca1..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/PersonalInformationToken.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.PersonalNameToken; - -public class PersonalInformationToken { - - private PersonalNameToken name = null; - - public PersonalNameToken getName() { - return name; - } - - public void setName(PersonalNameToken value) { - this.name = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/PersonalNameToken.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/PersonalNameToken.java deleted file mode 100644 index adbc5630f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/PersonalNameToken.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.PersonalNameBase; - -public class PersonalNameToken extends PersonalNameBase { -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenCard.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenCard.java deleted file mode 100644 index f32657129..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenCard.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCardData; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.AbstractToken; - -public class TokenCard extends AbstractToken { - - private CustomerToken customer = null; - - private TokenCardData data = null; - - public CustomerToken getCustomer() { - return customer; - } - - public void setCustomer(CustomerToken value) { - this.customer = value; - } - - public TokenCardData getData() { - return data; - } - - public void setData(TokenCardData value) { - this.data = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenEWallet.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenEWallet.java deleted file mode 100644 index 2dee3fd20..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenEWallet.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenEWalletData; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.AbstractToken; - -public class TokenEWallet extends AbstractToken { - - private CustomerToken customer = null; - - private TokenEWalletData data = null; - - public CustomerToken getCustomer() { - return customer; - } - - public void setCustomer(CustomerToken value) { - this.customer = value; - } - - public TokenEWalletData getData() { - return data; - } - - public void setData(TokenEWalletData value) { - this.data = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenEWalletData.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenEWalletData.java deleted file mode 100644 index fdd5bdfbd..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenEWalletData.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - - -public class TokenEWalletData { - - private String billingAgreementId = null; - - public String getBillingAgreementId() { - return billingAgreementId; - } - - public void setBillingAgreementId(String value) { - this.billingAgreementId = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebit.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebit.java deleted file mode 100644 index e7a72464b..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebit.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerToken; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateNonSepaDirectDebit; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.AbstractToken; - -public class TokenNonSepaDirectDebit extends AbstractToken { - - private CustomerToken customer = null; - - private MandateNonSepaDirectDebit mandate = null; - - public CustomerToken getCustomer() { - return customer; - } - - public void setCustomer(CustomerToken value) { - this.customer = value; - } - - public MandateNonSepaDirectDebit getMandate() { - return mandate; - } - - public void setMandate(MandateNonSepaDirectDebit value) { - this.mandate = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebitPaymentProduct705SpecificData.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebitPaymentProduct705SpecificData.java deleted file mode 100644 index e41bd813f..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebitPaymentProduct705SpecificData.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; - -public class TokenNonSepaDirectDebitPaymentProduct705SpecificData { - - private String authorisationId = null; - - private BankAccountBban bankAccountBban = null; - - public String getAuthorisationId() { - return authorisationId; - } - - public void setAuthorisationId(String value) { - this.authorisationId = value; - } - - public BankAccountBban getBankAccountBban() { - return bankAccountBban; - } - - public void setBankAccountBban(BankAccountBban value) { - this.bankAccountBban = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenSepaDirectDebit.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenSepaDirectDebit.java deleted file mode 100644 index 2d9734ffd..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenSepaDirectDebit.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerTokenWithContactDetails; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateSepaDirectDebit; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.AbstractToken; - -public class TokenSepaDirectDebit extends AbstractToken { - - private CustomerTokenWithContactDetails customer = null; - - private MandateSepaDirectDebit mandate = null; - - public CustomerTokenWithContactDetails getCustomer() { - return customer; - } - - public void setCustomer(CustomerTokenWithContactDetails value) { - this.customer = value; - } - - public MandateSepaDirectDebit getMandate() { - return mandate; - } - - public void setMandate(MandateSepaDirectDebit value) { - this.mandate = value; - } -} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenSepaDirectDebitWithoutCreditor.java b/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenSepaDirectDebitWithoutCreditor.java deleted file mode 100644 index 9deaf1f02..000000000 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenSepaDirectDebitWithoutCreditor.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.CustomerTokenWithContactDetails; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateSepaDirectDebitWithoutCreditor; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.AbstractToken; - -public class TokenSepaDirectDebitWithoutCreditor extends AbstractToken { - - private CustomerTokenWithContactDetails customer = null; - - private MandateSepaDirectDebitWithoutCreditor mandate = null; - - public CustomerTokenWithContactDetails getCustomer() { - return customer; - } - - public void setCustomer(CustomerTokenWithContactDetails value) { - this.customer = value; - } - - public MandateSepaDirectDebitWithoutCreditor getMandate() { - return mandate; - } - - public void setMandate(MandateSepaDirectDebitWithoutCreditor value) { - this.mandate = value; - } -} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/Client.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/Client.java new file mode 100644 index 000000000..5ae8b83d1 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/Client.java @@ -0,0 +1,123 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java; + +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.Communicator; +import com.ingenico.connect.gateway.sdk.java.MarshallerSyntaxException; +import com.ingenico.connect.gateway.sdk.java.PooledConnection; +import com.ingenico.connect.gateway.sdk.java.logging.CommunicatorLogger; +import com.ingenico.connect.gateway.sdk.java.logging.LoggingCapable; +import com.ingenico.connect.gateway.sdk.java.merchant.MerchantClient; +import java.io.Closeable; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.Collections; +import java.util.Map; +import java.util.TreeMap; +import java.util.concurrent.TimeUnit; +import org.apache.commons.codec.binary.Base64; + +/** + * GlobalCollect platform client. + *

+ * This client and all its child clients are bound to one specific value for the X-GCS-ClientMetaInfo header. + * To get a new client with a different header value, use {@link #withClientMetaInfo(String)}. + *

+ * Thread-safe. + */ +public class Client extends ApiResource implements Closeable, LoggingCapable { + + public static final String API_VERSION = "v1"; + + private static final Charset CHARSET = Charset.forName("UTF-8"); + + public Client(Communicator communicator) { + this(communicator, null); + } + + private Client(Communicator communicator, String clientMetaInfo) { + super(communicator, clientMetaInfo, Collections.singletonMap("apiVersion", API_VERSION)); + } + + /** + * Returns a new {@link Client} which uses the passed meta data for the + * X-GCS-ClientMetaInfo header. + * + * @param clientMetaInfo + * JSON string containing the meta data for the client + * @throws MarshallerSyntaxException + * if the given clientMetaInfo is not a valid JSON string + */ + public Client withClientMetaInfo(String clientMetaInfo) { + + if (this.clientMetaInfo == null && clientMetaInfo == null) { + return this; + } else if (clientMetaInfo == null) { + return new Client(communicator, null); + } else { + // Checking to see if this is valid JSON (no JSON parse exceptions) + communicator.getMarshaller().unmarshal(clientMetaInfo, Object.class); + + clientMetaInfo = Base64.encodeBase64String(clientMetaInfo.getBytes(CHARSET)); + + if (clientMetaInfo.equals(this.clientMetaInfo)) { + return this; + } else { + return new Client(communicator, clientMetaInfo); + } + } + } + + /** + * Utility method that delegates the call to this client's communicator. + * @see Communicator#closeIdleConnections(long, TimeUnit) + * @see PooledConnection#closeIdleConnections(long, TimeUnit) + */ + public void closeIdleConnections(long idleTime, TimeUnit timeUnit) { + communicator.closeIdleConnections(idleTime, timeUnit); + } + + /** + * Utility method that delegates the call to this client's communicator. + * @see Communicator#closeExpiredConnections() + * @see PooledConnection#closeExpiredConnections() + */ + public void closeExpiredConnections() { + communicator.closeExpiredConnections(); + } + + @Override + public void enableLogging(CommunicatorLogger communicatorLogger) { + // delegate to the communicator + communicator.enableLogging(communicatorLogger); + } + + @Override + public void disableLogging() { + // delegate to the communicator + communicator.disableLogging(); + } + + /** + * Releases any system resources associated with this object. + */ + @Override + public void close() throws IOException { + communicator.close(); + } + + /** + * Resource /{merchantId} + * + * @param merchantId String + * @return MerchantClient + */ + public MerchantClient merchant(String merchantId) { + Map subContext = new TreeMap(); + subContext.put("merchantId", merchantId); + return new MerchantClient(this, subContext); + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AbstractOrderStatus.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AbstractOrderStatus.java new file mode 100644 index 000000000..ac258317b --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AbstractOrderStatus.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + + +/** + * Class AbstractOrderStatus + */ +public class AbstractOrderStatus { + + private String id = null; + + public String getId() { + return id; + } + + public void setId(String value) { + this.id = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AbstractPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AbstractPaymentMethodSpecificInput.java new file mode 100644 index 000000000..3d451bc56 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AbstractPaymentMethodSpecificInput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + + +/** + * Class AbstractPaymentMethodSpecificInput + */ +public class AbstractPaymentMethodSpecificInput { + + private Integer paymentProductId = null; + + public Integer getPaymentProductId() { + return paymentProductId; + } + + public void setPaymentProductId(Integer value) { + this.paymentProductId = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AdditionalOrderInputAirlineData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AdditionalOrderInputAirlineData.java new file mode 100644 index 000000000..1b6ba904c --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AdditionalOrderInputAirlineData.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineData; + +/** + * Class AdditionalOrderInputAirlineData + */ +public class AdditionalOrderInputAirlineData { + + private AirlineData airlineData = null; + + public AirlineData getAirlineData() { + return airlineData; + } + + public void setAirlineData(AirlineData value) { + this.airlineData = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/Address.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/Address.java similarity index 80% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/Address.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/Address.java index ead6e5b0d..5be665e76 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/Address.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/Address.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class Address + */ public class Address { private String additionalInfo = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AirlineData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AirlineData.java similarity index 89% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AirlineData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AirlineData.java index e68169252..db2092702 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AirlineData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AirlineData.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AirlineFlightLeg; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineFlightLeg; import java.util.List; +/** + * Class AirlineData + */ public class AirlineData { private String agentNumericCode = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AirlineFlightLeg.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AirlineFlightLeg.java similarity index 84% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AirlineFlightLeg.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AirlineFlightLeg.java index 5ddf0527b..fa7c5e142 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AirlineFlightLeg.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AirlineFlightLeg.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class AirlineFlightLeg + */ public class AirlineFlightLeg { private String airlineClass = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AmountOfMoney.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AmountOfMoney.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AmountOfMoney.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AmountOfMoney.java index b9c5efada..8ccd60207 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/AmountOfMoney.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/AmountOfMoney.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class AmountOfMoney + */ public class AmountOfMoney { private Long amount = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccount.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccount.java new file mode 100644 index 000000000..0b22919a4 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccount.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + + +/** + * Class BankAccount + */ +public class BankAccount { + + private String accountHolderName = null; + + public String getAccountHolderName() { + return accountHolderName; + } + + public void setAccountHolderName(String value) { + this.accountHolderName = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccountBban.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccountBban.java similarity index 72% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccountBban.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccountBban.java index 370644e04..e49da91d2 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/BankAccountBban.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccountBban.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccount; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccount; +/** + * Class BankAccountBban + */ public class BankAccountBban extends BankAccount { private String accountNumber = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccountIban.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccountIban.java new file mode 100644 index 000000000..9524b267a --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/BankAccountIban.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccount; + +/** + * Class BankAccountIban + */ +public class BankAccountIban extends BankAccount { + + private String iban = null; + + public String getIban() { + return iban; + } + + public void setIban(String value) { + this.iban = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/Card.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/Card.java new file mode 100644 index 000000000..34e739f21 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/Card.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CardWithoutCvv; + +/** + * Class Card + */ +public class Card extends CardWithoutCvv { + + private String cvv = null; + + public String getCvv() { + return cvv; + } + + public void setCvv(String value) { + this.cvv = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardEssentials.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardEssentials.java similarity index 52% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardEssentials.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardEssentials.java index cfc98c695..7a3deb08c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardEssentials.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardEssentials.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class CardEssentials + */ public class CardEssentials { private String cardNumber = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardFraudResults.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardFraudResults.java similarity index 55% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardFraudResults.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardFraudResults.java index 0946ac139..5c0036622 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardFraudResults.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardFraudResults.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.FraudResultsRetailDecisions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.FraudResults; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.FraudResultsRetailDecisions; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.FraudResults; + +/** + * Class CardFraudResults + */ public class CardFraudResults extends FraudResults { private String avsResult = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardWithoutCvv.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardWithoutCvv.java similarity index 50% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardWithoutCvv.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardWithoutCvv.java index f09ae798d..935ad4751 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CardWithoutCvv.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CardWithoutCvv.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CardEssentials; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CardEssentials; +/** + * Class CardWithoutCvv + */ public class CardWithoutCvv extends CardEssentials { private String cardholderName = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CompanyInformation.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CompanyInformation.java new file mode 100644 index 000000000..826259b5a --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CompanyInformation.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + + +/** + * Class CompanyInformation + */ +public class CompanyInformation { + + private String name = null; + + public String getName() { + return name; + } + + public void setName(String value) { + this.name = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ContactDetailsBase.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ContactDetailsBase.java similarity index 54% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ContactDetailsBase.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ContactDetailsBase.java index a7eee4863..b32480dfe 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ContactDetailsBase.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ContactDetailsBase.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class ContactDetailsBase + */ public class ContactDetailsBase { private String emailAddress = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CustomerBase.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CustomerBase.java similarity index 60% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CustomerBase.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CustomerBase.java index fa03b873c..85960cf5c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/CustomerBase.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/CustomerBase.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CompanyInformation; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation; +/** + * Class CustomerBase + */ public class CustomerBase { private CompanyInformation companyInformation = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudFields.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudFields.java similarity index 87% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudFields.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudFields.java index 4db79e69f..d02910fa4 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudFields.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudFields.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; import java.util.List; +/** + * Class FraudFields + */ public class FraudFields { private String customerIpAddress = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudResults.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudResults.java new file mode 100644 index 000000000..e75100ee7 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudResults.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + + +/** + * Class FraudResults + */ +public class FraudResults { + + private String fraudServiceResult = null; + + public String getFraudServiceResult() { + return fraudServiceResult; + } + + public void setFraudServiceResult(String value) { + this.fraudServiceResult = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudResultsRetailDecisions.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudResultsRetailDecisions.java similarity index 60% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudResultsRetailDecisions.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudResultsRetailDecisions.java index 6420a1faa..c8cded4e8 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/FraudResultsRetailDecisions.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/FraudResultsRetailDecisions.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class FraudResultsRetailDecisions + */ public class FraudResultsRetailDecisions { private String fraudCode = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/KeyValuePair.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/KeyValuePair.java new file mode 100644 index 000000000..d41de190e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/KeyValuePair.java @@ -0,0 +1,32 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + + +/** + * Class KeyValuePair + */ +public class KeyValuePair { + + private String key = null; + + private String value = null; + + public String getKey() { + return key; + } + + public void setKey(String value) { + this.key = value; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/OrderStatusOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/OrderStatusOutput.java similarity index 70% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/OrderStatusOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/OrderStatusOutput.java index 5a9e99895..d6b427e52 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/OrderStatusOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/OrderStatusOutput.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; import java.util.List; +/** + * Class OrderStatusOutput + */ public class OrderStatusOutput { private List errors = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/PaymentProductFilter.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/PaymentProductFilter.java new file mode 100644 index 000000000..274ccca93 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/PaymentProductFilter.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + +import java.util.List; + +/** + * Class PaymentProductFilter + */ +public class PaymentProductFilter { + + private List groups = null; + + private List products = null; + + public List getGroups() { + return groups; + } + + public void setGroups(List value) { + this.groups = value; + } + + public List getProducts() { + return products; + } + + public void setProducts(List value) { + this.products = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/PersonalNameBase.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/PersonalNameBase.java similarity index 61% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/PersonalNameBase.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/PersonalNameBase.java index 45d164275..92fa5b64a 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/PersonalNameBase.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/PersonalNameBase.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class PersonalNameBase + */ public class PersonalNameBase { private String firstName = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ResultDoRiskAssessment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ResultDoRiskAssessment.java similarity index 65% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ResultDoRiskAssessment.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ResultDoRiskAssessment.java index b1ab5ac68..54ed85583 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ResultDoRiskAssessment.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ResultDoRiskAssessment.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.RetailDecisionsCCFraudCheckOutput; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ValidationBankAccountOutput; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.RetailDecisionsCCFraudCheckOutput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ValidationBankAccountOutput; + +/** + * Class ResultDoRiskAssessment + */ public class ResultDoRiskAssessment { private String category = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/RetailDecisionsCCFraudCheckOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/RetailDecisionsCCFraudCheckOutput.java similarity index 59% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/RetailDecisionsCCFraudCheckOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/RetailDecisionsCCFraudCheckOutput.java index c0c77a2cc..0b30ad849 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/RetailDecisionsCCFraudCheckOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/RetailDecisionsCCFraudCheckOutput.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class RetailDecisionsCCFraudCheckOutput + */ public class RetailDecisionsCCFraudCheckOutput { private String fraudCode = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ValidationBankAccountCheck.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ValidationBankAccountCheck.java similarity index 58% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ValidationBankAccountCheck.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ValidationBankAccountCheck.java index 7b68c15fb..5736b7e13 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ValidationBankAccountCheck.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ValidationBankAccountCheck.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; +/** + * Class ValidationBankAccountCheck + */ public class ValidationBankAccountCheck { private String code = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ValidationBankAccountOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ValidationBankAccountOutput.java similarity index 71% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ValidationBankAccountOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ValidationBankAccountOutput.java index 85e1814a2..3e9e2efa0 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/fei/definitions/ValidationBankAccountOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/definitions/ValidationBankAccountOutput.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.fei.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ValidationBankAccountCheck; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ValidationBankAccountCheck; import java.util.List; +/** + * Class ValidationBankAccountOutput + */ public class ValidationBankAccountOutput { private List checks = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/errors/ErrorResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/errors/ErrorResponse.java new file mode 100644 index 000000000..922388609 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/errors/ErrorResponse.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.errors; + +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import java.util.List; + +/** + * Class ErrorResponse + */ +public class ErrorResponse { + + private String errorId = null; + + private List errors = null; + + public String getErrorId() { + return errorId; + } + + public void setErrorId(String value) { + this.errorId = value; + } + + public List getErrors() { + return errors; + } + + public void setErrors(List value) { + this.errors = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/errors/definitions/APIError.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/errors/definitions/APIError.java similarity index 72% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/errors/definitions/APIError.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/errors/definitions/APIError.java index feab2b5be..5af1f80a0 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/errors/definitions/APIError.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/errors/definitions/APIError.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.errors.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.errors.definitions; +/** + * Class APIError + */ public class APIError { private String code = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/CreateHostedCheckoutRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/CreateHostedCheckoutRequest.java similarity index 67% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/CreateHostedCheckoutRequest.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/CreateHostedCheckoutRequest.java index d7e64e6ac..4e13d12e5 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/CreateHostedCheckoutRequest.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/CreateHostedCheckoutRequest.java @@ -1,15 +1,19 @@ -package com.globalcollect.gateway.sdk.java.gc.hostedcheckout; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.FraudFields; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.definitions.HostedCheckoutSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.BankTransferPaymentMethodSpecificInputBase; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificInputBase; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CashPaymentMethodSpecificInputBase; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentMethodSpecificInputBase; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.FraudFields; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions.HostedCheckoutSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.BankTransferPaymentMethodSpecificInputBase; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificInputBase; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CashPaymentMethodSpecificInputBase; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentMethodSpecificInputBase; /** - * class CreateHostedCheckoutRequest + * Class CreateHostedCheckoutRequest */ public class CreateHostedCheckoutRequest { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/CreateHostedCheckoutResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/CreateHostedCheckoutResponse.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/CreateHostedCheckoutResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/CreateHostedCheckoutResponse.java index 33ed5984d..dc4badce7 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/CreateHostedCheckoutResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/CreateHostedCheckoutResponse.java @@ -1,8 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.hostedcheckout; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout; +import java.util.List; /** - * class CreateHostedCheckoutResponse + * Class CreateHostedCheckoutResponse */ public class CreateHostedCheckoutResponse { @@ -10,6 +15,8 @@ public class CreateHostedCheckoutResponse { private String hostedCheckoutId = null; + private List invalidTokens = null; + private String partialRedirectUrl = null; public String getRETURNMAC() { @@ -28,6 +35,14 @@ public void setHostedCheckoutId(String value) { this.hostedCheckoutId = value; } + public List getInvalidTokens() { + return invalidTokens; + } + + public void setInvalidTokens(List value) { + this.invalidTokens = value; + } + public String getPartialRedirectUrl() { return partialRedirectUrl; } diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/GetHostedCheckoutResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/GetHostedCheckoutResponse.java similarity index 50% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/GetHostedCheckoutResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/GetHostedCheckoutResponse.java index 6d6c68c63..737d7a37b 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/GetHostedCheckoutResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/GetHostedCheckoutResponse.java @@ -1,9 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.hostedcheckout; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout; -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.definitions.CreatedPaymentOutput; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions.CreatedPaymentOutput; /** - * class GetHostedCheckoutResponse + * Class GetHostedCheckoutResponse */ public class GetHostedCheckoutResponse { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/CreatedPaymentOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/CreatedPaymentOutput.java similarity index 62% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/CreatedPaymentOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/CreatedPaymentOutput.java index 62b2feea5..60ae62636 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/CreatedPaymentOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/CreatedPaymentOutput.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.hostedcheckout.definitions; - -import com.globalcollect.gateway.sdk.java.gc.hostedcheckout.definitions.DisplayedData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Payment; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentCreationReferences; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions.DisplayedData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Payment; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentCreationReferences; + +/** + * Class CreatedPaymentOutput + */ public class CreatedPaymentOutput { private DisplayedData displayedData = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/DisplayedData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/DisplayedData.java similarity index 59% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/DisplayedData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/DisplayedData.java index aa4ab1084..d9751856a 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/DisplayedData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/DisplayedData.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.hostedcheckout.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.KeyValuePair; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.KeyValuePair; import java.util.List; +/** + * Class DisplayedData + */ public class DisplayedData { private String displayedDataType = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/HostedCheckoutSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/HostedCheckoutSpecificInput.java similarity index 56% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/HostedCheckoutSpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/HostedCheckoutSpecificInput.java index ab237e411..5d6d867c5 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/hostedcheckout/definitions/HostedCheckoutSpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/HostedCheckoutSpecificInput.java @@ -1,12 +1,22 @@ -package com.globalcollect.gateway.sdk.java.gc.hostedcheckout.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions.PaymentProductFiltersHostedCheckout; +/** + * Class HostedCheckoutSpecificInput + */ public class HostedCheckoutSpecificInput { private Boolean isRecurring = null; private String locale = null; + private PaymentProductFiltersHostedCheckout paymentProductFilters = null; + private String returnUrl = null; private Boolean showResultPage = null; @@ -31,6 +41,14 @@ public void setLocale(String value) { this.locale = value; } + public PaymentProductFiltersHostedCheckout getPaymentProductFilters() { + return paymentProductFilters; + } + + public void setPaymentProductFilters(PaymentProductFiltersHostedCheckout value) { + this.paymentProductFilters = value; + } + public String getReturnUrl() { return returnUrl; } diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/PaymentProductFiltersHostedCheckout.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/PaymentProductFiltersHostedCheckout.java new file mode 100644 index 000000000..eeeafd982 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/hostedcheckout/definitions/PaymentProductFiltersHostedCheckout.java @@ -0,0 +1,43 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.PaymentProductFilter; + +/** + * Class PaymentProductFiltersHostedCheckout + */ +public class PaymentProductFiltersHostedCheckout { + + private PaymentProductFilter exclude = null; + + private PaymentProductFilter restrictTo = null; + + private Boolean tokensOnly = null; + + public PaymentProductFilter getExclude() { + return exclude; + } + + public void setExclude(PaymentProductFilter value) { + this.exclude = value; + } + + public PaymentProductFilter getRestrictTo() { + return restrictTo; + } + + public void setRestrictTo(PaymentProductFilter value) { + this.restrictTo = value; + } + + public Boolean getTokensOnly() { + return tokensOnly; + } + + public void setTokensOnly(Boolean value) { + this.tokensOnly = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/ApprovePaymentRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/ApprovePaymentRequest.java similarity index 65% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/ApprovePaymentRequest.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/ApprovePaymentRequest.java index 25681be9f..7db9d9444 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/ApprovePaymentRequest.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/ApprovePaymentRequest.java @@ -1,11 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderApprovePayment; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderApprovePayment; /** - * class ApprovePaymentRequest + * Class ApprovePaymentRequest */ public class ApprovePaymentRequest { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CancelApprovalPaymentResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CancelApprovalPaymentResponse.java new file mode 100644 index 000000000..c1bd00384 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CancelApprovalPaymentResponse.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Payment; + +/** + * Class CancelApprovalPaymentResponse + */ +public class CancelApprovalPaymentResponse { + + private Payment payment = null; + + public Payment getPayment() { + return payment; + } + + public void setPayment(Payment value) { + this.payment = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CancelPaymentResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CancelPaymentResponse.java similarity index 52% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CancelPaymentResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CancelPaymentResponse.java index 0fba17817..b37673c96 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CancelPaymentResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CancelPaymentResponse.java @@ -1,10 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CancelPaymentCardPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Payment; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CancelPaymentCardPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Payment; /** - * class CancelPaymentResponse + * Class CancelPaymentResponse */ public class CancelPaymentResponse { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CreatePaymentRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CreatePaymentRequest.java similarity index 72% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CreatePaymentRequest.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CreatePaymentRequest.java index 698e6c4e0..dcb8d8db6 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/CreatePaymentRequest.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CreatePaymentRequest.java @@ -1,17 +1,21 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.FraudFields; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.BankTransferPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CashPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.InvoicePaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.NonSepaDirectDebitPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.SepaDirectDebitPaymentMethodSpecificInput; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.FraudFields; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.BankTransferPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CashPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.InvoicePaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.NonSepaDirectDebitPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.SepaDirectDebitPaymentMethodSpecificInput; /** - * class CreatePaymentRequest + * Class CreatePaymentRequest */ public class CreatePaymentRequest { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CreatePaymentResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CreatePaymentResponse.java new file mode 100644 index 000000000..cf61530b0 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/CreatePaymentResponse.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CreatePaymentResult; + +/** + * Class CreatePaymentResponse + */ +public class CreatePaymentResponse extends CreatePaymentResult { +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentApprovalResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentApprovalResponse.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentApprovalResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentApprovalResponse.java index 0aad61898..34b1819fb 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentApprovalResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentApprovalResponse.java @@ -1,10 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ApprovePaymentCardPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Payment; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ApprovePaymentCardPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Payment; /** - * class PaymentApprovalResponse + * Class PaymentApprovalResponse */ public class PaymentApprovalResponse { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentErrorResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentErrorResponse.java similarity index 54% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentErrorResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentErrorResponse.java index f8567af2d..b2893f177 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/PaymentErrorResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentErrorResponse.java @@ -1,11 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.payment; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CreatePaymentResult; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CreatePaymentResult; import java.util.List; /** - * class PaymentErrorResponse + * Class PaymentErrorResponse */ public class PaymentErrorResponse { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentResponse.java new file mode 100644 index 000000000..4b9491ade --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/PaymentResponse.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Payment; + +/** + * Class PaymentResponse + */ +public class PaymentResponse extends Payment { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/TokenizePaymentRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/TokenizePaymentRequest.java new file mode 100644 index 000000000..25ad3217e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/TokenizePaymentRequest.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment; + + +/** + * Class TokenizePaymentRequest + */ +public class TokenizePaymentRequest { + + private String alias = null; + + public String getAlias() { + return alias; + } + + public void setAlias(String value) { + this.alias = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AbstractPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AbstractPaymentMethodSpecificOutput.java new file mode 100644 index 000000000..5ec9dc4b9 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AbstractPaymentMethodSpecificOutput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class AbstractPaymentMethodSpecificOutput + */ +public class AbstractPaymentMethodSpecificOutput { + + private Integer paymentProductId = null; + + public Integer getPaymentProductId() { + return paymentProductId; + } + + public void setPaymentProductId(Integer value) { + this.paymentProductId = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AdditionalOrderInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AdditionalOrderInput.java similarity index 63% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AdditionalOrderInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AdditionalOrderInput.java index d5fd33124..3a9b08162 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/AdditionalOrderInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AdditionalOrderInput.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AirlineData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Level3SummaryData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderTypeInformation; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Level3SummaryData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderTypeInformation; + +/** + * Class AdditionalOrderInput + */ public class AdditionalOrderInput { private AirlineData airlineData = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AddressPersonal.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AddressPersonal.java new file mode 100644 index 000000000..a0b91c3c8 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/AddressPersonal.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; + +/** + * Class AddressPersonal + */ +public class AddressPersonal extends Address { + + private PersonalName name = null; + + public PersonalName getName() { + return name; + } + + public void setName(PersonalName value) { + this.name = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentCardPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentCardPaymentMethodSpecificOutput.java new file mode 100644 index 000000000..fb7501113 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentCardPaymentMethodSpecificOutput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class ApprovePaymentCardPaymentMethodSpecificOutput + */ +public class ApprovePaymentCardPaymentMethodSpecificOutput { + + private String voidResponseId = null; + + public String getVoidResponseId() { + return voidResponseId; + } + + public void setVoidResponseId(String value) { + this.voidResponseId = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput.java new file mode 100644 index 000000000..d83f3c715 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ApprovePaymentPaymentMethodSpecificInput; + +/** + * Class ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput + */ +public class ApprovePaymentNonSepaDirectDebitPaymentMethodSpecificInput extends ApprovePaymentPaymentMethodSpecificInput { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentPaymentMethodSpecificInput.java new file mode 100644 index 000000000..eb33ea2c5 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentPaymentMethodSpecificInput.java @@ -0,0 +1,32 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class ApprovePaymentPaymentMethodSpecificInput + */ +public class ApprovePaymentPaymentMethodSpecificInput { + + private String dateCollect = null; + + private String token = null; + + public String getDateCollect() { + return dateCollect; + } + + public void setDateCollect(String value) { + this.dateCollect = value; + } + + public String getToken() { + return token; + } + + public void setToken(String value) { + this.token = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.java new file mode 100644 index 000000000..606f287fe --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ApprovePaymentPaymentMethodSpecificInput; + +/** + * Class ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput + */ +public class ApprovePaymentSepaDirectDebitPaymentMethodSpecificInput extends ApprovePaymentPaymentMethodSpecificInput { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificInput.java new file mode 100644 index 000000000..d7337b73d --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificInput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.BankTransferPaymentMethodSpecificInputBase; + +/** + * Class BankTransferPaymentMethodSpecificInput + */ +public class BankTransferPaymentMethodSpecificInput extends BankTransferPaymentMethodSpecificInputBase { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificInputBase.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificInputBase.java new file mode 100644 index 000000000..1afcc24f6 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificInputBase.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractPaymentMethodSpecificInput; + +/** + * Class BankTransferPaymentMethodSpecificInputBase + */ +public class BankTransferPaymentMethodSpecificInputBase extends AbstractPaymentMethodSpecificInput { + + private String additionalReference = null; + + public String getAdditionalReference() { + return additionalReference; + } + + public void setAdditionalReference(String value) { + this.additionalReference = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificOutput.java new file mode 100644 index 000000000..863517c09 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/BankTransferPaymentMethodSpecificOutput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AbstractPaymentMethodSpecificOutput; + +/** + * Class BankTransferPaymentMethodSpecificOutput + */ +public class BankTransferPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CancelPaymentCardPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CancelPaymentCardPaymentMethodSpecificOutput.java new file mode 100644 index 000000000..2a72cf621 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CancelPaymentCardPaymentMethodSpecificOutput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class CancelPaymentCardPaymentMethodSpecificOutput + */ +public class CancelPaymentCardPaymentMethodSpecificOutput { + + private String voidResponseId = null; + + public String getVoidResponseId() { + return voidResponseId; + } + + public void setVoidResponseId(String value) { + this.voidResponseId = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificInput.java similarity index 58% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificInput.java index cbfe8e2dd..481261e6a 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificInput.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Card; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ExternalCardholderAuthenticationData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificInputBase; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Card; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ExternalCardholderAuthenticationData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificInputBase; + +/** + * Class CardPaymentMethodSpecificInput + */ public class CardPaymentMethodSpecificInput extends CardPaymentMethodSpecificInputBase { private Card card = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificInputBase.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificInputBase.java similarity index 70% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificInputBase.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificInputBase.java index ab01a32bd..fa5564ce2 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificInputBase.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificInputBase.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractPaymentMethodSpecificInput; +/** + * Class CardPaymentMethodSpecificInputBase + */ public class CardPaymentMethodSpecificInputBase extends AbstractPaymentMethodSpecificInput { private String customerReference = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificOutput.java similarity index 55% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificOutput.java index 0669663d0..65c763414 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CardPaymentMethodSpecificOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CardPaymentMethodSpecificOutput.java @@ -1,10 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CardEssentials; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CardFraudResults; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ThreeDSecureResults; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AbstractPaymentMethodSpecificOutput; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CardEssentials; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CardFraudResults; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ThreeDSecureResults; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AbstractPaymentMethodSpecificOutput; + +/** + * Class CardPaymentMethodSpecificOutput + */ public class CardPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { private String authorisationCode = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificInput.java similarity index 53% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificInput.java index 40b609886..c70a7d31e 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CashPaymentMethodSpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificInput.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CashPaymentProduct1503SpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CashPaymentProduct1504SpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CashPaymentMethodSpecificInputBase; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CashPaymentProduct1503SpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CashPaymentProduct1504SpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CashPaymentMethodSpecificInputBase; + +/** + * Class CashPaymentMethodSpecificInput + */ public class CashPaymentMethodSpecificInput extends CashPaymentMethodSpecificInputBase { private CashPaymentProduct1503SpecificInput paymentProduct1503SpecificInput = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificInputBase.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificInputBase.java new file mode 100644 index 000000000..e5da5da21 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificInputBase.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractPaymentMethodSpecificInput; + +/** + * Class CashPaymentMethodSpecificInputBase + */ +public class CashPaymentMethodSpecificInputBase extends AbstractPaymentMethodSpecificInput { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificOutput.java new file mode 100644 index 000000000..693d94b79 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentMethodSpecificOutput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AbstractPaymentMethodSpecificOutput; + +/** + * Class CashPaymentMethodSpecificOutput + */ +public class CashPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentProduct1503SpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentProduct1503SpecificInput.java new file mode 100644 index 000000000..fe5765eb9 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentProduct1503SpecificInput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class CashPaymentProduct1503SpecificInput + */ +public class CashPaymentProduct1503SpecificInput { + + private String returnUrl = null; + + public String getReturnUrl() { + return returnUrl; + } + + public void setReturnUrl(String value) { + this.returnUrl = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentProduct1504SpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentProduct1504SpecificInput.java new file mode 100644 index 000000000..49533507e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CashPaymentProduct1504SpecificInput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class CashPaymentProduct1504SpecificInput + */ +public class CashPaymentProduct1504SpecificInput { + + private String returnUrl = null; + + public String getReturnUrl() { + return returnUrl; + } + + public void setReturnUrl(String value) { + this.returnUrl = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ContactDetails.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ContactDetails.java new file mode 100644 index 000000000..4d80cd970 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ContactDetails.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase; + +/** + * Class ContactDetails + */ +public class ContactDetails extends ContactDetailsBase { + + private String faxNumber = null; + + private String phoneNumber = null; + + public String getFaxNumber() { + return faxNumber; + } + + public void setFaxNumber(String value) { + this.faxNumber = value; + } + + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(String value) { + this.phoneNumber = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CreatePaymentResult.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CreatePaymentResult.java similarity index 50% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CreatePaymentResult.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CreatePaymentResult.java index 3b85d9b42..8f2fa2730 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/CreatePaymentResult.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/CreatePaymentResult.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.MerchantAction; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Payment; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentCreationOutput; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.MerchantAction; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Payment; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentCreationOutput; + +/** + * Class CreatePaymentResult + */ public class CreatePaymentResult { private PaymentCreationOutput creationOutput = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Customer.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Customer.java similarity index 62% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Customer.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Customer.java index 37aebc5c8..9e75ab5c9 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Customer.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Customer.java @@ -1,11 +1,18 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AddressPersonal; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.ContactDetails; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalInformation; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CustomerBase; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AddressPersonal; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.ContactDetails; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalInformation; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CustomerBase; + +/** + * Class Customer + */ public class Customer extends CustomerBase { private Address billingAddress = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ExternalCardholderAuthenticationData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ExternalCardholderAuthenticationData.java similarity index 68% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ExternalCardholderAuthenticationData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ExternalCardholderAuthenticationData.java index e4fe89a7a..3cd038e46 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ExternalCardholderAuthenticationData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ExternalCardholderAuthenticationData.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class ExternalCardholderAuthenticationData + */ public class ExternalCardholderAuthenticationData { private String cavv = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/InvoicePaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/InvoicePaymentMethodSpecificInput.java new file mode 100644 index 000000000..d5431ef97 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/InvoicePaymentMethodSpecificInput.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractPaymentMethodSpecificInput; + +/** + * Class InvoicePaymentMethodSpecificInput + */ +public class InvoicePaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput { + + private String additionalReference = null; + + public String getAdditionalReference() { + return additionalReference; + } + + public void setAdditionalReference(String value) { + this.additionalReference = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/InvoicePaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/InvoicePaymentMethodSpecificOutput.java new file mode 100644 index 000000000..f9aa6cf6f --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/InvoicePaymentMethodSpecificOutput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AbstractPaymentMethodSpecificOutput; + +/** + * Class InvoicePaymentMethodSpecificOutput + */ +public class InvoicePaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Level3SummaryData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Level3SummaryData.java similarity index 61% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Level3SummaryData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Level3SummaryData.java index 1dd1dc630..af5ecfd39 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Level3SummaryData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Level3SummaryData.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class Level3SummaryData + */ public class Level3SummaryData { private Long discountAmount = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItem.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItem.java similarity index 56% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItem.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItem.java index 6d689a1db..652fff9a8 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItem.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItem.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.LineItemInvoiceData; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.LineItemLevel3InterchangeInformation; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.LineItemInvoiceData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.LineItemLevel3InterchangeInformation; + +/** + * Class LineItem + */ public class LineItem { private AmountOfMoney amountOfMoney = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItemInvoiceData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItemInvoiceData.java similarity index 73% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItemInvoiceData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItemInvoiceData.java index 8bd459b01..67b624d89 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItemInvoiceData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItemInvoiceData.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class LineItemInvoiceData + */ public class LineItemInvoiceData { private String description = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItemLevel3InterchangeInformation.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItemLevel3InterchangeInformation.java similarity index 78% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItemLevel3InterchangeInformation.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItemLevel3InterchangeInformation.java index 34707d865..1b4f9b69e 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/LineItemLevel3InterchangeInformation.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/LineItemLevel3InterchangeInformation.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class LineItemLevel3InterchangeInformation + */ public class LineItemLevel3InterchangeInformation { private Long discountAmount = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/MerchantAction.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/MerchantAction.java similarity index 61% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/MerchantAction.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/MerchantAction.java index f886da34b..d7bc3798c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/MerchantAction.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/MerchantAction.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.KeyValuePair; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectData; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.KeyValuePair; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectData; import java.util.List; +/** + * Class MerchantAction + */ public class MerchantAction { private String actionType = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificInput.java similarity index 71% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificInput.java index 017120bf8..3ee22309e 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificInput.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.NonSepaDirectDebitPaymentProduct705SpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.NonSepaDirectDebitPaymentProduct707SpecificInput; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractPaymentMethodSpecificInput; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.NonSepaDirectDebitPaymentProduct705SpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.NonSepaDirectDebitPaymentProduct707SpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractPaymentMethodSpecificInput; + +/** + * Class NonSepaDirectDebitPaymentMethodSpecificInput + */ public class NonSepaDirectDebitPaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput { private String dateCollect = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificOutput.java new file mode 100644 index 000000000..d147526ff --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentMethodSpecificOutput.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.FraudResults; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AbstractPaymentMethodSpecificOutput; + +/** + * Class NonSepaDirectDebitPaymentMethodSpecificOutput + */ +public class NonSepaDirectDebitPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { + + private FraudResults fraudResults = null; + + public FraudResults getFraudResults() { + return fraudResults; + } + + public void setFraudResults(FraudResults value) { + this.fraudResults = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentProduct705SpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentProduct705SpecificInput.java similarity index 57% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentProduct705SpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentProduct705SpecificInput.java index b7ada9c23..a464a1beb 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentProduct705SpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentProduct705SpecificInput.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +/** + * Class NonSepaDirectDebitPaymentProduct705SpecificInput + */ public class NonSepaDirectDebitPaymentProduct705SpecificInput { private String authorisationId = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentProduct707SpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentProduct707SpecificInput.java similarity index 78% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentProduct707SpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentProduct707SpecificInput.java index 479870401..6517a55a9 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/NonSepaDirectDebitPaymentProduct707SpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/NonSepaDirectDebitPaymentProduct707SpecificInput.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +/** + * Class NonSepaDirectDebitPaymentProduct707SpecificInput + */ public class NonSepaDirectDebitPaymentProduct707SpecificInput { private String addressLine1 = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Order.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Order.java similarity index 57% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Order.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Order.java index a0d10b989..f2445310a 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Order.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Order.java @@ -1,12 +1,19 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AdditionalOrderInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Customer; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.LineItem; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderReferences; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AdditionalOrderInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.LineItem; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderReferences; import java.util.List; +/** + * Class Order + */ public class Order { private AdditionalOrderInput additionalInput = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderApprovePayment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderApprovePayment.java new file mode 100644 index 000000000..7dd60c2b8 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderApprovePayment.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AdditionalOrderInputAirlineData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderReferencesApprovePayment; + +/** + * Class OrderApprovePayment + */ +public class OrderApprovePayment { + + private AdditionalOrderInputAirlineData additionalInput = null; + + private OrderReferencesApprovePayment references = null; + + public AdditionalOrderInputAirlineData getAdditionalInput() { + return additionalInput; + } + + public void setAdditionalInput(AdditionalOrderInputAirlineData value) { + this.additionalInput = value; + } + + public OrderReferencesApprovePayment getReferences() { + return references; + } + + public void setReferences(OrderReferencesApprovePayment value) { + this.references = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderInvoiceData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderInvoiceData.java similarity index 70% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderInvoiceData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderInvoiceData.java index 848aed77d..633595e8c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderInvoiceData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderInvoiceData.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; import java.util.List; +/** + * Class OrderInvoiceData + */ public class OrderInvoiceData { private String additionalData = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderOutput.java new file mode 100644 index 000000000..adc3e9f04 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderOutput.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentReferences; + +/** + * Class OrderOutput + */ +public class OrderOutput { + + private AmountOfMoney amountOfMoney = null; + + private PaymentReferences references = null; + + public AmountOfMoney getAmountOfMoney() { + return amountOfMoney; + } + + public void setAmountOfMoney(AmountOfMoney value) { + this.amountOfMoney = value; + } + + public PaymentReferences getReferences() { + return references; + } + + public void setReferences(PaymentReferences value) { + this.references = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderReferences.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderReferences.java similarity index 64% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderReferences.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderReferences.java index 0a636923d..a259e9c02 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderReferences.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderReferences.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderInvoiceData; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderInvoiceData; +/** + * Class OrderReferences + */ public class OrderReferences { private String descriptor = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderReferencesApprovePayment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderReferencesApprovePayment.java new file mode 100644 index 000000000..4e83019f8 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderReferencesApprovePayment.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class OrderReferencesApprovePayment + */ +public class OrderReferencesApprovePayment { + + private String merchantReference = null; + + public String getMerchantReference() { + return merchantReference; + } + + public void setMerchantReference(String value) { + this.merchantReference = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderTypeInformation.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderTypeInformation.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderTypeInformation.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderTypeInformation.java index 495d7117c..74c8232b1 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/OrderTypeInformation.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/OrderTypeInformation.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class OrderTypeInformation + */ public class OrderTypeInformation { private String purchaseType = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Payment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Payment.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Payment.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Payment.java index c56d46279..2c66a7a4f 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/Payment.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/Payment.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentStatusOutput; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractOrderStatus; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentStatusOutput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractOrderStatus; + +/** + * Class Payment + */ public class Payment extends AbstractOrderStatus { private PaymentOutput paymentOutput = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentCreationOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentCreationOutput.java new file mode 100644 index 000000000..548aade04 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentCreationOutput.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentCreationReferences; + +/** + * Class PaymentCreationOutput + */ +public class PaymentCreationOutput extends PaymentCreationReferences { + + private Boolean isNewToken = null; + + private String token = null; + + public Boolean getIsNewToken() { + return isNewToken; + } + + public void setIsNewToken(Boolean value) { + this.isNewToken = value; + } + + public String getToken() { + return token; + } + + public void setToken(String value) { + this.token = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentCreationReferences.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentCreationReferences.java similarity index 55% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentCreationReferences.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentCreationReferences.java index 09ddf6086..ae403122d 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentCreationReferences.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentCreationReferences.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class PaymentCreationReferences + */ public class PaymentCreationReferences { private String additionalReference = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentOutput.java similarity index 72% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentOutput.java index 95ab5cf41..8019eff93 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentOutput.java @@ -1,14 +1,21 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.BankTransferPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CashPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.InvoicePaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.NonSepaDirectDebitPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.SepaDirectDebitPaymentMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderOutput; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.BankTransferPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CashPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.InvoicePaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.NonSepaDirectDebitPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.SepaDirectDebitPaymentMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderOutput; + +/** + * Class PaymentOutput + */ public class PaymentOutput extends OrderOutput { private Long amountPaid = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct836SpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct836SpecificOutput.java new file mode 100644 index 000000000..d216d716e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct836SpecificOutput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class PaymentProduct836SpecificOutput + */ +public class PaymentProduct836SpecificOutput { + + private String securityIndicator = null; + + public String getSecurityIndicator() { + return securityIndicator; + } + + public void setSecurityIndicator(String value) { + this.securityIndicator = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct840CustomerAccount.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct840CustomerAccount.java similarity index 81% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct840CustomerAccount.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct840CustomerAccount.java index a54560e89..ee4fdb72e 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentProduct840CustomerAccount.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct840CustomerAccount.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class PaymentProduct840CustomerAccount + */ public class PaymentProduct840CustomerAccount { private String accountId = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct840SpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct840SpecificOutput.java new file mode 100644 index 000000000..48155ae8b --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentProduct840SpecificOutput.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentProduct840CustomerAccount; + +/** + * Class PaymentProduct840SpecificOutput + */ +public class PaymentProduct840SpecificOutput { + + private PaymentProduct840CustomerAccount customerAccount = null; + + private Address customerAddress = null; + + public PaymentProduct840CustomerAccount getCustomerAccount() { + return customerAccount; + } + + public void setCustomerAccount(PaymentProduct840CustomerAccount value) { + this.customerAccount = value; + } + + public Address getCustomerAddress() { + return customerAddress; + } + + public void setCustomerAddress(Address value) { + this.customerAddress = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentReferences.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentReferences.java similarity index 77% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentReferences.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentReferences.java index 8b200f3c7..9177d7265 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PaymentReferences.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentReferences.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class PaymentReferences + */ public class PaymentReferences { private Long merchantOrderId = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentStatusOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentStatusOutput.java new file mode 100644 index 000000000..493104508 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PaymentStatusOutput.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.OrderStatusOutput; + +/** + * Class PaymentStatusOutput + */ +public class PaymentStatusOutput extends OrderStatusOutput { + + private Boolean isAuthorized = null; + + private Boolean isRefundable = null; + + public Boolean getIsAuthorized() { + return isAuthorized; + } + + public void setIsAuthorized(Boolean value) { + this.isAuthorized = value; + } + + public Boolean getIsRefundable() { + return isRefundable; + } + + public void setIsRefundable(Boolean value) { + this.isRefundable = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PersonalInformation.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PersonalInformation.java similarity index 54% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PersonalInformation.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PersonalInformation.java index 60d2515ab..ac5205709 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/PersonalInformation.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PersonalInformation.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalName; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName; +/** + * Class PersonalInformation + */ public class PersonalInformation { private String dateOfBirth = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PersonalName.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PersonalName.java new file mode 100644 index 000000000..0732c3f5f --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/PersonalName.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.PersonalNameBase; + +/** + * Class PersonalName + */ +public class PersonalName extends PersonalNameBase { + + private String title = null; + + public String getTitle() { + return title; + } + + public void setTitle(String value) { + this.title = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectData.java similarity index 52% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectData.java index 9faa7a94a..e33a0a829 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectData.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class RedirectData + */ public class RedirectData { private String RETURNMAC = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificInput.java similarity index 64% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificInput.java index 95a99019c..76d728edb 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificInput.java @@ -1,10 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentProduct809SpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentProduct816SpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentProduct882SpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RedirectPaymentMethodSpecificInputBase; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentProduct809SpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentProduct816SpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentProduct882SpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RedirectPaymentMethodSpecificInputBase; + +/** + * Class RedirectPaymentMethodSpecificInput + */ public class RedirectPaymentMethodSpecificInput extends RedirectPaymentMethodSpecificInputBase { private Boolean isRecurring = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificInputBase.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificInputBase.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificInputBase.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificInputBase.java index c58320a71..e999e3409 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificInputBase.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificInputBase.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractPaymentMethodSpecificInput; +/** + * Class RedirectPaymentMethodSpecificInputBase + */ public class RedirectPaymentMethodSpecificInputBase extends AbstractPaymentMethodSpecificInput { private String recurringPaymentSequenceIndicator = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificOutput.java similarity index 56% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificOutput.java index b6cc53abe..11ff0d7f8 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentMethodSpecificOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentMethodSpecificOutput.java @@ -1,10 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentProduct836SpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PaymentProduct840SpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AbstractPaymentMethodSpecificOutput; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentProduct836SpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PaymentProduct840SpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AbstractPaymentMethodSpecificOutput; + +/** + * Class RedirectPaymentMethodSpecificOutput + */ public class RedirectPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { private BankAccountIban bankAccountIban = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct809SpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct809SpecificInput.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct809SpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct809SpecificInput.java index 49bd16a59..77be47d23 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RedirectPaymentProduct809SpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct809SpecificInput.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class RedirectPaymentProduct809SpecificInput + */ public class RedirectPaymentProduct809SpecificInput { private String expirationPeriod = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct816SpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct816SpecificInput.java new file mode 100644 index 000000000..65268cdc8 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct816SpecificInput.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; + +/** + * Class RedirectPaymentProduct816SpecificInput + */ +public class RedirectPaymentProduct816SpecificInput { + + private BankAccountIban bankAccountIban = null; + + public BankAccountIban getBankAccountIban() { + return bankAccountIban; + } + + public void setBankAccountIban(BankAccountIban value) { + this.bankAccountIban = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct882SpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct882SpecificInput.java new file mode 100644 index 000000000..5c01721d6 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RedirectPaymentProduct882SpecificInput.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + + +/** + * Class RedirectPaymentProduct882SpecificInput + */ +public class RedirectPaymentProduct882SpecificInput { + + private String issuerId = null; + + public String getIssuerId() { + return issuerId; + } + + public void setIssuerId(String value) { + this.issuerId = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundBankMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundBankMethodSpecificOutput.java new file mode 100644 index 000000000..97fdaa6f5 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundBankMethodSpecificOutput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundMethodSpecificOutput; + +/** + * Class RefundBankMethodSpecificOutput + */ +public class RefundBankMethodSpecificOutput extends RefundMethodSpecificOutput { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundCardMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundCardMethodSpecificOutput.java new file mode 100644 index 000000000..0bfd7026b --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundCardMethodSpecificOutput.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundMethodSpecificOutput; + +/** + * Class RefundCardMethodSpecificOutput + */ +public class RefundCardMethodSpecificOutput extends RefundMethodSpecificOutput { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundEWalletMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundEWalletMethodSpecificOutput.java new file mode 100644 index 000000000..7d1f5d646 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundEWalletMethodSpecificOutput.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundPaymentProduct840SpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundMethodSpecificOutput; + +/** + * Class RefundEWalletMethodSpecificOutput + */ +public class RefundEWalletMethodSpecificOutput extends RefundMethodSpecificOutput { + + private RefundPaymentProduct840SpecificOutput paymentProduct840SpecificOutput = null; + + public RefundPaymentProduct840SpecificOutput getPaymentProduct840SpecificOutput() { + return paymentProduct840SpecificOutput; + } + + public void setPaymentProduct840SpecificOutput(RefundPaymentProduct840SpecificOutput value) { + this.paymentProduct840SpecificOutput = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundMethodSpecificOutput.java similarity index 54% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundMethodSpecificOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundMethodSpecificOutput.java index 70e599154..5c891000c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundMethodSpecificOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundMethodSpecificOutput.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class RefundMethodSpecificOutput + */ public class RefundMethodSpecificOutput { private Long totalAmountPaid = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundOutput.java similarity index 66% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundOutput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundOutput.java index 330133e90..f52e663ee 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundOutput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundOutput.java @@ -1,10 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; - -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundBankMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundCardMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundEWalletMethodSpecificOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderOutput; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundBankMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundCardMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundEWalletMethodSpecificOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderOutput; + +/** + * Class RefundOutput + */ public class RefundOutput extends OrderOutput { private Long amountPaid = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundPaymentProduct840CustomerAccount.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundPaymentProduct840CustomerAccount.java similarity index 62% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundPaymentProduct840CustomerAccount.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundPaymentProduct840CustomerAccount.java index 5ea28f2a7..32bd9ae73 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/RefundPaymentProduct840CustomerAccount.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundPaymentProduct840CustomerAccount.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class RefundPaymentProduct840CustomerAccount + */ public class RefundPaymentProduct840CustomerAccount { private String customerAccountStatus = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundPaymentProduct840SpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundPaymentProduct840SpecificOutput.java new file mode 100644 index 000000000..9f2dc92c1 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/RefundPaymentProduct840SpecificOutput.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundPaymentProduct840CustomerAccount; + +/** + * Class RefundPaymentProduct840SpecificOutput + */ +public class RefundPaymentProduct840SpecificOutput { + + private RefundPaymentProduct840CustomerAccount customerAccount = null; + + public RefundPaymentProduct840CustomerAccount getCustomerAccount() { + return customerAccount; + } + + public void setCustomerAccount(RefundPaymentProduct840CustomerAccount value) { + this.customerAccount = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/SepaDirectDebitPaymentMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/SepaDirectDebitPaymentMethodSpecificInput.java similarity index 68% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/SepaDirectDebitPaymentMethodSpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/SepaDirectDebitPaymentMethodSpecificInput.java index ea095f594..5b167771f 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/SepaDirectDebitPaymentMethodSpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/SepaDirectDebitPaymentMethodSpecificInput.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractPaymentMethodSpecificInput; +/** + * Class SepaDirectDebitPaymentMethodSpecificInput + */ public class SepaDirectDebitPaymentMethodSpecificInput extends AbstractPaymentMethodSpecificInput { private String dateCollect = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/SepaDirectDebitPaymentMethodSpecificOutput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/SepaDirectDebitPaymentMethodSpecificOutput.java new file mode 100644 index 000000000..e7ff5fc41 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/SepaDirectDebitPaymentMethodSpecificOutput.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.FraudResults; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AbstractPaymentMethodSpecificOutput; + +/** + * Class SepaDirectDebitPaymentMethodSpecificOutput + */ +public class SepaDirectDebitPaymentMethodSpecificOutput extends AbstractPaymentMethodSpecificOutput { + + private FraudResults fraudResults = null; + + public FraudResults getFraudResults() { + return fraudResults; + } + + public void setFraudResults(FraudResults value) { + this.fraudResults = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ThreeDSecureResults.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ThreeDSecureResults.java similarity index 55% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ThreeDSecureResults.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ThreeDSecureResults.java index 57a8c85ff..eaf3bd22f 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payment/definitions/ThreeDSecureResults.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payment/definitions/ThreeDSecureResults.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payment.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payment.definitions; +/** + * Class ThreeDSecureResults + */ public class ThreeDSecureResults { private String cavv = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/ApprovePayoutRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/ApprovePayoutRequest.java new file mode 100644 index 000000000..327a4596e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/ApprovePayoutRequest.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payout; + + +/** + * Class ApprovePayoutRequest + */ +public class ApprovePayoutRequest { + + private String datePayout = null; + + public String getDatePayout() { + return datePayout; + } + + public void setDatePayout(String value) { + this.datePayout = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/CreatePayoutRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/CreatePayoutRequest.java similarity index 67% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/CreatePayoutRequest.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/CreatePayoutRequest.java index 1a9e96c71..6f0ec9c41 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/CreatePayoutRequest.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/CreatePayoutRequest.java @@ -1,13 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.payout; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payout; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutCustomer; -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutReferences; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutCustomer; +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutReferences; /** - * class CreatePayoutRequest + * Class CreatePayoutRequest */ public class CreatePayoutRequest { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/PayoutErrorResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/PayoutErrorResponse.java similarity index 54% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/PayoutErrorResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/PayoutErrorResponse.java index 876b225b6..69b0bbf60 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/PayoutErrorResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/PayoutErrorResponse.java @@ -1,11 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.payout; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payout; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutResult; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutResult; import java.util.List; /** - * class PayoutErrorResponse + * Class PayoutErrorResponse */ public class PayoutErrorResponse { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/PayoutResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/PayoutResponse.java new file mode 100644 index 000000000..7d515c7c1 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/PayoutResponse.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payout; + +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutResult; + +/** + * Class PayoutResponse + */ +public class PayoutResponse extends PayoutResult { +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutCustomer.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutCustomer.java similarity index 60% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutCustomer.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutCustomer.java index c3db6a991..e876faf37 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutCustomer.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutCustomer.java @@ -1,10 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.payout.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CompanyInformation; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ContactDetailsBase; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.PersonalName; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payout.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName; + +/** + * Class PayoutCustomer + */ public class PayoutCustomer { private Address address = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutReferences.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutReferences.java similarity index 63% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutReferences.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutReferences.java index 661c194c4..05efb4f3d 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutReferences.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutReferences.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.payout.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payout.definitions; +/** + * Class PayoutReferences + */ public class PayoutReferences { private String invoiceNumber = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutResult.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutResult.java similarity index 50% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutResult.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutResult.java index 12d3b97e2..5c97e8fc3 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/payout/definitions/PayoutResult.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/payout/definitions/PayoutResult.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.payout.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.OrderStatusOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.OrderOutput; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractOrderStatus; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.payout.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.OrderStatusOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.OrderOutput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractOrderStatus; + +/** + * Class PayoutResult + */ public class PayoutResult extends AbstractOrderStatus { private OrderOutput payoutOutput = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/Directory.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/Directory.java new file mode 100644 index 000000000..ea06aa7ca --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/Directory.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.DirectoryEntry; +import java.util.List; + +/** + * Class Directory + */ +public class Directory { + + private List entries = null; + + public List getEntries() { + return entries; + } + + public void setEntries(List value) { + this.entries = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductGroupResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductGroupResponse.java new file mode 100644 index 000000000..59464ed1c --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductGroupResponse.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductGroup; + +/** + * Class PaymentProductGroupResponse + */ +public class PaymentProductGroupResponse extends PaymentProductGroup { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductGroups.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductGroups.java new file mode 100644 index 000000000..62cd52adb --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductGroups.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductGroup; +import java.util.List; + +/** + * Class PaymentProductGroups + */ +public class PaymentProductGroups { + + private List paymentProductGroups = null; + + public List getPaymentProductGroups() { + return paymentProductGroups; + } + + public void setPaymentProductGroups(List value) { + this.paymentProductGroups = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductResponse.java new file mode 100644 index 000000000..64740c74d --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProductResponse.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProduct; + +/** + * Class PaymentProductResponse + */ +public class PaymentProductResponse extends PaymentProduct { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProducts.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProducts.java new file mode 100644 index 000000000..5d932bd5b --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/PaymentProducts.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProduct; +import java.util.List; + +/** + * Class PaymentProducts + */ +public class PaymentProducts { + + private List paymentProducts = null; + + public List getPaymentProducts() { + return paymentProducts; + } + + public void setPaymentProducts(List value) { + this.paymentProducts = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFile.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFile.java similarity index 61% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFile.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFile.java index feb48676f..1c3be94f0 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/AccountOnFile.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFile.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.AccountOnFileAttribute; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.AccountOnFileDisplayHints; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.AccountOnFileAttribute; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.AccountOnFileDisplayHints; import java.util.List; +/** + * Class AccountOnFile + */ public class AccountOnFile { private List attributes = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFileAttribute.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFileAttribute.java new file mode 100644 index 000000000..f8dddd2e1 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFileAttribute.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.KeyValuePair; + +/** + * Class AccountOnFileAttribute + */ +public class AccountOnFileAttribute extends KeyValuePair { + + private String mustWriteReason = null; + + private String status = null; + + public String getMustWriteReason() { + return mustWriteReason; + } + + public void setMustWriteReason(String value) { + this.mustWriteReason = value; + } + + public String getStatus() { + return status; + } + + public void setStatus(String value) { + this.status = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFileDisplayHints.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFileDisplayHints.java new file mode 100644 index 000000000..d04dc82b2 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/AccountOnFileDisplayHints.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.LabelTemplateElement; +import java.util.List; + +/** + * Class AccountOnFileDisplayHints + */ +public class AccountOnFileDisplayHints { + + private List labelTemplate = null; + + private String logo = null; + + public List getLabelTemplate() { + return labelTemplate; + } + + public void setLabelTemplate(List value) { + this.labelTemplate = value; + } + + public String getLogo() { + return logo; + } + + public void setLogo(String value) { + this.logo = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/DirectoryEntry.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/DirectoryEntry.java similarity index 68% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/DirectoryEntry.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/DirectoryEntry.java index 5948946af..4ce74b6e4 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/DirectoryEntry.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/DirectoryEntry.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; import java.util.List; +/** + * Class DirectoryEntry + */ public class DirectoryEntry { private List countryNames = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/EmptyValidator.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/EmptyValidator.java new file mode 100644 index 000000000..5e730ef69 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/EmptyValidator.java @@ -0,0 +1,12 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + + +/** + * Class EmptyValidator + */ +public class EmptyValidator { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/FixedListValidator.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/FixedListValidator.java new file mode 100644 index 000000000..4c8c108c9 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/FixedListValidator.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import java.util.List; + +/** + * Class FixedListValidator + */ +public class FixedListValidator { + + private List allowedValues = null; + + public List getAllowedValues() { + return allowedValues; + } + + public void setAllowedValues(List value) { + this.allowedValues = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/LabelTemplateElement.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/LabelTemplateElement.java similarity index 50% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/LabelTemplateElement.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/LabelTemplateElement.java index 0144c4355..8cea3d860 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/LabelTemplateElement.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/LabelTemplateElement.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; +/** + * Class LabelTemplateElement + */ public class LabelTemplateElement { private String attributeKey = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/LengthValidator.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/LengthValidator.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/LengthValidator.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/LengthValidator.java index 7b84705d7..7b3bb2ce2 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/LengthValidator.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/LengthValidator.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; +/** + * Class LengthValidator + */ public class LengthValidator { private Integer maxLength = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProduct.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProduct.java similarity index 80% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProduct.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProduct.java index 109ca6c13..e5c0f9120 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProduct.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProduct.java @@ -1,10 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.AccountOnFile; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductDisplayHints; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductField; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.AccountOnFile; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductDisplayHints; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductField; import java.util.List; +/** + * Class PaymentProduct + */ public class PaymentProduct { private List accountsOnFile = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductDisplayHints.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductDisplayHints.java similarity index 58% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductDisplayHints.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductDisplayHints.java index a03f0fd51..34e0c6091 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductDisplayHints.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductDisplayHints.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; +/** + * Class PaymentProductDisplayHints + */ public class PaymentProductDisplayHints { private Integer displayOrder = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductField.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductField.java similarity index 59% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductField.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductField.java index 2397eeba6..a2136aa6a 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductField.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductField.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductFieldDataRestrictions; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductFieldDisplayHints; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductFieldDataRestrictions; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductFieldDisplayHints; + +/** + * Class PaymentProductField + */ public class PaymentProductField { private PaymentProductFieldDataRestrictions dataRestrictions = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldDataRestrictions.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldDataRestrictions.java new file mode 100644 index 000000000..eddf46393 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldDataRestrictions.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductFieldValidators; + +/** + * Class PaymentProductFieldDataRestrictions + */ +public class PaymentProductFieldDataRestrictions { + + private Boolean isRequired = null; + + private PaymentProductFieldValidators validators = null; + + public Boolean getIsRequired() { + return isRequired; + } + + public void setIsRequired(Boolean value) { + this.isRequired = value; + } + + public PaymentProductFieldValidators getValidators() { + return validators; + } + + public void setValidators(PaymentProductFieldValidators value) { + this.validators = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldDisplayHints.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldDisplayHints.java similarity index 74% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldDisplayHints.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldDisplayHints.java index 8223c324a..d7995f2f7 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldDisplayHints.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldDisplayHints.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductFieldFormElement; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductFieldTooltip; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductFieldFormElement; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductFieldTooltip; + +/** + * Class PaymentProductFieldDisplayHints + */ public class PaymentProductFieldDisplayHints { private Boolean alwaysShow = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldFormElement.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldFormElement.java new file mode 100644 index 000000000..171883f9e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldFormElement.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.ValueMappingElement; +import java.util.List; + +/** + * Class PaymentProductFieldFormElement + */ +public class PaymentProductFieldFormElement { + + private String type = null; + + private List valueMapping = null; + + public String getType() { + return type; + } + + public void setType(String value) { + this.type = value; + } + + public List getValueMapping() { + return valueMapping; + } + + public void setValueMapping(List value) { + this.valueMapping = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldTooltip.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldTooltip.java new file mode 100644 index 000000000..d0bcfbd37 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldTooltip.java @@ -0,0 +1,32 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + + +/** + * Class PaymentProductFieldTooltip + */ +public class PaymentProductFieldTooltip { + + private String image = null; + + private String label = null; + + public String getImage() { + return image; + } + + public void setImage(String value) { + this.image = value; + } + + public String getLabel() { + return label; + } + + public void setLabel(String value) { + this.label = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldValidators.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldValidators.java similarity index 63% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldValidators.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldValidators.java index 7a42d298a..852cb80b5 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductFieldValidators.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductFieldValidators.java @@ -1,11 +1,18 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.EmptyValidator; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.FixedListValidator; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.LengthValidator; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.RangeValidator; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.RegularExpressionValidator; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.EmptyValidator; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.FixedListValidator; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.LengthValidator; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.RangeValidator; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.RegularExpressionValidator; + +/** + * Class PaymentProductFieldValidators + */ public class PaymentProductFieldValidators { private EmptyValidator emailAddress = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductGroup.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductGroup.java similarity index 57% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductGroup.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductGroup.java index d600f7528..e42260a21 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/PaymentProductGroup.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/PaymentProductGroup.java @@ -1,10 +1,17 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; - -import com.globalcollect.gateway.sdk.java.gc.product.definitions.AccountOnFile; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductDisplayHints; -import com.globalcollect.gateway.sdk.java.gc.product.definitions.PaymentProductField; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.AccountOnFile; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductDisplayHints; +import com.ingenico.connect.gateway.sdk.java.domain.product.definitions.PaymentProductField; import java.util.List; +/** + * Class PaymentProductGroup + */ public class PaymentProductGroup { private List accountsOnFile = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/RangeValidator.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/RangeValidator.java similarity index 51% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/RangeValidator.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/RangeValidator.java index 8d49e357e..6c269f98f 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/RangeValidator.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/RangeValidator.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; +/** + * Class RangeValidator + */ public class RangeValidator { private Integer maxValue = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/RegularExpressionValidator.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/RegularExpressionValidator.java new file mode 100644 index 000000000..0e8bb76f0 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/RegularExpressionValidator.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; + + +/** + * Class RegularExpressionValidator + */ +public class RegularExpressionValidator { + + private String regularExpression = null; + + public String getRegularExpression() { + return regularExpression; + } + + public void setRegularExpression(String value) { + this.regularExpression = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/ValueMappingElement.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/ValueMappingElement.java similarity index 50% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/ValueMappingElement.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/ValueMappingElement.java index 965a69e58..0b5f4b549 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/product/definitions/ValueMappingElement.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/product/definitions/ValueMappingElement.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.product.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.product.definitions; +/** + * Class ValueMappingElement + */ public class ValueMappingElement { private String displayName = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/ApproveRefundRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/ApproveRefundRequest.java new file mode 100644 index 000000000..527dfd2fe --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/ApproveRefundRequest.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund; + + +/** + * Class ApproveRefundRequest + */ +public class ApproveRefundRequest { + + private Long amount = null; + + public Long getAmount() { + return amount; + } + + public void setAmount(Long value) { + this.amount = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundErrorResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundErrorResponse.java similarity index 54% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundErrorResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundErrorResponse.java index 4a0223b3e..895ab6232 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundErrorResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundErrorResponse.java @@ -1,11 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.refund; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundResult; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundResult; import java.util.List; /** - * class RefundErrorResponse + * Class RefundErrorResponse */ public class RefundErrorResponse { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundRequest.java similarity index 63% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundRequest.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundRequest.java index 21c8620ec..74c938024 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/RefundRequest.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundRequest.java @@ -1,12 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.refund; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.BankRefundMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundCustomer; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundReferences; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.BankRefundMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundCustomer; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundReferences; /** - * class RefundRequest + * Class RefundRequest */ public class RefundRequest { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundResponse.java new file mode 100644 index 000000000..13815f265 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/RefundResponse.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund; + +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundResult; + +/** + * Class RefundResponse + */ +public class RefundResponse extends RefundResult { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/BankAccountBbanRefund.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/BankAccountBbanRefund.java new file mode 100644 index 000000000..8741bbbc2 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/BankAccountBbanRefund.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; + +/** + * Class BankAccountBbanRefund + */ +public class BankAccountBbanRefund extends BankAccountBban { + + private String bankCity = null; + + private String swiftCode = null; + + public String getBankCity() { + return bankCity; + } + + public void setBankCity(String value) { + this.bankCity = value; + } + + public String getSwiftCode() { + return swiftCode; + } + + public void setSwiftCode(String value) { + this.swiftCode = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/BankRefundMethodSpecificInput.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/BankRefundMethodSpecificInput.java similarity index 55% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/BankRefundMethodSpecificInput.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/BankRefundMethodSpecificInput.java index a8d517ccc..d875ee672 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/BankRefundMethodSpecificInput.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/BankRefundMethodSpecificInput.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.refund.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.BankAccountBbanRefund; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.BankAccountBbanRefund; + +/** + * Class BankRefundMethodSpecificInput + */ public class BankRefundMethodSpecificInput { private BankAccountBbanRefund bankAccountBban = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundCustomer.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundCustomer.java similarity index 53% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundCustomer.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundCustomer.java index e3d289815..0f794144c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundCustomer.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundCustomer.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.refund.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CompanyInformation; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.ContactDetailsBase; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AddressPersonal; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AddressPersonal; + +/** + * Class RefundCustomer + */ public class RefundCustomer { private AddressPersonal address = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundReferences.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundReferences.java new file mode 100644 index 000000000..d107bd3bc --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundReferences.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund.definitions; + + +/** + * Class RefundReferences + */ +public class RefundReferences { + + private String merchantReference = null; + + public String getMerchantReference() { + return merchantReference; + } + + public void setMerchantReference(String value) { + this.merchantReference = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundResult.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundResult.java similarity index 50% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundResult.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundResult.java index 9ff16fd2a..b50f68e84 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/refund/definitions/RefundResult.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/refund/definitions/RefundResult.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.refund.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.OrderStatusOutput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.RefundOutput; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AbstractOrderStatus; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.refund.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.OrderStatusOutput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.RefundOutput; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AbstractOrderStatus; + +/** + * Class RefundResult + */ public class RefundResult extends AbstractOrderStatus { private RefundOutput refundOutput = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentBankAccount.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentBankAccount.java new file mode 100644 index 000000000..d45c1da6e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentBankAccount.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.RiskAssessment; + +/** + * Class RiskAssessmentBankAccount + */ +public class RiskAssessmentBankAccount extends RiskAssessment { + + private BankAccountBban bankAccountBban = null; + + private BankAccountIban bankAccountIban = null; + + public BankAccountBban getBankAccountBban() { + return bankAccountBban; + } + + public void setBankAccountBban(BankAccountBban value) { + this.bankAccountBban = value; + } + + public BankAccountIban getBankAccountIban() { + return bankAccountIban; + } + + public void setBankAccountIban(BankAccountIban value) { + this.bankAccountIban = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentCard.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentCard.java new file mode 100644 index 000000000..c2f031db1 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentCard.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Card; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.RiskAssessment; + +/** + * Class RiskAssessmentCard + */ +public class RiskAssessmentCard extends RiskAssessment { + + private Card card = null; + + public Card getCard() { + return card; + } + + public void setCard(Card value) { + this.card = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentResponse.java new file mode 100644 index 000000000..c9a7d1b47 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/RiskAssessmentResponse.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ResultDoRiskAssessment; +import java.util.List; + +/** + * Class RiskAssessmentResponse + */ +public class RiskAssessmentResponse { + + private List results = null; + + public List getResults() { + return results; + } + + public void setResults(List value) { + this.results = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/CustomerRiskAssessment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/CustomerRiskAssessment.java similarity index 58% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/CustomerRiskAssessment.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/CustomerRiskAssessment.java index 29e8089e9..b6e59f845 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/CustomerRiskAssessment.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/CustomerRiskAssessment.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.AddressPersonal; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.PersonalInformationRiskAssessment; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AddressPersonal; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.PersonalInformationRiskAssessment; + +/** + * Class CustomerRiskAssessment + */ public class CustomerRiskAssessment { private Address billingAddress = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/OrderRiskAssessment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/OrderRiskAssessment.java similarity index 52% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/OrderRiskAssessment.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/OrderRiskAssessment.java index 5710edee3..a1e4064cc 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/OrderRiskAssessment.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/OrderRiskAssessment.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AdditionalOrderInputAirlineData; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.CustomerRiskAssessment; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AdditionalOrderInputAirlineData; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.CustomerRiskAssessment; + +/** + * Class OrderRiskAssessment + */ public class OrderRiskAssessment { private AdditionalOrderInputAirlineData additionalInput = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/PersonalInformationRiskAssessment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/PersonalInformationRiskAssessment.java new file mode 100644 index 000000000..9ac9d0cec --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/PersonalInformationRiskAssessment.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.PersonalNameRiskAssessment; + +/** + * Class PersonalInformationRiskAssessment + */ +public class PersonalInformationRiskAssessment { + + private PersonalNameRiskAssessment name = null; + + public PersonalNameRiskAssessment getName() { + return name; + } + + public void setName(PersonalNameRiskAssessment value) { + this.name = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/PersonalNameRiskAssessment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/PersonalNameRiskAssessment.java new file mode 100644 index 000000000..33e02a8e1 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/PersonalNameRiskAssessment.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.PersonalNameBase; + +/** + * Class PersonalNameRiskAssessment + */ +public class PersonalNameRiskAssessment extends PersonalNameBase { +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/RiskAssessment.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/RiskAssessment.java similarity index 53% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/RiskAssessment.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/RiskAssessment.java index bbb539afd..38c4ee5a5 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/riskassessments/definitions/RiskAssessment.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/riskassessments/definitions/RiskAssessment.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.FraudFields; -import com.globalcollect.gateway.sdk.java.gc.riskassessments.definitions.OrderRiskAssessment; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.FraudFields; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment; + +/** + * Class RiskAssessment + */ public class RiskAssessment { private FraudFields fraudFields = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/BankDetailsRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/BankDetailsRequest.java new file mode 100644 index 000000000..d82fde3df --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/BankDetailsRequest.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services; + +import com.ingenico.connect.gateway.sdk.java.domain.services.definitions.BankDetails; + +/** + * Class BankDetailsRequest + */ +public class BankDetailsRequest extends BankDetails { +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/BankDetailsResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/BankDetailsResponse.java similarity index 54% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/BankDetailsResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/BankDetailsResponse.java index 99506529e..0e5b2b4ef 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/BankDetailsResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/BankDetailsResponse.java @@ -1,12 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.services; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountBban; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.services.definitions.BankData; -import com.globalcollect.gateway.sdk.java.gc.services.definitions.Swift; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.services.definitions.BankData; +import com.ingenico.connect.gateway.sdk.java.domain.services.definitions.Swift; /** - * class BankDetailsResponse + * Class BankDetailsResponse */ public class BankDetailsResponse { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/ConvertAmount.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/ConvertAmount.java new file mode 100644 index 000000000..fabc1d2db --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/ConvertAmount.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services; + + +/** + * Class ConvertAmount + */ +public class ConvertAmount { + + private Long convertedAmount = null; + + public Long getConvertedAmount() { + return convertedAmount; + } + + public void setConvertedAmount(Long value) { + this.convertedAmount = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/GetIINDetailsRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/GetIINDetailsRequest.java new file mode 100644 index 000000000..a07046739 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/GetIINDetailsRequest.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services; + +import com.ingenico.connect.gateway.sdk.java.domain.services.definitions.PaymentContext; + +/** + * Class GetIINDetailsRequest + */ +public class GetIINDetailsRequest { + + private String bin = null; + + private PaymentContext paymentContext = null; + + public String getBin() { + return bin; + } + + public void setBin(String value) { + this.bin = value; + } + + public PaymentContext getPaymentContext() { + return paymentContext; + } + + public void setPaymentContext(PaymentContext value) { + this.paymentContext = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/GetIINDetailsResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/GetIINDetailsResponse.java similarity index 66% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/GetIINDetailsResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/GetIINDetailsResponse.java index db3895934..36ce1db94 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/GetIINDetailsResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/GetIINDetailsResponse.java @@ -1,10 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.services; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services; -import com.globalcollect.gateway.sdk.java.gc.services.definitions.IINDetail; +import com.ingenico.connect.gateway.sdk.java.domain.services.definitions.IINDetail; import java.util.List; /** - * class GetIINDetailsResponse + * Class GetIINDetailsResponse */ public class GetIINDetailsResponse { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/TestConnection.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/TestConnection.java new file mode 100644 index 000000000..01ef80214 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/TestConnection.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services; + + +/** + * Class TestConnection + */ +public class TestConnection { + + private String result = null; + + public String getResult() { + return result; + } + + public void setResult(String value) { + this.result = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/BankData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/BankData.java similarity index 72% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/BankData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/BankData.java index a63f98e57..bf9342d7c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/BankData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/BankData.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.services.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services.definitions; +/** + * Class BankData + */ public class BankData { private String newBankName = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/BankDetails.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/BankDetails.java new file mode 100644 index 000000000..35d41bd63 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/BankDetails.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; + +/** + * Class BankDetails + */ +public class BankDetails { + + private BankAccountBban bankAccountBban = null; + + private BankAccountIban bankAccountIban = null; + + public BankAccountBban getBankAccountBban() { + return bankAccountBban; + } + + public void setBankAccountBban(BankAccountBban value) { + this.bankAccountBban = value; + } + + public BankAccountIban getBankAccountIban() { + return bankAccountIban; + } + + public void setBankAccountIban(BankAccountIban value) { + this.bankAccountIban = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/IINDetail.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/IINDetail.java similarity index 56% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/IINDetail.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/IINDetail.java index 6eafb64e1..0ff1c1da3 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/IINDetail.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/IINDetail.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.services.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services.definitions; +/** + * Class IINDetail + */ public class IINDetail { private Boolean isAllowedInContext = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/PaymentContext.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/PaymentContext.java similarity index 58% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/PaymentContext.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/PaymentContext.java index 67e8a2aad..24e53d2ff 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/PaymentContext.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/PaymentContext.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.services.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +/** + * Class PaymentContext + */ public class PaymentContext { private AmountOfMoney amountOfMoney = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/Swift.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/Swift.java similarity index 83% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/Swift.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/Swift.java index 1705b7818..ea790a95c 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/services/definitions/Swift.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/services/definitions/Swift.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.services.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.services.definitions; +/** + * Class Swift + */ public class Swift { private String bic = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/SessionRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/SessionRequest.java new file mode 100644 index 000000000..db9c042dd --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/SessionRequest.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.sessions; + +import com.ingenico.connect.gateway.sdk.java.domain.sessions.definitions.PaymentProductFiltersClientSession; +import java.util.List; + +/** + * Class SessionRequest + */ +public class SessionRequest { + + private PaymentProductFiltersClientSession paymentProductFilters = null; + + private List tokens = null; + + public PaymentProductFiltersClientSession getPaymentProductFilters() { + return paymentProductFilters; + } + + public void setPaymentProductFilters(PaymentProductFiltersClientSession value) { + this.paymentProductFilters = value; + } + + public List getTokens() { + return tokens; + } + + public void setTokens(List value) { + this.tokens = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/sessions/SessionResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/SessionResponse.java similarity index 70% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/sessions/SessionResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/SessionResponse.java index a6e53c25d..861dc7110 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/sessions/SessionResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/SessionResponse.java @@ -1,9 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.sessions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.sessions; import java.util.List; /** - * class SessionResponse + * Class SessionResponse */ public class SessionResponse { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/definitions/PaymentProductFiltersClientSession.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/definitions/PaymentProductFiltersClientSession.java new file mode 100644 index 000000000..b9e786cbf --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/sessions/definitions/PaymentProductFiltersClientSession.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.sessions.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.PaymentProductFilter; + +/** + * Class PaymentProductFiltersClientSession + */ +public class PaymentProductFiltersClientSession { + + private PaymentProductFilter exclude = null; + + private PaymentProductFilter restrictTo = null; + + public PaymentProductFilter getExclude() { + return exclude; + } + + public void setExclude(PaymentProductFilter value) { + this.exclude = value; + } + + public PaymentProductFilter getRestrictTo() { + return restrictTo; + } + + public void setRestrictTo(PaymentProductFilter value) { + this.restrictTo = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/ApproveTokenRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/ApproveTokenRequest.java new file mode 100644 index 000000000..d5d0466dc --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/ApproveTokenRequest.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateApproval; + +/** + * Class ApproveTokenRequest + */ +public class ApproveTokenRequest extends MandateApproval { +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/CreateTokenRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/CreateTokenRequest.java similarity index 61% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/CreateTokenRequest.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/CreateTokenRequest.java index ffc4f16a4..c5288015a 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/CreateTokenRequest.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/CreateTokenRequest.java @@ -1,12 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.token; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCard; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenEWallet; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenNonSepaDirectDebit; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenSepaDirectDebitWithoutCreditor; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCard; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenEWallet; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenNonSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenSepaDirectDebitWithoutCreditor; /** - * class CreateTokenRequest + * Class CreateTokenRequest */ public class CreateTokenRequest { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/CreateTokenResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/CreateTokenResponse.java similarity index 52% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/CreateTokenResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/CreateTokenResponse.java index ec0663fdf..3a13db24e 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/CreateTokenResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/CreateTokenResponse.java @@ -1,8 +1,12 @@ -package com.globalcollect.gateway.sdk.java.gc.token; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token; /** - * class CreateTokenResponse + * Class CreateTokenResponse */ public class CreateTokenResponse { diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/TokenResponse.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/TokenResponse.java similarity index 56% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/TokenResponse.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/TokenResponse.java index d2e2576ab..d137e9114 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/TokenResponse.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/TokenResponse.java @@ -1,12 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.token; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCard; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenEWallet; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenNonSepaDirectDebit; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCard; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenEWallet; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenNonSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenSepaDirectDebit; /** - * class TokenResponse + * Class TokenResponse */ public class TokenResponse { @@ -14,6 +18,8 @@ public class TokenResponse { private TokenEWallet eWallet = null; + private String id = null; + private TokenNonSepaDirectDebit nonSepaDirectDebit = null; private Integer paymentProductId = null; @@ -36,6 +42,14 @@ public void setEWallet(TokenEWallet value) { this.eWallet = value; } + public String getId() { + return id; + } + + public void setId(String value) { + this.id = value; + } + public TokenNonSepaDirectDebit getNonSepaDirectDebit() { return nonSepaDirectDebit; } diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/UpdateTokenRequest.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/UpdateTokenRequest.java similarity index 61% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/UpdateTokenRequest.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/UpdateTokenRequest.java index 1dd6c2d91..2bc8757a6 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/UpdateTokenRequest.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/UpdateTokenRequest.java @@ -1,12 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.token; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenCard; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenEWallet; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenNonSepaDirectDebit; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenSepaDirectDebitWithoutCreditor; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCard; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenEWallet; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenNonSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenSepaDirectDebitWithoutCreditor; /** - * class UpdateTokenRequest + * Class UpdateTokenRequest */ public class UpdateTokenRequest { diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/AbstractToken.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/AbstractToken.java new file mode 100644 index 000000000..381aff1ea --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/AbstractToken.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + + +/** + * Class AbstractToken + */ +public class AbstractToken { + + private String alias = null; + + public String getAlias() { + return alias; + } + + public void setAlias(String value) { + this.alias = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/ContactDetailsToken.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/ContactDetailsToken.java new file mode 100644 index 000000000..a5d56456c --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/ContactDetailsToken.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase; + +/** + * Class ContactDetailsToken + */ +public class ContactDetailsToken extends ContactDetailsBase { +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/Creditor.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/Creditor.java similarity index 84% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/Creditor.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/Creditor.java index 79df9d207..8268bd0f2 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/Creditor.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/Creditor.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; +/** + * Class Creditor + */ public class Creditor { private String additionalAddressInfo = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/CustomerToken.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/CustomerToken.java new file mode 100644 index 000000000..3d286cd34 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/CustomerToken.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalInformationToken; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CustomerBase; + +/** + * Class CustomerToken + */ +public class CustomerToken extends CustomerBase { + + private Address billingAddress = null; + + private PersonalInformationToken personalInformation = null; + + public Address getBillingAddress() { + return billingAddress; + } + + public void setBillingAddress(Address value) { + this.billingAddress = value; + } + + public PersonalInformationToken getPersonalInformation() { + return personalInformation; + } + + public void setPersonalInformation(PersonalInformationToken value) { + this.personalInformation = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/CustomerTokenWithContactDetails.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/CustomerTokenWithContactDetails.java new file mode 100644 index 000000000..07996aea5 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/CustomerTokenWithContactDetails.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.ContactDetailsToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; + +/** + * Class CustomerTokenWithContactDetails + */ +public class CustomerTokenWithContactDetails extends CustomerToken { + + private ContactDetailsToken contactDetails = null; + + public ContactDetailsToken getContactDetails() { + return contactDetails; + } + + public void setContactDetails(ContactDetailsToken value) { + this.contactDetails = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/Debtor.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/Debtor.java similarity index 84% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/Debtor.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/Debtor.java index 68fe58999..e3ddf1fe1 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/Debtor.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/Debtor.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; +/** + * Class Debtor + */ public class Debtor { private String additionalAddressInfo = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateApproval.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateApproval.java similarity index 66% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateApproval.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateApproval.java index bfae9d714..f6ae0b119 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateApproval.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateApproval.java @@ -1,6 +1,13 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; +/** + * Class MandateApproval + */ public class MandateApproval { private String mandateSignatureDate = null; diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateNonSepaDirectDebit.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateNonSepaDirectDebit.java similarity index 58% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateNonSepaDirectDebit.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateNonSepaDirectDebit.java index 679d0cd75..15d33b424 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateNonSepaDirectDebit.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateNonSepaDirectDebit.java @@ -1,8 +1,15 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenNonSepaDirectDebitPaymentProduct705SpecificData; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.TokenNonSepaDirectDebitPaymentProduct707SpecificData; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenNonSepaDirectDebitPaymentProduct705SpecificData; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenNonSepaDirectDebitPaymentProduct707SpecificData; + +/** + * Class MandateNonSepaDirectDebit + */ public class MandateNonSepaDirectDebit { private TokenNonSepaDirectDebitPaymentProduct705SpecificData paymentProduct705SpecificData = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebit.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebit.java new file mode 100644 index 000000000..8d4f6b9f4 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebit.java @@ -0,0 +1,24 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.Creditor; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateSepaDirectDebitWithMandateId; + +/** + * Class MandateSepaDirectDebit + */ +public class MandateSepaDirectDebit extends MandateSepaDirectDebitWithMandateId { + + private Creditor creditor = null; + + public Creditor getCreditor() { + return creditor; + } + + public void setCreditor(Creditor value) { + this.creditor = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebitWithMandateId.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebitWithMandateId.java new file mode 100644 index 000000000..da019e4c2 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebitWithMandateId.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateSepaDirectDebitWithoutCreditor; + +/** + * Class MandateSepaDirectDebitWithMandateId + */ +public class MandateSepaDirectDebitWithMandateId extends MandateSepaDirectDebitWithoutCreditor { + + private String mandateId = null; + + public String getMandateId() { + return mandateId; + } + + public void setMandateId(String value) { + this.mandateId = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebitWithoutCreditor.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebitWithoutCreditor.java similarity index 66% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebitWithoutCreditor.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebitWithoutCreditor.java index 1e70e82fd..f6c75fda1 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/MandateSepaDirectDebitWithoutCreditor.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/MandateSepaDirectDebitWithoutCreditor.java @@ -1,9 +1,16 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; - -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.Debtor; -import com.globalcollect.gateway.sdk.java.gc.token.definitions.MandateApproval; - +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.Debtor; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateApproval; + +/** + * Class MandateSepaDirectDebitWithoutCreditor + */ public class MandateSepaDirectDebitWithoutCreditor { private BankAccountIban bankAccountIban = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/PersonalInformationToken.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/PersonalInformationToken.java new file mode 100644 index 000000000..778e37097 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/PersonalInformationToken.java @@ -0,0 +1,23 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalNameToken; + +/** + * Class PersonalInformationToken + */ +public class PersonalInformationToken { + + private PersonalNameToken name = null; + + public PersonalNameToken getName() { + return name; + } + + public void setName(PersonalNameToken value) { + this.name = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/PersonalNameToken.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/PersonalNameToken.java new file mode 100644 index 000000000..119962180 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/PersonalNameToken.java @@ -0,0 +1,13 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.PersonalNameBase; + +/** + * Class PersonalNameToken + */ +public class PersonalNameToken extends PersonalNameBase { +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenCard.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenCard.java new file mode 100644 index 000000000..87c911e41 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenCard.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCardData; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.AbstractToken; + +/** + * Class TokenCard + */ +public class TokenCard extends AbstractToken { + + private CustomerToken customer = null; + + private TokenCardData data = null; + + public CustomerToken getCustomer() { + return customer; + } + + public void setCustomer(CustomerToken value) { + this.customer = value; + } + + public TokenCardData getData() { + return data; + } + + public void setData(TokenCardData value) { + this.data = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenCardData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenCardData.java similarity index 61% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenCardData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenCardData.java index 59007514a..210b9f9e7 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenCardData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenCardData.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.CardWithoutCvv; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.CardWithoutCvv; +/** + * Class TokenCardData + */ public class TokenCardData { private CardWithoutCvv cardWithoutCvv = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenEWallet.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenEWallet.java new file mode 100644 index 000000000..440a14f29 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenEWallet.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenEWalletData; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.AbstractToken; + +/** + * Class TokenEWallet + */ +public class TokenEWallet extends AbstractToken { + + private CustomerToken customer = null; + + private TokenEWalletData data = null; + + public CustomerToken getCustomer() { + return customer; + } + + public void setCustomer(CustomerToken value) { + this.customer = value; + } + + public TokenEWalletData getData() { + return data; + } + + public void setData(TokenEWalletData value) { + this.data = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenEWalletData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenEWalletData.java new file mode 100644 index 000000000..51c090454 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenEWalletData.java @@ -0,0 +1,22 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + + +/** + * Class TokenEWalletData + */ +public class TokenEWalletData { + + private String billingAgreementId = null; + + public String getBillingAgreementId() { + return billingAgreementId; + } + + public void setBillingAgreementId(String value) { + this.billingAgreementId = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebit.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebit.java new file mode 100644 index 000000000..7caface1d --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebit.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateNonSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.AbstractToken; + +/** + * Class TokenNonSepaDirectDebit + */ +public class TokenNonSepaDirectDebit extends AbstractToken { + + private CustomerToken customer = null; + + private MandateNonSepaDirectDebit mandate = null; + + public CustomerToken getCustomer() { + return customer; + } + + public void setCustomer(CustomerToken value) { + this.customer = value; + } + + public MandateNonSepaDirectDebit getMandate() { + return mandate; + } + + public void setMandate(MandateNonSepaDirectDebit value) { + this.mandate = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebitPaymentProduct705SpecificData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebitPaymentProduct705SpecificData.java new file mode 100644 index 000000000..25aa607ef --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebitPaymentProduct705SpecificData.java @@ -0,0 +1,33 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban; + +/** + * Class TokenNonSepaDirectDebitPaymentProduct705SpecificData + */ +public class TokenNonSepaDirectDebitPaymentProduct705SpecificData { + + private String authorisationId = null; + + private BankAccountBban bankAccountBban = null; + + public String getAuthorisationId() { + return authorisationId; + } + + public void setAuthorisationId(String value) { + this.authorisationId = value; + } + + public BankAccountBban getBankAccountBban() { + return bankAccountBban; + } + + public void setBankAccountBban(BankAccountBban value) { + this.bankAccountBban = value; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebitPaymentProduct707SpecificData.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebitPaymentProduct707SpecificData.java similarity index 66% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebitPaymentProduct707SpecificData.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebitPaymentProduct707SpecificData.java index 413206ce9..4bea966b7 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/token/definitions/TokenNonSepaDirectDebitPaymentProduct707SpecificData.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenNonSepaDirectDebitPaymentProduct707SpecificData.java @@ -1,7 +1,14 @@ -package com.globalcollect.gateway.sdk.java.gc.token.definitions; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban; +/** + * Class TokenNonSepaDirectDebitPaymentProduct707SpecificData + */ public class TokenNonSepaDirectDebitPaymentProduct707SpecificData { private String addressLine1 = null; diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenSepaDirectDebit.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenSepaDirectDebit.java new file mode 100644 index 000000000..d17d9ee20 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenSepaDirectDebit.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerTokenWithContactDetails; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateSepaDirectDebit; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.AbstractToken; + +/** + * Class TokenSepaDirectDebit + */ +public class TokenSepaDirectDebit extends AbstractToken { + + private CustomerTokenWithContactDetails customer = null; + + private MandateSepaDirectDebit mandate = null; + + public CustomerTokenWithContactDetails getCustomer() { + return customer; + } + + public void setCustomer(CustomerTokenWithContactDetails value) { + this.customer = value; + } + + public MandateSepaDirectDebit getMandate() { + return mandate; + } + + public void setMandate(MandateSepaDirectDebit value) { + this.mandate = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenSepaDirectDebitWithoutCreditor.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenSepaDirectDebitWithoutCreditor.java new file mode 100644 index 000000000..00c3d580a --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/domain/token/definitions/TokenSepaDirectDebitWithoutCreditor.java @@ -0,0 +1,35 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.domain.token.definitions; + +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerTokenWithContactDetails; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.MandateSepaDirectDebitWithoutCreditor; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.AbstractToken; + +/** + * Class TokenSepaDirectDebitWithoutCreditor + */ +public class TokenSepaDirectDebitWithoutCreditor extends AbstractToken { + + private CustomerTokenWithContactDetails customer = null; + + private MandateSepaDirectDebitWithoutCreditor mandate = null; + + public CustomerTokenWithContactDetails getCustomer() { + return customer; + } + + public void setCustomer(CustomerTokenWithContactDetails value) { + this.customer = value; + } + + public MandateSepaDirectDebitWithoutCreditor getMandate() { + return mandate; + } + + public void setMandate(MandateSepaDirectDebitWithoutCreditor value) { + this.mandate = value; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/MerchantClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/MerchantClient.java new file mode 100644 index 000000000..5fd5f454f --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/MerchantClient.java @@ -0,0 +1,128 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant; + +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.merchant.hostedcheckouts.HostedcheckoutsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.payments.PaymentsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.payouts.PayoutsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.productgroups.ProductgroupsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.products.ProductsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.refunds.RefundsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.riskassessments.RiskassessmentsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ServicesClient; +import com.ingenico.connect.gateway.sdk.java.merchant.sessions.SessionsClient; +import com.ingenico.connect.gateway.sdk.java.merchant.tokens.TokensClient; +import java.util.Map; + +/** + * Merchant client. Thread-safe. + */ +public class MerchantClient extends ApiResource { + + public MerchantClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/payouts + * Create, cancel and approve payouts + * + * @return PayoutsClient + */ + public PayoutsClient payouts() { + return new PayoutsClient(this, null); + } + + /** + * Resource /{merchantId}/refunds + * Create, cancel and approve refunds + * + * @return RefundsClient + */ + public RefundsClient refunds() { + return new RefundsClient(this, null); + } + + /** + * Resource /{merchantId}/sessions + * Create new Session for Client2Server API calls + * + * @return SessionsClient + */ + public SessionsClient sessions() { + return new SessionsClient(this, null); + } + + /** + * Resource /{merchantId}/tokens + * Create, delete and update tokens + * + * @return TokensClient + */ + public TokensClient tokens() { + return new TokensClient(this, null); + } + + /** + * Resource /{merchantId}/services + * Several services to help you + * + * @return ServicesClient + */ + public ServicesClient services() { + return new ServicesClient(this, null); + } + + /** + * Resource /{merchantId}/hostedcheckouts + * Create new hosted checkout + * + * @return HostedcheckoutsClient + */ + public HostedcheckoutsClient hostedcheckouts() { + return new HostedcheckoutsClient(this, null); + } + + /** + * Resource /{merchantId}/products + * Get information about payment products + * + * @return ProductsClient + */ + public ProductsClient products() { + return new ProductsClient(this, null); + } + + /** + * Resource /{merchantId}/payments + * Create, cancel and approve payments + * + * @return PaymentsClient + */ + public PaymentsClient payments() { + return new PaymentsClient(this, null); + } + + /** + * Resource /{merchantId}/productgroups + * Get information about payment product groups + * + * @return ProductgroupsClient + */ + public ProductgroupsClient productgroups() { + return new ProductgroupsClient(this, null); + } + + /** + * Resource /{merchantId}/riskassessments + * Perform risk assessments on your customer data + * + * @return RiskassessmentsClient + */ + public RiskassessmentsClient riskassessments() { + return new RiskassessmentsClient(this, null); + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/HostedcheckoutsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/HostedcheckoutsClient.java new file mode 100644 index 000000000..760fb0f91 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/hostedcheckouts/HostedcheckoutsClient.java @@ -0,0 +1,148 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.hostedcheckouts; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.CreateHostedCheckoutRequest; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.CreateHostedCheckoutResponse; +import com.ingenico.connect.gateway.sdk.java.domain.hostedcheckout.GetHostedCheckoutResponse; +import java.util.Map; +import java.util.TreeMap; + +/** + * Hostedcheckouts client. Thread-safe. + */ +public class HostedcheckoutsClient extends ApiResource { + + public HostedcheckoutsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/hostedcheckouts + * Create hosted checkout + * + * @param body CreateHostedCheckoutRequest + * @return CreateHostedCheckoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreateHostedCheckoutResponse create(CreateHostedCheckoutRequest body) { + return create(body, null); + } + + /** + * Resource /{merchantId}/hostedcheckouts + * Create hosted checkout + * + * @param body CreateHostedCheckoutRequest + * @param context CallContext + * @return CreateHostedCheckoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreateHostedCheckoutResponse create(CreateHostedCheckoutRequest body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/hostedcheckouts", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + CreateHostedCheckoutResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} + * Get hosted checkout status + * + * @param hostedCheckoutId String + * @return GetHostedCheckoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public GetHostedCheckoutResponse get(String hostedCheckoutId) { + return get(hostedCheckoutId, null); + } + + /** + * Resource /{merchantId}/hostedcheckouts/{hostedCheckoutId} + * Get hosted checkout status + * + * @param hostedCheckoutId String + * @param context CallContext + * @return GetHostedCheckoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public GetHostedCheckoutResponse get(String hostedCheckoutId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("hostedCheckoutId", hostedCheckoutId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/hostedcheckouts/{hostedCheckoutId}", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + null, + GetHostedCheckoutResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/payments/PaymentsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/payments/PaymentsClient.java new file mode 100644 index 000000000..3b3058fc8 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/payments/PaymentsClient.java @@ -0,0 +1,572 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payments; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.DeclinedPaymentException; +import com.ingenico.connect.gateway.sdk.java.DeclinedRefundException; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.ApprovePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CancelApprovalPaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CancelPaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentApprovalResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.TokenizePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundRequest; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundResponse; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenResponse; +import java.util.Map; +import java.util.TreeMap; + +/** + * Payments client. Thread-safe. + */ +public class PaymentsClient extends ApiResource { + + public PaymentsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/payments/{paymentId}/refund + * Create refund + * + * @param paymentId String + * @param body RefundRequest + * @return RefundResponse + * @throws DeclinedRefundException if the GlobalCollect platform declined / rejected the refund. The refund result will be available from the exception. + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RefundResponse refund(String paymentId, RefundRequest body) { + return refund(paymentId, body, null); + } + + /** + * Resource /{merchantId}/payments/{paymentId}/refund + * Create refund + * + * @param paymentId String + * @param body RefundRequest + * @param context CallContext + * @return RefundResponse + * @throws DeclinedRefundException if the GlobalCollect platform declined / rejected the refund. The refund result will be available from the exception. + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RefundResponse refund(String paymentId, RefundRequest body, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentId", paymentId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/refund", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + RefundResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 400 : + errorType = RefundErrorResponse.class; + break; + case 404 : + errorType = RefundErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payments/{paymentId}/processchallenged + * Approves challenged payment + * + * @param paymentId String + * @return PaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentResponse processchallenged(String paymentId) { + return processchallenged(paymentId, null); + } + + /** + * Resource /{merchantId}/payments/{paymentId}/processchallenged + * Approves challenged payment + * + * @param paymentId String + * @param context CallContext + * @return PaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentResponse processchallenged(String paymentId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentId", paymentId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/processchallenged", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + null, + PaymentResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + case 405 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payments/{paymentId} + * Get payment + * + * @param paymentId String + * @return PaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentResponse get(String paymentId) { + return get(paymentId, null); + } + + /** + * Resource /{merchantId}/payments/{paymentId} + * Get payment + * + * @param paymentId String + * @param context CallContext + * @return PaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentResponse get(String paymentId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentId", paymentId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + null, + PaymentResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payments + * Create payment + * + * @param body CreatePaymentRequest + * @return CreatePaymentResponse + * @throws DeclinedPaymentException if the GlobalCollect platform declined / rejected the payment. The payment result will be available from the exception. + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreatePaymentResponse create(CreatePaymentRequest body) { + return create(body, null); + } + + /** + * Resource /{merchantId}/payments + * Create payment + * + * @param body CreatePaymentRequest + * @param context CallContext + * @return CreatePaymentResponse + * @throws DeclinedPaymentException if the GlobalCollect platform declined / rejected the payment. The payment result will be available from the exception. + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreatePaymentResponse create(CreatePaymentRequest body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + CreatePaymentResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 400 : + errorType = PaymentErrorResponse.class; + break; + case 402 : + errorType = PaymentErrorResponse.class; + break; + case 403 : + errorType = PaymentErrorResponse.class; + break; + case 502 : + errorType = PaymentErrorResponse.class; + break; + case 503 : + errorType = PaymentErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payments/{paymentId}/tokenize + * Create a token from payment + * + * @param paymentId String + * @param body TokenizePaymentRequest + * @return CreateTokenResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreateTokenResponse tokenize(String paymentId, TokenizePaymentRequest body) { + return tokenize(paymentId, body, null); + } + + /** + * Resource /{merchantId}/payments/{paymentId}/tokenize + * Create a token from payment + * + * @param paymentId String + * @param body TokenizePaymentRequest + * @param context CallContext + * @return CreateTokenResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreateTokenResponse tokenize(String paymentId, TokenizePaymentRequest body, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentId", paymentId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/tokenize", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + CreateTokenResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payments/{paymentId}/cancel + * Cancel payment + * + * @param paymentId String + * @return CancelPaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CancelPaymentResponse cancel(String paymentId) { + return cancel(paymentId, null); + } + + /** + * Resource /{merchantId}/payments/{paymentId}/cancel + * Cancel payment + * + * @param paymentId String + * @param context CallContext + * @return CancelPaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CancelPaymentResponse cancel(String paymentId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentId", paymentId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/cancel", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + null, + CancelPaymentResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 402 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payments/{paymentId}/approve + * Capture payment + * + * @param paymentId String + * @param body ApprovePaymentRequest + * @return PaymentApprovalResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentApprovalResponse approve(String paymentId, ApprovePaymentRequest body) { + return approve(paymentId, body, null); + } + + /** + * Resource /{merchantId}/payments/{paymentId}/approve + * Capture payment + * + * @param paymentId String + * @param body ApprovePaymentRequest + * @param context CallContext + * @return PaymentApprovalResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentApprovalResponse approve(String paymentId, ApprovePaymentRequest body, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentId", paymentId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/approve", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + PaymentApprovalResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 402 : + errorType = ErrorResponse.class; + break; + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payments/{paymentId}/cancelapproval + * Undo capture payment request + * + * @param paymentId String + * @return CancelApprovalPaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CancelApprovalPaymentResponse cancelapproval(String paymentId) { + return cancelapproval(paymentId, null); + } + + /** + * Resource /{merchantId}/payments/{paymentId}/cancelapproval + * Undo capture payment request + * + * @param paymentId String + * @param context CallContext + * @return CancelApprovalPaymentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CancelApprovalPaymentResponse cancelapproval(String paymentId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentId", paymentId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payments/{paymentId}/cancelapproval", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + null, + CancelApprovalPaymentResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/payouts/PayoutsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/payouts/PayoutsClient.java new file mode 100644 index 000000000..fbb2354e6 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/payouts/PayoutsClient.java @@ -0,0 +1,349 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.payouts; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.DeclinedPayoutException; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payout.ApprovePayoutRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payout.CreatePayoutRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutResponse; +import java.util.Map; +import java.util.TreeMap; + +/** + * Payouts client. Thread-safe. + */ +public class PayoutsClient extends ApiResource { + + public PayoutsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/payouts/{payoutId}/cancel + * Cancel payout + * + * @param payoutId String + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancel(String payoutId) { + return cancel(payoutId, null); + } + + /** + * Resource /{merchantId}/payouts/{payoutId}/cancel + * Cancel payout + * + * @param payoutId String + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancel(String payoutId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("payoutId", payoutId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}/cancel", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + null, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 402 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payouts + * Create payout + * + * @param body CreatePayoutRequest + * @return PayoutResponse + * @throws DeclinedPayoutException if the GlobalCollect platform declined / rejected the payout. The payout result will be available from the exception. + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PayoutResponse create(CreatePayoutRequest body) { + return create(body, null); + } + + /** + * Resource /{merchantId}/payouts + * Create payout + * + * @param body CreatePayoutRequest + * @param context CallContext + * @return PayoutResponse + * @throws DeclinedPayoutException if the GlobalCollect platform declined / rejected the payout. The payout result will be available from the exception. + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PayoutResponse create(CreatePayoutRequest body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + PayoutResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 400 : + errorType = PayoutErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payouts/{payoutId}/approve + * Approve payout + * + * @param payoutId String + * @param body ApprovePayoutRequest + * @return PayoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PayoutResponse approve(String payoutId, ApprovePayoutRequest body) { + return approve(payoutId, body, null); + } + + /** + * Resource /{merchantId}/payouts/{payoutId}/approve + * Approve payout + * + * @param payoutId String + * @param body ApprovePayoutRequest + * @param context CallContext + * @return PayoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PayoutResponse approve(String payoutId, ApprovePayoutRequest body, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("payoutId", payoutId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}/approve", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + PayoutResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 402 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payouts/{payoutId}/cancelapproval + * Undo approve payout + * + * @param payoutId String + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancelapproval(String payoutId) { + return cancelapproval(payoutId, null); + } + + /** + * Resource /{merchantId}/payouts/{payoutId}/cancelapproval + * Undo approve payout + * + * @param payoutId String + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancelapproval(String payoutId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("payoutId", payoutId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}/cancelapproval", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + null, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 405 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/payouts/{payoutId} + * Get payout + * + * @param payoutId String + * @return PayoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PayoutResponse get(String payoutId) { + return get(payoutId, null); + } + + /** + * Resource /{merchantId}/payouts/{payoutId} + * Get payout + * + * @param payoutId String + * @param context CallContext + * @return PayoutResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PayoutResponse get(String payoutId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("payoutId", payoutId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/payouts/{payoutId}", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + null, + PayoutResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/GetParams.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/FindProductgroupsParams.java similarity index 62% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/GetParams.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/FindProductgroupsParams.java index 5d1529e2e..e031ee808 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/GetParams.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/FindProductgroupsParams.java @@ -1,11 +1,19 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.productgroups; - -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.RequestParam; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.productgroups; + +import com.ingenico.connect.gateway.sdk.java.AbstractParamRequest; +import com.ingenico.connect.gateway.sdk.java.RequestParam; import java.util.LinkedList; import java.util.List; -public class GetParams implements GcParamRequest { +/** + * Query parameters for + * Get payment product groups + */ +public class FindProductgroupsParams extends AbstractParamRequest { private Long amount; @@ -88,28 +96,12 @@ public void setCurrencyCode(String value) { @Override public List toRequestParameters() { List result = new LinkedList(); - if (amount != null) { - result.add(new RequestParam("amount", amount.toString())); - } - if (hide != null) { - for (String value : hide) { - if (value != null) { - result.add(new RequestParam("hide", value.toString())); - } - } - } - if (isRecurring != null) { - result.add(new RequestParam("isRecurring", isRecurring.toString())); - } - if (countryCode != null) { - result.add(new RequestParam("countryCode", countryCode.toString())); - } - if (locale != null) { - result.add(new RequestParam("locale", locale.toString())); - } - if (currencyCode != null) { - result.add(new RequestParam("currencyCode", currencyCode.toString())); - } + addParameter(result, "amount", amount); + addParameter(result, "hide", hide); + addParameter(result, "isRecurring", isRecurring); + addParameter(result, "countryCode", countryCode); + addParameter(result, "locale", locale); + addParameter(result, "currencyCode", currencyCode); return result; } } diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/FindParams.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetProductgroupParams.java similarity index 62% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/FindParams.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetProductgroupParams.java index d4271a228..fb6896e95 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/productgroups/FindParams.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetProductgroupParams.java @@ -1,11 +1,19 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.productgroups; - -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.RequestParam; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.productgroups; + +import com.ingenico.connect.gateway.sdk.java.AbstractParamRequest; +import com.ingenico.connect.gateway.sdk.java.RequestParam; import java.util.LinkedList; import java.util.List; -public class FindParams implements GcParamRequest { +/** + * Query parameters for + * Get payment product group + */ +public class GetProductgroupParams extends AbstractParamRequest { private Long amount; @@ -88,28 +96,12 @@ public void setCurrencyCode(String value) { @Override public List toRequestParameters() { List result = new LinkedList(); - if (amount != null) { - result.add(new RequestParam("amount", amount.toString())); - } - if (hide != null) { - for (String value : hide) { - if (value != null) { - result.add(new RequestParam("hide", value.toString())); - } - } - } - if (isRecurring != null) { - result.add(new RequestParam("isRecurring", isRecurring.toString())); - } - if (countryCode != null) { - result.add(new RequestParam("countryCode", countryCode.toString())); - } - if (locale != null) { - result.add(new RequestParam("locale", locale.toString())); - } - if (currencyCode != null) { - result.add(new RequestParam("currencyCode", currencyCode.toString())); - } + addParameter(result, "amount", amount); + addParameter(result, "hide", hide); + addParameter(result, "isRecurring", isRecurring); + addParameter(result, "countryCode", countryCode); + addParameter(result, "locale", locale); + addParameter(result, "currencyCode", currencyCode); return result; } } diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/ProductgroupsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/ProductgroupsClient.java new file mode 100644 index 000000000..80277179f --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/ProductgroupsClient.java @@ -0,0 +1,151 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.productgroups; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProductGroupResponse; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProductGroups; +import java.util.Map; +import java.util.TreeMap; + +/** + * Productgroups client. Thread-safe. + */ +public class ProductgroupsClient extends ApiResource { + + public ProductgroupsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/productgroups + * Get payment product groups + * + * @param query FindProductgroupsParams + * @return PaymentProductGroups + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProductGroups find(FindProductgroupsParams query) { + return find(query, null); + } + + /** + * Resource /{merchantId}/productgroups + * Get payment product groups + * + * @param query FindProductgroupsParams + * @param context CallContext + * @return PaymentProductGroups + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProductGroups find(FindProductgroupsParams query, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/productgroups", null); + try { + return communicator.get( + uri, + getClientHeaders(), + query, + PaymentProductGroups.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/productgroups/{paymentProductGroupId} + * Get payment product group + * + * @param paymentProductGroupId String + * @param query GetProductgroupParams + * @return PaymentProductGroupResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProductGroupResponse get(String paymentProductGroupId, GetProductgroupParams query) { + return get(paymentProductGroupId, query, null); + } + + /** + * Resource /{merchantId}/productgroups/{paymentProductGroupId} + * Get payment product group + * + * @param paymentProductGroupId String + * @param query GetProductgroupParams + * @param context CallContext + * @return PaymentProductGroupResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProductGroupResponse get(String paymentProductGroupId, GetProductgroupParams query, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentProductGroupId", paymentProductGroupId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/productgroups/{paymentProductGroupId}", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + query, + PaymentProductGroupResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/DirectoryParams.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/DirectoryParams.java new file mode 100644 index 000000000..a90aecd78 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/DirectoryParams.java @@ -0,0 +1,45 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import com.ingenico.connect.gateway.sdk.java.AbstractParamRequest; +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import java.util.LinkedList; +import java.util.List; + +/** + * Query parameters for + * Get payment product directory + */ +public class DirectoryParams extends AbstractParamRequest { + + private String currencyCode; + + private String countryCode; + + public String getCurrencyCode() { + return currencyCode; + } + + public void setCurrencyCode(String value) { + this.currencyCode = value; + } + + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(String value) { + this.countryCode = value; + } + + @Override + public List toRequestParameters() { + List result = new LinkedList(); + addParameter(result, "currencyCode", currencyCode); + addParameter(result, "countryCode", countryCode); + return result; + } +} diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/GetParams.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/FindProductsParams.java similarity index 62% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/GetParams.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/FindProductsParams.java index 5ca0b50ec..4cdc1c9b1 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/GetParams.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/FindProductsParams.java @@ -1,11 +1,19 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.products; - -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.RequestParam; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import com.ingenico.connect.gateway.sdk.java.AbstractParamRequest; +import com.ingenico.connect.gateway.sdk.java.RequestParam; import java.util.LinkedList; import java.util.List; -public class GetParams implements GcParamRequest { +/** + * Query parameters for + * Get payment products + */ +public class FindProductsParams extends AbstractParamRequest { private Long amount; @@ -88,28 +96,12 @@ public void setCurrencyCode(String value) { @Override public List toRequestParameters() { List result = new LinkedList(); - if (amount != null) { - result.add(new RequestParam("amount", amount.toString())); - } - if (hide != null) { - for (String value : hide) { - if (value != null) { - result.add(new RequestParam("hide", value.toString())); - } - } - } - if (isRecurring != null) { - result.add(new RequestParam("isRecurring", isRecurring.toString())); - } - if (countryCode != null) { - result.add(new RequestParam("countryCode", countryCode.toString())); - } - if (locale != null) { - result.add(new RequestParam("locale", locale.toString())); - } - if (currencyCode != null) { - result.add(new RequestParam("currencyCode", currencyCode.toString())); - } + addParameter(result, "amount", amount); + addParameter(result, "hide", hide); + addParameter(result, "isRecurring", isRecurring); + addParameter(result, "countryCode", countryCode); + addParameter(result, "locale", locale); + addParameter(result, "currencyCode", currencyCode); return result; } } diff --git a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/FindParams.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/GetProductParams.java similarity index 62% rename from src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/FindParams.java rename to src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/GetProductParams.java index 1efa515a7..692fc2672 100644 --- a/src/main/generated/com/globalcollect/gateway/sdk/java/gc/merchant/products/FindParams.java +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/GetProductParams.java @@ -1,11 +1,19 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.products; - -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.RequestParam; +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import com.ingenico.connect.gateway.sdk.java.AbstractParamRequest; +import com.ingenico.connect.gateway.sdk.java.RequestParam; import java.util.LinkedList; import java.util.List; -public class FindParams implements GcParamRequest { +/** + * Query parameters for + * Get payment product + */ +public class GetProductParams extends AbstractParamRequest { private Long amount; @@ -88,28 +96,12 @@ public void setCurrencyCode(String value) { @Override public List toRequestParameters() { List result = new LinkedList(); - if (amount != null) { - result.add(new RequestParam("amount", amount.toString())); - } - if (hide != null) { - for (String value : hide) { - if (value != null) { - result.add(new RequestParam("hide", value.toString())); - } - } - } - if (isRecurring != null) { - result.add(new RequestParam("isRecurring", isRecurring.toString())); - } - if (countryCode != null) { - result.add(new RequestParam("countryCode", countryCode.toString())); - } - if (locale != null) { - result.add(new RequestParam("locale", locale.toString())); - } - if (currencyCode != null) { - result.add(new RequestParam("currencyCode", currencyCode.toString())); - } + addParameter(result, "amount", amount); + addParameter(result, "hide", hide); + addParameter(result, "isRecurring", isRecurring); + addParameter(result, "countryCode", countryCode); + addParameter(result, "locale", locale); + addParameter(result, "currencyCode", currencyCode); return result; } } diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/ProductsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/ProductsClient.java new file mode 100644 index 000000000..e5fc88c20 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/products/ProductsClient.java @@ -0,0 +1,213 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.product.Directory; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProductResponse; +import com.ingenico.connect.gateway.sdk.java.domain.product.PaymentProducts; +import java.util.Map; +import java.util.TreeMap; + +/** + * Products client. Thread-safe. + */ +public class ProductsClient extends ApiResource { + + public ProductsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/products/{paymentProductId}/directory + * Get payment product directory + * + * @param paymentProductId Integer + * @param query DirectoryParams + * @return Directory + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Directory directory(Integer paymentProductId, DirectoryParams query) { + return directory(paymentProductId, query, null); + } + + /** + * Resource /{merchantId}/products/{paymentProductId}/directory + * Get payment product directory + * + * @param paymentProductId Integer + * @param query DirectoryParams + * @param context CallContext + * @return Directory + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Directory directory(Integer paymentProductId, DirectoryParams query, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentProductId", paymentProductId.toString()); + String uri = instantiateUri("/{apiVersion}/{merchantId}/products/{paymentProductId}/directory", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + query, + Directory.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/products + * Get payment products + * + * @param query FindProductsParams + * @return PaymentProducts + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProducts find(FindProductsParams query) { + return find(query, null); + } + + /** + * Resource /{merchantId}/products + * Get payment products + * + * @param query FindProductsParams + * @param context CallContext + * @return PaymentProducts + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProducts find(FindProductsParams query, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/products", null); + try { + return communicator.get( + uri, + getClientHeaders(), + query, + PaymentProducts.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/products/{paymentProductId} + * Get payment product + * + * @param paymentProductId Integer + * @param query GetProductParams + * @return PaymentProductResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProductResponse get(Integer paymentProductId, GetProductParams query) { + return get(paymentProductId, query, null); + } + + /** + * Resource /{merchantId}/products/{paymentProductId} + * Get payment product + * + * @param paymentProductId Integer + * @param query GetProductParams + * @param context CallContext + * @return PaymentProductResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public PaymentProductResponse get(Integer paymentProductId, GetProductParams query, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("paymentProductId", paymentProductId.toString()); + String uri = instantiateUri("/{apiVersion}/{merchantId}/products/{paymentProductId}", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + query, + PaymentProductResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/refunds/RefundsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/refunds/RefundsClient.java new file mode 100644 index 000000000..0bbebea5e --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/refunds/RefundsClient.java @@ -0,0 +1,271 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.refunds; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.refund.ApproveRefundRequest; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundResponse; +import java.util.Map; +import java.util.TreeMap; + +/** + * Refunds client. Thread-safe. + */ +public class RefundsClient extends ApiResource { + + public RefundsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/refunds/{refundId}/cancel + * Cancel refund + * + * @param refundId String + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancel(String refundId) { + return cancel(refundId, null); + } + + /** + * Resource /{merchantId}/refunds/{refundId}/cancel + * Cancel refund + * + * @param refundId String + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancel(String refundId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("refundId", refundId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}/cancel", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + null, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/refunds/{refundId}/approve + * Approve refund + * + * @param refundId String + * @param body ApproveRefundRequest + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void approve(String refundId, ApproveRefundRequest body) { + return approve(refundId, body, null); + } + + /** + * Resource /{merchantId}/refunds/{refundId}/approve + * Approve refund + * + * @param refundId String + * @param body ApproveRefundRequest + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void approve(String refundId, ApproveRefundRequest body, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("refundId", refundId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}/approve", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/refunds/{refundId}/cancelapproval + * Undo approve refund + * + * @param refundId String + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancelapproval(String refundId) { + return cancelapproval(refundId, null); + } + + /** + * Resource /{merchantId}/refunds/{refundId}/cancelapproval + * Undo approve refund + * + * @param refundId String + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void cancelapproval(String refundId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("refundId", refundId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}/cancelapproval", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + null, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/refunds/{refundId} + * Get refund + * + * @param refundId String + * @return RefundResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RefundResponse get(String refundId) { + return get(refundId, null); + } + + /** + * Resource /{merchantId}/refunds/{refundId} + * Get refund + * + * @param refundId String + * @param context CallContext + * @return RefundResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RefundResponse get(String refundId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("refundId", refundId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/refunds/{refundId}", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + null, + RefundResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskassessmentsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskassessmentsClient.java new file mode 100644 index 000000000..732e7581f --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/riskassessments/RiskassessmentsClient.java @@ -0,0 +1,146 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.riskassessments; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentBankAccount; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentCard; +import com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentResponse; +import java.util.Map; + +/** + * Riskassessments client. Thread-safe. + */ +public class RiskassessmentsClient extends ApiResource { + + public RiskassessmentsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/riskassessments/cards + * Risk-assess card + * + * @param body RiskAssessmentCard + * @return RiskAssessmentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RiskAssessmentResponse cards(RiskAssessmentCard body) { + return cards(body, null); + } + + /** + * Resource /{merchantId}/riskassessments/cards + * Risk-assess card + * + * @param body RiskAssessmentCard + * @param context CallContext + * @return RiskAssessmentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RiskAssessmentResponse cards(RiskAssessmentCard body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/riskassessments/cards", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + RiskAssessmentResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/riskassessments/bankaccounts + * Risk-assess bank account + * + * @param body RiskAssessmentBankAccount + * @return RiskAssessmentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RiskAssessmentResponse bankaccounts(RiskAssessmentBankAccount body) { + return bankaccounts(body, null); + } + + /** + * Resource /{merchantId}/riskassessments/bankaccounts + * Risk-assess bank account + * + * @param body RiskAssessmentBankAccount + * @param context CallContext + * @return RiskAssessmentResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public RiskAssessmentResponse bankaccounts(RiskAssessmentBankAccount body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/riskassessments/bankaccounts", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + RiskAssessmentResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountParams.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountParams.java new file mode 100644 index 000000000..d1d8fff15 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountParams.java @@ -0,0 +1,56 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.services; + +import com.ingenico.connect.gateway.sdk.java.AbstractParamRequest; +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import java.util.LinkedList; +import java.util.List; + +/** + * Query parameters for + * Convert amount + */ +public class ConvertAmountParams extends AbstractParamRequest { + + private String source; + + private Long amount; + + private String target; + + public String getSource() { + return source; + } + + public void setSource(String value) { + this.source = value; + } + + public Long getAmount() { + return amount; + } + + public void setAmount(Long value) { + this.amount = value; + } + + public String getTarget() { + return target; + } + + public void setTarget(String value) { + this.target = value; + } + + @Override + public List toRequestParameters() { + List result = new LinkedList(); + addParameter(result, "source", source); + addParameter(result, "amount", amount); + addParameter(result, "target", target); + return result; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/services/ServicesClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/services/ServicesClient.java new file mode 100644 index 000000000..fe445471a --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/services/ServicesClient.java @@ -0,0 +1,267 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.services; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.services.BankDetailsRequest; +import com.ingenico.connect.gateway.sdk.java.domain.services.BankDetailsResponse; +import com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.domain.services.GetIINDetailsRequest; +import com.ingenico.connect.gateway.sdk.java.domain.services.GetIINDetailsResponse; +import com.ingenico.connect.gateway.sdk.java.domain.services.TestConnection; +import java.util.Map; + +/** + * Services client. Thread-safe. + */ +public class ServicesClient extends ApiResource { + + public ServicesClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/services/convert/bankaccount + * Convert Bankaccount + * + * @param body BankDetailsRequest + * @return BankDetailsResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public BankDetailsResponse bankaccount(BankDetailsRequest body) { + return bankaccount(body, null); + } + + /** + * Resource /{merchantId}/services/convert/bankaccount + * Convert Bankaccount + * + * @param body BankDetailsRequest + * @param context CallContext + * @return BankDetailsResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public BankDetailsResponse bankaccount(BankDetailsRequest body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/services/convert/bankaccount", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + BankDetailsResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/services/testconnection + * Test connection + * + * @return TestConnection + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public TestConnection testconnection() { + return testconnection(null); + } + + /** + * Resource /{merchantId}/services/testconnection + * Test connection + * + * @param context CallContext + * @return TestConnection + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public TestConnection testconnection(CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/services/testconnection", null); + try { + return communicator.get( + uri, + getClientHeaders(), + null, + TestConnection.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 403 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/services/getIINdetails + * Get IIN details + * + * @param body GetIINDetailsRequest + * @return GetIINDetailsResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public GetIINDetailsResponse getIINdetails(GetIINDetailsRequest body) { + return getIINdetails(body, null); + } + + /** + * Resource /{merchantId}/services/getIINdetails + * Get IIN details + * + * @param body GetIINDetailsRequest + * @param context CallContext + * @return GetIINDetailsResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public GetIINDetailsResponse getIINdetails(GetIINDetailsRequest body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/services/getIINdetails", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + GetIINDetailsResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/services/convert/amount + * Convert amount + * + * @param query ConvertAmountParams + * @return ConvertAmount + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public ConvertAmount convertAmount(ConvertAmountParams query) { + return convertAmount(query, null); + } + + /** + * Resource /{merchantId}/services/convert/amount + * Convert amount + * + * @param query ConvertAmountParams + * @param context CallContext + * @return ConvertAmount + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public ConvertAmount convertAmount(ConvertAmountParams query, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/services/convert/amount", null); + try { + return communicator.get( + uri, + getClientHeaders(), + query, + ConvertAmount.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/sessions/SessionsClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/sessions/SessionsClient.java new file mode 100644 index 000000000..6cf649904 --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/sessions/SessionsClient.java @@ -0,0 +1,87 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.sessions; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionRequest; +import com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionResponse; +import java.util.Map; + +/** + * Sessions client. Thread-safe. + */ +public class SessionsClient extends ApiResource { + + public SessionsClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/sessions + * Create Session + * + * @param body SessionRequest + * @return SessionResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public SessionResponse create(SessionRequest body) { + return create(body, null); + } + + /** + * Resource /{merchantId}/sessions + * Create Session + * + * @param body SessionRequest + * @param context CallContext + * @return SessionResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public SessionResponse create(SessionRequest body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/sessions", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + SessionResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenParams.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenParams.java new file mode 100644 index 000000000..d29744bed --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenParams.java @@ -0,0 +1,34 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import com.ingenico.connect.gateway.sdk.java.AbstractParamRequest; +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import java.util.LinkedList; +import java.util.List; + +/** + * Query parameters for + * Delete token + */ +public class DeleteTokenParams extends AbstractParamRequest { + + private String mandateCancelDate; + + public String getMandateCancelDate() { + return mandateCancelDate; + } + + public void setMandateCancelDate(String value) { + this.mandateCancelDate = value; + } + + @Override + public List toRequestParameters() { + List result = new LinkedList(); + addParameter(result, "mandateCancelDate", mandateCancelDate); + return result; + } +} diff --git a/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/tokens/TokensClient.java b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/tokens/TokensClient.java new file mode 100644 index 000000000..a88ed692f --- /dev/null +++ b/src/main/generated/com/ingenico/connect/gateway/sdk/java/merchant/tokens/TokensClient.java @@ -0,0 +1,344 @@ +/* + * This class was auto-generated from the API references found at + * https://developer.globalcollect.com/documentation/api/server/ + */ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.ApiResource; +import com.ingenico.connect.gateway.sdk.java.AuthorizationException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.token.ApproveTokenRequest; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenRequest; +import com.ingenico.connect.gateway.sdk.java.domain.token.CreateTokenResponse; +import com.ingenico.connect.gateway.sdk.java.domain.token.TokenResponse; +import com.ingenico.connect.gateway.sdk.java.domain.token.UpdateTokenRequest; +import java.util.Map; +import java.util.TreeMap; + +/** + * Tokens client. Thread-safe. + */ +public class TokensClient extends ApiResource { + + public TokensClient(ApiResource parent, Map pathContext) { + super(parent, pathContext); + } + + /** + * Resource /{merchantId}/tokens + * Create token + * + * @param body CreateTokenRequest + * @return CreateTokenResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreateTokenResponse create(CreateTokenRequest body) { + return create(body, null); + } + + /** + * Resource /{merchantId}/tokens + * Create token + * + * @param body CreateTokenRequest + * @param context CallContext + * @return CreateTokenResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public CreateTokenResponse create(CreateTokenRequest body, CallContext context) { + String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens", null); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + CreateTokenResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 403 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/tokens/{tokenId}/approvesepadirectdebit + * Approve SEPA DD mandate + * + * @param tokenId String + * @param body ApproveTokenRequest + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void approvesepadirectdebit(String tokenId, ApproveTokenRequest body) { + return approvesepadirectdebit(tokenId, body, null); + } + + /** + * Resource /{merchantId}/tokens/{tokenId}/approvesepadirectdebit + * Approve SEPA DD mandate + * + * @param tokenId String + * @param body ApproveTokenRequest + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void approvesepadirectdebit(String tokenId, ApproveTokenRequest body, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("tokenId", tokenId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}/approvesepadirectdebit", pathContext); + try { + return communicator.post( + uri, + getClientHeaders(), + null, + body, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/tokens/{tokenId} + * Update token + * + * @param tokenId String + * @param body UpdateTokenRequest + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void update(String tokenId, UpdateTokenRequest body) { + return update(tokenId, body, null); + } + + /** + * Resource /{merchantId}/tokens/{tokenId} + * Update token + * + * @param tokenId String + * @param body UpdateTokenRequest + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void update(String tokenId, UpdateTokenRequest body, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("tokenId", tokenId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}", pathContext); + try { + return communicator.put( + uri, + getClientHeaders(), + null, + body, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/tokens/{tokenId} + * Get token + * + * @param tokenId String + * @return TokenResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public TokenResponse get(String tokenId) { + return get(tokenId, null); + } + + /** + * Resource /{merchantId}/tokens/{tokenId} + * Get token + * + * @param tokenId String + * @param context CallContext + * @return TokenResponse + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public TokenResponse get(String tokenId, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("tokenId", tokenId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}", pathContext); + try { + return communicator.get( + uri, + getClientHeaders(), + null, + TokenResponse.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } + + /** + * Resource /{merchantId}/tokens/{tokenId} + * Delete token + * + * @param tokenId String + * @param query DeleteTokenParams + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void delete(String tokenId, DeleteTokenParams query) { + return delete(tokenId, query, null); + } + + /** + * Resource /{merchantId}/tokens/{tokenId} + * Delete token + * + * @param tokenId String + * @param query DeleteTokenParams + * @param context CallContext + * @return Void + * @throws ValidationException if the request was not correct and couldn't be processed (HTTP status code 400) + * @throws AuthorizationException if the request was not allowed (HTTP status code 403) + * @throws IdempotenceException if an idempotent request caused a conflict (HTTP status code 409) + * @throws ReferenceException if an object was attempted to be referenced that doesn't exist or has been removed, + * or there was a conflict (HTTP status code 404, 409 or 410) + * @throws GlobalCollectException if something went wrong at the GlobalCollect platform, + * the GlobalCollect platform was unable to process a message from a downstream partner/acquirer, + * or the service that you're trying to reach is temporary unavailable (HTTP status code 500, 502 or 503) + * @throws ApiException if the GlobalCollect platform returned any other error + */ + public Void delete(String tokenId, DeleteTokenParams query, CallContext context) { + Map pathContext = new TreeMap(); + pathContext.put("tokenId", tokenId); + String uri = instantiateUri("/{apiVersion}/{merchantId}/tokens/{tokenId}", pathContext); + try { + return communicator.delete( + uri, + getClientHeaders(), + query, + Void.class, + context); + } catch (ResponseException e) { + final Class errorType; + switch (e.getStatusCode()) { + case 404 : + errorType = ErrorResponse.class; + break; + default: + errorType = ErrorResponse.class; + break; + } + final Object errorObject = communicator.getMarshaller().unmarshal(e.getBody(), errorType); + throw createException(e.getStatusCode(), e.getBody(), errorObject, context); + } + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/AbstractGcParamRequest.java b/src/main/java/com/globalcollect/gateway/sdk/java/AbstractGcParamRequest.java deleted file mode 100644 index e7645fc45..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/AbstractGcParamRequest.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.util.List; - -/** - * Base class for a {@link GcParamRequest}s. - */ -public abstract class AbstractGcParamRequest implements GcParamRequest { - - protected void addParameter(List requestParameters, String name, Object value) { - if (value != null) { - if (value instanceof String) { - requestParameters.add(new RequestParam(name, (String)value)); - } else if (value instanceof Long) { - requestParameters.add(new RequestParam(name, String.valueOf(value))); - } else { - throw new IllegalArgumentException("Unsupported request parameter type"); - } - } - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcAuthorizationException.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcAuthorizationException.java deleted file mode 100644 index 3698ead10..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcAuthorizationException.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.util.List; - -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; - -/** - * Represents an error response from the GlobalCollect platform when authorization failed. - */ -@SuppressWarnings("serial") -public class GcAuthorizationException extends GcApiException { - - public GcAuthorizationException(int statusCode, String responseBody, String errorId, List errors) { - super("the GlobalCollect platform returned an authorization error response", statusCode, responseBody, errorId, errors); - } - - public GcAuthorizationException(String message, int statusCode, String responseBody, String errorId, List errors) { - super(message, statusCode, responseBody, errorId, errors); - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcCommunicator.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcCommunicator.java deleted file mode 100644 index 466452ebb..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcCommunicator.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.io.Closeable; -import java.io.IOException; -import java.util.List; - -import com.globalcollect.gateway.sdk.java.logging.LoggingCapable; - -/** - * Used to communicate with the GlobalCollect platform web services. - *

- * It contains all the logic to transform a request object to a HTTP request and - * a HTTP response to a response object. - *

- * Thread-safe. - */ -public interface GcCommunicator extends Closeable, LoggingCapable { - - /** - * Releases any system resources associated with this object. - */ - @Override - void close() throws IOException; - - /** - * Corresponds to the HTTP GET method. - * - * @param relativePath The path to call, relative to the base URI. - * @param requestHeaders An optional list of request headers. - * @param requestParameters An optional set of request parameters. - * @param responseType The type of response to return. - * @param context The optional call context to use. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform - * @throws GcResponseException when an error response was received from the GlobalCollect platform - * @throws GcApiException when an error response was received from the GlobalCollect platform which contained a list of errors - */ -

O get(String relativePath, List requestHeaders, P requestParameters, - Class responseType, CallContext context); - - /** - * Corresponds to the HTTP DELETE method. - * - * @param relativePath The path to call, relative to the base URI. - * @param requestHeaders An optional list of request headers. - * @param requestParameters An optional set of request parameters. - * @param responseType The type of response to return. - * @param context The optional call context to use. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform - * @throws GcResponseException when an error response was received from the GlobalCollect platform - * @throws GcApiException when an error response was received from the GlobalCollect platform which contained a list of errors - */ -

O delete(String relativePath, List requestHeaders, P requestParameters, - Class responseType, CallContext context); - - /** - * Corresponds to the HTTP POST method. - * - * @param relativePath The path to call, relative to the base URI. - * @param requestHeaders An optional list of request headers. - * @param requestParameters An optional set of request parameters. - * @param requestBody The optional request body to send. - * @param responseType The type of response to return. - * @param context The optional call context to use. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform - * @throws GcResponseException when an error response was received from the GlobalCollect platform - * @throws GcApiException when an error response was received from the GlobalCollect platform which contained a list of errors - */ -

O post(String relativePath, List requestHeaders, P requestParameters, Object requestBody, - Class responseType, CallContext context); - - /** - * Corresponds to the HTTP PUT method. - * - * @param relativePath The path to call, relative to the base URI. - * @param requestHeaders An optional list of request headers. - * @param requestParameters An optional set of request parameters. - * @param requestBody The optional request body to send. - * @param responseType The type of response to return. - * @param context The optional call context to use. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform - * @throws GcResponseException when an error response was received from the GlobalCollect platform - * @throws GcApiException when an error response was received from the GlobalCollect platform which contained a list of errors - */ -

O put(String relativePath, List requestHeaders, P requestParameters, Object requestBody, - Class responseType, CallContext context); - - /** - * @return The {@link GcMarshaller} object associated with this communicator. Never {@code null}. - */ - GcMarshaller getMarshaller(); -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedTransactionException.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedTransactionException.java deleted file mode 100644 index faeaf3d55..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedTransactionException.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.util.List; - -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; - -/** - * Represents an error response from a create payment, payout or refund call. - */ -@SuppressWarnings("serial") -public abstract class GcDeclinedTransactionException extends GcApiException { - - public GcDeclinedTransactionException(int statusCode, String responseBody, String errorId, List errors) { - super(statusCode, responseBody, errorId, errors); - } - - public GcDeclinedTransactionException(String message, int statusCode, String responseBody, String errorId, List errors) { - super(message, statusCode, responseBody, errorId, errors); - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcDefaultConfiguration.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcDefaultConfiguration.java deleted file mode 100644 index 5f8a98a86..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcDefaultConfiguration.java +++ /dev/null @@ -1,218 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Properties; - -import com.globalcollect.gateway.sdk.java.defaultimpl.AuthorizationType; -import com.globalcollect.gateway.sdk.java.gc.GcClient; - -/** - * Configuration for the default components. - */ -public class GcDefaultConfiguration { - - /** The default number of maximum connections. */ - public static final int DEFAULT_MAX_CONNECTIONS = 10; - - private URI apiEndpoint; - - private int connectTimeout; - - private int socketTimeout; - - private int maxConnections; - - private AuthorizationType authorizationType; - - private String apiKeyId; - - private String secretApiKey; - - private GcProxyConfiguration proxyConfiguration; - - public GcDefaultConfiguration() {} - - public GcDefaultConfiguration(Properties defaultProperties) { - if (defaultProperties != null) { - apiEndpoint = getApiEndpoint(defaultProperties); - authorizationType = AuthorizationType.valueOf(defaultProperties.getProperty("gcs.api.authorizationType")); - connectTimeout = Integer.parseInt(defaultProperties.getProperty("gcs.api.connectTimeout")); - socketTimeout = Integer.parseInt(defaultProperties.getProperty("gcs.api.socketTimeout")); - maxConnections = getProperty(defaultProperties, "gcs.api.maxConnections", DEFAULT_MAX_CONNECTIONS); - - String proxyURI = defaultProperties.getProperty("gcs.api.proxy.uri"); - String proxyUser = defaultProperties.getProperty("gcs.api.proxy.username"); - String proxyPass = defaultProperties.getProperty("gcs.api.proxy.password"); - if (proxyURI != null) { - proxyConfiguration = new GcProxyConfiguration(URI.create(proxyURI), proxyUser, proxyPass); - } - } - } - - private int getProperty(Properties properties, String key, int defaultValue) { - String propertyValue = properties.getProperty(key, null); - return propertyValue != null ? Integer.parseInt(propertyValue) : defaultValue; - } - - private URI getApiEndpoint(Properties properties) { - String baseUri = properties.getProperty("gcs.api.baseUri"); - - String host = properties.getProperty("gcs.api.endpoint.host"); - String scheme = properties.getProperty("gcs.api.endpoint.scheme"); - String port = properties.getProperty("gcs.api.endpoint.port"); - - if (baseUri != null && (host != null || scheme != null || port != null)) { - throw new IllegalArgumentException("use either gcs.api.endpoint.host, gcs.api.endpoint.scheme and gcs.api.endpoint.port, " - + "or gcs.api.baseUri, but not both"); - } - - if (baseUri != null) { - // no host, scheme or port - URI base = URI.create(baseUri); - String path = base.getPath(); - if (!isValidPath(path)) { - throw new IllegalArgumentException("baseUri contains invalid path: " + baseUri); - } - if (base.getUserInfo() != null - || base.getQuery() != null - || base.getFragment() != null) { - - throw new IllegalArgumentException("baseUri must not contain user info, query or fragment"); - } - // base.resolve("") and base.resolve("/") each will contain a path of / which is not what we want - return createURI(base.getScheme(), base.getHost(), base.getPort()); - } - - return createURI(scheme != null ? scheme : "https", host, port != null ? Integer.parseInt(port) : -1); - } - - private boolean isValidPath(String path) { - if (path == null || path.isEmpty()) { - return true; - } else { - return "/".equals(path) || ("/" + GcClient.API_VERSION).equals(path) || ("/" + GcClient.API_VERSION + "/").equals(path); - } - } - - private URI createURI(String scheme, String host, int port) { - try { - return new URI(scheme, null, host, port, null, null, null); - } catch (URISyntaxException e) { - throw new IllegalArgumentException("Unable to construct API endpoint URI", e); - } - } - - /** - * Returns the GlobalCollect platform base URI. - */ - public URI getApiEndpoint() { - return apiEndpoint; - } - public void setApiEndpoint(URI apiEndpoint) { - if (apiEndpoint != null && apiEndpoint.getPath() != null && !apiEndpoint.getPath().isEmpty()) { - throw new IllegalArgumentException("apiEndpoint should not contain a path"); - } - if (apiEndpoint != null - && apiEndpoint.getUserInfo() != null - || apiEndpoint.getQuery() != null - || apiEndpoint.getFragment() != null) { - - throw new IllegalArgumentException("apiEndpoint should not contain user info, query or fragment"); - } - this.apiEndpoint = apiEndpoint; - } - public GcDefaultConfiguration withApiEndpoint(URI apiEndpoint) { - setApiEndpoint(apiEndpoint); - return this; - } - - /** - * An identifier for the secret API key. The {@code apiKeyId} can be - * retrieved from the Configuration Center. This identifier is visible in - * the HTTP request and is also used to identify the correct account. - */ - public String getApiKeyId() { - return apiKeyId; - } - public void setApiKeyId(String apiKeyId) { - this.apiKeyId = apiKeyId; - } - public GcDefaultConfiguration withApiKeyId(String apiKeyId) { - setApiKeyId(apiKeyId); - return this; - } - - /** - * A shared secret. The shared secret can be retrieved from the - * Configuration Center. An {@code apiKeyId} and {@code secretApiKey} always - * go hand-in-hand, the difference is that {@code secretApiKey} is never - * visible in the HTTP request. This secret is used as input for the HMAC - * algorithm. - */ - public String getSecretApiKey() { - return secretApiKey; - } - public void setSecretApiKey(String secretApiKey) { - this.secretApiKey = secretApiKey; - } - public GcDefaultConfiguration withSecretApiKey(String secretApiKey) { - setSecretApiKey(secretApiKey); - return this; - } - - public AuthorizationType getAuthorizationType() { - return authorizationType; - } - public void setAuthorizationType(AuthorizationType authorizationType) { - this.authorizationType = authorizationType; - } - public GcDefaultConfiguration withAuthorizationType(AuthorizationType authorizationType) { - setAuthorizationType(authorizationType); - return this; - } - - public int getConnectTimeout() { - return connectTimeout; - } - public void setConnectTimeout(int connectTimeout) { - this.connectTimeout = connectTimeout; - } - public GcDefaultConfiguration withConnectTimeout(int connectTimeout) { - setConnectTimeout(connectTimeout); - return this; - } - - public int getSocketTimeout() { - return socketTimeout; - } - public void setSocketTimeout(int socketTimeout) { - this.socketTimeout = socketTimeout; - } - public GcDefaultConfiguration withSocketTimeout(int socketTimeout) { - setSocketTimeout(socketTimeout); - return this; - } - - public int getMaxConnections() { - return maxConnections; - } - public void setMaxConnections(int maxConnections) { - this.maxConnections = maxConnections; - } - public GcDefaultConfiguration withMaxConnections(int maxConnections) { - setMaxConnections(maxConnections); - return this; - } - - public GcProxyConfiguration getProxyConfiguration() { - return proxyConfiguration; - } - public void setProxyConfiguration(GcProxyConfiguration proxyConfiguration) { - this.proxyConfiguration = proxyConfiguration; - } - public GcDefaultConfiguration withProxyConfiguration(GcProxyConfiguration proxyConfiguration) { - setProxyConfiguration(proxyConfiguration); - return this; - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcFactory.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcFactory.java deleted file mode 100644 index 18ee60dd0..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcFactory.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.util.Properties; - -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcAuthenticator; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcCommunicator; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcConnection; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcMarshaller; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcSessionBuilder; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.GcClientImpl; - -/** - * GlobalCollect platform factory for several SDK components. - */ -public final class GcFactory { - - private GcFactory() {} - - /** - * Creates a {@link GcDefaultConfiguration} based on the configuration - * values in {@code configurationFileUri} and {@code apiKeyId} and - * {@code secretApiKey}. - */ - public static GcDefaultConfiguration createDefaultConfiguration(URI configurationFileUri, String apiKeyId, String secretApiKey) { - try { - Properties defaultProperties = new Properties(); - InputStream configurationFileInputStream = configurationFileUri.toURL().openStream(); - try { - defaultProperties.load(configurationFileInputStream); - } finally { - configurationFileInputStream.close(); - } - return new GcDefaultConfiguration(defaultProperties) - .withApiKeyId(apiKeyId) - .withSecretApiKey(secretApiKey); - } catch (IOException e) { - throw new RuntimeException("Unable to load default properties", e); - } - } - - /** - * Creates a {@link GcSessionBuilder} based on the configuration values in - * {@code configurationFileUri}, {@code apiKeyId} and {@code secretApiKey}. - */ - public static GcSessionBuilder createSessionBuilder(URI configurationFileUri, String apiKeyId, String secretApiKey) { - GcDefaultConfiguration defaultConfiguration = createDefaultConfiguration(configurationFileUri, apiKeyId, secretApiKey); - return createSessionBuilder(defaultConfiguration); - } - - /** - * Creates a {@link GcSessionBuilder} based on the passed configuration. - */ - @SuppressWarnings("resource") - public static GcSessionBuilder createSessionBuilder(GcDefaultConfiguration defaultConfiguration) { - - GcSessionBuilder builder = new DefaultGcSessionBuilder(); - builder.using(defaultConfiguration.getApiEndpoint()); - builder.using(new DefaultGcConnection( - defaultConfiguration.getConnectTimeout(), - defaultConfiguration.getSocketTimeout(), - defaultConfiguration.getMaxConnections(), - defaultConfiguration.getProxyConfiguration() - )); - builder.using(new DefaultGcMetaDataProvider()); - builder.using(new DefaultGcAuthenticator( - defaultConfiguration.getAuthorizationType(), - defaultConfiguration.getApiKeyId(), - defaultConfiguration.getSecretApiKey() - )); - return builder; - } - - /** - * Creates a {@link GcCommunicator} based on the configuration values in - * {@code configurationFileUri}, {@code apiKeyId} and {@code secretApiKey}. - */ - public static GcCommunicator createCommunicator(URI configurationFileUri, String apiKeyId, String secretApiKey) { - GcDefaultConfiguration defaultConfiguration = createDefaultConfiguration(configurationFileUri, apiKeyId, secretApiKey); - return createCommunicator(defaultConfiguration); - } - - /** - * Creates a {@link GcCommunicator} based on the passed configuration. - */ - public static GcCommunicator createCommunicator(GcDefaultConfiguration defaultConfiguration) { - GcSessionBuilder createSessionBuilder = createSessionBuilder(defaultConfiguration); - return createCommunicator(createSessionBuilder.build()); - } - - /** - * Creates a {@link GcCommunicator} based on the passed {@link GcSession}. - */ - public static GcCommunicator createCommunicator(GcSession session) { - return new DefaultGcCommunicator(session, DefaultGcMarshaller.INSTANCE); - } - - /** - * Creates a {@link GcClient} based on the configuration values in - * {@code configurationFileUri}, {@code apiKeyId} and {@code secretApiKey}. - */ - public static GcClient createClient(URI configurationFileUri, String apiKeyId, String secretApiKey) { - return createClient(createCommunicator(configurationFileUri, apiKeyId, secretApiKey)); - } - - /** - * Creates a {@link GcClient} based on the passed configuration. - */ - public static GcClient createClient(GcDefaultConfiguration defaultConfiguration) { - return createClient(createCommunicator(defaultConfiguration)); - } - - /** - * Creates a {@link GcClient} based on the passed {@link GcSession}. - */ - public static GcClient createClient(GcSession session) { - return createClient(createCommunicator(session)); - } - - /** - * Creates a {@link GcClient} based on the passed {@link GcCommunicator}. - */ - public static GcClient createClient(GcCommunicator communicator) { - return new GcClientImpl(communicator); - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcMarshaller.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcMarshaller.java deleted file mode 100644 index 2d728400e..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcMarshaller.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -/** - * Used to marshal and unmarshal GlobalCollect platform request and response objects to and from JSON. Thread-safe. - */ -public interface GcMarshaller { - - /** - * Marshal a request object to a JSON string. - */ - String marshal(Object requestObject); - - /** - * Unmarshal a JSON string to a response object, in case of an error. - * - * @param statusCode This can be used to determine a specific course of action in case the JSON is not valid - * @param requestPath Used for exception message - * @param type The response object type. - * @throws GcMarshallerSyntaxException if the JSON is not a valid representation for an object of the given type - */ - T unmarshal(String responseJson, int statusCode, String requestPath, Class type); - - /** - * Unmarshal a JSON string to a response object. - * - * @param type The response object type. - * @throws GcMarshallerSyntaxException if the JSON is not a valid representation for an object of the given type - */ - T unmarshal(String responseJson, Class type); -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcMarshallerSyntaxException.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcMarshallerSyntaxException.java deleted file mode 100644 index 89fb397e2..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcMarshallerSyntaxException.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -/** - * Thrown when a JSON string cannot be converted to a response object. - */ -@SuppressWarnings("serial") -public class GcMarshallerSyntaxException extends RuntimeException { - - public GcMarshallerSyntaxException() { - super(); - } - - public GcMarshallerSyntaxException(Throwable cause) { - super(cause); - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcMetaDataProvider.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcMetaDataProvider.java deleted file mode 100644 index 50cf58166..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcMetaDataProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.util.Collection; - -/** - * Provides meta info about the server. Thread-safe. - */ -public interface GcMetaDataProvider { - - /** - * @return The server related headers containing the META data to be associated with the request (if any). - * Never {@code null}. - */ - Collection getServerMetaDataHeaders(); -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcReferenceException.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcReferenceException.java deleted file mode 100644 index 9d0db18e3..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcReferenceException.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.util.List; - -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; - -/** - * Represents an error response from the GlobalCollect platform when a non-existing or removed object is trying to be accessed. - */ -@SuppressWarnings("serial") -public class GcReferenceException extends GcApiException { - - public GcReferenceException(int statusCode, String responseBody, String errorId, List errors) { - super("the GlobalCollect platform returned a reference error response", statusCode, responseBody, errorId, errors); - } - - public GcReferenceException(String message, int statusCode, String responseBody, String errorId, List errors) { - super(message, statusCode, responseBody, errorId, errors); - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcSession.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcSession.java deleted file mode 100644 index e3665ccf9..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcSession.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.net.URI; - -/** - * Contains the components needed to communicate with the GlobalCollect platform. Thread-safe. - */ -public interface GcSession { - - /** - * @return The GlobalCollect platform API endpoint URI. This URI's path should be {@code null} or empty. - */ - URI getApiEndpoint(); - - /** - * @return The {@link GcConnection} object associated with this session. Never {@code null}. - */ - GcConnection getConnection(); - - /** - * @return The {@link GcMetaDataProvider} object associated with this session. Never {@code null}. - */ - GcMetaDataProvider getMetaDataProvider(); - - /** - * @return The {@link GcAuthenticator} object associated with this session. Never {@code null}. - */ - GcAuthenticator getAuthenticator(); -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcSessionBuilder.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcSessionBuilder.java deleted file mode 100644 index 677e06b25..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcSessionBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.net.URI; - -/** - * Builder for a {@link GcSession} object. - */ -public interface GcSessionBuilder { - - /** - * Sets the GlobalCollect platform API endpoint URI to use. - */ - GcSessionBuilder using(URI apiEndpoint); - - /** - * Sets the {@link GcConnection} to use. - */ - GcSessionBuilder using(GcConnection connection); - - /** - * Sets the {@link GcAuthenticator} to use. - */ - GcSessionBuilder using(GcAuthenticator authenticator); - - /** - * Sets the {@link GcMetaDataProvider} to use. - */ - GcSessionBuilder using(GcMetaDataProvider metaDataProvider); - - /** - * Creates a fully initialized {@link GcSession} object. - * - * @throws IllegalArgumentException if not all required components are set - */ - GcSession build(); -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcValidationException.java b/src/main/java/com/globalcollect/gateway/sdk/java/GcValidationException.java deleted file mode 100644 index 25f8960b3..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcValidationException.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.util.List; - -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; - -/** - * Represents an error response from the GlobalCollect platform when validation of requests failed. - */ -@SuppressWarnings("serial") -public class GcValidationException extends GcApiException { - - public GcValidationException(int statusCode, String responseBody, String errorId, List errors) { - super("the GlobalCollect platform returned an incorrect request error response", statusCode, responseBody, errorId, errors); - } - - public GcValidationException(String message, int statusCode, String responseBody, String errorId, List errors) { - super(message, statusCode, responseBody, errorId, errors); - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcCommunicator.java b/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcCommunicator.java deleted file mode 100644 index 59cf000f7..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcCommunicator.java +++ /dev/null @@ -1,280 +0,0 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; - -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; -import java.util.Locale; -import java.util.TimeZone; - -import org.apache.http.HttpStatus; -import org.apache.http.client.utils.URIBuilder; - -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcAuthenticator; -import com.globalcollect.gateway.sdk.java.GcCommunicationException; -import com.globalcollect.gateway.sdk.java.GcCommunicator; -import com.globalcollect.gateway.sdk.java.GcConnection; -import com.globalcollect.gateway.sdk.java.GcMarshaller; -import com.globalcollect.gateway.sdk.java.GcNotFoundException; -import com.globalcollect.gateway.sdk.java.GcParamRequest; -import com.globalcollect.gateway.sdk.java.GcResponse; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.GcSession; -import com.globalcollect.gateway.sdk.java.RequestHeader; -import com.globalcollect.gateway.sdk.java.RequestParam; -import com.globalcollect.gateway.sdk.java.logging.GcCommunicatorLogger; - -/** - * {@link GcCommunicator} implementation based on the components provided by {@link GcSession}. - */ -public class DefaultGcCommunicator implements GcCommunicator { - - private final GcSession session; - - private final GcMarshaller marshaller; - - public DefaultGcCommunicator(GcSession session, GcMarshaller marshaller) { - if (session == null) { - throw new IllegalArgumentException("session is required"); - } - if (marshaller == null) { - throw new IllegalArgumentException("marshaller is required"); - } - this.session = session; - this.marshaller = marshaller; - } - - @Override - public void close() throws IOException { - session.getConnection().close(); - } - - @Override - @SuppressWarnings("resource") - public

O get(String relativePath, List requestHeaders, P requestParametersObject, - Class responseType, CallContext context) { - - GcConnection connection = session.getConnection(); - - List requestParameters = requestParametersObject == null ? null : requestParametersObject.toRequestParameters(); - URI uri = toAbsoluteURI(relativePath, requestParameters); - - if (requestHeaders == null) { - requestHeaders = new ArrayList(); - } - - addGenericHeaders("GET", uri, requestHeaders, context); - - GcResponse response = connection.get(uri, requestHeaders); - return processResponse(response, responseType, relativePath, context); - } - - @Override - @SuppressWarnings("resource") - public

O delete(String relativePath, List requestHeaders, P requestrequestParameters, - Class responseType, CallContext context) { - - GcConnection connection = session.getConnection(); - - List requestParameters = requestrequestParameters == null ? null : requestrequestParameters.toRequestParameters(); - URI uri = toAbsoluteURI(relativePath, requestParameters); - - if (requestHeaders == null) { - requestHeaders = new ArrayList(); - } - - addGenericHeaders("DELETE", uri, requestHeaders, context); - - GcResponse response = connection.delete(uri, requestHeaders); - return processResponse(response, responseType, relativePath, context); - } - - @Override - @SuppressWarnings("resource") - public

O post(String relativePath, List requestHeaders, P requestParamObject, Object requestBody, - Class responseType, CallContext context) { - - GcConnection connection = session.getConnection(); - - List requestParameters = requestParamObject == null ? null : requestParamObject.toRequestParameters(); - URI uri = toAbsoluteURI(relativePath, requestParameters); - - if (requestHeaders == null) { - requestHeaders = new ArrayList(); - } - - String requestJson = null; - if (requestBody != null) { - requestHeaders.add(new RequestHeader("Content-Type", "application/json")); - requestJson = marshaller.marshal(requestBody); - } - - addGenericHeaders("POST", uri, requestHeaders, context); - - GcResponse response = connection.post(uri, requestHeaders, requestJson); - return processResponse(response, responseType, relativePath, context); - } - - @Override - @SuppressWarnings("resource") - public

O put(String relativePath, List requestHeaders, P requestParamObject, Object requestBody, - Class responseType, CallContext context) { - - GcConnection connection = session.getConnection(); - - List requestParameters = requestParamObject == null ? null : requestParamObject.toRequestParameters(); - URI uri = toAbsoluteURI(relativePath, requestParameters); - - - if (requestHeaders == null) { - requestHeaders = new ArrayList(); - } - - String requestJson = null; - if (requestBody != null) { - requestHeaders.add(new RequestHeader("Content-Type", "application/json")); - requestJson = marshaller.marshal(requestBody); - } - - addGenericHeaders("PUT", uri, requestHeaders, context); - - GcResponse response = connection.put(uri, requestHeaders, requestJson); - return processResponse(response, responseType, relativePath, context); - } - - @Override - public GcMarshaller getMarshaller() { - return marshaller; - } - - protected URI toAbsoluteURI(String relativePath, List requestParameters) { - - URI apiEndpoint = session.getApiEndpoint(); - - if (apiEndpoint.getPath() != null && !apiEndpoint.getPath().isEmpty()) { - throw new IllegalStateException("apiEndpoint should not contain a path"); - } - if (apiEndpoint.getUserInfo() != null - || apiEndpoint.getQuery() != null - || apiEndpoint.getFragment() != null) { - - throw new IllegalStateException("apiEndpoint should not contain user info, query or fragment"); - } - - String absolutePath; - if (relativePath.startsWith("/")) { - absolutePath = relativePath; - } else { - absolutePath = "/" + relativePath; - } - - URIBuilder uriBuilder = new URIBuilder() - .setScheme(apiEndpoint.getScheme()) - .setHost(apiEndpoint.getHost()) - .setPort(apiEndpoint.getPort()) - .setPath(absolutePath); - - if (requestParameters != null) { - for (RequestParam nvp: requestParameters) { - uriBuilder.addParameter(nvp.getName(), nvp.getValue()); - } - } - - try { - return uriBuilder.build(); - } catch (URISyntaxException e) { - throw new IllegalArgumentException("Unable to construct URI", e); - } - } - - protected void addGenericHeaders(String httpMethod, URI uri, List requestHeaders, CallContext context) { - - // add server meta info headers - requestHeaders.addAll(session.getMetaDataProvider().getServerMetaDataHeaders()); - - // add date header - requestHeaders.add(new RequestHeader("Date", getHeaderDateString())); - - // add context specific headers - if (context != null && context.getIdempotenceKey() != null) { - requestHeaders.add(new RequestHeader("X-GCS-Idempotence-Key", context.getIdempotenceKey())); - } - - // add signature - GcAuthenticator authenticator = session.getAuthenticator(); - String authenticationSignature = authenticator.createSimpleAuthenticationSignature(httpMethod, uri, requestHeaders); - requestHeaders.add(new RequestHeader("Authorization", authenticationSignature)); - } - - /** - * Returns the date in the preferred format for the HTTP date header (RFC1123). - */ - protected String getHeaderDateString() { - Calendar calendar = Calendar.getInstance(); - SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); - dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); - return dateFormat.format(calendar.getTime()); - } - protected O processResponse(GcResponse response, Class responseType, String requestPath, CallContext context) { - - if (context != null) { - updateContext(response, context); - } - throwExceptionIfNecessary(response, requestPath); - return marshaller.unmarshal(response.getBody(), responseType); - } - - protected void updateContext(GcResponse response, CallContext context) { - - String idempotenceRequestTimestampValue = response.getHeaderValue("X-GCS-Idempotence-Request-Timestamp"); - if (idempotenceRequestTimestampValue != null) { - Long idempotenceRequestTimestamp = Long.valueOf(idempotenceRequestTimestampValue); - context.setIdempotenceRequestTimestamp(idempotenceRequestTimestamp); - } else { - context.setIdempotenceRequestTimestamp(null); - } - } - - /** - * Checks the {@link GcResponse} for errors and throws an exception if necessary. - */ - protected void throwExceptionIfNecessary(GcResponse response, String requestPath) throws GcResponseException, GcCommunicationException, GcNotFoundException { - - int statusCode = response.getStatusCode(); - // status codes in the 100 or 300 range are not expected - if (statusCode < 200 || statusCode >= 300) { - String body = response.getBody(); - if (body != null && !isJson(response)) { - GcResponseException cause = new GcResponseException(response); - if (statusCode == HttpStatus.SC_NOT_FOUND) { - throw new GcNotFoundException("The requested resource was not found; invalid path: " + requestPath, cause); - } else { - throw new GcCommunicationException(cause); - } - } else { - throw new GcResponseException(response); - } - } - } - - private boolean isJson(GcResponse response) { - String contentType = response.getHeaderValue("Content-Type"); - return contentType == null || "application/json".equalsIgnoreCase(contentType) || contentType.toLowerCase().startsWith("application/json"); - } - - @Override - public void enableLogging(GcCommunicatorLogger communicatorLogger) { - // delegate to the connection - session.getConnection().enableLogging(communicatorLogger); - } - - @Override - public void disableLogging() { - // delegate to the connection - session.getConnection().disableLogging(); - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcMarshaller.java b/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcMarshaller.java deleted file mode 100644 index 2c9de6d0f..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcMarshaller.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; - -import org.apache.http.HttpStatus; - -import com.globalcollect.gateway.sdk.java.GcMarshaller; -import com.globalcollect.gateway.sdk.java.GcMarshallerSyntaxException; -import com.globalcollect.gateway.sdk.java.GcNotFoundException; -import com.google.gson.Gson; -import com.google.gson.JsonSyntaxException; - -/** - * {@link GcMarshaller} implementation based on {@link Gson}. - */ -public class DefaultGcMarshaller implements GcMarshaller { - - // Gson instances are thread-safe, so reuse one single instance - private static final Gson GSON = new Gson(); - - public static final DefaultGcMarshaller INSTANCE = new DefaultGcMarshaller(); - - protected DefaultGcMarshaller() {} - - @Override - public String marshal(Object requestObject) { - return GSON.toJson(requestObject); - } - - @Override - public T unmarshal(String responseJson, int statusCode, String requestPath, Class type) { - try { - return GSON.fromJson(responseJson, type); - } catch (JsonSyntaxException e) { - if (statusCode == HttpStatus.SC_NOT_FOUND) { - throw new GcNotFoundException("The requested resource was not found; invalid path: " + requestPath, e); - } else { - throw new GcMarshallerSyntaxException(e); - } - } - } - - @Override - public T unmarshal(String responseJson, Class type) { - try { - return GSON.fromJson(responseJson, type); - } catch (JsonSyntaxException e) { - throw new GcMarshallerSyntaxException(e); - } - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcMetaDataProvider.java b/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcMetaDataProvider.java deleted file mode 100644 index 7f1178df0..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcMetaDataProvider.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; -import java.util.Collection; -import java.util.Collections; -import java.util.Properties; - -import org.apache.commons.codec.binary.Base64; - -import com.globalcollect.gateway.sdk.java.GcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.RequestHeader; - -/** - * Default {@link GcMetaDataProvider} implementation. - */ -public class DefaultGcMetaDataProvider implements GcMetaDataProvider { - - private static final Charset CHARSET = Charset.forName("UTF-8"); - - @SuppressWarnings("unused") - private static final class ServerMetaInfo { - String platformIdentifier; - String sdkIdentifier; - } - - private final Collection metaDataHeaders; - - public DefaultGcMetaDataProvider() { - - ServerMetaInfo serverMetaInfo = new ServerMetaInfo(); - serverMetaInfo.platformIdentifier = getPlatformIdentifier(); - serverMetaInfo.sdkIdentifier = getSdkIdentifier(); - - String serverMetaInfoString = DefaultGcMarshaller.INSTANCE.marshal(serverMetaInfo); - RequestHeader serverMetaInfoHeader = new RequestHeader("X-GCS-ServerMetaInfo", Base64.encodeBase64String(serverMetaInfoString.getBytes(CHARSET))); - metaDataHeaders = Collections.singletonList(serverMetaInfoHeader); - } - - @Override - public Collection getServerMetaDataHeaders() { - return metaDataHeaders; - } - - protected String getPlatformIdentifier() { - Properties properties = System.getProperties(); - StringBuilder sb = new StringBuilder(); - sb.append(properties.get("os.name")); - sb.append("/"); - sb.append(properties.get("os.version")); - sb.append(" "); - sb.append("Java"); - sb.append("/"); - sb.append(properties.get("java.vm.specification.version")); - sb.append(" "); - sb.append("("); - sb.append(properties.get("java.vm.vendor")); - sb.append("; "); - sb.append(properties.get("java.vm.name")); - sb.append("; "); - sb.append(properties.get("java.version")); - sb.append(")"); - return sb.toString(); - } - - protected String getSdkIdentifier() { - String sdkIdentifier = "unknown"; - - // don't use getClass() because of possible overrides - InputStream pomProperties = DefaultGcMetaDataProvider.class.getResourceAsStream("/META-INF/maven/com.ingenico.connect.gateway/connect-sdk-java/pom.properties"); - if (pomProperties != null) { - try { - try { - Properties properties = new Properties(); - properties.load(pomProperties); - sdkIdentifier = properties.getProperty("version", sdkIdentifier); - } finally { - pomProperties.close(); - } - } catch (IOException e) { - // ignore the exception - } - } - - return sdkIdentifier; - } -} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcSessionBuilder.java b/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcSessionBuilder.java deleted file mode 100644 index 40176208b..000000000 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcSessionBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; - -import java.net.URI; - -import com.globalcollect.gateway.sdk.java.GcAuthenticator; -import com.globalcollect.gateway.sdk.java.GcConnection; -import com.globalcollect.gateway.sdk.java.GcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.GcSession; -import com.globalcollect.gateway.sdk.java.GcSessionBuilder; - -/** - * Default {@link GcSessionBuilder} implementation. - */ -public class DefaultGcSessionBuilder implements GcSessionBuilder { - - private URI apiEndpoint; - - private GcConnection connection; - - private GcMetaDataProvider metaDataProvider; - - private GcAuthenticator authenticator; - - @Override - public GcSessionBuilder using(URI apiEndpoint) { - this.apiEndpoint = apiEndpoint; - return this; - } - - @Override - public GcSessionBuilder using(GcConnection connection) { - this.connection = connection; - return this; - } - - @Override - public GcSessionBuilder using(GcAuthenticator authenticator) { - this.authenticator = authenticator; - return this; - } - - @Override - public GcSessionBuilder using(GcMetaDataProvider metaDataProvider) { - this.metaDataProvider = metaDataProvider; - return this; - } - - @Override - public GcSession build() { - return new DefaultGcSession( - apiEndpoint, - connection, - authenticator, - metaDataProvider - ); - } -} diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/AbstractParamRequest.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/AbstractParamRequest.java new file mode 100644 index 000000000..dcbe46d39 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/AbstractParamRequest.java @@ -0,0 +1,41 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.Collection; +import java.util.List; + +/** + * Base class for a {@link ParamRequest}s. + */ +public abstract class AbstractParamRequest implements ParamRequest { + + /** + * Adds a request parameter with the given name and value to the given list, unless if the value is {@code null}. + *

+ * The following types are supported: + *

    + *
  • {@link String} + *
  • {@link Integer} + *
  • {@link Long} + *
  • {@link Boolean} + *
  • {@link Collection}s of the above + *
+ */ + protected void addParameter(List requestParameters, String name, Object value) { + addParameter(requestParameters, name, value, true); + } + + private void addParameter(List requestParameters, String name, Object value, boolean allowCollection) { + if (value instanceof String) { + requestParameters.add(new RequestParam(name, (String) value)); + } else if (value instanceof Integer || value instanceof Long || value instanceof Boolean) { + requestParameters.add(new RequestParam(name, value.toString())); + } else if (allowCollection && value instanceof Collection) { + Collection values = (Collection) value; + for (Object element : values) { + addParameter(requestParameters, name, element, false); + } + } else if (value != null) { + throw new IllegalArgumentException("Unsupported request parameter type"); + } + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcApiException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ApiException.java similarity index 80% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcApiException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/ApiException.java index e9e8149d3..8925400ce 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcApiException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ApiException.java @@ -1,26 +1,26 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.util.Collections; import java.util.List; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; /** * Represents an error response from the GlobalCollect platform which contains an ID and a list of errors. */ @SuppressWarnings("serial") -public class GcApiException extends RuntimeException { +public class ApiException extends RuntimeException { private final int statusCode; private final String responseBody; private final String errorId; private final List errors; - public GcApiException(int statusCode, String responseBody, String errorId, List errors) { + public ApiException(int statusCode, String responseBody, String errorId, List errors) { this("the GlobalCollect platform returned an error response", statusCode, responseBody, errorId, errors); } - public GcApiException(String message, int statusCode, String responseBody, String errorId, List errors) { + public ApiException(String message, int statusCode, String responseBody, String errorId, List errors) { super(message); this.statusCode = statusCode; this.responseBody = responseBody; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcApiResource.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ApiResource.java similarity index 70% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcApiResource.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/ApiResource.java index eeaa1ab0c..eb85e46b1 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcApiResource.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ApiResource.java @@ -1,26 +1,26 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.util.ArrayList; import java.util.List; import java.util.Map; -import com.globalcollect.gateway.sdk.java.gc.errors.ErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.errors.ErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundErrorResponse; /** * Base class of all GlobalCollect platform API resources. */ -public abstract class GcApiResource { +public abstract class ApiResource { - private final GcApiResource parent; - protected final GcCommunicator communicator; + private final ApiResource parent; + protected final Communicator communicator; private final Map pathContext; protected final String clientMetaInfo; - protected GcApiResource(GcApiResource parent, Map pathContext) { + protected ApiResource(ApiResource parent, Map pathContext) { if (parent == null) { throw new IllegalArgumentException("parent is required"); } @@ -30,7 +30,7 @@ protected GcApiResource(GcApiResource parent, Map pathContext) { this.clientMetaInfo = parent.clientMetaInfo; } - protected GcApiResource(GcCommunicator communicator, String clientMetaInfo, Map pathContext) { + protected ApiResource(Communicator communicator, String clientMetaInfo, Map pathContext) { if (communicator == null) { throw new IllegalArgumentException("communicator is required"); } @@ -77,11 +77,11 @@ private String replaceAll(String uri, Map pathContext) { protected RuntimeException createException(int statusCode, String responseBody, Object errorObject, CallContext context) { if (errorObject instanceof PaymentErrorResponse && ((PaymentErrorResponse) errorObject).getPaymentResult() != null) { - return new GcDeclinedPaymentException(statusCode, responseBody, (PaymentErrorResponse) errorObject); + return new DeclinedPaymentException(statusCode, responseBody, (PaymentErrorResponse) errorObject); } else if (errorObject instanceof PayoutErrorResponse && ((PayoutErrorResponse) errorObject).getPayoutResult() != null) { - return new GcDeclinedPayoutException(statusCode, responseBody, (PayoutErrorResponse) errorObject); + return new DeclinedPayoutException(statusCode, responseBody, (PayoutErrorResponse) errorObject); } else if (errorObject instanceof RefundErrorResponse && ((RefundErrorResponse) errorObject).getRefundResult() != null) { - return new GcDeclinedRefundException(statusCode, responseBody, (RefundErrorResponse) errorObject); + return new DeclinedRefundException(statusCode, responseBody, (RefundErrorResponse) errorObject); } String errorId; @@ -108,21 +108,21 @@ protected RuntimeException createException(int statusCode, String responseBody, switch (statusCode) { case 400: - return new GcValidationException(statusCode, responseBody, errorId, errors); + return new ValidationException(statusCode, responseBody, errorId, errors); case 403: - return new GcAuthorizationException(statusCode, responseBody, errorId, errors); + return new AuthorizationException(statusCode, responseBody, errorId, errors); case 404: - return new GcReferenceException(statusCode, responseBody, errorId, errors); + return new ReferenceException(statusCode, responseBody, errorId, errors); case 409: if (isIdempotenceError(errors, context)) { String idempotenceKey = context.getIdempotenceKey(); Long idempotenceRequestTimestamp = context.getIdempotenceRequestTimestamp(); - return new GcIdempotenceException(idempotenceKey, idempotenceRequestTimestamp, statusCode, responseBody, errorId, errors); + return new IdempotenceException(idempotenceKey, idempotenceRequestTimestamp, statusCode, responseBody, errorId, errors); } else { - return new GcReferenceException(statusCode, responseBody, errorId, errors); + return new ReferenceException(statusCode, responseBody, errorId, errors); } case 410: - return new GcReferenceException(statusCode, responseBody, errorId, errors); + return new ReferenceException(statusCode, responseBody, errorId, errors); case 500: return new GlobalCollectException(statusCode, responseBody, errorId, errors); case 502: @@ -130,7 +130,7 @@ protected RuntimeException createException(int statusCode, String responseBody, case 503: return new GlobalCollectException(statusCode, responseBody, errorId, errors); default: - return new GcApiException(statusCode, responseBody, errorId, errors); + return new ApiException(statusCode, responseBody, errorId, errors); } } diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcAuthenticator.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/Authenticator.java similarity index 87% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcAuthenticator.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/Authenticator.java index 9b44e4385..012d8ce3a 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcAuthenticator.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/Authenticator.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.net.URI; import java.util.List; @@ -6,7 +6,7 @@ /** * Used to sign requests to the GlobalCollect platform. Thread-safe. */ -public interface GcAuthenticator { +public interface Authenticator { /** * Creates a signature for the simple security model. diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/AuthorizationException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/AuthorizationException.java new file mode 100644 index 000000000..cd079a944 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/AuthorizationException.java @@ -0,0 +1,20 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.List; + +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; + +/** + * Represents an error response from the GlobalCollect platform when authorization failed. + */ +@SuppressWarnings("serial") +public class AuthorizationException extends ApiException { + + public AuthorizationException(int statusCode, String responseBody, String errorId, List errors) { + super("the GlobalCollect platform returned an authorization error response", statusCode, responseBody, errorId, errors); + } + + public AuthorizationException(String message, int statusCode, String responseBody, String errorId, List errors) { + super(message, statusCode, responseBody, errorId, errors); + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/CallContext.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/CallContext.java similarity index 88% rename from src/main/java/com/globalcollect/gateway/sdk/java/CallContext.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/CallContext.java index 27e7bd487..6060a9db6 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/CallContext.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/CallContext.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; /** * A call context can be used to send extra information with a request, and to receive extra information from a response. @@ -37,7 +37,7 @@ public Long getIdempotenceRequestTimestamp() { /** * Sets the idempotence request timestamp. - * This method should only be called by {@link GcCommunicator} objects based on the response to the request for which this + * This method should only be called by {@link Communicator} objects based on the response to the request for which this * call context was used. */ public void setIdempotenceRequestTimestamp(Long idempotenceRequestTimestamp) { diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcCommunicationException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/CommunicationException.java similarity index 52% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcCommunicationException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/CommunicationException.java index 96242bd13..722ddf0dc 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcCommunicationException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/CommunicationException.java @@ -1,12 +1,12 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; /** * Indicates an exception regarding the communication with the GlobalCollect platform such as a connection exception. */ @SuppressWarnings("serial") -public class GcCommunicationException extends RuntimeException { +public class CommunicationException extends RuntimeException { - public GcCommunicationException(Exception e) { + public CommunicationException(Exception e) { super(e); } } diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/Communicator.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/Communicator.java new file mode 100644 index 000000000..826c813d2 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/Communicator.java @@ -0,0 +1,361 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.io.Closeable; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Locale; +import java.util.TimeZone; +import java.util.concurrent.TimeUnit; + +import org.apache.http.HttpStatus; +import org.apache.http.client.utils.URIBuilder; + +import com.ingenico.connect.gateway.sdk.java.logging.CommunicatorLogger; +import com.ingenico.connect.gateway.sdk.java.logging.LoggingCapable; + +/** + * Used to communicate with the GlobalCollect platform web services. + *

+ * It contains all the logic to transform a request object to a HTTP request and + * a HTTP response to a response object. + *

+ * Thread-safe. + */ +public class Communicator implements Closeable, LoggingCapable { + + private final Session session; + + private final Marshaller marshaller; + + public Communicator(Session session, Marshaller marshaller) { + if (session == null) { + throw new IllegalArgumentException("session is required"); + } + if (marshaller == null) { + throw new IllegalArgumentException("marshaller is required"); + } + this.session = session; + this.marshaller = marshaller; + } + + /** + * Releases any system resources associated with this object. + */ + @Override + public void close() throws IOException { + session.getConnection().close(); + } + + /** + * Corresponds to the HTTP GET method. + * + * @param relativePath The path to call, relative to the base URI. + * @param requestHeaders An optional list of request headers. + * @param requestParameters An optional set of request parameters. + * @param responseType The type of response to return. + * @param context The optional call context to use. + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws ResponseException when an error response was received from the GlobalCollect platform + * @throws ApiException when an error response was received from the GlobalCollect platform which contained a list of errors + */ + @SuppressWarnings("resource") + public

O get(String relativePath, List requestHeaders, P requestParameters, + Class responseType, CallContext context) { + + Connection connection = session.getConnection(); + + List requestParameterList = requestParameters == null ? null : requestParameters.toRequestParameters(); + URI uri = toAbsoluteURI(relativePath, requestParameterList); + + if (requestHeaders == null) { + requestHeaders = new ArrayList(); + } + + addGenericHeaders("GET", uri, requestHeaders, context); + + Response response = connection.get(uri, requestHeaders); + return processResponse(response, responseType, relativePath, context); + } + + /** + * Corresponds to the HTTP DELETE method. + * + * @param relativePath The path to call, relative to the base URI. + * @param requestHeaders An optional list of request headers. + * @param requestParameters An optional set of request parameters. + * @param responseType The type of response to return. + * @param context The optional call context to use. + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws ResponseException when an error response was received from the GlobalCollect platform + * @throws ApiException when an error response was received from the GlobalCollect platform which contained a list of errors + */ + @SuppressWarnings("resource") + public

O delete(String relativePath, List requestHeaders, P requestParameters, + Class responseType, CallContext context) { + + Connection connection = session.getConnection(); + + List requestParameterList = requestParameters == null ? null : requestParameters.toRequestParameters(); + URI uri = toAbsoluteURI(relativePath, requestParameterList); + + if (requestHeaders == null) { + requestHeaders = new ArrayList(); + } + + addGenericHeaders("DELETE", uri, requestHeaders, context); + + Response response = connection.delete(uri, requestHeaders); + return processResponse(response, responseType, relativePath, context); + } + + /** + * Corresponds to the HTTP POST method. + * + * @param relativePath The path to call, relative to the base URI. + * @param requestHeaders An optional list of request headers. + * @param requestParameters An optional set of request parameters. + * @param requestBody The optional request body to send. + * @param responseType The type of response to return. + * @param context The optional call context to use. + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws ResponseException when an error response was received from the GlobalCollect platform + * @throws ApiException when an error response was received from the GlobalCollect platform which contained a list of errors + */ + @SuppressWarnings("resource") + public

O post(String relativePath, List requestHeaders, P requestParameters, Object requestBody, + Class responseType, CallContext context) { + + Connection connection = session.getConnection(); + + List requestParameterList = requestParameters == null ? null : requestParameters.toRequestParameters(); + URI uri = toAbsoluteURI(relativePath, requestParameterList); + + if (requestHeaders == null) { + requestHeaders = new ArrayList(); + } + + String requestJson = null; + if (requestBody != null) { + requestHeaders.add(new RequestHeader("Content-Type", "application/json")); + requestJson = marshaller.marshal(requestBody); + } + + addGenericHeaders("POST", uri, requestHeaders, context); + + Response response = connection.post(uri, requestHeaders, requestJson); + return processResponse(response, responseType, relativePath, context); + } + + /** + * Corresponds to the HTTP PUT method. + * + * @param relativePath The path to call, relative to the base URI. + * @param requestHeaders An optional list of request headers. + * @param requestParameters An optional set of request parameters. + * @param requestBody The optional request body to send. + * @param responseType The type of response to return. + * @param context The optional call context to use. + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws ResponseException when an error response was received from the GlobalCollect platform + * @throws ApiException when an error response was received from the GlobalCollect platform which contained a list of errors + */ + @SuppressWarnings("resource") + public

O put(String relativePath, List requestHeaders, P requestParameters, Object requestBody, + Class responseType, CallContext context) { + + Connection connection = session.getConnection(); + + List requestParameterList = requestParameters == null ? null : requestParameters.toRequestParameters(); + URI uri = toAbsoluteURI(relativePath, requestParameterList); + + + if (requestHeaders == null) { + requestHeaders = new ArrayList(); + } + + String requestJson = null; + if (requestBody != null) { + requestHeaders.add(new RequestHeader("Content-Type", "application/json")); + requestJson = marshaller.marshal(requestBody); + } + + addGenericHeaders("PUT", uri, requestHeaders, context); + + Response response = connection.put(uri, requestHeaders, requestJson); + return processResponse(response, responseType, relativePath, context); + } + + /** + * @return The {@link Marshaller} object associated with this communicator. Never {@code null}. + */ + public Marshaller getMarshaller() { + return marshaller; + } + + protected URI toAbsoluteURI(String relativePath, List requestParameters) { + + URI apiEndpoint = session.getApiEndpoint(); + + if (apiEndpoint.getPath() != null && !apiEndpoint.getPath().isEmpty()) { + throw new IllegalStateException("apiEndpoint should not contain a path"); + } + if (apiEndpoint.getUserInfo() != null + || apiEndpoint.getQuery() != null + || apiEndpoint.getFragment() != null) { + + throw new IllegalStateException("apiEndpoint should not contain user info, query or fragment"); + } + + String absolutePath; + if (relativePath.startsWith("/")) { + absolutePath = relativePath; + } else { + absolutePath = "/" + relativePath; + } + + URIBuilder uriBuilder = new URIBuilder() + .setScheme(apiEndpoint.getScheme()) + .setHost(apiEndpoint.getHost()) + .setPort(apiEndpoint.getPort()) + .setPath(absolutePath); + + if (requestParameters != null) { + for (RequestParam nvp: requestParameters) { + uriBuilder.addParameter(nvp.getName(), nvp.getValue()); + } + } + + try { + return uriBuilder.build(); + } catch (URISyntaxException e) { + throw new IllegalArgumentException("Unable to construct URI", e); + } + } + + /** + * Adds the necessary headers to the given list of headers. This includes the authorization header, which uses + * other headers, so when you need to override this method, make sure to call {@code super.addGenericHeaders} + * at the end of your overridden method. + */ + protected void addGenericHeaders(String httpMethod, URI uri, List requestHeaders, CallContext context) { + + // add server meta info headers + requestHeaders.addAll(session.getMetaDataProvider().getServerMetaDataHeaders()); + + // add date header + requestHeaders.add(new RequestHeader("Date", getHeaderDateString())); + + // add context specific headers + if (context != null && context.getIdempotenceKey() != null) { + requestHeaders.add(new RequestHeader("X-GCS-Idempotence-Key", context.getIdempotenceKey())); + } + + // add signature + Authenticator authenticator = session.getAuthenticator(); + String authenticationSignature = authenticator.createSimpleAuthenticationSignature(httpMethod, uri, requestHeaders); + requestHeaders.add(new RequestHeader("Authorization", authenticationSignature)); + } + + /** + * Returns the date in the preferred format for the HTTP date header (RFC1123). + */ + protected String getHeaderDateString() { + Calendar calendar = Calendar.getInstance(); + SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); + dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + return dateFormat.format(calendar.getTime()); + } + + protected O processResponse(Response response, Class responseType, String requestPath, CallContext context) { + + if (context != null) { + updateContext(response, context); + } + throwExceptionIfNecessary(response, requestPath); + return marshaller.unmarshal(response.getBody(), responseType); + } + + /** + * Updates the given call context based on the contents of the given response. + */ + protected void updateContext(Response response, CallContext context) { + + String idempotenceRequestTimestampValue = response.getHeaderValue("X-GCS-Idempotence-Request-Timestamp"); + if (idempotenceRequestTimestampValue != null) { + Long idempotenceRequestTimestamp = Long.valueOf(idempotenceRequestTimestampValue); + context.setIdempotenceRequestTimestamp(idempotenceRequestTimestamp); + } else { + context.setIdempotenceRequestTimestamp(null); + } + } + + /** + * Checks the {@link Response} for errors and throws an exception if necessary. + */ + protected void throwExceptionIfNecessary(Response response, String requestPath) throws ResponseException, CommunicationException, NotFoundException { + + int statusCode = response.getStatusCode(); + // status codes in the 100 or 300 range are not expected + if (statusCode < 200 || statusCode >= 300) { + String body = response.getBody(); + if (body != null && !isJson(response)) { + ResponseException cause = new ResponseException(response); + if (statusCode == HttpStatus.SC_NOT_FOUND) { + throw new NotFoundException("The requested resource was not found; invalid path: " + requestPath, cause); + } else { + throw new CommunicationException(cause); + } + } else { + throw new ResponseException(response); + } + } + } + + private boolean isJson(Response response) { + String contentType = response.getHeaderValue("Content-Type"); + return contentType == null || "application/json".equalsIgnoreCase(contentType) || contentType.toLowerCase().startsWith("application/json"); + } + + /** + * Utility method that delegates the call to this communicator's session's connection if that's an instance of + * {@link PooledConnection}. If not this method does nothing. + * @see PooledConnection#closeIdleConnections(long, TimeUnit) + */ + public void closeIdleConnections(long idleTime, TimeUnit timeUnit) { + @SuppressWarnings("resource") + Connection connection = session.getConnection(); + if (connection instanceof PooledConnection) { + ((PooledConnection) connection).closeIdleConnections(idleTime, timeUnit); + } + } + + /** + * Utility method that delegates the call to this communicator's session's connection if that's an instance of + * {@link PooledConnection}. If not this method does nothing. + * @see PooledConnection#closeExpiredConnections() + */ + public void closeExpiredConnections() { + @SuppressWarnings("resource") + Connection connection = session.getConnection(); + if (connection instanceof PooledConnection) { + ((PooledConnection) connection).closeExpiredConnections(); + } + } + + @Override + public void enableLogging(CommunicatorLogger communicatorLogger) { + // delegate to the connection + session.getConnection().enableLogging(communicatorLogger); + } + + @Override + public void disableLogging() { + // delegate to the connection + session.getConnection().disableLogging(); + } +} diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/CommunicatorConfiguration.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/CommunicatorConfiguration.java new file mode 100644 index 000000000..87c87ea53 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/CommunicatorConfiguration.java @@ -0,0 +1,227 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Properties; + +import com.ingenico.connect.gateway.sdk.java.defaultimpl.AuthorizationType; +import com.ingenico.connect.gateway.sdk.java.domain.metadata.ShoppingCartExtension; + +/** + * Configuration for the communicator. + */ +public class CommunicatorConfiguration { + + /** The default number of maximum connections. */ + public static final int DEFAULT_MAX_CONNECTIONS = 10; + + private URI apiEndpoint; + + private int connectTimeout; + + private int socketTimeout; + + private int maxConnections; + + private AuthorizationType authorizationType; + + private String apiKeyId; + + private String secretApiKey; + + private ProxyConfiguration proxyConfiguration; + + private String integrator; + + private ShoppingCartExtension shoppingCartExtension; + + public CommunicatorConfiguration() {} + + public CommunicatorConfiguration(Properties properties) { + if (properties != null) { + apiEndpoint = getApiEndpoint(properties); + authorizationType = AuthorizationType.valueOf(properties.getProperty("connect.api.authorizationType")); + connectTimeout = Integer.parseInt(properties.getProperty("connect.api.connectTimeout")); + socketTimeout = Integer.parseInt(properties.getProperty("connect.api.socketTimeout")); + maxConnections = getProperty(properties, "connect.api.maxConnections", DEFAULT_MAX_CONNECTIONS); + + String proxyURI = properties.getProperty("connect.api.proxy.uri"); + String proxyUser = properties.getProperty("connect.api.proxy.username"); + String proxyPass = properties.getProperty("connect.api.proxy.password"); + if (proxyURI != null) { + proxyConfiguration = new ProxyConfiguration(URI.create(proxyURI), proxyUser, proxyPass); + } + + integrator = properties.getProperty("connect.api.integrator"); + shoppingCartExtension = getShoppingCartExtension(properties); + } + } + + private int getProperty(Properties properties, String key, int defaultValue) { + String propertyValue = properties.getProperty(key, null); + return propertyValue != null ? Integer.parseInt(propertyValue) : defaultValue; + } + + private URI getApiEndpoint(Properties properties) { + String host = properties.getProperty("connect.api.endpoint.host"); + String scheme = properties.getProperty("connect.api.endpoint.scheme"); + String port = properties.getProperty("connect.api.endpoint.port"); + + return createURI(scheme != null ? scheme : "https", host, port != null ? Integer.parseInt(port) : -1); + } + + private URI createURI(String scheme, String host, int port) { + try { + return new URI(scheme, null, host, port, null, null, null); + } catch (URISyntaxException e) { + throw new IllegalArgumentException("Unable to construct API endpoint URI", e); + } + } + + private ShoppingCartExtension getShoppingCartExtension(Properties properties) { + String creator = properties.getProperty("connect.api.shoppingCartExtension.creator"); + String name = properties.getProperty("connect.api.shoppingCartExtension.name"); + String version = properties.getProperty("connect.api.shoppingCartExtension.version"); + + if (creator == null && name == null && version == null) { + return null; + } else { + return new ShoppingCartExtension(creator, name, version); + } + } + + /** + * Returns the GlobalCollect platform API endpoint URI. + */ + public URI getApiEndpoint() { + return apiEndpoint; + } + public void setApiEndpoint(URI apiEndpoint) { + if (apiEndpoint != null && apiEndpoint.getPath() != null && !apiEndpoint.getPath().isEmpty()) { + throw new IllegalArgumentException("apiEndpoint should not contain a path"); + } + if (apiEndpoint != null && ( + apiEndpoint.getUserInfo() != null + || apiEndpoint.getQuery() != null + || apiEndpoint.getFragment() != null + )) { + throw new IllegalArgumentException("apiEndpoint should not contain user info, query or fragment"); + } + this.apiEndpoint = apiEndpoint; + } + public CommunicatorConfiguration withApiEndpoint(URI apiEndpoint) { + setApiEndpoint(apiEndpoint); + return this; + } + + /** + * An identifier for the secret API key. The {@code apiKeyId} can be + * retrieved from the Configuration Center. This identifier is visible in + * the HTTP request and is also used to identify the correct account. + */ + public String getApiKeyId() { + return apiKeyId; + } + public void setApiKeyId(String apiKeyId) { + this.apiKeyId = apiKeyId; + } + public CommunicatorConfiguration withApiKeyId(String apiKeyId) { + setApiKeyId(apiKeyId); + return this; + } + + /** + * A shared secret. The shared secret can be retrieved from the + * Configuration Center. An {@code apiKeyId} and {@code secretApiKey} always + * go hand-in-hand, the difference is that {@code secretApiKey} is never + * visible in the HTTP request. This secret is used as input for the HMAC + * algorithm. + */ + public String getSecretApiKey() { + return secretApiKey; + } + public void setSecretApiKey(String secretApiKey) { + this.secretApiKey = secretApiKey; + } + public CommunicatorConfiguration withSecretApiKey(String secretApiKey) { + setSecretApiKey(secretApiKey); + return this; + } + + public AuthorizationType getAuthorizationType() { + return authorizationType; + } + public void setAuthorizationType(AuthorizationType authorizationType) { + this.authorizationType = authorizationType; + } + public CommunicatorConfiguration withAuthorizationType(AuthorizationType authorizationType) { + setAuthorizationType(authorizationType); + return this; + } + + public int getConnectTimeout() { + return connectTimeout; + } + public void setConnectTimeout(int connectTimeout) { + this.connectTimeout = connectTimeout; + } + public CommunicatorConfiguration withConnectTimeout(int connectTimeout) { + setConnectTimeout(connectTimeout); + return this; + } + + public int getSocketTimeout() { + return socketTimeout; + } + public void setSocketTimeout(int socketTimeout) { + this.socketTimeout = socketTimeout; + } + public CommunicatorConfiguration withSocketTimeout(int socketTimeout) { + setSocketTimeout(socketTimeout); + return this; + } + + public int getMaxConnections() { + return maxConnections; + } + public void setMaxConnections(int maxConnections) { + this.maxConnections = maxConnections; + } + public CommunicatorConfiguration withMaxConnections(int maxConnections) { + setMaxConnections(maxConnections); + return this; + } + + public ProxyConfiguration getProxyConfiguration() { + return proxyConfiguration; + } + public void setProxyConfiguration(ProxyConfiguration proxyConfiguration) { + this.proxyConfiguration = proxyConfiguration; + } + public CommunicatorConfiguration withProxyConfiguration(ProxyConfiguration proxyConfiguration) { + setProxyConfiguration(proxyConfiguration); + return this; + } + + public String getIntegrator() { + return integrator; + } + public void setIntegrator(String integrator) { + this.integrator = integrator; + } + public CommunicatorConfiguration withIntegrator(String integrator) { + setIntegrator(integrator); + return this; + } + + public ShoppingCartExtension getShoppingCartExtension() { + return shoppingCartExtension; + } + public void setShoppingCartExtension(ShoppingCartExtension shoppingCartExtension) { + this.shoppingCartExtension = shoppingCartExtension; + } + public CommunicatorConfiguration withShoppingCartExtension(ShoppingCartExtension shoppingCartExtension) { + setShoppingCartExtension(shoppingCartExtension); + return this; + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcConnection.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/Connection.java similarity index 60% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcConnection.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/Connection.java index 1ec9f4d0c..6dd9527ad 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcConnection.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/Connection.java @@ -1,16 +1,16 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.io.Closeable; import java.io.IOException; import java.net.URI; import java.util.List; -import com.globalcollect.gateway.sdk.java.logging.LoggingCapable; +import com.ingenico.connect.gateway.sdk.java.logging.LoggingCapable; /** * Represents a connection to the GlobalCollect platform server. Thread-safe. */ -public interface GcConnection extends Closeable, LoggingCapable { +public interface Connection extends Closeable, LoggingCapable { /** * Releases any system resources associated with this object. @@ -24,18 +24,18 @@ public interface GcConnection extends Closeable, LoggingCapable { * * @param uri The URI to call, including any necessary query parameters. * @param requestHeaders An optional list of request headers. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform */ - GcResponse get(URI uri, List requestHeaders); + Response get(URI uri, List requestHeaders); /** * Send a DELETE request to the GlobalCollect platform and return the response. * * @param uri The URI to call, including any necessary query parameters. * @param requestHeaders An optional list of request headers. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform */ - GcResponse delete(URI uri, List requestHeaders); + Response delete(URI uri, List requestHeaders); /** * Send a POST request to the GlobalCollect platform and return the response. @@ -43,9 +43,9 @@ public interface GcConnection extends Closeable, LoggingCapable { * @param uri The URI to call, including any necessary query parameters. * @param requestHeaders An optional list of request headers. * @param body The optional body to send. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform */ - GcResponse post(URI uri, List requestHeaders, String body); + Response post(URI uri, List requestHeaders, String body); /** * Send a PUT request to the GlobalCollect platform and return the response. @@ -53,7 +53,7 @@ public interface GcConnection extends Closeable, LoggingCapable { * @param uri The URI to call, including any necessary query parameters. * @param requestHeaders An optional list of request headers. * @param body The optional body to send. - * @throws GcCommunicationException when an exception occurred communicating with the GlobalCollect platform + * @throws CommunicationException when an exception occurred communicating with the GlobalCollect platform */ - GcResponse put(URI uri, List requestHeaders, String body); + Response put(URI uri, List requestHeaders, String body); } diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedPaymentException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedPaymentException.java similarity index 66% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedPaymentException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedPaymentException.java index 7f12b8665..f112697c6 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedPaymentException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedPaymentException.java @@ -1,18 +1,18 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; -import com.globalcollect.gateway.sdk.java.gc.payment.PaymentErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CreatePaymentResult; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Payment; +import com.ingenico.connect.gateway.sdk.java.domain.payment.PaymentErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CreatePaymentResult; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Payment; /** * Represents an error response from a create payment call. */ @SuppressWarnings("serial") -public class GcDeclinedPaymentException extends GcDeclinedTransactionException { +public class DeclinedPaymentException extends DeclinedTransactionException { private final PaymentErrorResponse errors; - public GcDeclinedPaymentException(int statusCode, String responseBody, PaymentErrorResponse errors) { + public DeclinedPaymentException(int statusCode, String responseBody, PaymentErrorResponse errors) { super(buildMessage(errors), statusCode, responseBody, errors != null ? errors.getErrorId() : null, errors != null ? errors.getErrors() : null); this.errors = errors; } diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedPayoutException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedPayoutException.java similarity index 69% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedPayoutException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedPayoutException.java index 9f9979805..1fbebcb5e 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedPayoutException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedPayoutException.java @@ -1,17 +1,17 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; -import com.globalcollect.gateway.sdk.java.gc.payout.PayoutErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.payout.definitions.PayoutResult; +import com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutResult; /** * Represents an error response from a payout call. */ @SuppressWarnings("serial") -public class GcDeclinedPayoutException extends GcDeclinedTransactionException { +public class DeclinedPayoutException extends DeclinedTransactionException { private final PayoutErrorResponse errors; - public GcDeclinedPayoutException(int statusCode, String responseBody, PayoutErrorResponse errors) { + public DeclinedPayoutException(int statusCode, String responseBody, PayoutErrorResponse errors) { super(buildMessage(errors), statusCode, responseBody, errors != null ? errors.getErrorId() : null, errors != null ? errors.getErrors() : null); this.errors = errors; } diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedRefundException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedRefundException.java similarity index 69% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedRefundException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedRefundException.java index af8e48dc5..b174b1e9b 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcDeclinedRefundException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedRefundException.java @@ -1,17 +1,17 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; -import com.globalcollect.gateway.sdk.java.gc.refund.RefundErrorResponse; -import com.globalcollect.gateway.sdk.java.gc.refund.definitions.RefundResult; +import com.ingenico.connect.gateway.sdk.java.domain.refund.RefundErrorResponse; +import com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundResult; /** * Represents an error response from a refund call. */ @SuppressWarnings("serial") -public class GcDeclinedRefundException extends GcDeclinedTransactionException { +public class DeclinedRefundException extends DeclinedTransactionException { private RefundErrorResponse errors; - public GcDeclinedRefundException(int statusCode, String responseBody, RefundErrorResponse errors) { + public DeclinedRefundException(int statusCode, String responseBody, RefundErrorResponse errors) { super(buildMessage(errors), statusCode, responseBody, errors != null ? errors.getErrorId() : null, errors != null ? errors.getErrors() : null); this.errors = errors; } diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedTransactionException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedTransactionException.java new file mode 100644 index 000000000..37859f726 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/DeclinedTransactionException.java @@ -0,0 +1,20 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.List; + +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; + +/** + * Represents an error response from a create payment, payout or refund call. + */ +@SuppressWarnings("serial") +public abstract class DeclinedTransactionException extends ApiException { + + public DeclinedTransactionException(int statusCode, String responseBody, String errorId, List errors) { + super(statusCode, responseBody, errorId, errors); + } + + public DeclinedTransactionException(String message, int statusCode, String responseBody, String errorId, List errors) { + super(message, statusCode, responseBody, errorId, errors); + } +} diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/Factory.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/Factory.java new file mode 100644 index 000000000..70e2ce594 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/Factory.java @@ -0,0 +1,128 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.util.Properties; + +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultAuthenticator; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultConnection; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultMarshaller; + +/** + * GlobalCollect platform factory for several SDK components. + */ +public final class Factory { + + private Factory() {} + + /** + * Creates a {@link CommunicatorConfiguration} based on the configuration + * values in {@code configurationFileUri} and {@code apiKeyId} and + * {@code secretApiKey}. + */ + public static CommunicatorConfiguration createConfiguration(URI configurationFileUri, String apiKeyId, String secretApiKey) { + try { + Properties properties = new Properties(); + InputStream configurationFileInputStream = configurationFileUri.toURL().openStream(); + try { + properties.load(configurationFileInputStream); + } finally { + configurationFileInputStream.close(); + } + return new CommunicatorConfiguration(properties) + .withApiKeyId(apiKeyId) + .withSecretApiKey(secretApiKey); + } catch (IOException e) { + throw new RuntimeException("Unable to load properties", e); + } + } + + /** + * Creates a {@link SessionBuilder} based on the configuration values in + * {@code configurationFileUri}, {@code apiKeyId} and {@code secretApiKey}. + */ + public static SessionBuilder createSessionBuilder(URI configurationFileUri, String apiKeyId, String secretApiKey) { + CommunicatorConfiguration configuration = createConfiguration(configurationFileUri, apiKeyId, secretApiKey); + return createSessionBuilder(configuration); + } + + /** + * Creates a {@link SessionBuilder} based on the passed configuration. + */ + @SuppressWarnings("resource") + public static SessionBuilder createSessionBuilder(CommunicatorConfiguration configuration) { + + MetaDataProvider metaDataProvider = new MetaDataProviderBuilder(configuration.getIntegrator()) + .withShoppingCartExtension(configuration.getShoppingCartExtension()) + .build(); + + return new SessionBuilder() + .withAPIEndpoint(configuration.getApiEndpoint()) + .withConnection(new DefaultConnection( + configuration.getConnectTimeout(), + configuration.getSocketTimeout(), + configuration.getMaxConnections(), + configuration.getProxyConfiguration() + )) + .withMetaDataProvider(metaDataProvider) + .withAuthenticator(new DefaultAuthenticator( + configuration.getAuthorizationType(), + configuration.getApiKeyId(), + configuration.getSecretApiKey() + )); + } + + /** + * Creates a {@link Communicator} based on the configuration values in + * {@code configurationFileUri}, {@code apiKeyId} and {@code secretApiKey}. + */ + public static Communicator createCommunicator(URI configurationFileUri, String apiKeyId, String secretApiKey) { + CommunicatorConfiguration configuration = createConfiguration(configurationFileUri, apiKeyId, secretApiKey); + return createCommunicator(configuration); + } + + /** + * Creates a {@link Communicator} based on the passed configuration. + */ + public static Communicator createCommunicator(CommunicatorConfiguration configuration) { + SessionBuilder sessionBuilder = createSessionBuilder(configuration); + return createCommunicator(sessionBuilder.build()); + } + + /** + * Creates a {@link Communicator} based on the passed {@link Session}. + */ + public static Communicator createCommunicator(Session session) { + return new Communicator(session, DefaultMarshaller.INSTANCE); + } + + /** + * Creates a {@link Client} based on the configuration values in + * {@code configurationFileUri}, {@code apiKeyId} and {@code secretApiKey}. + */ + public static Client createClient(URI configurationFileUri, String apiKeyId, String secretApiKey) { + return createClient(createCommunicator(configurationFileUri, apiKeyId, secretApiKey)); + } + + /** + * Creates a {@link Client} based on the passed configuration. + */ + public static Client createClient(CommunicatorConfiguration configuration) { + return createClient(createCommunicator(configuration)); + } + + /** + * Creates a {@link Client} based on the passed {@link Session}. + */ + public static Client createClient(Session session) { + return createClient(createCommunicator(session)); + } + + /** + * Creates a {@link Client} based on the passed {@link Communicator}. + */ + public static Client createClient(Communicator communicator) { + return new Client(communicator); + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GlobalCollectException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/GlobalCollectException.java similarity index 76% rename from src/main/java/com/globalcollect/gateway/sdk/java/GlobalCollectException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/GlobalCollectException.java index afe71eb2a..65ad2718d 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GlobalCollectException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/GlobalCollectException.java @@ -1,14 +1,14 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.util.List; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; /** * Represents an error response from the GlobalCollect platform when something went wrong at the GlobalCollect platform or further downstream. */ @SuppressWarnings("serial") -public class GlobalCollectException extends GcApiException { +public class GlobalCollectException extends ApiException { public GlobalCollectException(int statusCode, String responseBody, String errorId, List errors) { super("the GlobalCollect platform returned an error response", statusCode, responseBody, errorId, errors); diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcIdempotenceException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/IdempotenceException.java similarity index 76% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcIdempotenceException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/IdempotenceException.java index cd275156a..27e9092d0 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcIdempotenceException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/IdempotenceException.java @@ -1,27 +1,27 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.util.List; -import com.globalcollect.gateway.sdk.java.gc.errors.definitions.APIError; +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; /** * Represents an error response from the GlobalCollect platform when an idempotent request failed because the first request has not * finished yet. */ @SuppressWarnings("serial") -public class GcIdempotenceException extends GcApiException { +public class IdempotenceException extends ApiException { private final String idempotenceKey; private final Long idempotenceRequestTimestamp; - public GcIdempotenceException(String idempotenceKey, Long idempotenceRequestTimestamp, + public IdempotenceException(String idempotenceKey, Long idempotenceRequestTimestamp, int statusCode, String responseBody, String errorId, List errors) { super("the GlobalCollect platform returned a duplicate request error response", statusCode, responseBody, errorId, errors); this.idempotenceKey = idempotenceKey; this.idempotenceRequestTimestamp = idempotenceRequestTimestamp; } - public GcIdempotenceException(String message, String idempotenceKey, Long idempotenceRequestTimestamp, + public IdempotenceException(String message, String idempotenceKey, Long idempotenceRequestTimestamp, int statusCode, String responseBody, String errorId, List errors) { super(message, statusCode, responseBody, errorId, errors); this.idempotenceKey = idempotenceKey; diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/Marshaller.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/Marshaller.java new file mode 100644 index 000000000..1599a01f0 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/Marshaller.java @@ -0,0 +1,20 @@ +package com.ingenico.connect.gateway.sdk.java; + +/** + * Used to marshal and unmarshal GlobalCollect platform request and response objects to and from JSON. Thread-safe. + */ +public interface Marshaller { + + /** + * Marshal a request object to a JSON string. + */ + String marshal(Object requestObject); + + /** + * Unmarshal a JSON string to a response object. + * + * @param type The response object type. + * @throws MarshallerSyntaxException if the JSON is not a valid representation for an object of the given type + */ + T unmarshal(String responseJson, Class type); +} diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/MarshallerSyntaxException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/MarshallerSyntaxException.java new file mode 100644 index 000000000..94a0a686e --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/MarshallerSyntaxException.java @@ -0,0 +1,16 @@ +package com.ingenico.connect.gateway.sdk.java; + +/** + * Thrown when a JSON string cannot be converted to a response object. + */ +@SuppressWarnings("serial") +public class MarshallerSyntaxException extends RuntimeException { + + public MarshallerSyntaxException() { + super(); + } + + public MarshallerSyntaxException(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/MetaDataProvider.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/MetaDataProvider.java new file mode 100644 index 000000000..f29c734b3 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/MetaDataProvider.java @@ -0,0 +1,145 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.commons.codec.binary.Base64; + +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultMarshaller; +import com.ingenico.connect.gateway.sdk.java.domain.metadata.ShoppingCartExtension; + +/** + * Provides meta info about the server. Thread-safe. + */ +public class MetaDataProvider { + + private static final String SDK_VERSION = "4.0.0"; + + private static final String SERVER_META_INFO_HEADER = "X-GCS-ServerMetaInfo"; + static final Set PROHIBITED_HEADERS; + static { + Set prohibitedHeaders = new TreeSet(String.CASE_INSENSITIVE_ORDER); + prohibitedHeaders.add(SERVER_META_INFO_HEADER); + prohibitedHeaders.add("X-GCS-Idempotence-Key"); + prohibitedHeaders.add("Date"); + prohibitedHeaders.add("Content-Type"); + prohibitedHeaders.add("Authorization"); + + PROHIBITED_HEADERS = Collections.unmodifiableSet(prohibitedHeaders); + } + + private static final Charset CHARSET = Charset.forName("UTF-8"); + + static final class ServerMetaInfo { + String platformIdentifier; + String sdkIdentifier; + String sdkCreator; + String integrator; + ShoppingCartExtension shoppingCartExtension; + } + + private final Collection metaDataHeaders; + + /** + * @deprecated Use {@link #MetaDataProvider(String)} or a {@link MetaDataProviderBuilder} instead. + */ + @Deprecated + public MetaDataProvider() { + this((String) null); + } + + public MetaDataProvider(String integrator) { + this( + integrator, + null, + Collections.emptyList() + ); + } + + protected MetaDataProvider(MetaDataProviderBuilder builder) { + this( + builder.integrator, + builder.shoppingCartExtension, + builder.additionalRequestHeaders + ); + } + + private MetaDataProvider(String integrator, + ShoppingCartExtension shoppingCartExtension, + Collection additionalRequestHeaders) { + + validateAdditionalRequestHeaders(additionalRequestHeaders); + + ServerMetaInfo serverMetaInfo = new ServerMetaInfo(); + serverMetaInfo.platformIdentifier = getPlatformIdentifier(); + serverMetaInfo.sdkIdentifier = getSdkIdentifier(); + serverMetaInfo.sdkCreator = "Ingenico"; + serverMetaInfo.integrator = integrator; + serverMetaInfo.shoppingCartExtension = shoppingCartExtension; + + String serverMetaInfoString = DefaultMarshaller.INSTANCE.marshal(serverMetaInfo); + RequestHeader serverMetaInfoHeader = new RequestHeader(SERVER_META_INFO_HEADER, Base64.encodeBase64String(serverMetaInfoString.getBytes(CHARSET))); + + if (additionalRequestHeaders == null || additionalRequestHeaders.isEmpty()) { + metaDataHeaders = Collections.singleton(serverMetaInfoHeader); + } else { + List requestHeaders = new ArrayList(additionalRequestHeaders.size() + 1); + requestHeaders.add(serverMetaInfoHeader); + requestHeaders.addAll(additionalRequestHeaders); + metaDataHeaders = Collections.unmodifiableList(requestHeaders); + } + } + + static void validateAdditionalRequestHeaders(Collection additionalRequestHeaders) { + if (additionalRequestHeaders != null) { + for (RequestHeader additionalRequestHeader : additionalRequestHeaders) { + validateAdditionalRequestHeader(additionalRequestHeader); + } + } + } + + static void validateAdditionalRequestHeader(RequestHeader additionalRequestHeader) { + if (PROHIBITED_HEADERS.contains(additionalRequestHeader.getName())) { + throw new IllegalArgumentException("request header not allowed: " + additionalRequestHeader); + } + } + + /** + * @return The server related headers containing the META data to be associated with the request (if any). + * This will always contain at least an automatically generated header {@code X-GCS-ServerMetaInfo}. + */ + public final Collection getServerMetaDataHeaders() { + return metaDataHeaders; + } + + protected final String getPlatformIdentifier() { + Properties properties = System.getProperties(); + StringBuilder sb = new StringBuilder(); + sb.append(properties.get("os.name")); + sb.append("/"); + sb.append(properties.get("os.version")); + sb.append(" "); + sb.append("Java"); + sb.append("/"); + sb.append(properties.get("java.vm.specification.version")); + sb.append(" "); + sb.append("("); + sb.append(properties.get("java.vm.vendor")); + sb.append("; "); + sb.append(properties.get("java.vm.name")); + sb.append("; "); + sb.append(properties.get("java.version")); + sb.append(")"); + return sb.toString(); + } + + protected final String getSdkIdentifier() { + return "JavaServerSDK/v" + SDK_VERSION; + } +} diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderBuilder.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderBuilder.java new file mode 100644 index 000000000..f057c2285 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderBuilder.java @@ -0,0 +1,59 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.ArrayList; +import java.util.List; + +import com.ingenico.connect.gateway.sdk.java.domain.metadata.ShoppingCartExtension; + +/** + * Builder for a {@link MetaDataProvider} object. + */ +public class MetaDataProviderBuilder { + + final String integrator; + + ShoppingCartExtension shoppingCartExtension; + + final List additionalRequestHeaders = new ArrayList(); + + /** + * @param integrator The integrator to use. + */ + public MetaDataProviderBuilder(String integrator) { + this.integrator = integrator; + } + + /** + * Sets the shopping cart extension to use. + */ + public MetaDataProviderBuilder withShoppingCartExtension(ShoppingCartExtension shoppingCartExtension) { + this.shoppingCartExtension = shoppingCartExtension; + return this; + } + + /** + * Adds an additional request header. + * The following names are prohibited in these additional request headers, because these will be set automatically + * as needed: + *

    + *
  • X-GCS-ServerMetaInfo
  • + *
  • X-GCS-ClientMetaInfo
  • + *
  • X-GCS-Idempotence-Key
  • + *
  • Date
  • + *
  • Content-Type
  • + *
  • Authorization
  • + *
+ */ + public MetaDataProviderBuilder withAdditionalRequestHeader(RequestHeader additionalRequestHeader) { + MetaDataProvider.validateAdditionalRequestHeader(additionalRequestHeader); + additionalRequestHeaders.add(additionalRequestHeader); + return this; + } + + /** + * Creates a fully initialized {@link MetaDataProvider} object. + */ + public MetaDataProvider build() { + return new MetaDataProvider(this); + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcNotFoundException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/NotFoundException.java similarity index 60% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcNotFoundException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/NotFoundException.java index c9754941c..5ecc8e9f7 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcNotFoundException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/NotFoundException.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; /** * Indicates an exception that occurs when the requested resource is not found. @@ -6,13 +6,13 @@ * For example when path parameters are set with invalid values. */ @SuppressWarnings("serial") -public class GcNotFoundException extends RuntimeException { +public class NotFoundException extends RuntimeException { - public GcNotFoundException(Exception e) { + public NotFoundException(Exception e) { super(e); } - public GcNotFoundException(String message, Exception e) { + public NotFoundException(String message, Exception e) { super(message, e); } } diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcParamRequest.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ParamRequest.java similarity index 60% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcParamRequest.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/ParamRequest.java index c239c0ea1..2ff20a3f9 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcParamRequest.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ParamRequest.java @@ -1,11 +1,11 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.util.List; /** * Represents a set of request parameters. */ -public interface GcParamRequest { +public interface ParamRequest { List toRequestParameters(); } diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/PooledConnection.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/PooledConnection.java new file mode 100644 index 000000000..bdc4136b9 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/PooledConnection.java @@ -0,0 +1,23 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.concurrent.TimeUnit; + +/** + * Represents a pooled connection to the GlobalCollect platform server. + * Instead of setting up a new HTTP connection for each request, this connection uses a pool of HTTP connections. + * Thread-safe. + */ +public interface PooledConnection extends Connection { + + /** + * Closes all HTTP connections that have been idle for the specified time. + * This should also include all expired HTTP connections. + * @see #closeExpiredConnections() + */ + void closeIdleConnections(long idleTime, TimeUnit timeUnit); + + /** + * Closes all expired HTTP connections. + */ + void closeExpiredConnections(); +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcProxyConfiguration.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ProxyConfiguration.java similarity index 71% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcProxyConfiguration.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/ProxyConfiguration.java index ea8bae806..03de5604d 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcProxyConfiguration.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ProxyConfiguration.java @@ -1,11 +1,11 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.net.URI; /** * HTTP proxy configuration. */ -public class GcProxyConfiguration { +public class ProxyConfiguration { private String scheme; @@ -17,19 +17,19 @@ public class GcProxyConfiguration { private String password; - public GcProxyConfiguration(String host, int port) { + public ProxyConfiguration(String host, int port) { this("http", host, port); } - public GcProxyConfiguration(String host, int port, String username, String password) { + public ProxyConfiguration(String host, int port, String username, String password) { this("http", host, port, username, password); } - public GcProxyConfiguration(String scheme, String host, int port) { + public ProxyConfiguration(String scheme, String host, int port) { this(scheme, host, port, null, null); } - public GcProxyConfiguration(String scheme, String host, int port, String username, String password) { + public ProxyConfiguration(String scheme, String host, int port, String username, String password) { if (scheme == null || scheme.trim().isEmpty()) { throw new IllegalArgumentException("scheme is required"); } @@ -46,11 +46,11 @@ public GcProxyConfiguration(String scheme, String host, int port, String usernam this.password = password; } - public GcProxyConfiguration(URI address) { + public ProxyConfiguration(URI address) { this(address, null, null); } - public GcProxyConfiguration(URI address, String username, String password) { + public ProxyConfiguration(URI address, String username, String password) { this(address.getScheme(), address.getHost(), getPort(address), username, password); } @@ -73,7 +73,7 @@ public String getScheme() { public void setScheme(String scheme) { this.scheme = scheme; } - public GcProxyConfiguration withScheme(String scheme) { + public ProxyConfiguration withScheme(String scheme) { this.scheme = scheme; return this; } @@ -84,7 +84,7 @@ public String getHost() { public void setHost(String host) { this.host = host; } - public GcProxyConfiguration withHost(String host) { + public ProxyConfiguration withHost(String host) { this.host = host; return this; } @@ -95,7 +95,7 @@ public int getPort() { public void setPort(int port) { this.port = port; } - public GcProxyConfiguration withPort(int port) { + public ProxyConfiguration withPort(int port) { this.port = port; return this; } @@ -106,7 +106,7 @@ public String getUsername() { public void setUsername(String username) { this.username = username; } - public GcProxyConfiguration withUsername(String username) { + public ProxyConfiguration withUsername(String username) { this.username = username; return this; } @@ -117,7 +117,7 @@ public String getPassword() { public void setPassword(String password) { this.password = password; } - public GcProxyConfiguration withPassword(String password) { + public ProxyConfiguration withPassword(String password) { this.password = password; return this; } diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/ReferenceException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ReferenceException.java new file mode 100644 index 000000000..29dcd0567 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ReferenceException.java @@ -0,0 +1,20 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.List; + +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; + +/** + * Represents an error response from the GlobalCollect platform when a non-existing or removed object is trying to be accessed. + */ +@SuppressWarnings("serial") +public class ReferenceException extends ApiException { + + public ReferenceException(int statusCode, String responseBody, String errorId, List errors) { + super("the GlobalCollect platform returned a reference error response", statusCode, responseBody, errorId, errors); + } + + public ReferenceException(String message, int statusCode, String responseBody, String errorId, List errors) { + super(message, statusCode, responseBody, errorId, errors); + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/RequestHeader.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/RequestHeader.java similarity index 86% rename from src/main/java/com/globalcollect/gateway/sdk/java/RequestHeader.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/RequestHeader.java index 800b6e822..447594487 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/RequestHeader.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/RequestHeader.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; /** * A single request header. Immutable. @@ -18,10 +18,10 @@ public RequestHeader(String name, String value) { public String getName(){ return name; - }; + } /** - * @return The unencoded value. + * @return The un-encoded value. */ public String getValue() { return value; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/RequestParam.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/RequestParam.java similarity index 85% rename from src/main/java/com/globalcollect/gateway/sdk/java/RequestParam.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/RequestParam.java index b85eacc57..7baa7a3d1 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/RequestParam.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/RequestParam.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; /** * A single request parameter. Immutable. @@ -20,6 +20,9 @@ public String getName(){ return name; } + /** + * @return The un-encoded value. + */ public String getValue() { return value; } diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcResponse.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/Response.java similarity index 82% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcResponse.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/Response.java index f778b4e19..cc5cacbfe 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcResponse.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/Response.java @@ -1,18 +1,18 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.util.Collections; import java.util.List; /** - * Thrown when a response was received from the GlobalCollect platform which indicates an error. + * A response from the GlobalCollect platform. */ -public class GcResponse { +public class Response { private final int statusCode; private final String body; private final List headers; - public GcResponse(int statusCode, String body, List headers) { + public Response(int statusCode, String body, List headers) { this.statusCode = statusCode; this.body = body; this.headers = headers != null ? Collections.unmodifiableList(headers) : Collections.emptyList(); @@ -52,7 +52,7 @@ public ResponseHeader getHeader(String headerName) { } /** - * @return The value header with the given name, or {@code null} if there was no such header. + * @return The value of the header with the given name, or {@code null} if there was no such header. */ public String getHeaderValue(String headerName) { ResponseHeader header = getHeader(headerName); diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/GcResponseException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ResponseException.java similarity index 83% rename from src/main/java/com/globalcollect/gateway/sdk/java/GcResponseException.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/ResponseException.java index 651a34b77..9b75d1305 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/GcResponseException.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ResponseException.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; import java.util.List; @@ -6,11 +6,11 @@ * Thrown when a response was received from the GlobalCollect platform which indicates an error. */ @SuppressWarnings("serial") -public class GcResponseException extends RuntimeException { +public class ResponseException extends RuntimeException { - private final GcResponse response; + private final Response response; - public GcResponseException(GcResponse response) { + public ResponseException(Response response) { super("the GlobalCollect platform returned an error response"); this.response = response; } @@ -18,7 +18,7 @@ public GcResponseException(GcResponse response) { /** * @return The response that was returned by the GlobalCollect platform. */ - public GcResponse getResponse() { + public Response getResponse() { return response; } @@ -51,7 +51,7 @@ public ResponseHeader getHeader(String headerName) { } /** - * @return The value header with the given name, or {@code null} if there was no such header. + * @return The value of the header with the given name, or {@code null} if there was no such header. */ public String getHeaderValue(String headerName) { return response.getHeaderValue(headerName); diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/ResponseHeader.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ResponseHeader.java similarity index 85% rename from src/main/java/com/globalcollect/gateway/sdk/java/ResponseHeader.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/ResponseHeader.java index 44f88f868..d204ed321 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/ResponseHeader.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ResponseHeader.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java; +package com.ingenico.connect.gateway.sdk.java; /** * A single response header. Immutable. @@ -18,10 +18,10 @@ public ResponseHeader(String name, String value) { public String getName(){ return name; - }; + } /** - * @return The unencoded value. + * @return The un-encoded value. */ public String getValue() { return value; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcSession.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/Session.java similarity index 54% rename from src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcSession.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/Session.java index b7b24f354..e6eee032a 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcSession.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/Session.java @@ -1,26 +1,21 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java; import java.net.URI; -import com.globalcollect.gateway.sdk.java.GcAuthenticator; -import com.globalcollect.gateway.sdk.java.GcConnection; -import com.globalcollect.gateway.sdk.java.GcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.GcSession; - /** - * Default {@link GcSession} implementation. + * Contains the components needed to communicate with the GlobalCollect platform. Thread-safe. */ -public class DefaultGcSession implements GcSession { +public class Session { private final URI apiEndpoint; - private final GcConnection connection; + private final Connection connection; - private final GcAuthenticator authenticator; + private final Authenticator authenticator; - private final GcMetaDataProvider metaDataProvider; + private final MetaDataProvider metaDataProvider; - public DefaultGcSession(URI apiEndpoint, GcConnection connection, GcAuthenticator authenticator, GcMetaDataProvider metaDataProvider) { + public Session(URI apiEndpoint, Connection connection, Authenticator authenticator, MetaDataProvider metaDataProvider) { if (apiEndpoint == null) { throw new IllegalArgumentException("apiEndpoint is required"); } @@ -49,23 +44,31 @@ public DefaultGcSession(URI apiEndpoint, GcConnection connection, GcAuthenticato this.metaDataProvider = metaDataProvider; } - @Override + /** + * @return The GlobalCollect platform API endpoint URI. This URI's path will be {@code null} or empty. + */ public URI getApiEndpoint() { return apiEndpoint; } - @Override - public GcConnection getConnection() { + /** + * @return The {@link Connection} object associated with this session. Never {@code null}. + */ + public Connection getConnection() { return connection; } - @Override - public GcMetaDataProvider getMetaDataProvider() { + /** + * @return The {@link MetaDataProvider} object associated with this session. Never {@code null}. + */ + public MetaDataProvider getMetaDataProvider() { return metaDataProvider; } - @Override - public GcAuthenticator getAuthenticator() { + /** + * @return The {@link Authenticator} object associated with this session. Never {@code null}. + */ + public Authenticator getAuthenticator() { return authenticator; } } diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/SessionBuilder.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/SessionBuilder.java new file mode 100644 index 000000000..631839310 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/SessionBuilder.java @@ -0,0 +1,99 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.net.URI; + +/** + * Builder for a {@link Session} object. + */ +public class SessionBuilder { + + private URI apiEndpoint; + + private Connection connection; + + private MetaDataProvider metaDataProvider; + + private Authenticator authenticator; + + /** + * Sets the GlobalCollect platform API endpoint URI to use. + */ + public SessionBuilder withAPIEndpoint(URI apiEndpoint) { + this.apiEndpoint = apiEndpoint; + return this; + } + + /** + * Sets the GlobalCollect platform API endpoint URI to use. + * @deprecated Use {@link #withAPIEndpoint(URI)} instead. + */ + @Deprecated + public SessionBuilder using(URI apiEndpoint) { + return withAPIEndpoint(apiEndpoint); + } + + /** + * Sets the {@link Connection} to use. + */ + public SessionBuilder withConnection(Connection connection) { + this.connection = connection; + return this; + } + + /** + * Sets the {@link Connection} to use. + * @deprecated Use {@link #withConnection(Connection)} instead. + */ + @Deprecated + public SessionBuilder using(Connection connection) { + return withConnection(connection); + } + + /** + * Sets the {@link Authenticator} to use. + */ + public SessionBuilder withAuthenticator(Authenticator authenticator) { + this.authenticator = authenticator; + return this; + } + + /** + * Sets the {@link Authenticator} to use. + * @deprecated Use {@link #withAuthenticator(Authenticator)} instead. + */ + @Deprecated + public SessionBuilder using(Authenticator authenticator) { + return withAuthenticator(authenticator); + } + + /** + * Sets the {@link MetaDataProvider} to use. + */ + public SessionBuilder withMetaDataProvider(MetaDataProvider metaDataProvider) { + this.metaDataProvider = metaDataProvider; + return this; + } + + /** + * Sets the {@link MetaDataProvider} to use. + * @deprecated Use {@link #withMetaDataProvider(MetaDataProvider)} instead. + */ + @Deprecated + public SessionBuilder using(MetaDataProvider metaDataProvider) { + return withMetaDataProvider(metaDataProvider); + } + + /** + * Creates a fully initialized {@link Session} object. + * + * @throws IllegalArgumentException if not all required components are set + */ + public Session build() { + return new Session( + apiEndpoint, + connection, + authenticator, + metaDataProvider + ); + } +} diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/ValidationException.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/ValidationException.java new file mode 100644 index 000000000..0ddc9e3e8 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/ValidationException.java @@ -0,0 +1,20 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.List; + +import com.ingenico.connect.gateway.sdk.java.domain.errors.definitions.APIError; + +/** + * Represents an error response from the GlobalCollect platform when validation of requests failed. + */ +@SuppressWarnings("serial") +public class ValidationException extends ApiException { + + public ValidationException(int statusCode, String responseBody, String errorId, List errors) { + super("the GlobalCollect platform returned an incorrect request error response", statusCode, responseBody, errorId, errors); + } + + public ValidationException(String message, int statusCode, String responseBody, String errorId, List errors) { + super(message, statusCode, responseBody, errorId, errors); + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/AuthorizationType.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/AuthorizationType.java similarity index 81% rename from src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/AuthorizationType.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/AuthorizationType.java index 2660416fd..b64dc1158 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/AuthorizationType.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/AuthorizationType.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; public enum AuthorizationType { diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcAuthenticator.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultAuthenticator.java similarity index 89% rename from src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcAuthenticator.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultAuthenticator.java index 14f0e1d6b..89ce5c743 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcAuthenticator.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultAuthenticator.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; import java.net.URI; import java.nio.charset.Charset; @@ -14,13 +14,13 @@ import org.apache.commons.codec.binary.Base64; -import com.globalcollect.gateway.sdk.java.GcAuthenticator; -import com.globalcollect.gateway.sdk.java.RequestHeader; +import com.ingenico.connect.gateway.sdk.java.Authenticator; +import com.ingenico.connect.gateway.sdk.java.RequestHeader; /** - * Default {@link GcAuthenticator} implementation. + * Default {@link Authenticator} implementation. */ -public class DefaultGcAuthenticator implements GcAuthenticator { +public class DefaultAuthenticator implements Authenticator { private static final Charset CHARSET = Charset.forName("UTF-8"); @@ -56,7 +56,7 @@ public int compare(RequestHeader header1, RequestHeader header2) { * that {@code secretApiKey} is never visible in the HTTP * request. This secret is used as input for the HMAC algorithm. */ - public DefaultGcAuthenticator(AuthorizationType authorizationType, String apiKeyId, String secretApiKey) { + public DefaultAuthenticator(AuthorizationType authorizationType, String apiKeyId, String secretApiKey) { if (authorizationType == null) { throw new IllegalArgumentException("authorizationType is required"); } @@ -101,12 +101,13 @@ String toDataToSign(String httpMethod, URI resourceUri, List http contentType = httpHeader.getValue(); } else if ("Date".equalsIgnoreCase(httpHeader.getName())) { date = httpHeader.getValue(); - } if (httpHeader.getName().toUpperCase().startsWith("X-GCS")) { - + } else { String name = toCanonicalizeHeaderName(httpHeader.getName()); - String value = toCanonicalizeHeaderValue(httpHeader.getValue()); - RequestHeader xgcsHttpHeader = new RequestHeader(name, value); - xgcsHttpHeaders.add(xgcsHttpHeader); + if (name.startsWith("x-gcs")) { + String value = toCanonicalizeHeaderValue(httpHeader.getValue()); + RequestHeader xgcsHttpHeader = new RequestHeader(name, value); + xgcsHttpHeaders.add(xgcsHttpHeader); + } } } } diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnection.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnection.java similarity index 74% rename from src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnection.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnection.java index 18eff3eb0..a2ce3aaa2 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnection.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnection.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; import java.io.IOException; import java.net.ProxySelector; @@ -7,6 +7,7 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.TimeUnit; import org.apache.http.Header; import org.apache.http.HttpEntity; @@ -34,6 +35,7 @@ import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.conn.routing.HttpRoutePlanner; import org.apache.http.entity.BufferedHttpEntity; import org.apache.http.impl.auth.BasicScheme; @@ -44,56 +46,63 @@ import org.apache.http.impl.client.SystemDefaultCredentialsProvider; import org.apache.http.impl.conn.DefaultProxyRoutePlanner; import org.apache.http.impl.conn.DefaultSchemePortResolver; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.impl.conn.SystemDefaultRoutePlanner; import org.apache.http.message.BasicHeader; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.HttpContext; import org.apache.http.util.EntityUtils; -import com.globalcollect.gateway.sdk.java.GcCommunicationException; -import com.globalcollect.gateway.sdk.java.GcConnection; -import com.globalcollect.gateway.sdk.java.GcDefaultConfiguration; -import com.globalcollect.gateway.sdk.java.GcProxyConfiguration; -import com.globalcollect.gateway.sdk.java.GcResponse; -import com.globalcollect.gateway.sdk.java.RequestHeader; -import com.globalcollect.gateway.sdk.java.ResponseHeader; -import com.globalcollect.gateway.sdk.java.logging.GcCommunicatorLogger; -import com.globalcollect.gateway.sdk.java.logging.LogMessageBuilder; -import com.globalcollect.gateway.sdk.java.logging.RequestLogMessageBuilder; -import com.globalcollect.gateway.sdk.java.logging.ResponseLogMessageBuilder; +import com.ingenico.connect.gateway.sdk.java.CommunicationException; +import com.ingenico.connect.gateway.sdk.java.Connection; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.PooledConnection; +import com.ingenico.connect.gateway.sdk.java.ProxyConfiguration; +import com.ingenico.connect.gateway.sdk.java.RequestHeader; +import com.ingenico.connect.gateway.sdk.java.Response; +import com.ingenico.connect.gateway.sdk.java.ResponseHeader; +import com.ingenico.connect.gateway.sdk.java.logging.CommunicatorLogger; +import com.ingenico.connect.gateway.sdk.java.logging.LogMessageBuilder; +import com.ingenico.connect.gateway.sdk.java.logging.RequestLogMessageBuilder; +import com.ingenico.connect.gateway.sdk.java.logging.ResponseLogMessageBuilder; /** - * {@link GcConnection} implementation based on {@link HttpClient}. + * {@link Connection} implementation based on {@link HttpClient}. */ -public class DefaultGcConnection implements GcConnection { +public class DefaultConnection implements PooledConnection { private static final Charset CHARSET = Charset.forName("UTF-8"); - private static final String REQUEST_ID_ATTRIBUTE = DefaultGcConnection.class.getName() + ".requestId"; - private static final String START_TIMME_ATTRIBUTE = DefaultGcConnection.class.getName() + ".startTme"; + private static final String REQUEST_ID_ATTRIBUTE = DefaultConnection.class.getName() + ".requestId"; + private static final String START_TIMME_ATTRIBUTE = DefaultConnection.class.getName() + ".startTme"; // CloseableHttpClient is marked to be thread safe protected final CloseableHttpClient httpClient; + // PoolingHttpClientConnectionManager, the implementation used, is marked to be thread safe + private final HttpClientConnectionManager connectionManager; + + // RequestConfig is marked to be immutable protected final RequestConfig requestConfig; - private volatile GcCommunicatorLogger communicatorLogger; + private volatile CommunicatorLogger communicatorLogger; - public DefaultGcConnection(int connectTimeout, int socketTimeout) { + public DefaultConnection(int connectTimeout, int socketTimeout) { this(connectTimeout, socketTimeout, null); } - public DefaultGcConnection(int connectTimeout, int socketTimeout, int maxConnections) { + public DefaultConnection(int connectTimeout, int socketTimeout, int maxConnections) { this(connectTimeout, socketTimeout, maxConnections, null); } - public DefaultGcConnection(int connectTimeout, int socketTimeout, GcProxyConfiguration proxyConfiguration) { - this(connectTimeout, socketTimeout, GcDefaultConfiguration.DEFAULT_MAX_CONNECTIONS, proxyConfiguration); + public DefaultConnection(int connectTimeout, int socketTimeout, ProxyConfiguration proxyConfiguration) { + this(connectTimeout, socketTimeout, CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, proxyConfiguration); } - public DefaultGcConnection(int connectTimeout, int socketTimeout, int maxConnections, GcProxyConfiguration proxyConfiguration) { + public DefaultConnection(int connectTimeout, int socketTimeout, int maxConnections, ProxyConfiguration proxyConfiguration) { requestConfig = createRequestConfig(connectTimeout, socketTimeout); - httpClient = createHttpClient(maxConnections, proxyConfiguration); + connectionManager = createHttpClientConnectionManager(maxConnections); + httpClient = createHttpClient(proxyConfiguration); } private RequestConfig createRequestConfig(int connectTimeout, int socketTimeout) { @@ -103,11 +112,18 @@ private RequestConfig createRequestConfig(int connectTimeout, int socketTimeout) .build(); } - private CloseableHttpClient createHttpClient(int maxConnections, GcProxyConfiguration proxyConfiguration) { + private HttpClientConnectionManager createHttpClientConnectionManager(int maxConnections) { + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); + connectionManager.setDefaultMaxPerRoute(maxConnections); + connectionManager.setMaxTotal(maxConnections + 20); + return connectionManager; + } + + private CloseableHttpClient createHttpClient(ProxyConfiguration proxyConfiguration) { HttpClientBuilder builder = HttpClients.custom() - .setMaxConnPerRoute(maxConnections) - .setMaxConnTotal(maxConnections + 20); + .setConnectionManager(connectionManager); HttpRoutePlanner routePlanner; CredentialsProvider credentialsProvider; @@ -164,7 +180,7 @@ public void close() throws IOException { } @Override - public GcResponse get(URI uri, List requestHeaders) { + public Response get(URI uri, List requestHeaders) { HttpGet httpGet = new HttpGet(uri); httpGet.setConfig(requestConfig); @@ -173,7 +189,7 @@ public GcResponse get(URI uri, List requestHeaders) { } @Override - public GcResponse delete(URI uri, List requestHeaders) { + public Response delete(URI uri, List requestHeaders) { HttpDelete httpDelete = new HttpDelete(uri); httpDelete.setConfig(requestConfig); @@ -182,33 +198,33 @@ public GcResponse delete(URI uri, List requestHeaders) { } @Override - public GcResponse post(URI uri, List requestHeaders, String body) { + public Response post(URI uri, List requestHeaders, String body) { HttpPost httpPost = new HttpPost(uri); httpPost.setConfig(requestConfig); addHeaders(httpPost, requestHeaders); if (body != null) { - HttpEntity requestEntity = new GcJsonEntity(body, CHARSET); + HttpEntity requestEntity = new JsonEntity(body, CHARSET); httpPost.setEntity(requestEntity); } return executeRequest(httpPost); } @Override - public GcResponse put(URI uri, List requestHeaders, String body) { + public Response put(URI uri, List requestHeaders, String body) { HttpPut httpPut = new HttpPut(uri); httpPut.setConfig(requestConfig); addHeaders(httpPut, requestHeaders); if (body != null) { - HttpEntity requestEntity = new GcJsonEntity(body, CHARSET); + HttpEntity requestEntity = new JsonEntity(body, CHARSET); httpPut.setEntity(requestEntity); } return executeRequest(httpPut); } @SuppressWarnings("resource") - protected GcResponse executeRequest(HttpUriRequest request) { + protected Response executeRequest(HttpUriRequest request) { final String requestId = UUID.randomUUID().toString(); final long startTime = System.currentTimeMillis(); @@ -224,7 +240,7 @@ protected GcResponse executeRequest(HttpUriRequest request) { int statusCode = httpResponse.getStatusLine().getStatusCode(); String body = entity == null ? null : EntityUtils.toString(entity, CHARSET); List headers = getHeaders(httpResponse); - return new GcResponse(statusCode, body, headers); + return new Response(statusCode, body, headers); } finally { /* @@ -237,10 +253,10 @@ protected GcResponse executeRequest(HttpUriRequest request) { } } catch (ClientProtocolException e) { logError(requestId, e, startTime, communicatorLogger); - throw new GcCommunicationException(e); + throw new CommunicationException(e); } catch (IOException e) { logError(requestId, e, startTime, communicatorLogger); - throw new GcCommunicationException(e); + throw new CommunicationException(e); } catch (RuntimeException e) { logError(requestId, e, startTime, communicatorLogger); throw e; @@ -265,7 +281,17 @@ protected List getHeaders(HttpResponse httpResponse) { } @Override - public void enableLogging(GcCommunicatorLogger communicatorLogger) { + public void closeIdleConnections(long idleTime, TimeUnit timeUnit) { + connectionManager.closeIdleConnections(idleTime, timeUnit); + } + + @Override + public void closeExpiredConnections() { + connectionManager.closeExpiredConnections(); + } + + @Override + public void enableLogging(CommunicatorLogger communicatorLogger) { if (communicatorLogger == null) { throw new IllegalArgumentException("communicatorLogger is required"); } @@ -279,7 +305,7 @@ public void disableLogging() { // logging code - private void logRequest(final HttpRequest request, final String requestId, final GcCommunicatorLogger logger) { + private void logRequest(final HttpRequest request, final String requestId, final CommunicatorLogger logger) { try { RequestLine requestLine = request.getRequestLine(); @@ -311,7 +337,7 @@ private void logRequest(final HttpRequest request, final String requestId, final } } - private void logResponse(final HttpResponse response, final String requestId, final long startTime, final GcCommunicatorLogger logger) { + private void logResponse(final HttpResponse response, final String requestId, final long startTime, final CommunicatorLogger logger) { final long endTime = System.currentTimeMillis(); final long duration = endTime - startTime; @@ -360,9 +386,9 @@ private void setBody(LogMessageBuilder logMessageBuilder, HttpEntity entity, Hea if (entity == null) { logMessageBuilder.setBody("", contentType); - } else if (entity instanceof GcJsonEntity) { + } else if (entity instanceof JsonEntity) { - String body = ((GcJsonEntity) entity).getString(); + String body = ((JsonEntity) entity).getString(); logMessageBuilder.setBody(body, contentType); } else { @@ -371,7 +397,7 @@ private void setBody(LogMessageBuilder logMessageBuilder, HttpEntity entity, Hea } } - private void logError(final String requestId, final Exception error, final long startTime, final GcCommunicatorLogger logger) { + private void logError(final String requestId, final Exception error, final long startTime, final CommunicatorLogger logger) { if (logger != null) { @@ -391,7 +417,7 @@ private class LoggingInterceptor implements HttpRequestInterceptor, HttpResponse @Override public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { - final GcCommunicatorLogger logger = communicatorLogger; + final CommunicatorLogger logger = communicatorLogger; if (logger != null) { final String requestId = (String) context.getAttribute(REQUEST_ID_ATTRIBUTE); @@ -405,7 +431,7 @@ public void process(HttpRequest request, HttpContext context) throws HttpExcepti @Override public void process(HttpResponse response, HttpContext context) throws HttpException, IOException { - final GcCommunicatorLogger logger = communicatorLogger; + final CommunicatorLogger logger = communicatorLogger; if (logger != null) { final String requestId = (String) context.getAttribute(REQUEST_ID_ATTRIBUTE); diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultMarshaller.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultMarshaller.java new file mode 100644 index 000000000..fc87c66d8 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultMarshaller.java @@ -0,0 +1,33 @@ +package com.ingenico.connect.gateway.sdk.java.defaultimpl; + +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; +import com.ingenico.connect.gateway.sdk.java.Marshaller; +import com.ingenico.connect.gateway.sdk.java.MarshallerSyntaxException; + +/** + * {@link Marshaller} implementation based on {@link Gson}. + */ +public class DefaultMarshaller implements Marshaller { + + // Gson instances are thread-safe, so reuse one single instance + private static final Gson GSON = new Gson(); + + public static final DefaultMarshaller INSTANCE = new DefaultMarshaller(); + + protected DefaultMarshaller() {} + + @Override + public String marshal(Object requestObject) { + return GSON.toJson(requestObject); + } + + @Override + public T unmarshal(String responseJson, Class type) { + try { + return GSON.fromJson(responseJson, type); + } catch (JsonSyntaxException e) { + throw new MarshallerSyntaxException(e); + } + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/GcJsonEntity.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/JsonEntity.java similarity index 72% rename from src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/GcJsonEntity.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/JsonEntity.java index da24444e7..62fa53d14 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/defaultimpl/GcJsonEntity.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/JsonEntity.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; import java.nio.charset.Charset; @@ -8,11 +8,11 @@ /** * A sub class of {@link StringEntity} that keeps its original string. */ -class GcJsonEntity extends StringEntity { +class JsonEntity extends StringEntity { private final String string; - public GcJsonEntity(String string, Charset charset) { + public JsonEntity(String string, Charset charset) { super(string, ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), charset)); this.string = string; } diff --git a/src/main/java/com/ingenico/connect/gateway/sdk/java/domain/metadata/ShoppingCartExtension.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/domain/metadata/ShoppingCartExtension.java new file mode 100644 index 000000000..72363a600 --- /dev/null +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/domain/metadata/ShoppingCartExtension.java @@ -0,0 +1,35 @@ +package com.ingenico.connect.gateway.sdk.java.domain.metadata; + +public class ShoppingCartExtension { + + private final String creator; + private final String name; + private final String version; + + public ShoppingCartExtension(String creator, String name, String version) { + if (creator == null || creator.trim().isEmpty()) { + throw new IllegalArgumentException("creator is required"); + } + if (name == null || name.trim().isEmpty()) { + throw new IllegalArgumentException("name is required"); + } + if (version == null || version.trim().isEmpty()) { + throw new IllegalArgumentException("version is required"); + } + this.creator = creator; + this.name = name; + this.version = version; + } + + public String getCreator() { + return creator; + } + + public String getName() { + return name; + } + + public String getVersion() { + return version; + } +} diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/GcCommunicatorLogger.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/CommunicatorLogger.java similarity index 79% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/GcCommunicatorLogger.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/CommunicatorLogger.java index b3c5c7cb1..da2aa29ea 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/GcCommunicatorLogger.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/CommunicatorLogger.java @@ -1,9 +1,9 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; /** * Used to log messages from communicators. Thread-safe. */ -public interface GcCommunicatorLogger { +public interface CommunicatorLogger { /** * Logs a message. diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/HeaderObfuscator.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/HeaderObfuscator.java similarity index 94% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/HeaderObfuscator.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/HeaderObfuscator.java index 57b2c3bd8..b68a344f0 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/HeaderObfuscator.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/HeaderObfuscator.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.util.Map; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/JdkCommunicatorLogger.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/JdkCommunicatorLogger.java similarity index 92% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/JdkCommunicatorLogger.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/JdkCommunicatorLogger.java index b72c4d223..69574a151 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/JdkCommunicatorLogger.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/JdkCommunicatorLogger.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.util.logging.Level; import java.util.logging.Logger; @@ -6,7 +6,7 @@ /** * A communicator logger that is backed by a {@link java.util.logging.Logger}. */ -public class JdkCommunicatorLogger implements GcCommunicatorLogger { +public class JdkCommunicatorLogger implements CommunicatorLogger { private final Logger logger; private final Level logLevel; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/LogMessageBuilder.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LogMessageBuilder.java similarity index 97% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/LogMessageBuilder.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LogMessageBuilder.java index 0fd4b8a61..e340ff2db 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/LogMessageBuilder.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LogMessageBuilder.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/LoggingCapable.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingCapable.java similarity index 69% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/LoggingCapable.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingCapable.java index b86960332..450a3f593 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/LoggingCapable.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingCapable.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; /** * Classes that implement this interface have support for logging messages from communicators. @@ -7,9 +7,9 @@ public interface LoggingCapable { /** * Turns on logging using the given communicator logger. - * @throws IllegalArgumentException If the given communicator logger is null. + * @throws IllegalArgumentException If the given communicator logger is {@code null}. */ - void enableLogging(GcCommunicatorLogger communicatorLogger); + void enableLogging(CommunicatorLogger communicatorLogger); /** * Turns off logging. diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/LoggingUtil.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingUtil.java similarity index 98% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/LoggingUtil.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingUtil.java index 9d3c9d153..bcaa77aef 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/LoggingUtil.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingUtil.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/Obfuscator.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/Obfuscator.java similarity index 96% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/Obfuscator.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/Obfuscator.java index 8751c4242..b9f2f4b79 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/Obfuscator.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/Obfuscator.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.util.Collections; import java.util.LinkedHashMap; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/PropertyObfuscator.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/PropertyObfuscator.java similarity index 98% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/PropertyObfuscator.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/PropertyObfuscator.java index de86e7e0d..18c47bb21 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/PropertyObfuscator.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/PropertyObfuscator.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.util.Iterator; import java.util.Map; diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/RequestLogMessageBuilder.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/RequestLogMessageBuilder.java similarity index 95% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/RequestLogMessageBuilder.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/RequestLogMessageBuilder.java index 3297510f6..7bb6e5d35 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/RequestLogMessageBuilder.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/RequestLogMessageBuilder.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; /** * A utility class to build request log messages. diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/ResponseLogMessageBuilder.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/ResponseLogMessageBuilder.java similarity index 95% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/ResponseLogMessageBuilder.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/ResponseLogMessageBuilder.java index 781fddcc7..4aa5d9941 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/ResponseLogMessageBuilder.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/ResponseLogMessageBuilder.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; /** * A utility class to build request log messages. diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/SysOutCommunicatorLogger.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/SysOutCommunicatorLogger.java similarity index 89% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/SysOutCommunicatorLogger.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/SysOutCommunicatorLogger.java index 1af787014..1c2890733 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/SysOutCommunicatorLogger.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/SysOutCommunicatorLogger.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.io.PrintStream; import java.util.Date; @@ -7,7 +7,7 @@ * A communicator logger that prints its message to {@link System#out}. * It includes a timestamp in yyyy-MM-ddTHH:mm:ss format in the system time zone. */ -public final class SysOutCommunicatorLogger implements GcCommunicatorLogger { +public final class SysOutCommunicatorLogger implements CommunicatorLogger { public static final SysOutCommunicatorLogger INSTANCE = new SysOutCommunicatorLogger(); diff --git a/src/main/java/com/globalcollect/gateway/sdk/java/logging/ValueObfuscator.java b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/ValueObfuscator.java similarity index 96% rename from src/main/java/com/globalcollect/gateway/sdk/java/logging/ValueObfuscator.java rename to src/main/java/com/ingenico/connect/gateway/sdk/java/logging/ValueObfuscator.java index 94b1c5df8..78afce13f 100644 --- a/src/main/java/com/globalcollect/gateway/sdk/java/logging/ValueObfuscator.java +++ b/src/main/java/com/ingenico/connect/gateway/sdk/java/logging/ValueObfuscator.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.util.Arrays; diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/GcDefaultConfigurationTest.java b/src/test/java/com/globalcollect/gateway/sdk/java/GcDefaultConfigurationTest.java deleted file mode 100644 index fe5f0cd3f..000000000 --- a/src/test/java/com/globalcollect/gateway/sdk/java/GcDefaultConfigurationTest.java +++ /dev/null @@ -1,308 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.net.URI; -import java.util.Properties; - -import org.junit.Assert; -import org.junit.Test; - -import com.globalcollect.gateway.sdk.java.defaultimpl.AuthorizationType; - -public class GcDefaultConfigurationTest { - - @Test - public void testConstructFromPropertiesWithoutProxy() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); - Assert.assertEquals(20000, configuration.getConnectTimeout()); - Assert.assertEquals(10000, configuration.getSocketTimeout()); - Assert.assertEquals(GcDefaultConfiguration.DEFAULT_MAX_CONNECTIONS, configuration.getMaxConnections()); - Assert.assertNull(configuration.getApiKeyId()); - Assert.assertNull(configuration.getSecretApiKey()); - Assert.assertNull(configuration.getProxyConfiguration()); - } - - @Test - public void testConstructFromPropertiesWithProxyWithoutAuthentication() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - properties.setProperty("gcs.api.proxy.uri", "http://proxy.example.org:3128"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); - Assert.assertEquals(20000, configuration.getConnectTimeout()); - Assert.assertEquals(10000, configuration.getSocketTimeout()); - Assert.assertEquals(GcDefaultConfiguration.DEFAULT_MAX_CONNECTIONS, configuration.getMaxConnections()); - Assert.assertNull(configuration.getApiKeyId()); - Assert.assertNull(configuration.getSecretApiKey()); - - Assert.assertNotNull(configuration.getProxyConfiguration()); - GcProxyConfiguration proxyConfiguration = configuration.getProxyConfiguration(); - Assert.assertEquals("http", proxyConfiguration.getScheme()); - Assert.assertEquals("proxy.example.org", proxyConfiguration.getHost()); - Assert.assertEquals(3128, proxyConfiguration.getPort()); - Assert.assertNull(proxyConfiguration.getUsername()); - Assert.assertNull(proxyConfiguration.getPassword()); - } - - @Test - public void testConstructFromPropertiesWithProxyWithAuthentication() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - properties.setProperty("gcs.api.proxy.uri", "http://proxy.example.org:3128"); - properties.setProperty("gcs.api.proxy.username", "global-collect-username"); - properties.setProperty("gcs.api.proxy.password", "global-collect-password"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); - Assert.assertEquals(20000, configuration.getConnectTimeout()); - Assert.assertEquals(10000, configuration.getSocketTimeout()); - Assert.assertEquals(GcDefaultConfiguration.DEFAULT_MAX_CONNECTIONS, configuration.getMaxConnections()); - Assert.assertNull(configuration.getApiKeyId()); - Assert.assertNull(configuration.getSecretApiKey()); - - Assert.assertNotNull(configuration.getProxyConfiguration()); - GcProxyConfiguration proxyConfiguration = configuration.getProxyConfiguration(); - Assert.assertEquals("http", proxyConfiguration.getScheme()); - Assert.assertEquals("proxy.example.org", proxyConfiguration.getHost()); - Assert.assertEquals(3128, proxyConfiguration.getPort()); - Assert.assertEquals("global-collect-username", proxyConfiguration.getUsername()); - Assert.assertEquals("global-collect-password", proxyConfiguration.getPassword()); - } - - @Test - public void testConstructFromPropertiesWithMaxConnections() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - properties.setProperty("gcs.api.maxConnections", "100"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); - Assert.assertEquals(20000, configuration.getConnectTimeout()); - Assert.assertEquals(10000, configuration.getSocketTimeout()); - Assert.assertEquals(100, configuration.getMaxConnections()); - Assert.assertNull(configuration.getApiKeyId()); - Assert.assertNull(configuration.getSecretApiKey()); - Assert.assertNull(configuration.getProxyConfiguration()); - } - - @Test - public void testConstructFromPropertiesWithHost() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - } - - @Test - public void testConstructFromPropertiesWithHostAndScheme() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.endpoint.scheme", "http"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("http://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - } - - @Test - public void testConstructFromPropertiesWithHostAndPort() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.endpoint.port", "8443"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com:8443"), configuration.getApiEndpoint()); - } - - @Test - public void testConstructFromPropertiesWithHostSchemeAndPort() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.endpoint.scheme", "http"); - properties.setProperty("gcs.api.endpoint.port", "8080"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("http://api-sandbox.globalcollect.com:8080"), configuration.getApiEndpoint()); - } - - @Test - public void testConstructFromPropertiesWithBaseURI() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/v1"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - - // with a trailing / - - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/v1/"); - - configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - - // no version - - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/"); - - configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); - } - - @Test(expected = IllegalArgumentException.class) - public void testConstructFromPropertiesWithHostAndBaseURI() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/v1"); - properties.setProperty("gcs.api.endpoint.host", "api-sandbox.globalcollect.com"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - new GcDefaultConfiguration(properties); - } - - @Test(expected = IllegalArgumentException.class) - public void testConstructFromPropertiesWithPortAndBaseURI() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/v1"); - properties.setProperty("gcs.api.endpoint.port", "80"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - new GcDefaultConfiguration(properties); - } - - @Test(expected = IllegalArgumentException.class) - public void testConstructFromPropertiesWithSchemeAndBaseURI() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/v1"); - properties.setProperty("gcs.api.endpoint.scheme", "http"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - new GcDefaultConfiguration(properties); - } - - @Test(expected = IllegalArgumentException.class) - public void testConstructFromPropertiesWithBaseURIWithInvalidVersion() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/v0"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - new GcDefaultConfiguration(properties); - } - - @Test(expected = IllegalArgumentException.class) - public void testConstructFromPropertiesWithInvalidBaseURI() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://api-sandbox.globalcollect.com/v1/hello"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - new GcDefaultConfiguration(properties); - } - - @Test(expected = IllegalArgumentException.class) - public void testConstructFromPropertiesWithBaseURIWithCredentials() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://test:test@api-sandbox.globalcollect.com/v1"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - new GcDefaultConfiguration(properties); - } - - @Test - public void testConstructFromPropertiesWithIPv6Host() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.endpoint.host", "::1"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://[::1]"), configuration.getApiEndpoint()); - } - - @Test - public void testConstructFromPropertiesWithIPv6BaseURI() { - - Properties properties = new Properties(); - properties.setProperty("gcs.api.baseUri", "https://[::1]/v1"); - properties.setProperty("gcs.api.authorizationType", "V1HMAC"); - properties.setProperty("gcs.api.connectTimeout", "20000"); - properties.setProperty("gcs.api.socketTimeout", "10000"); - - GcDefaultConfiguration configuration = new GcDefaultConfiguration(properties); - - Assert.assertEquals(URI.create("https://[::1]"), configuration.getApiEndpoint()); - } -} diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/GcFactoryTest.java b/src/test/java/com/globalcollect/gateway/sdk/java/GcFactoryTest.java deleted file mode 100644 index 8da4e14d1..000000000 --- a/src/test/java/com/globalcollect/gateway/sdk/java/GcFactoryTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.globalcollect.gateway.sdk.java; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Collection; - -import org.junit.Assert; -import org.junit.Test; - -import com.globalcollect.gateway.sdk.java.defaultimpl.AuthorizationType; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcAuthenticator; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcConnection; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcConnectionTest; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcMarshaller; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcSession; -import com.globalcollect.gateway.sdk.java.util.ReflectionUtil; - -public class GcFactoryTest { - - public static final URI PROPERTIES_URI; - public static final String API_KEY_ID = "d8b5c5c457d80349"; - public static final String SECRET_API_KEY = "KbaFESwwqgwidbbhf2GECxGFayerrnbT2bPznc3Vfdg="; - - static { - try { - PROPERTIES_URI = GcFactoryTest.class.getResource("configuration.properties").toURI(); - } catch (URISyntaxException e) { - InstantiationError error = new InstantiationError(e.getMessage()); - error.initCause(e); - throw error; - } - } - - @Test - public void testCreateDefaultConfiguration() { - GcDefaultConfiguration defaultConfiguration = GcFactory.createDefaultConfiguration(PROPERTIES_URI, API_KEY_ID, SECRET_API_KEY); - Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), defaultConfiguration.getApiEndpoint()); - Assert.assertEquals(AuthorizationType.V1HMAC, defaultConfiguration.getAuthorizationType()); - Assert.assertEquals(-1, defaultConfiguration.getConnectTimeout()); - Assert.assertEquals(-1, defaultConfiguration.getSocketTimeout()); - Assert.assertEquals(100, defaultConfiguration.getMaxConnections()); - Assert.assertEquals(API_KEY_ID, defaultConfiguration.getApiKeyId()); - Assert.assertEquals(SECRET_API_KEY, defaultConfiguration.getSecretApiKey()); - Assert.assertNull(defaultConfiguration.getProxyConfiguration()); - } - - @Test - public void testCreateCommunicator() { - @SuppressWarnings("resource") - GcCommunicator communicator = GcFactory.createCommunicator(PROPERTIES_URI, API_KEY_ID, SECRET_API_KEY); - - Assert.assertSame(DefaultGcMarshaller.INSTANCE, communicator.getMarshaller()); - - DefaultGcSession session = ReflectionUtil.getField(communicator, "session", DefaultGcSession.class); - - @SuppressWarnings("resource") - GcConnection connection = session.getConnection(); - Assert.assertTrue(connection instanceof DefaultGcConnection); - DefaultGcConnectionTest.assertConnection((DefaultGcConnection) connection, -1, -1, 100, null); - - GcAuthenticator authenticator = session.getAuthenticator(); - Assert.assertTrue(authenticator instanceof DefaultGcAuthenticator); - Assert.assertEquals(AuthorizationType.V1HMAC, ReflectionUtil.getField(authenticator, "authorizationType", AuthorizationType.class)); - Assert.assertEquals(API_KEY_ID, ReflectionUtil.getField(authenticator, "apiKeyId", String.class)); - Assert.assertEquals(SECRET_API_KEY, ReflectionUtil.getField(authenticator, "secretApiKey", String.class)); - - GcMetaDataProvider metaDataProvider = session.getMetaDataProvider(); - Assert.assertTrue(metaDataProvider instanceof DefaultGcMetaDataProvider); - Collection requestHeaders = metaDataProvider.getServerMetaDataHeaders(); - Assert.assertEquals(1, requestHeaders.size()); - RequestHeader requestHeader = requestHeaders.iterator().next(); - Assert.assertEquals("X-GCS-ServerMetaInfo", requestHeader.getName()); - } -} diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/gc/GcClientTest.java b/src/test/java/com/globalcollect/gateway/sdk/java/gc/GcClientTest.java deleted file mode 100644 index 58859ba85..000000000 --- a/src/test/java/com/globalcollect/gateway/sdk/java/gc/GcClientTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.globalcollect.gateway.sdk.java.gc; - -import java.util.Collections; - -import org.junit.Assert; -import org.junit.Test; - -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.GcFactoryTest; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcMarshaller; - -public class GcClientTest { - - @Test - @SuppressWarnings("resource") - public void testWithClientMetaInfo() { - - GcClient client1 = GcFactory.createClient(GcFactoryTest.PROPERTIES_URI, GcFactoryTest.API_KEY_ID, GcFactoryTest.SECRET_API_KEY); - - GcClient client2 = client1.withClientMetaInfo(null); - Assert.assertSame(client1, client2); - - String clientMetaInfo = DefaultGcMarshaller.INSTANCE.marshal(Collections.singletonMap("test", "test")); - GcClient client3 = client1.withClientMetaInfo(clientMetaInfo); - Assert.assertNotSame(client1, client3); - - GcClient client4 = client3.withClientMetaInfo(clientMetaInfo); - Assert.assertSame(client3, client4); - - GcClient client5 = client3.withClientMetaInfo(null); - Assert.assertNotSame(client3, client5); - - // nothing can be said about client1 and client5 - } -} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/AbstractParamRequestTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/AbstractParamRequestTest.java new file mode 100644 index 000000000..218feb159 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/AbstractParamRequestTest.java @@ -0,0 +1,160 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class AbstractParamRequestTest { + + @Test + public void testAddParameterString() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", "foo"); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "foo")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test + public void testAddParameterInteger() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", 1); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "1")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test + public void testAddParameterLong() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", 1L); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "1")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test + public void testAddParameterBoolean() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", true); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "true")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test + public void testAddParameterStringList() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", Arrays.asList("foo", "bar")); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "foo")); + matchers.add(new RequestParamMatcher("test", "bar")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test + public void testAddParameterIntegerList() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", Arrays.asList(1, 2)); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "1")); + matchers.add(new RequestParamMatcher("test", "2")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test + public void testAddParameterLongList() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", Arrays.asList(1L, 2L)); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "1")); + matchers.add(new RequestParamMatcher("test", "2")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test + public void testAddParameterBooleanList() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", Arrays.asList(true, false)); + + List> matchers = new ArrayList>(); + matchers.add(new RequestParamMatcher("test", "true")); + matchers.add(new RequestParamMatcher("test", "false")); + + Assert.assertThat(requestParameters, Matchers.contains(matchers)); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddParameterDate() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", new Date()); + } + + @Test(expected = IllegalArgumentException.class) + public void testAddParameterStringListList() { + AbstractParamRequest request = new TestParamRequest(); + + List requestParameters = new LinkedList(); + + request.addParameter(requestParameters, "test", Collections.singletonList(Collections.singletonList("foo"))); + } + + private static final class TestParamRequest extends AbstractParamRequest { + + @Override + public List toRequestParameters() { + throw new UnsupportedOperationException(); + } + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/ClientTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/ClientTest.java new file mode 100644 index 000000000..ea6c2ac1a --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/ClientTest.java @@ -0,0 +1,131 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.codec.binary.Base64; +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.runners.MockitoJUnitRunner; + +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultMarshaller; +import com.ingenico.connect.gateway.sdk.java.util.RequestHeaderMatcher; + +@RunWith(MockitoJUnitRunner.class) +public class ClientTest { + + @Mock PooledConnection pooledConnection; + @Mock Connection connection; + + @Test + @SuppressWarnings("resource") + public void testWithClientMetaInfo() { + + Client client1 = Factory.createClient(FactoryTest.PROPERTIES_URI, FactoryTest.API_KEY_ID, FactoryTest.SECRET_API_KEY); + assertNoClientHeaders(client1); + + Client client2 = client1.withClientMetaInfo(null); + Assert.assertSame(client1, client2); + + String clientMetaInfo = DefaultMarshaller.INSTANCE.marshal(Collections.singletonMap("test", "test")); + Client client3 = client1.withClientMetaInfo(clientMetaInfo); + Assert.assertNotSame(client1, client3); + assertClientHeaders(client3, clientMetaInfo); + + Client client4 = client3.withClientMetaInfo(clientMetaInfo); + Assert.assertSame(client3, client4); + + Client client5 = client3.withClientMetaInfo(null); + Assert.assertNotSame(client3, client5); + assertNoClientHeaders(client5); + + // nothing can be said about client1 and client5 being the same or not + } + + private void assertNoClientHeaders(Client client) { + List headers = getHeaders(client); + Assert.assertNull(headers); + } + + private void assertClientHeaders(Client client, String clientMetaInfo) { + List headers = getHeaders(client); + + final Charset charset = Charset.forName("UTF-8"); + String headerValue = Base64.encodeBase64String(clientMetaInfo.getBytes(charset)); + + List> matchers = new ArrayList>(); + matchers.add(new RequestHeaderMatcher("X-GCS-ClientMetaInfo", headerValue)); + + Assert.assertThat(headers, Matchers.containsInAnyOrder(matchers)); + } + + @SuppressWarnings("unchecked") + private List getHeaders(Client client) { + // ApiResource.getClientHeaders() is protected, so this test class has no access to it; use reflection to get it + try { + Method method = ApiResource.class.getDeclaredMethod("getClientHeaders"); + method.setAccessible(true); + return (List) method.invoke(client); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + @Test + @SuppressWarnings("resource") + public void testCloseIdleConnectionsNotPooled() { + SessionBuilder builder = Factory.createSessionBuilder(FactoryTest.PROPERTIES_URI, FactoryTest.API_KEY_ID, FactoryTest.SECRET_API_KEY); + Session session = builder.withConnection(connection).build(); + Client client = Factory.createClient(session); + // with a connection that isn't a PooledConnection, this doesn't throw any exceptions + client.closeIdleConnections(5, TimeUnit.SECONDS); + } + + @Test + @SuppressWarnings("resource") + public void testCloseIdleConnectionsPooled() { + SessionBuilder builder = Factory.createSessionBuilder(FactoryTest.PROPERTIES_URI, FactoryTest.API_KEY_ID, FactoryTest.SECRET_API_KEY); + Session session = builder.withConnection(pooledConnection).build(); + Client client = Factory.createClient(session); + // with a connection that is a PooledConnection, this gets delegated to pooledConnection + client.closeIdleConnections(5, TimeUnit.SECONDS); + + Mockito.verify(pooledConnection).closeIdleConnections(5, TimeUnit.SECONDS); + } + + @Test + @SuppressWarnings("resource") + public void testCloseExpiredConnectionsNotPooled() { + SessionBuilder builder = Factory.createSessionBuilder(FactoryTest.PROPERTIES_URI, FactoryTest.API_KEY_ID, FactoryTest.SECRET_API_KEY); + Session session = builder.withConnection(connection).build(); + Client client = Factory.createClient(session); + // with a connection that isn't a PooledConnection, this doesn't throw any exceptions + client.closeExpiredConnections(); + } + + @Test + @SuppressWarnings("resource") + public void testCloseExpiredConnectionsPooled() { + SessionBuilder builder = Factory.createSessionBuilder(FactoryTest.PROPERTIES_URI, FactoryTest.API_KEY_ID, FactoryTest.SECRET_API_KEY); + Session session = builder.withConnection(pooledConnection).build(); + Client client = Factory.createClient(session); + // with a connection that is a PooledConnection, this gets delegated to pooledConnection + client.closeExpiredConnections(); + + Mockito.verify(pooledConnection).closeExpiredConnections(); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/CommunicatorConfigurationTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/CommunicatorConfigurationTest.java new file mode 100644 index 000000000..6c8a1dea4 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/CommunicatorConfigurationTest.java @@ -0,0 +1,221 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.net.URI; +import java.util.Properties; + +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.defaultimpl.AuthorizationType; + +public class CommunicatorConfigurationTest { + + @Test + public void testConstructFromPropertiesWithoutProxy() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); + Assert.assertEquals(20000, configuration.getConnectTimeout()); + Assert.assertEquals(10000, configuration.getSocketTimeout()); + Assert.assertEquals(CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, configuration.getMaxConnections()); + Assert.assertNull(configuration.getApiKeyId()); + Assert.assertNull(configuration.getSecretApiKey()); + Assert.assertNull(configuration.getProxyConfiguration()); + Assert.assertNull(configuration.getIntegrator()); + Assert.assertNull(configuration.getShoppingCartExtension()); + } + + @Test + public void testConstructFromPropertiesWithProxyWithoutAuthentication() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + properties.setProperty("connect.api.proxy.uri", "http://proxy.example.org:3128"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); + Assert.assertEquals(20000, configuration.getConnectTimeout()); + Assert.assertEquals(10000, configuration.getSocketTimeout()); + Assert.assertEquals(CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, configuration.getMaxConnections()); + Assert.assertNull(configuration.getApiKeyId()); + Assert.assertNull(configuration.getSecretApiKey()); + + Assert.assertNotNull(configuration.getProxyConfiguration()); + ProxyConfiguration proxyConfiguration = configuration.getProxyConfiguration(); + Assert.assertEquals("http", proxyConfiguration.getScheme()); + Assert.assertEquals("proxy.example.org", proxyConfiguration.getHost()); + Assert.assertEquals(3128, proxyConfiguration.getPort()); + Assert.assertNull(proxyConfiguration.getUsername()); + Assert.assertNull(proxyConfiguration.getPassword()); + } + + @Test + public void testConstructFromPropertiesWithProxyWithAuthentication() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + properties.setProperty("connect.api.proxy.uri", "http://proxy.example.org:3128"); + properties.setProperty("connect.api.proxy.username", "global-collect-username"); + properties.setProperty("connect.api.proxy.password", "global-collect-password"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); + Assert.assertEquals(20000, configuration.getConnectTimeout()); + Assert.assertEquals(10000, configuration.getSocketTimeout()); + Assert.assertEquals(CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, configuration.getMaxConnections()); + Assert.assertNull(configuration.getApiKeyId()); + Assert.assertNull(configuration.getSecretApiKey()); + + Assert.assertNotNull(configuration.getProxyConfiguration()); + ProxyConfiguration proxyConfiguration = configuration.getProxyConfiguration(); + Assert.assertEquals("http", proxyConfiguration.getScheme()); + Assert.assertEquals("proxy.example.org", proxyConfiguration.getHost()); + Assert.assertEquals(3128, proxyConfiguration.getPort()); + Assert.assertEquals("global-collect-username", proxyConfiguration.getUsername()); + Assert.assertEquals("global-collect-password", proxyConfiguration.getPassword()); + } + + @Test + public void testConstructFromPropertiesWithMaxConnections() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + properties.setProperty("connect.api.maxConnections", "100"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); + Assert.assertEquals(20000, configuration.getConnectTimeout()); + Assert.assertEquals(10000, configuration.getSocketTimeout()); + Assert.assertEquals(100, configuration.getMaxConnections()); + Assert.assertNull(configuration.getApiKeyId()); + Assert.assertNull(configuration.getSecretApiKey()); + Assert.assertNull(configuration.getProxyConfiguration()); + } + + @Test + public void testConstructFromPropertiesWithHost() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + } + + @Test + public void testConstructFromPropertiesWithHostAndScheme() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.endpoint.scheme", "http"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("http://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + } + + @Test + public void testConstructFromPropertiesWithHostAndPort() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.endpoint.port", "8443"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com:8443"), configuration.getApiEndpoint()); + } + + @Test + public void testConstructFromPropertiesWithHostSchemeAndPort() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.endpoint.scheme", "http"); + properties.setProperty("connect.api.endpoint.port", "8080"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("http://api-sandbox.globalcollect.com:8080"), configuration.getApiEndpoint()); + } + + @Test + public void testConstructFromPropertiesWithIPv6Host() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "::1"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://[::1]"), configuration.getApiEndpoint()); + } + + @Test + public void testConstructFromPropertiesWithMetaData() { + + Properties properties = new Properties(); + properties.setProperty("connect.api.endpoint.host", "api-sandbox.globalcollect.com"); + properties.setProperty("connect.api.authorizationType", "V1HMAC"); + properties.setProperty("connect.api.connectTimeout", "20000"); + properties.setProperty("connect.api.socketTimeout", "10000"); + properties.setProperty("connect.api.integrator", "Ingenico.Integrator"); + properties.setProperty("connect.api.shoppingCartExtension.creator", "Ingenico.Creator"); + properties.setProperty("connect.api.shoppingCartExtension.name", "Ingenico.ShoppingCarts"); + properties.setProperty("connect.api.shoppingCartExtension.version", "1.0"); + + CommunicatorConfiguration configuration = new CommunicatorConfiguration(properties); + + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); + Assert.assertEquals(20000, configuration.getConnectTimeout()); + Assert.assertEquals(10000, configuration.getSocketTimeout()); + Assert.assertEquals(CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, configuration.getMaxConnections()); + Assert.assertNull(configuration.getApiKeyId()); + Assert.assertNull(configuration.getSecretApiKey()); + Assert.assertNull(configuration.getProxyConfiguration()); + Assert.assertEquals("Ingenico.Integrator", configuration.getIntegrator()); + Assert.assertNotNull(configuration.getShoppingCartExtension()); + Assert.assertEquals("Ingenico.Creator", configuration.getShoppingCartExtension().getCreator()); + Assert.assertEquals("Ingenico.ShoppingCarts", configuration.getShoppingCartExtension().getName()); + Assert.assertEquals("1.0", configuration.getShoppingCartExtension().getVersion()); + } +} diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcCommunicatorTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/CommunicatorTest.java similarity index 77% rename from src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcCommunicatorTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/CommunicatorTest.java index d602c117b..3ca4d0a3e 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcCommunicatorTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/CommunicatorTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java; import java.net.URI; import java.util.Arrays; @@ -12,15 +12,14 @@ import org.mockito.Mockito; import org.mockito.runners.MockitoJUnitRunner; -import com.globalcollect.gateway.sdk.java.GcSession; -import com.globalcollect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultMarshaller; @RunWith(MockitoJUnitRunner.class) -public class DefaultGcCommunicatorTest { +public class CommunicatorTest { - private static final URI BASE_URI = URI.create("https://api-sandbox.globalcollect.com"); + private static final URI BASE_URI = URI.create("https://api-sandbox.globalcollect.com"); - @Mock GcSession session; + @Mock Session session; @Test public void testToURIWithoutRequestParams() { @@ -28,7 +27,7 @@ public void testToURIWithoutRequestParams() { Mockito.when(session.getApiEndpoint()).thenReturn(BASE_URI); @SuppressWarnings("resource") - DefaultGcCommunicator communicator = new DefaultGcCommunicator(session, DefaultGcMarshaller.INSTANCE); + Communicator communicator = new Communicator(session, DefaultMarshaller.INSTANCE); URI uri = communicator.toAbsoluteURI("v1/merchant/20000/convertamount", Collections.emptyList()); Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com/v1/merchant/20000/convertamount"), uri); @@ -50,7 +49,7 @@ public void testToURIWithRequestParams() { Mockito.when(session.getApiEndpoint()).thenReturn(BASE_URI); @SuppressWarnings("resource") - DefaultGcCommunicator communicator = new DefaultGcCommunicator(session, DefaultGcMarshaller.INSTANCE); + Communicator communicator = new Communicator(session, DefaultMarshaller.INSTANCE); URI uri = communicator.toAbsoluteURI("v1/merchant/20000/convertamount", requestParams); Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com/v1/merchant/20000/convertamount?amount=123&source=USD&target=EUR&dummy=%C3%A9%26%25%3D"), uri); diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/FactoryTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/FactoryTest.java new file mode 100644 index 000000000..01aced847 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/FactoryTest.java @@ -0,0 +1,73 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Collection; + +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.defaultimpl.AuthorizationType; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultAuthenticator; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultConnection; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultConnectionTest; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultMarshaller; +import com.ingenico.connect.gateway.sdk.java.util.ReflectionUtil; + +public class FactoryTest { + + public static final URI PROPERTIES_URI; + public static final String API_KEY_ID = "someKey"; + public static final String SECRET_API_KEY = "someSecret"; + + static { + try { + PROPERTIES_URI = FactoryTest.class.getResource("configuration.properties").toURI(); + } catch (URISyntaxException e) { + InstantiationError error = new InstantiationError(e.getMessage()); + error.initCause(e); + throw error; + } + } + + @Test + public void testCreateConfiguration() { + CommunicatorConfiguration configuration = Factory.createConfiguration(PROPERTIES_URI, API_KEY_ID, SECRET_API_KEY); + Assert.assertEquals(URI.create("https://api-sandbox.globalcollect.com"), configuration.getApiEndpoint()); + Assert.assertEquals(AuthorizationType.V1HMAC, configuration.getAuthorizationType()); + Assert.assertEquals(-1, configuration.getConnectTimeout()); + Assert.assertEquals(-1, configuration.getSocketTimeout()); + Assert.assertEquals(100, configuration.getMaxConnections()); + Assert.assertEquals(API_KEY_ID, configuration.getApiKeyId()); + Assert.assertEquals(SECRET_API_KEY, configuration.getSecretApiKey()); + Assert.assertNull(configuration.getProxyConfiguration()); + } + + @Test + public void testCreateCommunicator() { + @SuppressWarnings("resource") + Communicator communicator = Factory.createCommunicator(PROPERTIES_URI, API_KEY_ID, SECRET_API_KEY); + + Assert.assertSame(DefaultMarshaller.INSTANCE, communicator.getMarshaller()); + + Session session = ReflectionUtil.getField(communicator, "session", Session.class); + + @SuppressWarnings("resource") + Connection connection = session.getConnection(); + Assert.assertTrue(connection instanceof DefaultConnection); + DefaultConnectionTest.assertConnection((DefaultConnection) connection, -1, -1, 100, null); + + Authenticator authenticator = session.getAuthenticator(); + Assert.assertTrue(authenticator instanceof DefaultAuthenticator); + Assert.assertEquals(AuthorizationType.V1HMAC, ReflectionUtil.getField(authenticator, "authorizationType", AuthorizationType.class)); + Assert.assertEquals(API_KEY_ID, ReflectionUtil.getField(authenticator, "apiKeyId", String.class)); + Assert.assertEquals(SECRET_API_KEY, ReflectionUtil.getField(authenticator, "secretApiKey", String.class)); + + MetaDataProvider metaDataProvider = session.getMetaDataProvider(); + Assert.assertEquals(MetaDataProvider.class, metaDataProvider.getClass()); + Collection requestHeaders = metaDataProvider.getServerMetaDataHeaders(); + Assert.assertEquals(1, requestHeaders.size()); + RequestHeader requestHeader = requestHeaders.iterator().next(); + Assert.assertEquals("X-GCS-ServerMetaInfo", requestHeader.getName()); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderBuilderTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderBuilderTest.java new file mode 100644 index 000000000..d757f94a5 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderBuilderTest.java @@ -0,0 +1,67 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.UUID; + +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +import com.ingenico.connect.gateway.sdk.java.util.RequestHeaderMatcher; + +@RunWith(Parameterized.class) +public class MetaDataProviderBuilderTest { + + private final String additionalHeaderName; + private final boolean isAllowed; + + public MetaDataProviderBuilderTest(String additionalHeaderName, boolean isAllowed) { + this.additionalHeaderName = additionalHeaderName; + this.isAllowed = isAllowed; + } + + @Parameters(name = "Header {0} is allowed: {1}") + public static Iterable getParameters() { + List parameters = new ArrayList(); + for (String prohibitedHeaders : MetaDataProvider.PROHIBITED_HEADERS) { + parameters.add(new Object[] { prohibitedHeaders, false }); + } + parameters.add(new Object[] { "Dummy", true, }); + parameters.add(new Object[] { "Accept", true, }); + parameters.add(new Object[] { "If-None-Match", true, }); + parameters.add(new Object[] { "If-Modified-Since", true, }); + return parameters; + } + + @Test + public void testWithAdditionalRequestHeader() { + RequestHeader additionalRequestHeader = new RequestHeader(additionalHeaderName, UUID.randomUUID().toString()); + + MetaDataProviderBuilder builder = new MetaDataProviderBuilder("Ingenico"); + if (isAllowed) { + MetaDataProvider metaDataProvider = builder.withAdditionalRequestHeader(additionalRequestHeader).build(); + Collection requestHeaders = metaDataProvider.getServerMetaDataHeaders(); + Assert.assertEquals(2, requestHeaders.size()); + + Iterator requestHeaderIterator = requestHeaders.iterator(); + RequestHeader requestHeader = requestHeaderIterator.next(); + Assert.assertEquals("X-GCS-ServerMetaInfo", requestHeader.getName()); + + requestHeader = requestHeaderIterator.next(); + Assert.assertThat(requestHeader, new RequestHeaderMatcher(additionalRequestHeader)); + } else { + try { + builder.withAdditionalRequestHeader(additionalRequestHeader); + Assert.fail("expected IllegalArgumentException"); + } catch (IllegalArgumentException e) { + Assert.assertThat(e.getMessage(), Matchers.containsString(additionalHeaderName)); + } + } + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderTest.java new file mode 100644 index 000000000..67a500afe --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/MetaDataProviderTest.java @@ -0,0 +1,121 @@ +package com.ingenico.connect.gateway.sdk.java; + +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.codec.binary.Base64; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.MetaDataProvider.ServerMetaInfo; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultMarshaller; +import com.ingenico.connect.gateway.sdk.java.domain.metadata.ShoppingCartExtension; +import com.ingenico.connect.gateway.sdk.java.util.RequestHeaderMatcher; +import com.ingenico.connect.gateway.sdk.java.util.ShoppingCartExtensionMatcher; + +public class MetaDataProviderTest { + + @Test + public void testGetServerMetaDataHeadersFull() { + + ShoppingCartExtension shoppingCartExtension = new ShoppingCartExtension("Ingenico.Creator", "Extension", "1.0"); + + MetaDataProvider metaDataProvider = new MetaDataProviderBuilder("Ingenico.Integrator") + .withShoppingCartExtension(shoppingCartExtension) + .build(); + + Collection requestHeaders = metaDataProvider.getServerMetaDataHeaders(); + Assert.assertEquals(1, requestHeaders.size()); + + RequestHeader requestHeader = requestHeaders.iterator().next(); + assertServerMetaInfo(metaDataProvider, "Ingenico.Integrator", shoppingCartExtension, requestHeader); + } + + @Test + public void testGetServerMetaDataHeadersNoAdditionalHeaders() { + + MetaDataProvider metaDataProvider = new MetaDataProvider("Ingenico"); + + Collection requestHeaders = metaDataProvider.getServerMetaDataHeaders(); + Assert.assertEquals(1, requestHeaders.size()); + + RequestHeader requestHeader = requestHeaders.iterator().next(); + assertServerMetaInfo(metaDataProvider, "Ingenico", null, requestHeader); + } + + @Test + public void testGetServerMetaDataHeadersWithAdditionalHeaders() { + + final List additionalHeaders = Arrays.asList( + new RequestHeader("Header1", "Value1"), + new RequestHeader("Header2", "Value2"), + new RequestHeader("Header3", "Value3") + ); + + MetaDataProviderBuilder builder = new MetaDataProviderBuilder("Ingenico"); + // add directly, to bypass the checks - this test is also for validation in MetaDataProvider + builder.additionalRequestHeaders.addAll(additionalHeaders); + + MetaDataProvider metaDataProvider = new MetaDataProvider(builder); + + Collection requestHeaders = metaDataProvider.getServerMetaDataHeaders(); + Assert.assertEquals(4, requestHeaders.size()); + + Iterator requestHeaderIterator = requestHeaders.iterator(); + + RequestHeader requestHeader = requestHeaderIterator.next(); + assertServerMetaInfo(metaDataProvider, "Ingenico", null, requestHeader); + + for (RequestHeader additionalHeader : additionalHeaders) { + Assert.assertTrue(requestHeaderIterator.hasNext()); + requestHeader = requestHeaderIterator.next(); + Assert.assertThat(requestHeader, new RequestHeaderMatcher(additionalHeader)); + } + } + + @Test + public void testConstructorWithProhibitedHeaders() { + + for (final String name : MetaDataProvider.PROHIBITED_HEADERS) { + + MetaDataProviderBuilder builder = new MetaDataProviderBuilder("Ingenico"); + // add directly, to bypass the checks - this test is also for validation in MetaDataProvider + builder.additionalRequestHeaders.add(new RequestHeader("Header1", "Value1")); + builder.additionalRequestHeaders.add(new RequestHeader(name, name)); + builder.additionalRequestHeaders.add(new RequestHeader("Header2", "Value2")); + + try { + new MetaDataProvider(builder); + Assert.fail("expected an IllegalArgumentException"); + } catch (IllegalArgumentException e) { + Assert.assertThat(e.getMessage(), Matchers.containsString(name)); + } + } + } + + private void assertServerMetaInfo(MetaDataProvider metaDataProvider, + String integrator, + ShoppingCartExtension shoppingCartExtension, + RequestHeader requestHeader) { + + Assert.assertEquals("X-GCS-ServerMetaInfo", requestHeader.getName()); + Assert.assertNotNull(requestHeader.getValue()); + + String serverMetaInfoJson = new String(Base64.decodeBase64(requestHeader.getValue()), Charset.forName("UTF-8")); + + ServerMetaInfo serverMetaInfo = DefaultMarshaller.INSTANCE.unmarshal(serverMetaInfoJson, ServerMetaInfo.class); + Assert.assertEquals(metaDataProvider.getPlatformIdentifier(), serverMetaInfo.platformIdentifier); + Assert.assertEquals(metaDataProvider.getSdkIdentifier(), serverMetaInfo.sdkIdentifier); + Assert.assertEquals("Ingenico", serverMetaInfo.sdkCreator); + Assert.assertEquals(integrator, serverMetaInfo.integrator); + if (shoppingCartExtension == null) { + Assert.assertNull(serverMetaInfo.shoppingCartExtension); + } else { + Assert.assertThat(serverMetaInfo.shoppingCartExtension, new ShoppingCartExtensionMatcher(shoppingCartExtension)); + } + } +} diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcAuthenticatorTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultAuthenticatorTest.java similarity index 63% rename from src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcAuthenticatorTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultAuthenticatorTest.java index 50ad568da..db0e196ae 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcAuthenticatorTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultAuthenticatorTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; import java.net.URI; import java.util.ArrayList; @@ -7,29 +7,29 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.RequestHeader; +import com.ingenico.connect.gateway.sdk.java.RequestHeader; -public class DefaultGcAuthenticatorTest { +public class DefaultAuthenticatorTest { @Test public void testToCanonicalizeHeaderValue() { - DefaultGcAuthenticator gcAuthenticator = new DefaultGcAuthenticator(AuthorizationType.V1HMAC, "apiKeyId", "secretApiKey"); - Assert.assertEquals("aap noot", gcAuthenticator.toCanonicalizeHeaderValue("aap\nnoot ")); - Assert.assertEquals("aap noot", gcAuthenticator.toCanonicalizeHeaderValue(" aap\r\n noot")); + DefaultAuthenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKeyId", "secretApiKey"); + Assert.assertEquals("aap noot", authenticator.toCanonicalizeHeaderValue("aap\nnoot ")); + Assert.assertEquals("aap noot", authenticator.toCanonicalizeHeaderValue(" aap\r\n noot")); } @Test public void testToDataToSign() { - DefaultGcAuthenticator gcAuthenticator = new DefaultGcAuthenticator(AuthorizationType.V1HMAC, "apiKeyId", "secretApiKey"); + DefaultAuthenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKeyId", "secretApiKey"); List httpHeaders = new ArrayList(); httpHeaders.add(new RequestHeader("X-GCS-ServerMetaInfo", "{\"platformIdentifier\":\"Windows 7/6.1 Java/1.7 (Oracle Corporation; Java HotSpot(TM) 64-Bit Server VM; 1.7.0_45)\",\"sdkIdentifier\":\"1.0\"}")); httpHeaders.add(new RequestHeader("Content-Type", "application/json")); httpHeaders.add(new RequestHeader("X-GCS-ClientMetaInfo", "{\"aap\",\"noot\"}")); httpHeaders.add(new RequestHeader("User-Agent", "Apache-HttpClient/4.3.4 (java 1.5)")); httpHeaders.add(new RequestHeader("Date", "Mon, 07 Jul 2014 12:12:40 GMT")); - String dataToSign = gcAuthenticator.toDataToSign("POST", URI.create("http://localhost:8080/v1/9991/services%20bla/convert/amount?aap=noot&mies=geen%20noot"), httpHeaders); + String dataToSign = authenticator.toDataToSign("POST", URI.create("http://localhost:8080/v1/9991/services%20bla/convert/amount?aap=noot&mies=geen%20noot"), httpHeaders); String expectedStart = "POST\n" + @@ -51,7 +51,7 @@ public void testToDataToSign() { @Test public void testCreateAuthenticationSignature() { - DefaultGcAuthenticator gcAuthenticator = new DefaultGcAuthenticator(AuthorizationType.V1HMAC, "apiKeyId", "secretApiKey"); + DefaultAuthenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKeyId", "secretApiKey"); String dataToSign = "DELETE\n"+ "application/json\n"+ @@ -61,7 +61,7 @@ public void testCreateAuthenticationSignature() { "x-gcs-servermetainfo:processed header value\n"+ "/v1/9991/tokens/123456789\n"; - String authenticationSignature = gcAuthenticator.createAuthenticationSignature(dataToSign); + String authenticationSignature = authenticator.createAuthenticationSignature(dataToSign); Assert.assertEquals("VfnXpPBQQoHZivTcAg0JvOWkhnzlPnaCPKpTQn/uMJM=", authenticationSignature); } @@ -69,14 +69,14 @@ public void testCreateAuthenticationSignature() { @Test public void testCreateAuthenticationSignature2() { - DefaultGcAuthenticator gcAuthenticator = new DefaultGcAuthenticator(AuthorizationType.V1HMAC, "EC36A74A98D21", "6Kj5HT0MQKC6D8eb7W3lTg71kVKVDSt1"); + DefaultAuthenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "EC36A74A98D21", "6Kj5HT0MQKC6D8eb7W3lTg71kVKVDSt1"); String dataToSign = "GET\n"+ "\n"+ "Fri, 06 Jun 2014 13:39:43 GMT\n"+ "/v1/9991/tokens/123456789\n"; - String authenticationSignature = gcAuthenticator.createAuthenticationSignature(dataToSign); + String authenticationSignature = authenticator.createAuthenticationSignature(dataToSign); Assert.assertEquals("9ond5EIN05dBXJGCLRK5om9pxHsyrh/12pZJ7bvmwNM=", authenticationSignature); } diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionIdempotenceTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionIdempotenceTest.java similarity index 81% rename from src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionIdempotenceTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionIdempotenceTest.java index fbb0506e8..c601f108b 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionIdempotenceTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionIdempotenceTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; import java.io.IOException; import java.io.InputStreamReader; @@ -28,27 +28,27 @@ import org.mockito.runners.MockitoJUnitRunner; import org.mockito.stubbing.Answer; -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcAuthenticator; -import com.globalcollect.gateway.sdk.java.GcCommunicator; -import com.globalcollect.gateway.sdk.java.GcConnection; -import com.globalcollect.gateway.sdk.java.GcDeclinedPaymentException; -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.GcSession; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Card; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Customer; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; +import com.ingenico.connect.gateway.sdk.java.Authenticator; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.Communicator; +import com.ingenico.connect.gateway.sdk.java.Connection; +import com.ingenico.connect.gateway.sdk.java.DeclinedPaymentException; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.MetaDataProvider; +import com.ingenico.connect.gateway.sdk.java.Session; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Card; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; @RunWith(MockitoJUnitRunner.class) -public class DefaultGcConnectionIdempotenceTest extends LocalServerTestBase { +public class DefaultConnectionIdempotenceTest extends LocalServerTestBase { @Mock HttpRequestHandler requestHandler; @@ -71,7 +71,7 @@ public void testIdempotenceFirstRequest() throws Exception { CallContext context = new CallContext().withIdempotenceKey(idempotenceKey); - GcClient client = createClient(host); + Client client = createClient(host); try { CreatePaymentRequest request = createRequest(); @@ -114,7 +114,7 @@ public void testIdempotenceSecondRequest() throws Exception { final String idempotenceKey = UUID.randomUUID().toString(); CallContext context = new CallContext().withIdempotenceKey(idempotenceKey); - GcClient client = createClient(host); + Client client = createClient(host); try { CreatePaymentRequest request = createRequest(); @@ -153,16 +153,16 @@ public void testIdempotenceFirstFailure() throws Exception { final String idempotenceKey = UUID.randomUUID().toString(); CallContext context = new CallContext().withIdempotenceKey(idempotenceKey); - GcClient client = createClient(host); + Client client = createClient(host); try { CreatePaymentRequest request = createRequest(); client.merchant("20000").payments().create(request, context); - Assert.fail("Expected GcDeclinedPaymentException"); + Assert.fail("Expected DeclinedPaymentException"); - } catch (GcDeclinedPaymentException e) { + } catch (DeclinedPaymentException e) { Assert.assertEquals(402, e.getStatusCode()); Assert.assertEquals(body, e.getResponseBody()); @@ -198,16 +198,16 @@ public void testIdempotenceSecondFailure() throws Exception { final String idempotenceKey = UUID.randomUUID().toString(); CallContext context = new CallContext().withIdempotenceKey(idempotenceKey); - GcClient client = createClient(host); + Client client = createClient(host); try { CreatePaymentRequest request = createRequest(); client.merchant("20000").payments().create(request, context); - Assert.fail("Expected GcDeclinedPaymentException"); + Assert.fail("Expected DeclinedPaymentException"); - } catch (GcDeclinedPaymentException e) { + } catch (DeclinedPaymentException e) { Assert.assertEquals(402, e.getStatusCode()); Assert.assertEquals(body, e.getResponseBody()); @@ -244,16 +244,16 @@ public void testIdempotenceDuplicateRequest() throws Exception { final String idempotenceKey = UUID.randomUUID().toString(); CallContext context = new CallContext().withIdempotenceKey(idempotenceKey); - GcClient client = createClient(host); + Client client = createClient(host); try { CreatePaymentRequest request = createRequest(); client.merchant("20000").payments().create(request, context); - Assert.fail("Expected GcIdempotenceException"); + Assert.fail("Expected IdempotenceException"); - } catch (GcIdempotenceException e) { + } catch (IdempotenceException e) { Assert.assertEquals(409, e.getStatusCode()); Assert.assertEquals(body, e.getResponseBody()); @@ -319,14 +319,14 @@ public Void answer(InvocationOnMock invocation) throws Throwable { } @SuppressWarnings("resource") - private GcClient createClient(HttpHost host) { - - GcConnection connection = new DefaultGcConnection(500, 500); - GcAuthenticator authenticator = new DefaultGcAuthenticator(AuthorizationType.V1HMAC, "apiKey", "secret"); - GcMetaDataProvider metaDataProvider = new DefaultGcMetaDataProvider(); - GcSession session = new DefaultGcSession(URI.create(host.toURI()), connection, authenticator, metaDataProvider); - GcCommunicator communicator = GcFactory.createCommunicator(session); - GcClient client = GcFactory.createClient(communicator); + private Client createClient(HttpHost host) { + + Connection connection = new DefaultConnection(500, 500); + Authenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKey", "secret"); + MetaDataProvider metaDataProvider = new MetaDataProvider("Ingenico"); + Session session = new Session(URI.create(host.toURI()), connection, authenticator, metaDataProvider); + Communicator communicator = Factory.createCommunicator(session); + Client client = Factory.createClient(communicator); return client; } diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionLoggerTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionLoggerTest.java similarity index 85% rename from src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionLoggerTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionLoggerTest.java index eee5511ad..675060042 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionLoggerTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionLoggerTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; import java.io.IOException; import java.io.InputStreamReader; @@ -31,33 +31,33 @@ import org.mockito.runners.MockitoJUnitRunner; import org.mockito.stubbing.Answer; -import com.globalcollect.gateway.sdk.java.GcAuthenticator; -import com.globalcollect.gateway.sdk.java.GcCommunicationException; -import com.globalcollect.gateway.sdk.java.GcCommunicator; -import com.globalcollect.gateway.sdk.java.GcConnection; -import com.globalcollect.gateway.sdk.java.GcDeclinedPaymentException; -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.GcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.GcNotFoundException; -import com.globalcollect.gateway.sdk.java.GcSession; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.GlobalCollectException; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Card; -import com.globalcollect.gateway.sdk.java.gc.merchant.services.ConvertAmountParams; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Customer; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; -import com.globalcollect.gateway.sdk.java.gc.services.ConvertAmount; -import com.globalcollect.gateway.sdk.java.gc.services.TestConnection; -import com.globalcollect.gateway.sdk.java.logging.GcCommunicatorLogger; +import com.ingenico.connect.gateway.sdk.java.Authenticator; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicationException; +import com.ingenico.connect.gateway.sdk.java.Communicator; +import com.ingenico.connect.gateway.sdk.java.Connection; +import com.ingenico.connect.gateway.sdk.java.DeclinedPaymentException; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.GlobalCollectException; +import com.ingenico.connect.gateway.sdk.java.MetaDataProvider; +import com.ingenico.connect.gateway.sdk.java.NotFoundException; +import com.ingenico.connect.gateway.sdk.java.Session; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Card; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; +import com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount; +import com.ingenico.connect.gateway.sdk.java.domain.services.TestConnection; +import com.ingenico.connect.gateway.sdk.java.logging.CommunicatorLogger; +import com.ingenico.connect.gateway.sdk.java.merchant.services.ConvertAmountParams; @RunWith(MockitoJUnitRunner.class) -public class DefaultGcConnectionLoggerTest extends LocalServerTestBase { +public class DefaultConnectionLoggerTest extends LocalServerTestBase { @Mock HttpRequestHandler requestHandler; @@ -68,7 +68,7 @@ public void testLoggingTestConnection() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/testconnection", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -106,7 +106,7 @@ public void testLoggingConvertAmount() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/convert/amount", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -148,7 +148,7 @@ public void testDeleteToken() throws Exception { serverBootstrap.registerHandler("/v1/1234/tokens/5678", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -183,7 +183,7 @@ public void testCreatePayment() throws Exception { serverBootstrap.registerHandler("/v1/1234/payments", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -249,7 +249,7 @@ public void testCreatePaymentInvalidCardNumber() throws Exception { serverBootstrap.registerHandler("/v1/1234/payments", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -285,9 +285,9 @@ public void testCreatePaymentInvalidCardNumber() throws Exception { client.merchant("1234").payments().create(request); - Assert.fail("expected GcValidationException"); + Assert.fail("expected ValidationException"); - } catch (GcValidationException e) { + } catch (ValidationException e) { // expected @@ -317,7 +317,7 @@ public void testCreatePaymentRejected() throws Exception { serverBootstrap.registerHandler("/v1/1234/payments", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -353,9 +353,9 @@ public void testCreatePaymentRejected() throws Exception { client.merchant("1234").payments().create(request); - Assert.fail("expected GcDeclinedPaymentException"); + Assert.fail("expected DeclinedPaymentException"); - } catch (GcDeclinedPaymentException e) { + } catch (DeclinedPaymentException e) { // expected @@ -389,7 +389,7 @@ public void testLoggingUnknownServerError() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/testconnection", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -430,7 +430,7 @@ public void testNonJson() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/testconnection", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -439,9 +439,9 @@ public void testNonJson() throws Exception { try { client.merchant("1234").services().testconnection(); - Assert.fail("expected GcNotFoundException"); + Assert.fail("expected NotFoundException"); - } catch (GcNotFoundException e) { + } catch (NotFoundException e) { // expected @@ -471,7 +471,7 @@ public void testReadTimeout() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/testconnection", requestHandler); HttpHost host = start(); - GcClient client = createClient(host, 500, 10); + Client client = createClient(host, 500, 10); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -480,9 +480,9 @@ public void testReadTimeout() throws Exception { try { client.merchant("1234").services().testconnection(); - Assert.fail("expected GcCommunicationException"); + Assert.fail("expected CommunicationException"); - } catch (GcCommunicationException e) { + } catch (CommunicationException e) { // expected @@ -514,7 +514,7 @@ public void testLogRequestOnly() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/testconnection", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); client.enableLogging(logger); @@ -547,7 +547,7 @@ public void testLogResponseOnly() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/testconnection", requestHandler); HttpHost host = start(); - GcClient client = createClient(host); + Client client = createClient(host); TestLogger logger = new TestLogger(); setupRequestHandler(enableLogging(setOKJsonResponse("testConnection.json"), client, logger)); @@ -579,7 +579,7 @@ public void testLogErrorOnly() throws Exception { serverBootstrap.registerHandler("/v1/1234/services/testconnection", requestHandler); HttpHost host = start(); - GcClient client = createClient(host, 500, 10); + Client client = createClient(host, 500, 10); TestLogger logger = new TestLogger(); setupRequestHandler(enableLogging(delayedAnswer(setHtmlResponse("notFound.html", 404), 100), client, logger)); @@ -587,9 +587,9 @@ public void testLogErrorOnly() throws Exception { try { client.merchant("1234").services().testconnection(); - Assert.fail("expected GcCommunicationException"); + Assert.fail("expected CommunicationException"); - } catch (GcCommunicationException e) { + } catch (CommunicationException e) { // expected @@ -747,7 +747,7 @@ public Void answer(InvocationOnMock invocation) throws Throwable { response.setHeader(entry.getKey(), entry.getValue()); } - response.setEntity(new InputStreamEntity(DefaultGcConnectionLoggerTest.class.getResourceAsStream(resource))); + response.setEntity(new InputStreamEntity(DefaultConnectionLoggerTest.class.getResourceAsStream(resource))); return null; } @@ -773,7 +773,7 @@ public Void answer(InvocationOnMock invocation) throws Throwable { response.setHeader(entry.getKey(), entry.getValue()); } - response.setEntity(new InputStreamEntity(DefaultGcConnectionLoggerTest.class.getResourceAsStream(resource))); + response.setEntity(new InputStreamEntity(DefaultConnectionLoggerTest.class.getResourceAsStream(resource))); return null; } @@ -790,7 +790,7 @@ public T answer(InvocationOnMock invocation) throws Throwable { }; } - private Answer enableLogging(final Answer answer, final GcClient client, final GcCommunicatorLogger communicatorLogger) { + private Answer enableLogging(final Answer answer, final Client client, final CommunicatorLogger communicatorLogger) { return new Answer() { @Override public T answer(InvocationOnMock invocation) throws Throwable { @@ -800,7 +800,7 @@ public T answer(InvocationOnMock invocation) throws Throwable { }; } - private Answer disableLogging(final Answer answer, final GcClient client) { + private Answer disableLogging(final Answer answer, final Client client) { return new Answer() { @Override public T answer(InvocationOnMock invocation) throws Throwable { @@ -812,21 +812,21 @@ public T answer(InvocationOnMock invocation) throws Throwable { // general utility methods - private GcClient createClient(HttpHost host) throws URISyntaxException { + private Client createClient(HttpHost host) throws URISyntaxException { return createClient(host, 500, 500); } @SuppressWarnings("resource") - private GcClient createClient(HttpHost host, int connectTimeout, int socketTimeout) throws URISyntaxException { + private Client createClient(HttpHost host, int connectTimeout, int socketTimeout) throws URISyntaxException { URI uri = new URI(host.getSchemeName(), null, host.getHostName(), host.getPort(), null, null, null); - GcConnection connection = new DefaultGcConnection(connectTimeout, socketTimeout); - GcAuthenticator authenticator = new DefaultGcAuthenticator(AuthorizationType.V1HMAC, "apiKey", "secret"); - GcMetaDataProvider metaDataProvider = new DefaultGcMetaDataProvider(); - GcSession session = new DefaultGcSession(uri, connection, authenticator, metaDataProvider); - GcCommunicator communicator = GcFactory.createCommunicator(session); - GcClient client = GcFactory.createClient(communicator); + Connection connection = new DefaultConnection(connectTimeout, socketTimeout); + Authenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKey", "secret"); + MetaDataProvider metaDataProvider = new MetaDataProvider("Ingenico"); + Session session = new Session(uri, connection, authenticator, metaDataProvider); + Communicator communicator = Factory.createCommunicator(session); + Client client = Factory.createClient(communicator); return client; } @@ -846,9 +846,9 @@ private String readResource(String resource) throws IOException { return result.toString(); } - private static final class TestLogger implements GcCommunicatorLogger { + private static final class TestLogger implements CommunicatorLogger { - private List entries = new ArrayList(); + private List entries = new ArrayList(); @Override public void log(String message) { diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionTest.java similarity index 70% rename from src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionTest.java index 974828928..53fe23682 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/defaultimpl/DefaultGcConnectionTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultConnectionTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.defaultimpl; +package com.ingenico.connect.gateway.sdk.java.defaultimpl; import java.net.URI; @@ -17,11 +17,11 @@ import org.junit.Assert; import org.junit.Test; -import com.globalcollect.gateway.sdk.java.GcDefaultConfiguration; -import com.globalcollect.gateway.sdk.java.GcProxyConfiguration; -import com.globalcollect.gateway.sdk.java.util.ReflectionUtil; +import com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration; +import com.ingenico.connect.gateway.sdk.java.ProxyConfiguration; +import com.ingenico.connect.gateway.sdk.java.util.ReflectionUtil; -public class DefaultGcConnectionTest { +public class DefaultConnectionTest { private static final int CONNECT_TIMEOUT = 10000; private static final int SOCKET_TIMEOUT = 20000; @@ -31,31 +31,31 @@ public class DefaultGcConnectionTest { @SuppressWarnings("resource") public void testConstructWithoutProxy() { - DefaultGcConnection connection = new DefaultGcConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT); + DefaultConnection connection = new DefaultConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT); assertRequestConfig(connection, CONNECT_TIMEOUT, SOCKET_TIMEOUT); - assertMaxConnections(connection, GcDefaultConfiguration.DEFAULT_MAX_CONNECTIONS, null); + assertMaxConnections(connection, CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, null); assertNoProxy(connection); } @Test @SuppressWarnings("resource") public void testConstructWithProxyWithoutAuthentication() { - GcProxyConfiguration proxyConfiguration = new GcProxyConfiguration(URI.create("http://test-proxy")); + ProxyConfiguration proxyConfiguration = new ProxyConfiguration(URI.create("http://test-proxy")); - DefaultGcConnection connection = new DefaultGcConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, proxyConfiguration); + DefaultConnection connection = new DefaultConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, proxyConfiguration); assertRequestConfig(connection, CONNECT_TIMEOUT, SOCKET_TIMEOUT); - assertMaxConnections(connection, GcDefaultConfiguration.DEFAULT_MAX_CONNECTIONS, proxyConfiguration); + assertMaxConnections(connection, CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, proxyConfiguration); assertProxy(connection, proxyConfiguration); } @Test @SuppressWarnings("resource") public void testConstructWithProxyWithAuthentication() { - GcProxyConfiguration proxyConfiguration = new GcProxyConfiguration(URI.create("http://test-proxy"), "test-username", "test-password"); + ProxyConfiguration proxyConfiguration = new ProxyConfiguration(URI.create("http://test-proxy"), "test-username", "test-password"); - DefaultGcConnection connection = new DefaultGcConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, proxyConfiguration); + DefaultConnection connection = new DefaultConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, proxyConfiguration); assertRequestConfig(connection, CONNECT_TIMEOUT, SOCKET_TIMEOUT); - assertMaxConnections(connection, GcDefaultConfiguration.DEFAULT_MAX_CONNECTIONS, proxyConfiguration); + assertMaxConnections(connection, CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS, proxyConfiguration); assertProxy(connection, proxyConfiguration); } @@ -63,7 +63,7 @@ public void testConstructWithProxyWithAuthentication() { @SuppressWarnings("resource") public void testConstructWithMaxConnectionsWithoutProxy() { - DefaultGcConnection connection = new DefaultGcConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, MAX_CONNECTIONS); + DefaultConnection connection = new DefaultConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, MAX_CONNECTIONS); assertRequestConfig(connection, CONNECT_TIMEOUT, SOCKET_TIMEOUT); assertMaxConnections(connection, MAX_CONNECTIONS, null); assertNoProxy(connection); @@ -72,15 +72,15 @@ public void testConstructWithMaxConnectionsWithoutProxy() { @Test @SuppressWarnings("resource") public void testConstructWithMaxConnectionsWithProxy() { - GcProxyConfiguration proxyConfiguration = new GcProxyConfiguration(URI.create("http://test-proxy")); + ProxyConfiguration proxyConfiguration = new ProxyConfiguration(URI.create("http://test-proxy")); - DefaultGcConnection connection = new DefaultGcConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, MAX_CONNECTIONS, proxyConfiguration); + DefaultConnection connection = new DefaultConnection(CONNECT_TIMEOUT, SOCKET_TIMEOUT, MAX_CONNECTIONS, proxyConfiguration); assertRequestConfig(connection, CONNECT_TIMEOUT, SOCKET_TIMEOUT); assertMaxConnections(connection, MAX_CONNECTIONS, proxyConfiguration); assertProxy(connection, proxyConfiguration); } - public static void assertConnection(DefaultGcConnection connection, int connectTimeout, int socketTimeout, int maxConnections, GcProxyConfiguration proxyConfiguration) { + public static void assertConnection(DefaultConnection connection, int connectTimeout, int socketTimeout, int maxConnections, ProxyConfiguration proxyConfiguration) { assertRequestConfig(connection, connectTimeout, socketTimeout); assertMaxConnections(connection, maxConnections, proxyConfiguration); if (proxyConfiguration != null) { @@ -90,7 +90,7 @@ public static void assertConnection(DefaultGcConnection connection, int connectT } } - private static void assertRequestConfig(DefaultGcConnection connection, int connectTimeout, int socketTimeout) { + private static void assertRequestConfig(DefaultConnection connection, int connectTimeout, int socketTimeout) { RequestConfig requestConfig = connection.requestConfig; Assert.assertEquals(connectTimeout, requestConfig.getConnectTimeout()); @@ -98,7 +98,7 @@ private static void assertRequestConfig(DefaultGcConnection connection, int conn } @SuppressWarnings("resource") - private static void assertMaxConnections(DefaultGcConnection connection, int maxConnections, GcProxyConfiguration proxyConfiguration) { + private static void assertMaxConnections(DefaultConnection connection, int maxConnections, ProxyConfiguration proxyConfiguration) { CloseableHttpClient httpClient = ReflectionUtil.getField(connection, "httpClient", CloseableHttpClient.class); PoolingHttpClientConnectionManager connectionManager = ReflectionUtil.getField(httpClient, "connManager", PoolingHttpClientConnectionManager.class); Assert.assertEquals(maxConnections, connectionManager.getDefaultMaxPerRoute()); @@ -111,7 +111,7 @@ private static void assertMaxConnections(DefaultGcConnection connection, int max } @SuppressWarnings("resource") - private static void assertNoProxy(DefaultGcConnection connection) { + private static void assertNoProxy(DefaultConnection connection) { CloseableHttpClient httpClient = ReflectionUtil.getField(connection, "httpClient", CloseableHttpClient.class); // don't inspect the route planner any further ReflectionUtil.getField(httpClient, "routePlanner", SystemDefaultRoutePlanner.class); @@ -120,7 +120,7 @@ private static void assertNoProxy(DefaultGcConnection connection) { } @SuppressWarnings("resource") - private static void assertProxy(DefaultGcConnection connection, GcProxyConfiguration proxyConfiguration) { + private static void assertProxy(DefaultConnection connection, ProxyConfiguration proxyConfiguration) { CloseableHttpClient httpClient = ReflectionUtil.getField(connection, "httpClient", CloseableHttpClient.class); DefaultProxyRoutePlanner routePlanner = ReflectionUtil.getField(httpClient, "routePlanner", DefaultProxyRoutePlanner.class); HttpHost proxy = ReflectionUtil.getField(routePlanner, "proxy", HttpHost.class); diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultMarshallerTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultMarshallerTest.java new file mode 100644 index 000000000..67c9026a6 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/defaultimpl/DefaultMarshallerTest.java @@ -0,0 +1,55 @@ +package com.ingenico.connect.gateway.sdk.java.defaultimpl; + +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.token.TokenResponse; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.CustomerToken; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCard; +import com.ingenico.connect.gateway.sdk.java.domain.token.definitions.TokenCardData; + +public class DefaultMarshallerTest { + + @Test + public void testUnmarshalWithExtraFields() { + TokenResponseWithExtraField original = new TokenResponseWithExtraField(); + + Address billingAddress = new Address(); + billingAddress.setCountryCode("NL"); + + CustomerToken customer = new CustomerToken(); + customer.setBillingAddress(billingAddress); + + TokenCardData data = new TokenCardData(); + + TokenCard card = new TokenCard(); + card.setCustomer(customer); + card.setData(data); + original.setCard(card); + + original.setExtraField("extra-field-value"); + + String json = DefaultMarshaller.INSTANCE.marshal(original); + + TokenResponse unmarshalled = DefaultMarshaller.INSTANCE.unmarshal(json, TokenResponse.class); + + Assert.assertNotNull(unmarshalled.getCard()); + Assert.assertNotNull(unmarshalled.getCard().getCustomer()); + Assert.assertNotNull(unmarshalled.getCard().getCustomer().getBillingAddress()); + Assert.assertEquals("NL", unmarshalled.getCard().getCustomer().getBillingAddress().getCountryCode()); + Assert.assertNotNull(unmarshalled.getCard().getData()); + } + + static final class TokenResponseWithExtraField extends TokenResponse { + + private String extraField; + + public String getExtraField() { + return extraField; + } + public void setExtraField(String extraField) { + this.extraField = extraField; + } + } +} diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/logging/JdkCommunicatorLoggerTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/logging/JdkCommunicatorLoggerTest.java similarity index 94% rename from src/test/java/com/globalcollect/gateway/sdk/java/logging/JdkCommunicatorLoggerTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/logging/JdkCommunicatorLoggerTest.java index 98c8a2bf9..8944e8f44 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/logging/JdkCommunicatorLoggerTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/logging/JdkCommunicatorLoggerTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.util.ArrayList; import java.util.List; @@ -10,6 +10,8 @@ import org.junit.Assert; import org.junit.Test; +import com.ingenico.connect.gateway.sdk.java.logging.JdkCommunicatorLogger; + public class JdkCommunicatorLoggerTest { @Test diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/logging/LoggingUtilTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingUtilTest.java similarity index 96% rename from src/test/java/com/globalcollect/gateway/sdk/java/logging/LoggingUtilTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingUtilTest.java index e003eaf13..2ac77169d 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/logging/LoggingUtilTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/logging/LoggingUtilTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -10,6 +10,8 @@ import org.junit.Test; +import com.ingenico.connect.gateway.sdk.java.logging.LoggingUtil; + public class LoggingUtilTest { @Test diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/logging/SysOutCommunicatorLoggerTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/logging/SysOutCommunicatorLoggerTest.java similarity index 94% rename from src/test/java/com/globalcollect/gateway/sdk/java/logging/SysOutCommunicatorLoggerTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/logging/SysOutCommunicatorLoggerTest.java index f10ca3078..f44bb3a0e 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/logging/SysOutCommunicatorLoggerTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/logging/SysOutCommunicatorLoggerTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.logging; +package com.ingenico.connect.gateway.sdk.java.logging; import java.io.ByteArrayOutputStream; import java.io.PrintStream; @@ -13,6 +13,8 @@ import org.junit.Before; import org.junit.Test; +import com.ingenico.connect.gateway.sdk.java.logging.SysOutCommunicatorLogger; + public class SysOutCommunicatorLoggerTest { private static final Pattern MESSAGE_PATTERN = Pattern.compile("\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2} (.*)", Pattern.DOTALL); diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClientTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/PaymentsClientTest.java similarity index 59% rename from src/test/java/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClientTest.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/PaymentsClientTest.java index 9f2c59eed..d86896f22 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/gc/merchant/payments/PaymentsClientTest.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/payments/PaymentsClientTest.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.gc.merchant.payments; +package com.ingenico.connect.gateway.sdk.java.merchant.payments; import java.io.IOException; import java.io.InputStreamReader; @@ -17,46 +17,45 @@ import org.mockito.runners.MockitoJUnitRunner; import org.mockito.stubbing.OngoingStubbing; -import com.globalcollect.gateway.sdk.java.CallContext; -import com.globalcollect.gateway.sdk.java.GcApiException; -import com.globalcollect.gateway.sdk.java.GcCommunicationException; -import com.globalcollect.gateway.sdk.java.GcConnection; -import com.globalcollect.gateway.sdk.java.GcDeclinedPaymentException; -import com.globalcollect.gateway.sdk.java.GcFactory; -import com.globalcollect.gateway.sdk.java.GcIdempotenceException; -import com.globalcollect.gateway.sdk.java.GcNotFoundException; -import com.globalcollect.gateway.sdk.java.GcReferenceException; -import com.globalcollect.gateway.sdk.java.GcResponse; -import com.globalcollect.gateway.sdk.java.GcResponseException; -import com.globalcollect.gateway.sdk.java.GcSession; -import com.globalcollect.gateway.sdk.java.GcValidationException; -import com.globalcollect.gateway.sdk.java.RequestHeader; -import com.globalcollect.gateway.sdk.java.ResponseHeader; -import com.globalcollect.gateway.sdk.java.defaultimpl.AuthorizationType; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcAuthenticator; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcMetaDataProvider; -import com.globalcollect.gateway.sdk.java.defaultimpl.DefaultGcSession; -import com.globalcollect.gateway.sdk.java.gc.GcClient; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Address; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.AmountOfMoney; -import com.globalcollect.gateway.sdk.java.gc.fei.definitions.Card; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentRequest; -import com.globalcollect.gateway.sdk.java.gc.payment.CreatePaymentResponse; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.CardPaymentMethodSpecificInput; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Customer; -import com.globalcollect.gateway.sdk.java.gc.payment.definitions.Order; +import com.ingenico.connect.gateway.sdk.java.ApiException; +import com.ingenico.connect.gateway.sdk.java.CallContext; +import com.ingenico.connect.gateway.sdk.java.Client; +import com.ingenico.connect.gateway.sdk.java.CommunicationException; +import com.ingenico.connect.gateway.sdk.java.Connection; +import com.ingenico.connect.gateway.sdk.java.DeclinedPaymentException; +import com.ingenico.connect.gateway.sdk.java.Factory; +import com.ingenico.connect.gateway.sdk.java.IdempotenceException; +import com.ingenico.connect.gateway.sdk.java.MetaDataProvider; +import com.ingenico.connect.gateway.sdk.java.NotFoundException; +import com.ingenico.connect.gateway.sdk.java.ReferenceException; +import com.ingenico.connect.gateway.sdk.java.RequestHeader; +import com.ingenico.connect.gateway.sdk.java.Response; +import com.ingenico.connect.gateway.sdk.java.ResponseException; +import com.ingenico.connect.gateway.sdk.java.ResponseHeader; +import com.ingenico.connect.gateway.sdk.java.Session; +import com.ingenico.connect.gateway.sdk.java.ValidationException; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.AuthorizationType; +import com.ingenico.connect.gateway.sdk.java.defaultimpl.DefaultAuthenticator; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Address; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney; +import com.ingenico.connect.gateway.sdk.java.domain.definitions.Card; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentRequest; +import com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.CardPaymentMethodSpecificInput; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer; +import com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order; @RunWith(MockitoJUnitRunner.class) public class PaymentsClientTest { - private GcSession session; + private Session session; - @Mock private GcConnection connection; + @Mock private Connection connection; @Before public void initializeSession() { URI apiEndpoint = URI.create("http://localhost"); - session = new DefaultGcSession(apiEndpoint, connection, new DefaultGcAuthenticator(AuthorizationType.V1HMAC, "test", "test"), new DefaultGcMetaDataProvider()); + session = new Session(apiEndpoint, connection, new DefaultAuthenticator(AuthorizationType.V1HMAC, "test", "test"), new MetaDataProvider("Ingenico")); } /** @@ -66,9 +65,9 @@ public void initializeSession() { @SuppressWarnings("resource") public void testCreateSuccess() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("pending_approval.json"); - whenPost().thenReturn(new GcResponse(201, responseBody, null)); + whenPost().thenReturn(new Response(201, responseBody, null)); CreatePaymentRequest body = createRequest(); @@ -78,22 +77,22 @@ public void testCreateSuccess() { } /** - * Tests that a failure response with a payment result will throw a {@link GcDeclinedPaymentException}. + * Tests that a failure response with a payment result will throw a {@link DeclinedPaymentException}. */ @Test @SuppressWarnings("resource") public void testCreateRejected() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("rejected.json"); - whenPost().thenReturn(new GcResponse(400, responseBody, null)); + whenPost().thenReturn(new Response(400, responseBody, null)); CreatePaymentRequest body = createRequest(); try { client.merchant("merchantId").payments().create(body); - Assert.fail("Expected GcDeclinedPaymentException"); - } catch (GcDeclinedPaymentException e) { + Assert.fail("Expected DeclinedPaymentException"); + } catch (DeclinedPaymentException e) { Assert.assertTrue(e.toString().contains("payment '000002000020142544360000100001'")); Assert.assertTrue(e.toString().contains("status 'REJECTED'")); Assert.assertTrue(e.toString().contains(responseBody)); @@ -104,79 +103,79 @@ public void testCreateRejected() { } /** - * Tests that a 400 failure response without a payment result will throw a {@link GcValidationException}. + * Tests that a 400 failure response without a payment result will throw a {@link ValidationException}. */ @Test @SuppressWarnings("resource") public void testCreateInvalidRequest() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("invalid_request.json"); - whenPost().thenReturn(new GcResponse(400, responseBody, null)); + whenPost().thenReturn(new Response(400, responseBody, null)); CreatePaymentRequest body = createRequest(); try { client.merchant("merchantId").payments().create(body); - Assert.fail("Expected GcValidationException"); - } catch (GcValidationException e) { + Assert.fail("Expected ValidationException"); + } catch (ValidationException e) { Assert.assertTrue(e.toString().contains(responseBody)); } } /** - * Tests that a 401 failure response without a payment result will throw a {@link GcApiException}. + * Tests that a 401 failure response without a payment result will throw a {@link ApiException}. */ @Test @SuppressWarnings("resource") public void testCreateInvalidAuthorization() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("invalid_authorization.json"); - whenPost().thenReturn(new GcResponse(401, responseBody, null)); + whenPost().thenReturn(new Response(401, responseBody, null)); CreatePaymentRequest body = createRequest(); try { client.merchant("merchantId").payments().create(body); - Assert.fail("Expected GcApiException"); - } catch (GcApiException e) { + Assert.fail("Expected ApiException"); + } catch (ApiException e) { Assert.assertTrue(e.toString().contains(responseBody)); } } /** * Tests that a 409 failure response with a duplicate request code but without an idempotence key will throw a - * {@link GcReferenceException}. + * {@link ReferenceException}. */ @Test @SuppressWarnings("resource") public void testCreateReferenceError() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("duplicate_request.json"); - whenPost().thenReturn(new GcResponse(409, responseBody, null)); + whenPost().thenReturn(new Response(409, responseBody, null)); CreatePaymentRequest body = createRequest(); try { client.merchant("merchantId").payments().create(body); - Assert.fail("Expected GcApiException"); - } catch (GcReferenceException e) { + Assert.fail("Expected ApiException"); + } catch (ReferenceException e) { Assert.assertTrue(e.toString().contains(responseBody)); } } /** - * Tests that a 409 failure response with a duplicate request code and an idempotence key will throw a {@link GcReferenceException}. + * Tests that a 409 failure response with a duplicate request code and an idempotence key will throw an {@link IdempotenceException}. */ @Test @SuppressWarnings("resource") public void testCreateIdempotenceError() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("duplicate_request.json"); - whenPost().thenReturn(new GcResponse(409, responseBody, null)); + whenPost().thenReturn(new Response(409, responseBody, null)); CreatePaymentRequest body = createRequest(); @@ -184,23 +183,23 @@ public void testCreateIdempotenceError() { try { client.merchant("merchantId").payments().create(body, context); - Assert.fail("Expected GcApiException"); - } catch (GcIdempotenceException e) { + Assert.fail("Expected ApiException"); + } catch (IdempotenceException e) { Assert.assertTrue(e.toString().contains(responseBody)); Assert.assertEquals(context.getIdempotenceKey(), e.getIdempotenceKey()); } } /** - * Tests that a 404 response with a non-JSON response will throw a {@link GcNotFoundException}. + * Tests that a 404 response with a non-JSON response will throw a {@link NotFoundException}. */ @Test @SuppressWarnings("resource") public void testCreateNotFound() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("not_found.html"); - whenPost().thenReturn(new GcResponse(404, responseBody, Arrays.asList( + whenPost().thenReturn(new Response(404, responseBody, Arrays.asList( new ResponseHeader("content-type", "text/html") ))); @@ -208,24 +207,24 @@ public void testCreateNotFound() { try { client.merchant("merchantId").payments().create(body); - Assert.fail("Expected GcNotFoundException"); - } catch (GcNotFoundException e) { + Assert.fail("Expected NotFoundException"); + } catch (NotFoundException e) { Assert.assertNotNull(e.getCause()); - Assert.assertEquals(GcResponseException.class, e.getCause().getClass()); + Assert.assertEquals(ResponseException.class, e.getCause().getClass()); Assert.assertTrue(e.getCause().toString().contains(responseBody)); } } /** - * Tests that a 405 response with a non-JSON response will throw a {@link GcCommunicationException}. + * Tests that a 405 response with a non-JSON response will throw a {@link CommunicationException}. */ @Test @SuppressWarnings("resource") public void testCreateMethodNotAllowed() { - GcClient client = GcFactory.createClient(session); + Client client = Factory.createClient(session); String responseBody = getResource("method_not_allowed.html"); - whenPost().thenReturn(new GcResponse(405, responseBody, Arrays.asList( + whenPost().thenReturn(new Response(405, responseBody, Arrays.asList( new ResponseHeader("content-type", "text/html") ))); @@ -233,15 +232,15 @@ public void testCreateMethodNotAllowed() { try { client.merchant("merchantId").payments().create(body); - Assert.fail("Expected GcCommunicationException"); - } catch (GcCommunicationException e) { + Assert.fail("Expected CommunicationException"); + } catch (CommunicationException e) { Assert.assertNotNull(e.getCause()); - Assert.assertEquals(GcResponseException.class, e.getCause().getClass()); + Assert.assertEquals(ResponseException.class, e.getCause().getClass()); Assert.assertTrue(e.getCause().toString().contains(responseBody)); } } - private OngoingStubbing whenPost() { + private OngoingStubbing whenPost() { return Mockito.when(connection.post(Mockito.any(), Mockito.>any(), Mockito.anyString())); } diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/FindProductgroupsParamsTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/FindProductgroupsParamsTest.java new file mode 100644 index 000000000..c0b507645 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/FindProductgroupsParamsTest.java @@ -0,0 +1,55 @@ +package com.ingenico.connect.gateway.sdk.java.merchant.productgroups; + +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class FindProductgroupsParamsTest { + + @Test + public void testToRequestParameters() { + FindProductgroupsParams params = new FindProductgroupsParams(); + List> matchers = new ArrayList>(); + + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(1000L); + matchers.add(new RequestParamMatcher("amount", "1000")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCountryCode("NL"); + matchers.add(new RequestParamMatcher("countryCode", "NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCurrencyCode("EUR"); + matchers.add(new RequestParamMatcher("currencyCode", "EUR")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setIsRecurring(true); + matchers.add(new RequestParamMatcher("isRecurring", "true")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setLocale("nl_NL"); + matchers.add(new RequestParamMatcher("locale", "nl_NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("fields"); + matchers.add(new RequestParamMatcher("hide", "fields")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("accountsOnFile"); + matchers.add(new RequestParamMatcher("hide", "accountsOnFile")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(null); + matchers.remove(0); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetProductgroupParamsTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetProductgroupParamsTest.java new file mode 100644 index 000000000..85dd4393b --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/productgroups/GetProductgroupParamsTest.java @@ -0,0 +1,55 @@ +package com.ingenico.connect.gateway.sdk.java.merchant.productgroups; + +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class GetProductgroupParamsTest { + + @Test + public void testToRequestParameters() { + GetProductgroupParams params = new GetProductgroupParams(); + List> matchers = new ArrayList>(); + + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(1000L); + matchers.add(new RequestParamMatcher("amount", "1000")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCountryCode("NL"); + matchers.add(new RequestParamMatcher("countryCode", "NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCurrencyCode("EUR"); + matchers.add(new RequestParamMatcher("currencyCode", "EUR")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setIsRecurring(true); + matchers.add(new RequestParamMatcher("isRecurring", "true")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setLocale("nl_NL"); + matchers.add(new RequestParamMatcher("locale", "nl_NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("fields"); + matchers.add(new RequestParamMatcher("hide", "fields")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("accountsOnFile"); + matchers.add(new RequestParamMatcher("hide", "accountsOnFile")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(null); + matchers.remove(0); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/DirectoryParamsTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/DirectoryParamsTest.java new file mode 100644 index 000000000..c2cd52dc6 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/DirectoryParamsTest.java @@ -0,0 +1,35 @@ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class DirectoryParamsTest { + + @Test + public void testToRequestParameters() { + DirectoryParams params = new DirectoryParams(); + List> matchers = new ArrayList>(); + + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCountryCode("NL"); + matchers.add(new RequestParamMatcher("countryCode", "NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCurrencyCode("EUR"); + matchers.add(new RequestParamMatcher("currencyCode", "EUR")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCountryCode(null); + matchers.remove(0); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/FindProductsParamsTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/FindProductsParamsTest.java new file mode 100644 index 000000000..b098673f5 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/FindProductsParamsTest.java @@ -0,0 +1,55 @@ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class FindProductsParamsTest { + + @Test + public void testToRequestParameters() { + FindProductsParams params = new FindProductsParams(); + List> matchers = new ArrayList>(); + + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(1000L); + matchers.add(new RequestParamMatcher("amount", "1000")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCountryCode("NL"); + matchers.add(new RequestParamMatcher("countryCode", "NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCurrencyCode("EUR"); + matchers.add(new RequestParamMatcher("currencyCode", "EUR")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setIsRecurring(true); + matchers.add(new RequestParamMatcher("isRecurring", "true")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setLocale("nl_NL"); + matchers.add(new RequestParamMatcher("locale", "nl_NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("fields"); + matchers.add(new RequestParamMatcher("hide", "fields")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("accountsOnFile"); + matchers.add(new RequestParamMatcher("hide", "accountsOnFile")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(null); + matchers.remove(0); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetProductParamsTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetProductParamsTest.java new file mode 100644 index 000000000..cef11ddd9 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/products/GetProductParamsTest.java @@ -0,0 +1,55 @@ +package com.ingenico.connect.gateway.sdk.java.merchant.products; + +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class GetProductParamsTest { + + @Test + public void testToRequestParameters() { + GetProductParams params = new GetProductParams(); + List> matchers = new ArrayList>(); + + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(1000L); + matchers.add(new RequestParamMatcher("amount", "1000")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCountryCode("NL"); + matchers.add(new RequestParamMatcher("countryCode", "NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setCurrencyCode("EUR"); + matchers.add(new RequestParamMatcher("currencyCode", "EUR")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setIsRecurring(true); + matchers.add(new RequestParamMatcher("isRecurring", "true")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setLocale("nl_NL"); + matchers.add(new RequestParamMatcher("locale", "nl_NL")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("fields"); + matchers.add(new RequestParamMatcher("hide", "fields")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.addHide("accountsOnFile"); + matchers.add(new RequestParamMatcher("hide", "accountsOnFile")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(null); + matchers.remove(0); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountParamsTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountParamsTest.java new file mode 100644 index 000000000..4dd5e955f --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/services/ConvertAmountParamsTest.java @@ -0,0 +1,39 @@ +package com.ingenico.connect.gateway.sdk.java.merchant.services; + +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class ConvertAmountParamsTest { + + @Test + public void testToRequestParameters() { + ConvertAmountParams params = new ConvertAmountParams(); + List> matchers = new ArrayList>(); + + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(1000L); + matchers.add(new RequestParamMatcher("amount", "1000")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setSource("EUR"); + matchers.add(new RequestParamMatcher("source", "EUR")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setTarget("USD"); + matchers.add(new RequestParamMatcher("target", "USD")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setAmount(null); + matchers.remove(0); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenParamsTest.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenParamsTest.java new file mode 100644 index 000000000..817235721 --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/merchant/tokens/DeleteTokenParamsTest.java @@ -0,0 +1,31 @@ +package com.ingenico.connect.gateway.sdk.java.merchant.tokens; + +import java.util.ArrayList; +import java.util.List; + +import org.hamcrest.Matcher; +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Test; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; +import com.ingenico.connect.gateway.sdk.java.util.RequestParamMatcher; + +public class DeleteTokenParamsTest { + + @Test + public void testToRequestParameters() { + DeleteTokenParams params = new DeleteTokenParams(); + List> matchers = new ArrayList>(); + + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setMandateCancelDate("20160610"); + matchers.add(new RequestParamMatcher("mandateCancelDate", "20160610")); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + + params.setMandateCancelDate(null); + matchers.remove(0); + Assert.assertThat(params.toRequestParameters(), Matchers.containsInAnyOrder(matchers)); + } +} diff --git a/src/test/java/com/globalcollect/gateway/sdk/java/util/ReflectionUtil.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/ReflectionUtil.java similarity index 93% rename from src/test/java/com/globalcollect/gateway/sdk/java/util/ReflectionUtil.java rename to src/test/java/com/ingenico/connect/gateway/sdk/java/util/ReflectionUtil.java index 1badfca27..88a034adc 100644 --- a/src/test/java/com/globalcollect/gateway/sdk/java/util/ReflectionUtil.java +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/ReflectionUtil.java @@ -1,4 +1,4 @@ -package com.globalcollect.gateway.sdk.java.util; +package com.ingenico.connect.gateway.sdk.java.util; import java.lang.reflect.Field; diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/util/RequestHeaderMatcher.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/RequestHeaderMatcher.java new file mode 100644 index 000000000..def63e51e --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/RequestHeaderMatcher.java @@ -0,0 +1,36 @@ +package com.ingenico.connect.gateway.sdk.java.util; + +import org.hamcrest.Description; +import org.hamcrest.TypeSafeDiagnosingMatcher; + +import com.ingenico.connect.gateway.sdk.java.RequestHeader; + +public class RequestHeaderMatcher extends TypeSafeDiagnosingMatcher { + + private final String name; + private final String value; + + public RequestHeaderMatcher(RequestHeader requestHeader) { + this(requestHeader.getName(), requestHeader.getValue()); + } + + public RequestHeaderMatcher(String name, String value) { + this.name = name; + this.value = value; + } + + @Override + protected boolean matchesSafely(RequestHeader item, Description mismatchDescription) { + return (name == null ? item.getName() == null : name.equals(item.getName())) + && (value == null ? item.getValue() == null : value.equals(item.getValue())); + } + + @Override + public void describeTo(Description description) { + description + .appendText("name is ") + .appendValue(name) + .appendText(", value is ") + .appendValue(value); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/util/RequestParamMatcher.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/RequestParamMatcher.java new file mode 100644 index 000000000..dd1d47edd --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/RequestParamMatcher.java @@ -0,0 +1,32 @@ +package com.ingenico.connect.gateway.sdk.java.util; + +import org.hamcrest.Description; +import org.hamcrest.TypeSafeDiagnosingMatcher; + +import com.ingenico.connect.gateway.sdk.java.RequestParam; + +public class RequestParamMatcher extends TypeSafeDiagnosingMatcher { + + private final String name; + private final String value; + + public RequestParamMatcher(String name, String value) { + this.name = name; + this.value = value; + } + + @Override + protected boolean matchesSafely(RequestParam item, Description mismatchDescription) { + return (name == null ? item.getName() == null : name.equals(item.getName())) + && (value == null ? item.getValue() == null : value.equals(item.getValue())); + } + + @Override + public void describeTo(Description description) { + description + .appendText("name is ") + .appendValue(name) + .appendText(", value is ") + .appendValue(value); + } +} diff --git a/src/test/java/com/ingenico/connect/gateway/sdk/java/util/ShoppingCartExtensionMatcher.java b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/ShoppingCartExtensionMatcher.java new file mode 100644 index 000000000..130d6fa4b --- /dev/null +++ b/src/test/java/com/ingenico/connect/gateway/sdk/java/util/ShoppingCartExtensionMatcher.java @@ -0,0 +1,41 @@ +package com.ingenico.connect.gateway.sdk.java.util; + +import org.hamcrest.Description; +import org.hamcrest.TypeSafeDiagnosingMatcher; + +import com.ingenico.connect.gateway.sdk.java.domain.metadata.ShoppingCartExtension; + +public class ShoppingCartExtensionMatcher extends TypeSafeDiagnosingMatcher { + + private final String creator; + private final String name; + private final String version; + + public ShoppingCartExtensionMatcher(ShoppingCartExtension shoppingCartExtension) { + this(shoppingCartExtension.getCreator(), shoppingCartExtension.getName(), shoppingCartExtension.getVersion()); + } + + public ShoppingCartExtensionMatcher(String creator, String name, String version) { + this.creator = creator; + this.name = name; + this.version = version; + } + + @Override + protected boolean matchesSafely(ShoppingCartExtension item, Description mismatchDescription) { + return (creator == null ? item.getCreator() == null : creator.equals(item.getCreator())) + && (name == null ? item.getName() == null : name.equals(item.getName())) + && (version == null ? item.getVersion() == null : version.equals(item.getVersion())); + } + + @Override + public void describeTo(Description description) { + description + .appendText("creator is") + .appendValue(creator) + .appendText(", name is ") + .appendValue(name) + .appendText(", version is ") + .appendValue(version); + } +} diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/configuration.properties b/src/test/resources/com/globalcollect/gateway/sdk/java/configuration.properties deleted file mode 100644 index 5dc36f6dc..000000000 --- a/src/test/resources/com/globalcollect/gateway/sdk/java/configuration.properties +++ /dev/null @@ -1,6 +0,0 @@ -# GlobalCollect platform connection settings -gcs.api.endpoint.host=api-sandbox.globalcollect.com -gcs.api.authorizationType=V1HMAC -gcs.api.connectTimeout=-1 -gcs.api.socketTimeout=-1 -gcs.api.maxConnections=100 diff --git a/src/test/resources/com/ingenico/connect/gateway/sdk/java/configuration.properties b/src/test/resources/com/ingenico/connect/gateway/sdk/java/configuration.properties new file mode 100644 index 000000000..914c469d8 --- /dev/null +++ b/src/test/resources/com/ingenico/connect/gateway/sdk/java/configuration.properties @@ -0,0 +1,7 @@ +# GlobalCollect platform connection settings +connect.api.endpoint.host=api-sandbox.globalcollect.com +connect.api.authorizationType=V1HMAC +connect.api.connectTimeout=-1 +connect.api.socketTimeout=-1 +connect.api.maxConnections=100 +connect.api.integrator=Ingenico diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/convertAmount.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/convertAmount.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/convertAmount.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/convertAmount.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/convertAmount.request b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/convertAmount.request similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/convertAmount.request rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/convertAmount.request diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/convertAmount.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/convertAmount.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/convertAmount.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/convertAmount.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.request b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.request similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.request rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.request diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.invalidCardNumber.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.request b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.request similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.request rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.request diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.failure.rejected.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.request b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.request similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.request rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.request diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/createPayment.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/createPayment.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/deleteToken.request b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/deleteToken.request similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/deleteToken.request rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/deleteToken.request diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/deleteToken.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/deleteToken.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/deleteToken.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/deleteToken.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/generic.error b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/generic.error similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/generic.error rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/generic.error diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/idempotence_duplicate_failure.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/idempotence_duplicate_failure.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/idempotence_duplicate_failure.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/idempotence_duplicate_failure.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/idempotence_rejected.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/idempotence_rejected.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/idempotence_rejected.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/idempotence_rejected.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/idempotence_success.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/idempotence_success.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/idempotence_success.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/idempotence_success.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/notFound.html b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/notFound.html similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/notFound.html rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/notFound.html diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/notFound.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/notFound.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/notFound.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/notFound.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/testConnection.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/testConnection.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/testConnection.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/testConnection.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/testConnection.request b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/testConnection.request similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/testConnection.request rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/testConnection.request diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/testConnection.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/testConnection.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/testConnection.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/testConnection.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/unknownServerError.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/unknownServerError.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/unknownServerError.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/unknownServerError.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/unknownServerError.response b/src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/unknownServerError.response similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/defaultimpl/unknownServerError.response rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/defaultimpl/unknownServerError.response diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyNoObfuscation.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyNoObfuscation.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyNoObfuscation.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyNoObfuscation.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithBinObfuscated.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithBinObfuscated.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithBinObfuscated.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithBinObfuscated.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithBinOriginal.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithBinOriginal.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithBinOriginal.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithBinOriginal.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithCardObfuscated.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithCardObfuscated.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithCardObfuscated.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithCardObfuscated.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithCardOriginal.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithCardOriginal.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithCardOriginal.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithCardOriginal.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithIbanObfuscated.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithIbanObfuscated.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithIbanObfuscated.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithIbanObfuscated.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithIbanOriginal.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithIbanOriginal.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/logging/bodyWithIbanOriginal.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/logging/bodyWithIbanOriginal.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/duplicate_request.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/duplicate_request.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/duplicate_request.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/duplicate_request.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/invalid_authorization.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/invalid_authorization.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/invalid_authorization.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/invalid_authorization.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/invalid_request.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/invalid_request.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/invalid_request.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/invalid_request.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/method_not_allowed.html b/src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/method_not_allowed.html similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/method_not_allowed.html rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/method_not_allowed.html diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/not_found.html b/src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/not_found.html similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/not_found.html rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/not_found.html diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/pending_approval.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/pending_approval.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/pending_approval.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/pending_approval.json diff --git a/src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/rejected.json b/src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/rejected.json similarity index 100% rename from src/test/resources/com/globalcollect/gateway/sdk/java/gc/merchant/payments/rejected.json rename to src/test/resources/com/ingenico/connect/gateway/sdk/java/merchant/payments/rejected.json