From a5783ae8a3d829b729659ecab0be8e91b54fb2bd Mon Sep 17 00:00:00 2001 From: Bruno Goyanna Date: Thu, 13 Jul 2017 01:31:43 -0300 Subject: [PATCH 01/24] =?UTF-8?q?Incluindo=20campos=20faltantes=20de=20bol?= =?UTF-8?q?eto=20seguindo=20documenta=C3=A7=C3=A3o=20WEB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cieloecommerce/sdk/ecommerce/Payment.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index ea4a0ca..53f3fcf 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -69,6 +69,17 @@ public class Payment { private String digitableLine; @SerializedName("Address") private String address; + @SerializedName("BoletoNumber") + private String boletoNumber; + @SerializedName("Assignor") + private String assignor; + @SerializedName("Demonstrative") + private String demonstrative; + @SerializedName("Identification") + private String identification; + @SerializedName("Instructions") + private String instructions; + public Payment(Integer amount, Integer installments) { setAmount(amount); @@ -333,6 +344,42 @@ public Payment setCapture(boolean capture) { return this; } + public String getBoletoNumber() { + return boletoNumber; + } + + public Payment setBoletoNumber(String boletoNumber) { + this.boletoNumber = boletoNumber; + return this; + } + + public String getDemonstrative() { + return demonstrative; + } + + public Payment setDemonstrative(String demonstrative) { + this.demonstrative = demonstrative; + return this; + } + + public String getIdentification() { + return identification; + } + + public Payment setIdentification(String identification) { + this.identification = identification; + return this; + } + + public String getInstructions() { + return instructions; + } + + public Payment setInstructions(String instructions) { + this.instructions = instructions; + return this; + } + public String getDigitableLine() { return digitableLine; } From 429eb2f99642ce28484980416cf57f73b6af49c7 Mon Sep 17 00:00:00 2001 From: Bruno Goyanna Date: Thu, 13 Jul 2017 01:48:37 -0300 Subject: [PATCH 02/24] =?UTF-8?q?Incluindo=20Cart=C3=A3o=20de=20D=C3=A9bit?= =?UTF-8?q?o.=20Erro=20na=20documenta=C3=A7=C3=A3o=20do=20site=20onde=20es?= =?UTF-8?q?pecifica=20CreditCard=20e=20exemplo=20com=20DebitCard.=20E=20ao?= =?UTF-8?q?=20setar=20o=20cartao=20muda=20o=20tipo=20de=20pagamento=20para?= =?UTF-8?q?=20cart=C3=A3o=20de=20Debito.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk/ecommerce/DebitCard.java | 71 +++++++++++++++++++ .../cieloecommerce/sdk/ecommerce/Payment.java | 19 +++++ 2 files changed, 90 insertions(+) create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/DebitCard.java diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/DebitCard.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/DebitCard.java new file mode 100644 index 0000000..805fde7 --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/DebitCard.java @@ -0,0 +1,71 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +public class DebitCard { + + @SerializedName("CardNumber") + private String cardNumber; + + @SerializedName("Holder") + private String holder; + + @SerializedName("ExpirationDate") + private String expirationDate; + + @SerializedName("SecurityCode") + private String securityCode; + + @SerializedName("Brand") + private String brand; + + public DebitCard(String securityCode, String brand) { + setSecurityCode(securityCode); + setBrand(brand); + } + + public String getBrand() { + return brand; + } + + public DebitCard setBrand(String brand) { + this.brand = brand; + return this; + } + + public String getCardNumber() { + return cardNumber; + } + + public DebitCard setCardNumber(String cardNumber) { + this.cardNumber = cardNumber; + return this; + } + + public String getExpirationDate() { + return expirationDate; + } + + public DebitCard setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + public String getHolder() { + return holder; + } + + public DebitCard setHolder(String holder) { + this.holder = holder; + return this; + } + + public String getSecurityCode() { + return securityCode; + } + + public DebitCard setSecurityCode(String securityCode) { + this.securityCode = securityCode; + return this; + } +} diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index 53f3fcf..f736b08 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -19,6 +19,8 @@ public class Payment { private RecurrentPayment recurrentPayment; @SerializedName("CreditCard") private CreditCard creditCard; + @SerializedName("DebitCard") + private DebitCard debitCard; @SerializedName("Tid") private String tid; @SerializedName("ProofOfSale") @@ -96,6 +98,14 @@ public CreditCard creditCard(String securityCode, String brand) { return getCreditCard(); } + + public DebitCard debitCard(String securityCode, String brand) { + setType(Type.DebitCard); + setDebitCard(new DebitCard(securityCode, brand)); + + return getDebitCard(); + } + public RecurrentPayment recurrentPayment(boolean authorizeNow) { setRecurrentPayment(new RecurrentPayment(authorizeNow)); @@ -165,6 +175,15 @@ public Payment setCreditCard(CreditCard creditCard) { return this; } + public Payment setDebitCard(DebitCard debitCard) { + this.debitCard = debitCard; + return this; + } + + public DebitCard getDebitCard() { + return debitCard; + } + public Currency getCurrency() { return currency; } From f9acc5e478842458cacc1cfe695ea1c240b53124 Mon Sep 17 00:00:00 2001 From: Bruno Goyanna Date: Thu, 13 Jul 2017 02:37:51 -0300 Subject: [PATCH 03/24] =?UTF-8?q?Incluindo=20o=20AuthenticationUrl=20para?= =?UTF-8?q?=20pagamento=20com=20D=C3=A9bito=20para=20redirecionar=20o=20cl?= =?UTF-8?q?iente.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cieloecommerce/sdk/ecommerce/Payment.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index f736b08..6c244af 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -81,6 +81,8 @@ public class Payment { private String identification; @SerializedName("Instructions") private String instructions; + @SerializedName("AuthenticationUrl") + private String authenticationUrl; public Payment(Integer amount, Integer installments) { @@ -130,6 +132,10 @@ public String getAuthorizationCode() { return authorizationCode; } + public String getAuthenticationUrl() { + return authenticationUrl; + } + public Payment setAuthorizationCode(String authorizationCode) { this.authorizationCode = authorizationCode; return this; From 472ea9e14bc58a5bda8a12bb0f586d395f1432c7 Mon Sep 17 00:00:00 2001 From: Bruno Goyanna Date: Fri, 14 Jul 2017 01:42:53 -0300 Subject: [PATCH 04/24] Corrigindo o nome do campo ReceivedDate no JSON que estava ReceiveDate. --- .../src/main/java/cieloecommerce/sdk/ecommerce/Payment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index 6c244af..4c61997 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -39,7 +39,7 @@ public class Payment { private Type type; @SerializedName("Amount") private Integer amount; - @SerializedName("ReceiveDate") + @SerializedName("ReceivedDate") private String receivedDate; @SerializedName("CapturedAmount") private Integer capturedAmount; From 364b2d8d2606a9b42ad3f4ae7df8324ca9a31cfe Mon Sep 17 00:00:00 2001 From: Bruno Goyanna Date: Fri, 14 Jul 2017 01:43:59 -0300 Subject: [PATCH 05/24] Incluindo chamada de mapeamento de MerchantOrderId para PaymentId --- .../sdk/ecommerce/CieloEcommerce.java | 25 ++++++++++++++++ .../ecommerce/QueryMerchantOrderResponse.java | 25 ++++++++++++++++ .../sdk/ecommerce/SaleResponse.java | 26 ++++++++++++++-- .../request/QueryMerchantOrderRequest.java | 30 +++++++++++++++++++ .../request/QueryRecurrentSaleRequest.java | 10 +++---- 5 files changed, 109 insertions(+), 7 deletions(-) create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/QueryMerchantOrderResponse.java create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java index 79b5ae7..b5818c0 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java @@ -112,6 +112,31 @@ public Sale querySale(String paymentId) throws IOException, CieloRequestExceptio return sale; } + + /** + * Query a Sale on Cielo by paymentId + * + * @param paymentId + * The paymentId to be queried + * @return The Sale with authorization, tid, etc. returned by Cielo. + * @throws IOException + * @throws CieloRequestException + * if anything gets wrong. + * @see Error + * Codes + */ + public QueryMerchantOrderResponse queryMerchantOrder(String merchantOrderId) throws IOException, CieloRequestException { + QueryMerchantOrderRequest querySaleRequest = new QueryMerchantOrderRequest(merchant, environment); + + querySaleRequest.setHttpClient(httpClient); + + QueryMerchantOrderResponse merchantOrder = querySaleRequest.execute(merchantOrderId); + + return merchantOrder; + } + + /** * Query a RecurrentSale on Cielo by recurrentPaymentId diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/QueryMerchantOrderResponse.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/QueryMerchantOrderResponse.java new file mode 100644 index 0000000..14f85be --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/QueryMerchantOrderResponse.java @@ -0,0 +1,25 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +/** + * Created by gustavo.kruger + */ +public class QueryMerchantOrderResponse { + + @SerializedName("Payments") + private Payment[] payments; + + public QueryMerchantOrderResponse() { + } + + public Payment[] getPayments() { + return payments; + } + + public void setPayment(Payment[] payments) { + this.payments = payments; + } + + +} \ No newline at end of file diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SaleResponse.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SaleResponse.java index 8973e76..9a20fe7 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SaleResponse.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SaleResponse.java @@ -7,6 +7,9 @@ */ public class SaleResponse { + @SerializedName("MerchantOrderId") + private String merchantOrderId; + @SerializedName("Status") private String status; @@ -28,6 +31,9 @@ public class SaleResponse { @SerializedName("ReturnMessage") private String returnMessage; + @SerializedName("AuthenticationUrl") + private String authenticationUrl; + @SerializedName("Links") private Links[] links; @@ -49,7 +55,15 @@ public String getStatus() { return status; } - public void setStatus(String status) { + public String getMerchantOrderId() { + return merchantOrderId; + } + + public void setMerchantOrderId(String merchantOrderId) { + this.merchantOrderId = merchantOrderId; + } + + public void setStatus(String status) { this.status = status; } @@ -101,7 +115,15 @@ public void setReturnMessage(String returnMessage) { this.returnMessage = returnMessage; } - public Links[] getLinks() { + public String getAuthenticationUrl() { + return authenticationUrl; + } + + public void setAuthenticationUrl(String authenticationUrl) { + this.authenticationUrl = authenticationUrl; + } + + public Links[] getLinks() { return links; } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java new file mode 100644 index 0000000..3b501cc --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java @@ -0,0 +1,30 @@ +package cieloecommerce.sdk.ecommerce.request; + +import java.io.IOException; + +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; + +import cieloecommerce.sdk.Environment; +import cieloecommerce.sdk.Merchant; +import cieloecommerce.sdk.ecommerce.QueryMerchantOrderResponse; + +/** + * Query a Sale by it's Merchant Order Id to retrieve Cielo's paymentId + */ +public class QueryMerchantOrderRequest extends AbstractSaleRequest { + public QueryMerchantOrderRequest(Merchant merchant, Environment environment) { + super(merchant, environment); + } + + @Override + public QueryMerchantOrderResponse execute(String merchnatOrderId) throws IOException, CieloRequestException { + String url = environment.getApiQueryURL() + "1/sales?merchantOrderId=" + merchnatOrderId; + + HttpGet request = new HttpGet(url); + HttpResponse response = sendRequest(request); + + return readResponse(response, QueryMerchantOrderResponse.class); + } + +} diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java index e28d1de..e3a4c38 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java @@ -1,13 +1,13 @@ package cieloecommerce.sdk.ecommerce.request; -import cieloecommerce.sdk.Environment; -import cieloecommerce.sdk.Merchant; -import cieloecommerce.sdk.ecommerce.RecurrentSale; -import cieloecommerce.sdk.ecommerce.Sale; +import java.io.IOException; + import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; -import java.io.IOException; +import cieloecommerce.sdk.Environment; +import cieloecommerce.sdk.Merchant; +import cieloecommerce.sdk.ecommerce.RecurrentSale; public class QueryRecurrentSaleRequest extends AbstractSaleRequest { public QueryRecurrentSaleRequest(Merchant merchant, Environment environment) { From a7f32adbd4614dca1139962af68b77b541133e71 Mon Sep 17 00:00:00 2001 From: Gabriel Oliveira Date: Tue, 9 Apr 2019 16:15:33 -0300 Subject: [PATCH 06/24] Adiciona VoidedAmound e VoidedDate ao modelo Payment Os campos estao presentes na resposta da API mas nao estavam mapeados na sdk --- .../cieloecommerce/sdk/ecommerce/Payment.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index 4c61997..c3e9212 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -83,7 +83,10 @@ public class Payment { private String instructions; @SerializedName("AuthenticationUrl") private String authenticationUrl; - + @SerializedName("VoidedAmount") + private Integer voidedAmount; + @SerializedName("VoidedDate") + private String voidedDate; public Payment(Integer amount, Integer installments) { setAmount(amount); @@ -100,14 +103,14 @@ public CreditCard creditCard(String securityCode, String brand) { return getCreditCard(); } - + public DebitCard debitCard(String securityCode, String brand) { setType(Type.DebitCard); setDebitCard(new DebitCard(securityCode, brand)); return getDebitCard(); } - + public RecurrentPayment recurrentPayment(boolean authorizeNow) { setRecurrentPayment(new RecurrentPayment(authorizeNow)); @@ -185,11 +188,11 @@ public Payment setDebitCard(DebitCard debitCard) { this.debitCard = debitCard; return this; } - + public DebitCard getDebitCard() { return debitCard; } - + public Currency getCurrency() { return currency; } @@ -429,6 +432,14 @@ public String getUrl() { return url; } + public Integer getVoidedAmount() { + return voidedAmount; + } + + public String getVoidedDate() { + return voidedDate; + } + public enum Provider { Bradesco, BancoDoBrasil, Simulado } From 0db72e2c336b08073dec2c2b6bc00a10f321217c Mon Sep 17 00:00:00 2001 From: "daniel.alves" Date: Tue, 2 Jul 2019 12:57:55 -0300 Subject: [PATCH 07/24] Adiciona ExternalAuthentication na sdk. Task https://evoluservices.atlassian.net/browse/GAT-73 Signed-off-by: daniel.alves --- .../sdk/ecommerce/ExternalAuthentication.java | 50 +++++++++++++++++++ .../cieloecommerce/sdk/ecommerce/Payment.java | 10 ++++ 2 files changed, 60 insertions(+) create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java new file mode 100644 index 0000000..2b43a37 --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java @@ -0,0 +1,50 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +public class ExternalAuthentication { + + @SerializedName("Cavv") + private String cavv; + + @SerializedName("Xid") + private String xid; + + @SerializedName("Eci") + private String eci; + + public ExternalAuthentication(String cavv, + String xid, + String eci) { + this.cavv = cavv; + this.xid = xid; + this.eci = eci; + } + + public String getCavv() { + return cavv; + } + + public ExternalAuthentication setCavv(String cavv) { + this.cavv = cavv; + return this; + } + + public String getXid() { + return xid; + } + + public ExternalAuthentication setXid(String xid) { + this.xid = xid; + return this; + } + + public String getEci() { + return eci; + } + + public ExternalAuthentication setEci(String eci) { + this.eci = eci; + return this; + } +} diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index c3e9212..9d1a31e 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -87,6 +87,8 @@ public class Payment { private Integer voidedAmount; @SerializedName("VoidedDate") private String voidedDate; + @SerializedName("ExternalAuthentication") + private ExternalAuthentication externalAuthentication; public Payment(Integer amount, Integer installments) { setAmount(amount); @@ -451,4 +453,12 @@ public enum Type { public enum Currency { BRL, USD, MXN, COP, CLP, ARS, PEN, EUR, PYN, UYU, VEB, VEF, GBP } + + public ExternalAuthentication getExternalAuthentication() { + return externalAuthentication; + } + + public void setExternalAuthentication(ExternalAuthentication externalAuthentication) { + this.externalAuthentication = externalAuthentication; + } } \ No newline at end of file From 4090cb3e0ab4c83f3d09b15b95c5c7f9e8235e89 Mon Sep 17 00:00:00 2001 From: "daniel.alves" Date: Tue, 2 Jul 2019 15:18:38 -0300 Subject: [PATCH 08/24] Adiciona referenceId e version para receber a ExternalAuthentication. Signed-off-by: daniel.alves --- api30.sdk/pom.xml | 10 ++++++++ .../sdk/ecommerce/ExternalAuthentication.java | 24 +++++++++++++++++++ .../cieloecommerce/sdk/ecommerce/Payment.java | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index 91c3e3b..6ccd65e 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -32,4 +32,14 @@ 4.5.2 + + + nexus-snapshots + https://repos.evoluservices.com/repository/maven-snapshots/ + + + nexus-releases + https://repos.evoluservices.com/repository/maven-releases/ + + diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java index 2b43a37..4000c24 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java @@ -13,6 +13,12 @@ public class ExternalAuthentication { @SerializedName("Eci") private String eci; + @SerializedName("Version") + private String version; + + @SerializedName("ReferenceID") + private String referenceId; + public ExternalAuthentication(String cavv, String xid, String eci) { @@ -47,4 +53,22 @@ public ExternalAuthentication setEci(String eci) { this.eci = eci; return this; } + + public String getVersion() { + return version; + } + + public ExternalAuthentication setVersion(String version) { + this.version = version; + return this; + } + + public String getReferenceId() { + return referenceId; + } + + public ExternalAuthentication setReferenceId(String referenceId) { + this.referenceId = referenceId; + return this; + } } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index 9d1a31e..2768010 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -458,7 +458,8 @@ public ExternalAuthentication getExternalAuthentication() { return externalAuthentication; } - public void setExternalAuthentication(ExternalAuthentication externalAuthentication) { + public Payment setExternalAuthentication(ExternalAuthentication externalAuthentication) { this.externalAuthentication = externalAuthentication; + return this; } } \ No newline at end of file From 81297e993e73d814e93c18bc2dae18b19a67639b Mon Sep 17 00:00:00 2001 From: "daniel.alves" Date: Fri, 12 Jul 2019 12:39:04 -0300 Subject: [PATCH 09/24] Altera construtor para receber mais parametros e adiciona construtor vazio. Signed-off-by: daniel.alves --- .../sdk/ecommerce/ExternalAuthentication.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java index 4000c24..5ab3ff5 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/ExternalAuthentication.java @@ -21,10 +21,17 @@ public class ExternalAuthentication { public ExternalAuthentication(String cavv, String xid, - String eci) { + String eci, + String version, + String referenceId) { this.cavv = cavv; this.xid = xid; this.eci = eci; + this.version = version; + this.referenceId = referenceId; + } + + public ExternalAuthentication() { } public String getCavv() { From a768254d20a70e6e400dcffaabbe5e177014d8bf Mon Sep 17 00:00:00 2001 From: Marcelo Teixeira Date: Mon, 29 Jul 2019 11:21:07 -0300 Subject: [PATCH 10/24] =?UTF-8?q?Adiciona=20op=C3=A7=C3=A3o=20de=20pagamen?= =?UTF-8?q?to=20por=20QRCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcelo Teixeira --- .gitignore | 2 ++ .../java/cieloecommerce/sdk/ecommerce/Payment.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4513824..9b4ff1a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ local.properties .settings/ .project .classpath +.idea/ +*.iml # Maven diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index 2768010..df318d2 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -87,6 +87,8 @@ public class Payment { private Integer voidedAmount; @SerializedName("VoidedDate") private String voidedDate; + @SerializedName("QrCodeBase64Image") + private String qrCodeBase64Image; @SerializedName("ExternalAuthentication") private ExternalAuthentication externalAuthentication; @@ -442,12 +444,20 @@ public String getVoidedDate() { return voidedDate; } + public String getQrCodeBase64Image() { + return qrCodeBase64Image; + } + + public void setQrCodeBase64Image(String qrCodeBase64Image) { + this.qrCodeBase64Image = qrCodeBase64Image; + } + public enum Provider { Bradesco, BancoDoBrasil, Simulado } public enum Type { - CreditCard, DebitCard, ElectronicTransfer, Boleto + CreditCard, DebitCard, ElectronicTransfer, Boleto, QRCode } public enum Currency { From 3fd6ff8762322ff42d4185071e570c4277675b7b Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Thu, 5 Mar 2020 11:41:20 -0300 Subject: [PATCH 11/24] Adiciona novos campos para o envio de dados de Facilitadores de Pagamento Signed-off-by: Plinio Umezaki --- .../cieloecommerce/sdk/ecommerce/Payment.java | 9 ++ .../sdk/ecommerce/PaymentFacilitator.java | 27 ++++++ .../sdk/ecommerce/SubEstablishment.java | 84 +++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index df318d2..2f3f357 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -29,6 +29,8 @@ public class Payment { private String authorizationCode; @SerializedName("SoftDescriptor") private String softDescriptor = ""; + @SerializedName("PaymentFacilitator") + private PaymentFacilitator paymentFacilitator; @SerializedName("ReturnUrl") private String returnUrl; @SerializedName("Provider") @@ -323,6 +325,13 @@ public Payment setSoftDescriptor(String softDescriptor) { return this; } + public PaymentFacilitator getPaymentFacilitator() { return paymentFacilitator; } + + public Payment setPaymentFacilitator(PaymentFacilitator paymentFacilitator) { + this.paymentFacilitator = paymentFacilitator; + return this; + } + public Integer getStatus() { return status; } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java new file mode 100644 index 0000000..5de2202 --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java @@ -0,0 +1,27 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +public class PaymentFacilitator { + + @SerializedName("EstablishmentCode") + private String establishmentCode; + @SerializedName("SubEstablishment") + private SubEstablishment subEstablishment; + + public String getEstablishmentCode() { + return this.establishmentCode; + } + + public PaymentFacilitator setEstablishmentCode(String establishmentCode) { + this.establishmentCode = establishmentCode; + return this; + } + + public SubEstablishment getSubEstablishment() { return this.subEstablishment; } + + public PaymentFacilitator setSubEstablishment(SubEstablishment subEstablishment) { + this.subEstablishment = subEstablishment; + return this; + } +} diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java new file mode 100644 index 0000000..f952a08 --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java @@ -0,0 +1,84 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +public class SubEstablishment { + + @SerializedName("EstablishmentCode") + private String establishmentCode; + @SerializedName("Mcc") + private String mcc; + @SerializedName("Address") + private String address; + @SerializedName("City") + private String city; + @SerializedName("State") + private String state; + @SerializedName("PostalCode") + private String postalCode; + @SerializedName("PhoneNumber") + private String phoneNumber; + + public String getEstablishmentCode() { + return this.establishmentCode; + } + + public SubEstablishment setEstablishmentCode(String establishmentCode) { + this.establishmentCode = establishmentCode; + return this; + } + + public String getMcc() { + return this.mcc; + } + + public SubEstablishment setMcc(String mcc) { + this.mcc = mcc; + return this; + } + + public String getAddress() { + return this.address; + } + + public SubEstablishment setAddress(String address) { + this.address = address; + return this; + } + + public String getCity() { + return this.city; + } + + public SubEstablishment setCity(String city) { + this.city = city; + return this; + } + + public String getState() { + return this.state; + } + + public SubEstablishment setState(String state) { + this.state = state; + return this; + } + + public String getPostalCode() { + return this.postalCode; + } + + public SubEstablishment setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public SubEstablishment setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } +} From a6544fc26f706c27fc1bb2bccdf139e1ee490d8e Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Thu, 5 Mar 2020 11:41:20 -0300 Subject: [PATCH 12/24] Adiciona novos campos para os dados de Facilitadores de Pagamento Signed-off-by: Plinio Umezaki --- .../cieloecommerce/sdk/ecommerce/Payment.java | 9 ++ .../sdk/ecommerce/PaymentFacilitator.java | 27 ++++++ .../sdk/ecommerce/SubEstablishment.java | 84 +++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index df318d2..2f3f357 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -29,6 +29,8 @@ public class Payment { private String authorizationCode; @SerializedName("SoftDescriptor") private String softDescriptor = ""; + @SerializedName("PaymentFacilitator") + private PaymentFacilitator paymentFacilitator; @SerializedName("ReturnUrl") private String returnUrl; @SerializedName("Provider") @@ -323,6 +325,13 @@ public Payment setSoftDescriptor(String softDescriptor) { return this; } + public PaymentFacilitator getPaymentFacilitator() { return paymentFacilitator; } + + public Payment setPaymentFacilitator(PaymentFacilitator paymentFacilitator) { + this.paymentFacilitator = paymentFacilitator; + return this; + } + public Integer getStatus() { return status; } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java new file mode 100644 index 0000000..5de2202 --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/PaymentFacilitator.java @@ -0,0 +1,27 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +public class PaymentFacilitator { + + @SerializedName("EstablishmentCode") + private String establishmentCode; + @SerializedName("SubEstablishment") + private SubEstablishment subEstablishment; + + public String getEstablishmentCode() { + return this.establishmentCode; + } + + public PaymentFacilitator setEstablishmentCode(String establishmentCode) { + this.establishmentCode = establishmentCode; + return this; + } + + public SubEstablishment getSubEstablishment() { return this.subEstablishment; } + + public PaymentFacilitator setSubEstablishment(SubEstablishment subEstablishment) { + this.subEstablishment = subEstablishment; + return this; + } +} diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java new file mode 100644 index 0000000..f952a08 --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java @@ -0,0 +1,84 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +public class SubEstablishment { + + @SerializedName("EstablishmentCode") + private String establishmentCode; + @SerializedName("Mcc") + private String mcc; + @SerializedName("Address") + private String address; + @SerializedName("City") + private String city; + @SerializedName("State") + private String state; + @SerializedName("PostalCode") + private String postalCode; + @SerializedName("PhoneNumber") + private String phoneNumber; + + public String getEstablishmentCode() { + return this.establishmentCode; + } + + public SubEstablishment setEstablishmentCode(String establishmentCode) { + this.establishmentCode = establishmentCode; + return this; + } + + public String getMcc() { + return this.mcc; + } + + public SubEstablishment setMcc(String mcc) { + this.mcc = mcc; + return this; + } + + public String getAddress() { + return this.address; + } + + public SubEstablishment setAddress(String address) { + this.address = address; + return this; + } + + public String getCity() { + return this.city; + } + + public SubEstablishment setCity(String city) { + this.city = city; + return this; + } + + public String getState() { + return this.state; + } + + public SubEstablishment setState(String state) { + this.state = state; + return this; + } + + public String getPostalCode() { + return this.postalCode; + } + + public SubEstablishment setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + public String getPhoneNumber() { + return this.phoneNumber; + } + + public SubEstablishment setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } +} From 01e9e0a14635407f0b40b3d35260a4cc6dc87efa Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Thu, 5 Mar 2020 11:41:20 -0300 Subject: [PATCH 13/24] =?UTF-8?q?Incrementa=20vers=C3=A3o=20do=20SDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Plinio Umezaki --- api30.sdk/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index 6ccd65e..1af4f15 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.1-SNAPSHOT + 0.0.2-SNAPSHOT jar api30.sdk From 1227b84f62c346fda6009877a72d2441c3f65603 Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Tue, 10 Mar 2020 10:17:30 -0300 Subject: [PATCH 14/24] =?UTF-8?q?Volta=20=C3=A0=20vers=C3=A3o=20original?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api30.sdk/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index 1af4f15..6ccd65e 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.2-SNAPSHOT + 0.0.1-SNAPSHOT jar api30.sdk From 28d7dbde5764949b2b0df0d0982eb4178fbe803d Mon Sep 17 00:00:00 2001 From: Gabriel Oliveira Date: Mon, 16 Mar 2020 12:40:15 -0300 Subject: [PATCH 15/24] Altera content-type de envio para "application/json; charset-utf8" Esta correcao permite o envio de caracteres codificados em UTF-8 atraves da SDK Signed-off-by: Gabriel Oliveira --- api30.sdk/pom.xml | 2 +- .../sdk/ecommerce/request/CreateSaleRequest.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index 6ccd65e..1af4f15 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.1-SNAPSHOT + 0.0.2-SNAPSHOT jar api30.sdk diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java index 5654490..01656b6 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java @@ -2,8 +2,10 @@ import java.io.IOException; +import org.apache.commons.codec.Charsets; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import com.google.gson.GsonBuilder; @@ -25,8 +27,8 @@ public Sale execute(Sale param) throws IOException, CieloRequestException { String url = environment.getApiUrl() + "1/sales/"; HttpPost request = new HttpPost(url); - request.setEntity(new StringEntity(new GsonBuilder().create().toJson(param))); - + request.setEntity(new StringEntity(new GsonBuilder().create().toJson(param), + ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), Charsets.UTF_8.name()))); HttpResponse response = sendRequest(request); return readResponse(response, Sale.class); From a88a4f573c8edd3eb72dcf7f626a0e83a2e77150 Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Tue, 3 Nov 2020 13:05:51 -0300 Subject: [PATCH 16/24] =?UTF-8?q?Adiciona=20novos=20campos=20de=20subadqui?= =?UTF-8?q?r=C3=AAncia=20solicitados=20pela=20Cielo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - GAT-104 - Adiciona novos campos determinados pela Cielo para envio de dados de subadquirência: documento(Identity), código do país(CountryCode) e software descriptor (SoftDescriptor) - Incrementa versão. Signed-off-by: Plinio Umezaki --- api30.sdk/pom.xml | 2 +- .../sdk/ecommerce/SubEstablishment.java | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index 1af4f15..ac94dca 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.2-SNAPSHOT + 0.0.3-SNAPSHOT jar api30.sdk diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java index f952a08..0c11c64 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java @@ -6,6 +6,8 @@ public class SubEstablishment { @SerializedName("EstablishmentCode") private String establishmentCode; + @SerializedName("Identity") + private String identity; @SerializedName("Mcc") private String mcc; @SerializedName("Address") @@ -16,8 +18,12 @@ public class SubEstablishment { private String state; @SerializedName("PostalCode") private String postalCode; + @SerializedName("CountryCode") + private String countryCode; @SerializedName("PhoneNumber") private String phoneNumber; + @SerializedName("SoftDescriptor") + private String softDescriptor; public String getEstablishmentCode() { return this.establishmentCode; @@ -28,6 +34,15 @@ public SubEstablishment setEstablishmentCode(String establishmentCode) { return this; } + public String getIdentity() { + return this.identity; + } + + public SubEstablishment setIdentity(String identity) { + this.identity = identity; + return this; + } + public String getMcc() { return this.mcc; } @@ -73,6 +88,15 @@ public SubEstablishment setPostalCode(String postalCode) { return this; } + public String getCountryCode() { + return this.countryCode; + } + + public SubEstablishment setCountryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + public String getPhoneNumber() { return this.phoneNumber; } @@ -81,4 +105,13 @@ public SubEstablishment setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; return this; } + + public String getSoftDescriptor() { + return this.softDescriptor; + } + + public SubEstablishment setSoftDescriptor(String softDescriptor) { + this.softDescriptor = softDescriptor; + return this; + } } From 1802f43a33733b9d4f3aa78c8cc9cfeb74a12d0c Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Thu, 5 Nov 2020 13:27:22 -0300 Subject: [PATCH 17/24] Remove campo softDescriptor - GAT-104 - O campo em si existe apenas na entidade Payment. Por isso, este campo foi removido. --- .../sdk/ecommerce/SubEstablishment.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java index 0c11c64..2edbc6a 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java @@ -22,8 +22,6 @@ public class SubEstablishment { private String countryCode; @SerializedName("PhoneNumber") private String phoneNumber; - @SerializedName("SoftDescriptor") - private String softDescriptor; public String getEstablishmentCode() { return this.establishmentCode; @@ -100,18 +98,4 @@ public SubEstablishment setCountryCode(String countryCode) { public String getPhoneNumber() { return this.phoneNumber; } - - public SubEstablishment setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - return this; - } - - public String getSoftDescriptor() { - return this.softDescriptor; - } - - public SubEstablishment setSoftDescriptor(String softDescriptor) { - this.softDescriptor = softDescriptor; - return this; - } } From de488aaa8ab12f1e9cc9c7526c0b2ad4530c4761 Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Thu, 5 Nov 2020 13:34:01 -0300 Subject: [PATCH 18/24] Inclui Setter do campo PhoneNumber do SubEstablishment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - O método foi removido acidentalmente no commit anterior. Signed-off-by: Plinio Umezaki --- .../java/cieloecommerce/sdk/ecommerce/SubEstablishment.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java index 2edbc6a..8166a70 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java @@ -98,4 +98,9 @@ public SubEstablishment setCountryCode(String countryCode) { public String getPhoneNumber() { return this.phoneNumber; } + + public SubEstablishment setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } } From 21739883c4649ca1c03e21738cee6bb77a72e689 Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Thu, 5 Nov 2020 13:42:17 -0300 Subject: [PATCH 19/24] =?UTF-8?q?Incrementa=20vers=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Plinio Umezaki --- api30.sdk/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index ac94dca..e7818ba 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.3-SNAPSHOT + 0.0.4-SNAPSHOT jar api30.sdk From 6f271913c8f50cacd263114931f02025e970e285 Mon Sep 17 00:00:00 2001 From: Gabriel Oliveira Date: Tue, 17 Nov 2020 16:30:07 -0300 Subject: [PATCH 20/24] Corrige a utilizacao do HttpClient Consome a entidade e invoca o metodo close do CloseableHttpResponse para evitar vazamento de conexoes. Esta mudanca e particularmente importante quando a instancia do HttpClient for definida pelo cliente, pois permite a utilizacao de um HttpClient configurado com um gerenciador de conexoes do tipo PoolingHttpClientConnectionManager Signed-off-by: Gabriel Oliveira --- api30.sdk/pom.xml | 2 +- .../sdk/ecommerce/CieloEcommerce.java | 12 ++--- .../request/AbstractSaleRequest.java | 51 +++++++------------ .../request/CreateCartTokenRequest.java | 4 +- .../ecommerce/request/CreateSaleRequest.java | 4 +- .../DeactivateRecurrentSaleRequest.java | 4 +- .../request/QueryMerchantOrderRequest.java | 6 +-- .../request/QueryRecurrentSaleRequest.java | 4 +- .../ecommerce/request/QuerySaleRequest.java | 4 +- .../ecommerce/request/UpdateSaleRequest.java | 4 +- 10 files changed, 40 insertions(+), 55 deletions(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index e7818ba..c7a8211 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT jar api30.sdk diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java index b5818c0..67e3098 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/CieloEcommerce.java @@ -2,7 +2,7 @@ import cieloecommerce.sdk.Merchant; import cieloecommerce.sdk.ecommerce.request.*; -import org.apache.http.client.HttpClient; +import org.apache.http.impl.client.CloseableHttpClient; import java.io.IOException; @@ -12,7 +12,7 @@ public class CieloEcommerce { private final Merchant merchant; private final Environment environment; - private HttpClient httpClient; + private CloseableHttpClient httpClient; /** * Create an instance of CieloEcommerce choosing the environment where the @@ -39,7 +39,7 @@ public CieloEcommerce(Merchant merchant) { this(merchant, Environment.PRODUCTION); } - public void setHttpClient(HttpClient httpClient) { + public void setHttpClient(CloseableHttpClient httpClient) { this.httpClient = httpClient; } @@ -69,7 +69,7 @@ public Sale createSale(Sale sale) throws IOException, CieloRequestException { /** * Create a card token to be stored on store - * + * * @param cardToken * The credit card data * @return The card token @@ -112,7 +112,7 @@ public Sale querySale(String paymentId) throws IOException, CieloRequestExceptio return sale; } - + /** * Query a Sale on Cielo by paymentId * @@ -136,7 +136,7 @@ public QueryMerchantOrderResponse queryMerchantOrder(String merchantOrderId) thr return merchantOrder; } - + /** * Query a RecurrentSale on Cielo by recurrentPaymentId diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/AbstractSaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/AbstractSaleRequest.java index 6a7ee79..ed03325 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/AbstractSaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/AbstractSaleRequest.java @@ -1,22 +1,18 @@ package cieloecommerce.sdk.ecommerce.request; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.util.UUID; -import java.util.zip.GZIPInputStream; -import org.apache.http.Header; import org.apache.http.HttpEntity; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import com.google.gson.Gson; import cieloecommerce.sdk.Environment; import cieloecommerce.sdk.Merchant; +import org.apache.http.util.EntityUtils; /** * Abstraction to reuse most of the code that send and receive the HTTP @@ -25,7 +21,7 @@ public abstract class AbstractSaleRequest { final Environment environment; private final Merchant merchant; - private HttpClient httpClient; + private CloseableHttpClient httpClient; AbstractSaleRequest(Merchant merchant, Environment environment) { this.merchant = merchant; @@ -34,7 +30,7 @@ public abstract class AbstractSaleRequest { public abstract Response execute(Request param) throws IOException, CieloRequestException; - public void setHttpClient(HttpClient httpClient) { + public void setHttpClient(CloseableHttpClient httpClient) { this.httpClient = httpClient; } @@ -48,7 +44,7 @@ public void setHttpClient(HttpClient httpClient) { * @throws IOException * yeah, deal with it */ - HttpResponse sendRequest(HttpUriRequest request) throws IOException { + CloseableHttpResponse sendRequest(HttpUriRequest request) throws IOException { if (httpClient == null) { httpClient = HttpClientBuilder.create().build(); } @@ -67,33 +63,22 @@ HttpResponse sendRequest(HttpUriRequest request) throws IOException { /** * Read the response body sent by Cielo * - * @param response - * HttpResponse by Cielo, with headers, status code, etc. + * @param response HttpResponse by Cielo, with headers, status code, etc. * @return An instance of Sale with the response entity sent by Cielo. - * @throws IOException - * yeah, deal with it + * @throws IOException yeah, deal with it * @throws CieloRequestException */ - Response readResponse(HttpResponse response, Class responseClassOf) - throws IOException, CieloRequestException { - HttpEntity responseEntity = response.getEntity(); - InputStream responseEntityContent = responseEntity.getContent(); - - Header contentEncoding = response.getFirstHeader("Content-Encoding"); - - if (contentEncoding != null && contentEncoding.getValue().equalsIgnoreCase("gzip")) { - responseEntityContent = new GZIPInputStream(responseEntityContent); + Response readResponse(CloseableHttpResponse response, Class responseClassOf) + throws IOException, CieloRequestException { + try { + HttpEntity responseEntity = response.getEntity(); + final String responseBody = EntityUtils.toString(responseEntity); + EntityUtils.consume(responseEntity); + return parseResponse(response.getStatusLine().getStatusCode(), responseBody, + responseClassOf); + } finally { + response.close(); } - - BufferedReader responseReader = new BufferedReader(new InputStreamReader(responseEntityContent)); - StringBuilder responseBuilder = new StringBuilder(); - String line; - - while ((line = responseReader.readLine()) != null) { - responseBuilder.append(line); - } - - return parseResponse(response.getStatusLine().getStatusCode(), responseBuilder.toString(), responseClassOf); } /** diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateCartTokenRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateCartTokenRequest.java index 08dba25..c061e46 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateCartTokenRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateCartTokenRequest.java @@ -2,7 +2,7 @@ import java.io.IOException; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; @@ -24,7 +24,7 @@ public CardToken execute(CardToken param) throws IOException, CieloRequestExcept request.setEntity(new StringEntity(new GsonBuilder().create().toJson(param))); - HttpResponse response = sendRequest(request); + CloseableHttpResponse response = sendRequest(request); return readResponse(response, CardToken.class); } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java index 01656b6..6c033a2 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/CreateSaleRequest.java @@ -3,7 +3,7 @@ import java.io.IOException; import org.apache.commons.codec.Charsets; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; @@ -29,7 +29,7 @@ public Sale execute(Sale param) throws IOException, CieloRequestException { request.setEntity(new StringEntity(new GsonBuilder().create().toJson(param), ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), Charsets.UTF_8.name()))); - HttpResponse response = sendRequest(request); + CloseableHttpResponse response = sendRequest(request); return readResponse(response, Sale.class); } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/DeactivateRecurrentSaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/DeactivateRecurrentSaleRequest.java index e767cfb..7cffac0 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/DeactivateRecurrentSaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/DeactivateRecurrentSaleRequest.java @@ -3,7 +3,7 @@ import cieloecommerce.sdk.Environment; import cieloecommerce.sdk.Merchant; import cieloecommerce.sdk.ecommerce.RecurrentSale; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPut; import java.io.IOException; @@ -18,7 +18,7 @@ public RecurrentSale execute(String recurrentPaymentId) throws IOException, Ciel String url = environment.getApiUrl() + "1/RecurrentPayment/" + recurrentPaymentId + "/Deactivate"; HttpPut request = new HttpPut(url); - HttpResponse response = sendRequest(request); + CloseableHttpResponse response = sendRequest(request); return readResponse(response, RecurrentSale.class); } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java index 3b501cc..1a33e1d 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryMerchantOrderRequest.java @@ -2,7 +2,7 @@ import java.io.IOException; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import cieloecommerce.sdk.Environment; @@ -22,9 +22,9 @@ public QueryMerchantOrderResponse execute(String merchnatOrderId) throws IOExcep String url = environment.getApiQueryURL() + "1/sales?merchantOrderId=" + merchnatOrderId; HttpGet request = new HttpGet(url); - HttpResponse response = sendRequest(request); + CloseableHttpResponse response = sendRequest(request); return readResponse(response, QueryMerchantOrderResponse.class); } - + } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java index e3a4c38..2aa9d68 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QueryRecurrentSaleRequest.java @@ -2,7 +2,7 @@ import java.io.IOException; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import cieloecommerce.sdk.Environment; @@ -19,7 +19,7 @@ public RecurrentSale execute(String recurrentPaymentId) throws IOException, Ciel String url = environment.getApiQueryURL() + "1/RecurrentPayment/" + recurrentPaymentId; HttpGet request = new HttpGet(url); - HttpResponse response = sendRequest(request); + CloseableHttpResponse response = sendRequest(request); return readResponse(response, RecurrentSale.class); } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QuerySaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QuerySaleRequest.java index 817ba85..9899a11 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QuerySaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/QuerySaleRequest.java @@ -2,7 +2,7 @@ import java.io.IOException; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import cieloecommerce.sdk.Environment; @@ -22,7 +22,7 @@ public Sale execute(String paymentId) throws IOException, CieloRequestException String url = environment.getApiQueryURL() + "1/sales/" + paymentId; HttpGet request = new HttpGet(url); - HttpResponse response = sendRequest(request); + CloseableHttpResponse response = sendRequest(request); return readResponse(response, Sale.class); } diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/UpdateSaleRequest.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/UpdateSaleRequest.java index fd4a1eb..23dbf1f 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/UpdateSaleRequest.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/request/UpdateSaleRequest.java @@ -3,7 +3,7 @@ import cieloecommerce.sdk.Environment; import cieloecommerce.sdk.Merchant; import cieloecommerce.sdk.ecommerce.SaleResponse; -import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPut; import org.apache.http.client.utils.URIBuilder; @@ -43,7 +43,7 @@ public SaleResponse execute(String paymentId) throws IOException, CieloRequestEx request = new HttpPut(builder.build().toString()); - HttpResponse response = sendRequest(request); + CloseableHttpResponse response = sendRequest(request); sale = readResponse(response, SaleResponse.class); } catch (URISyntaxException e) { From df9ebbef5922cbe8d0b950616a0e95b837de017a Mon Sep 17 00:00:00 2001 From: Matheus Tirabassi Date: Thu, 16 Nov 2023 10:34:57 -0300 Subject: [PATCH 21/24] Adiciona campo InitiatedTransactionIndicator Complementa GAT-140. Signed-off-by: Matheus Tirabassi --- api30.sdk/pom.xml | 2 +- .../InitiatedTransactionIndicator.java | 55 +++++++++++++++++++ .../cieloecommerce/sdk/ecommerce/Payment.java | 54 +++++++++++++++++- 3 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/InitiatedTransactionIndicator.java diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index c7a8211..a57ffec 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.5-SNAPSHOT + 0.0.6-SNAPSHOT jar api30.sdk diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/InitiatedTransactionIndicator.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/InitiatedTransactionIndicator.java new file mode 100644 index 0000000..ba695be --- /dev/null +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/InitiatedTransactionIndicator.java @@ -0,0 +1,55 @@ +package cieloecommerce.sdk.ecommerce; + +import com.google.gson.annotations.SerializedName; + +/** + * + * Identifica se a transação foi iniciada pelo titular do cartão ou pela loja. Válido apenas para + * bandeira Mastercard. + * + * Category: Categoria do indicador de início da transação. + * Valores possíveis: + * - “C1”: transação inciada pelo portador do cartão; + * - “M1”: transação recorrente ou parcelada iniciada pela loja; + * - “M2”: transação iniciada pela loja. + * + * Subcategory: Subcategoria do indicador. + * Valores possíveis: + * + * Se Category = “C1” ou “M1” + * - CredentialsOnFile + * - StandingOrder + * - Subscription + * - Installment + * + * Se Category = “M2” + * - PartialShipment + * - RelatedOrDelayedCharge + * - NoShow + * - Resubmission + */ +public class InitiatedTransactionIndicator { + @SerializedName("Category") + private String category; + + @SerializedName("Subcategory") + private String subcategory; + + public String getCategory() { + return this.category; + } + + public InitiatedTransactionIndicator setCategory(String category) { + this.category = category; + return this; + } + + public String getSubcategory() { + return this.subcategory; + } + + public InitiatedTransactionIndicator setSubcategory(String subcategory) { + this.subcategory = subcategory; + return this; + } +} diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index 2f3f357..aceba35 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -93,6 +93,8 @@ public class Payment { private String qrCodeBase64Image; @SerializedName("ExternalAuthentication") private ExternalAuthentication externalAuthentication; + @SerializedName("InitiatedTransactionIndicator") + private InitiatedTransactionIndicator initiatedTransactionIndicator; public Payment(Integer amount, Integer installments) { setAmount(amount); @@ -481,4 +483,54 @@ public Payment setExternalAuthentication(ExternalAuthentication externalAuthenti this.externalAuthentication = externalAuthentication; return this; } -} \ No newline at end of file + + public InitiatedTransactionIndicator getInitiatedTransactionIndicator() { + return this.initiatedTransactionIndicator; + } + + public Payment setInitiatedTransactionIndicator(InitiatedTransactionIndicator initiatedTransactionIndicator) { + this.initiatedTransactionIndicator = initiatedTransactionIndicator; + return this; + } + + /** + * Categoria do indicador de início da transação. Válido apenas para bandeira Mastercard. + * + * Valores possíveis: + * - “C1”: transação inciada pelo portador do cartão; + * - “M1”: transação recorrente ou parcelada iniciada pela loja; + * - “M2”: transação iniciada pela loja. + */ + public enum Category { + C1, + M1, + M2 + } + + /** + * Subcategoria do indicador. Válido apenas para bandeira Mastercard. + * Valores possíveis: + * + * Se InitiatedTransactionIndicator.Category = “C1” ou “M1” + * - CredentialsOnFile + * - StandingOrder + * - Subscription + * - Installment + * + * Se InitiatedTransactionIndicator.Category = “M2” + * - PartialShipment + * - RelatedOrDelayedCharge + * - NoShow + * - Resubmission + */ + public enum Subcategory { + CredentialsOnFile, + StandingOrder, + Subscription, + Installment, + PartialShipment, + RelatedOrDelayedCharge, + NoShow, + Resubmission + } +} From 5661f560cb6d69058ee9ed60962fb289bc5b0edc Mon Sep 17 00:00:00 2001 From: Plinio Umezaki Date: Fri, 21 Mar 2025 12:58:12 -0300 Subject: [PATCH 22/24] =?UTF-8?q?Adiciona=20a=20raz=C3=A3o=20social=20na?= =?UTF-8?q?=20requisi=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implementa GAT-157 Signed-off-by: Plinio Umezaki --- api30.sdk/pom.xml | 2 +- .../sdk/ecommerce/SubEstablishment.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index a57ffec..50c5c98 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.6-SNAPSHOT + 0.0.7-SNAPSHOT jar api30.sdk diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java index 8166a70..fbf3ffe 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/SubEstablishment.java @@ -6,6 +6,8 @@ public class SubEstablishment { @SerializedName("EstablishmentCode") private String establishmentCode; + @SerializedName("CompanyName") + private String companyName; @SerializedName("Identity") private String identity; @SerializedName("Mcc") @@ -32,6 +34,15 @@ public SubEstablishment setEstablishmentCode(String establishmentCode) { return this; } + public SubEstablishment setCompanyName(String companyName) { + this.companyName = companyName; + return this; + } + + public String getCompanyName() { + return companyName; + } + public String getIdentity() { return this.identity; } From 61ccd9f41ed03d28a74ecd4107ba60e59e274ddd Mon Sep 17 00:00:00 2001 From: Wagner Almeida Date: Wed, 15 Oct 2025 17:55:24 -0300 Subject: [PATCH 23/24] =?UTF-8?q?Adiciona=20SolutionType=20na=20requsi?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cria atributo SolutionType - Cria Enum PaymentSolutionType Task: GAT-166 Signed-off-by: Wagner Almeida --- api30.sdk/pom.xml | 2 +- .../cieloecommerce/sdk/ecommerce/Payment.java | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/api30.sdk/pom.xml b/api30.sdk/pom.xml index 50c5c98..ec622a7 100644 --- a/api30.sdk/pom.xml +++ b/api30.sdk/pom.xml @@ -4,7 +4,7 @@ br.cielo.cieloecommerce api30.sdk - 0.0.7-SNAPSHOT + 0.0.8-SNAPSHOT jar api30.sdk diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index aceba35..c4c00ed 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -89,6 +89,8 @@ public class Payment { private Integer voidedAmount; @SerializedName("VoidedDate") private String voidedDate; + @SerializedName("SolutionType") + private PaymentSolutionType solutionType; @SerializedName("QrCodeBase64Image") private String qrCodeBase64Image; @SerializedName("ExternalAuthentication") @@ -455,6 +457,15 @@ public String getVoidedDate() { return voidedDate; } + public PaymentSolutionType getSolutionType() { + return solutionType; + } + + public Payment setSolutionType(PaymentSolutionType solutionType) { + this.solutionType = solutionType; + return this; + } + public String getQrCodeBase64Image() { return qrCodeBase64Image; } @@ -475,6 +486,17 @@ public enum Currency { BRL, USD, MXN, COP, CLP, ARS, PEN, EUR, PYN, UYU, VEB, VEF, GBP } + /** + * Representa os tipos de solução de pagamento aceitos pela Cielo. + *

+ * Este enum é utilizado para serializar e desserializar o campo JSON + * Payment.SolutionType, obrigatório em transações com a bandeira Elo + * oriundas de link de pagamento. + */ + public enum PaymentSolutionType { + EXTERNAL_LINK_PAY + } + public ExternalAuthentication getExternalAuthentication() { return externalAuthentication; } From cc6479e52309863b833035def156d44daf02db1b Mon Sep 17 00:00:00 2001 From: Wagner Almeida Date: Wed, 15 Oct 2025 19:06:11 -0300 Subject: [PATCH 24/24] =?UTF-8?q?Adiciona=20SolutionType=20na=20requsi?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cria atributo SolutionType - Cria Enum PaymentSolutionType Task: GAT-166 Signed-off-by: Wagner Almeida --- .../src/main/java/cieloecommerce/sdk/ecommerce/Payment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java index c4c00ed..dd54028 100644 --- a/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java +++ b/api30.sdk/src/main/java/cieloecommerce/sdk/ecommerce/Payment.java @@ -494,7 +494,7 @@ public enum Currency { * oriundas de link de pagamento. */ public enum PaymentSolutionType { - EXTERNAL_LINK_PAY + ExternalLinkPay } public ExternalAuthentication getExternalAuthentication() {