diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 72496b5..0cb96c9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,9 +20,9 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'temurin' # See 'Supported distributions' for available options
- java-version: '17'
+ java-version: '18'
- name: Install dependencies & run tests
env:
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
- run: mvn install -DskipTests
+ run: mvn install
diff --git a/pom.xml b/pom.xml
index 3779fa1..639958c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
gr4vy
jar
gr4vy
- 0.29.1
+ 0.29.2
https://gr4vy.com
Gr4vy Java SDK
@@ -259,7 +259,7 @@
- 1.7
+ 1.8
${java.version}
${java.version}
1.8.5
diff --git a/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceCard.java b/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceCard.java
index 5776e65..d64b89c 100644
--- a/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceCard.java
+++ b/src/main/java/com/gr4vy/api/model/ConnectionOptionsCybersourceCard.java
@@ -23,6 +23,9 @@
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* Additional options for Cybersource payment gateway.
@@ -34,6 +37,14 @@ public class ConnectionOptionsCybersourceCard {
@SerializedName(SERIALIZED_NAME_META_KEY_MERCHANT_ID)
private String metaKeyMerchantId;
+ public static final String SERIALIZED_NAME_MERCHANT_DEFINED_INFORMATION = "merchant_defined_information";
+ @SerializedName(SERIALIZED_NAME_MERCHANT_DEFINED_INFORMATION)
+ private Map merchantDefinedInformation = null;
+
+ public static final String SERIALIZED_NAME_SHIP_TO_METHOD = "ship_to_method";
+ @SerializedName(SERIALIZED_NAME_SHIP_TO_METHOD)
+ private String shipToMethod;
+
public ConnectionOptionsCybersourceCard metaKeyMerchantId(String metaKeyMerchantId) {
@@ -58,6 +69,60 @@ public void setMetaKeyMerchantId(String metaKeyMerchantId) {
}
+ public ConnectionOptionsCybersourceCard merchantDefinedInformation(Map merchantDefinedInformation) {
+
+ this.merchantDefinedInformation = merchantDefinedInformation;
+ return this;
+ }
+
+ public ConnectionOptionsCybersourceCard putMerchantDefinedInformationItem(String key, String merchantDefinedInformationItem) {
+ if (this.merchantDefinedInformation == null) {
+ this.merchantDefinedInformation = new HashMap();
+ }
+ this.merchantDefinedInformation.put(key, merchantDefinedInformationItem);
+ return this;
+ }
+
+ /**
+ * This is a key-value object for merchant defined information. Each key needs to be a numeric string identifying the MDI field to set. For example, for field 1 set the key to \"1\".
+ * @return merchantDefinedInformation
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(example = "{\"1\":\"John Doe\",\"2\":\"trusted\",\"99\":\"recurring\"}", value = "This is a key-value object for merchant defined information. Each key needs to be a numeric string identifying the MDI field to set. For example, for field 1 set the key to \"1\".")
+
+ public Map getMerchantDefinedInformation() {
+ return merchantDefinedInformation;
+ }
+
+
+ public void setMerchantDefinedInformation(Map merchantDefinedInformation) {
+ this.merchantDefinedInformation = merchantDefinedInformation;
+ }
+
+
+ public ConnectionOptionsCybersourceCard shipToMethod(String shipToMethod) {
+
+ this.shipToMethod = shipToMethod;
+ return this;
+ }
+
+ /**
+ * Shipping method for the order.
+ * @return shipToMethod
+ **/
+ @javax.annotation.Nullable
+ @ApiModelProperty(value = "Shipping method for the order.")
+
+ public String getShipToMethod() {
+ return shipToMethod;
+ }
+
+
+ public void setShipToMethod(String shipToMethod) {
+ this.shipToMethod = shipToMethod;
+ }
+
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -67,12 +132,14 @@ public boolean equals(Object o) {
return false;
}
ConnectionOptionsCybersourceCard connectionOptionsCybersourceCard = (ConnectionOptionsCybersourceCard) o;
- return Objects.equals(this.metaKeyMerchantId, connectionOptionsCybersourceCard.metaKeyMerchantId);
+ return Objects.equals(this.metaKeyMerchantId, connectionOptionsCybersourceCard.metaKeyMerchantId) &&
+ Objects.equals(this.merchantDefinedInformation, connectionOptionsCybersourceCard.merchantDefinedInformation) &&
+ Objects.equals(this.shipToMethod, connectionOptionsCybersourceCard.shipToMethod);
}
@Override
public int hashCode() {
- return Objects.hash(metaKeyMerchantId);
+ return Objects.hash(metaKeyMerchantId, merchantDefinedInformation, shipToMethod);
}
@Override
@@ -80,6 +147,8 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConnectionOptionsCybersourceCard {\n");
sb.append(" metaKeyMerchantId: ").append(toIndentedString(metaKeyMerchantId)).append("\n");
+ sb.append(" merchantDefinedInformation: ").append(toIndentedString(merchantDefinedInformation)).append("\n");
+ sb.append(" shipToMethod: ").append(toIndentedString(shipToMethod)).append("\n");
sb.append("}");
return sb.toString();
}
diff --git a/src/main/java/com/gr4vy/api/model/PaymentOption.java b/src/main/java/com/gr4vy/api/model/PaymentOption.java
index 192f98b..809a2c3 100644
--- a/src/main/java/com/gr4vy/api/model/PaymentOption.java
+++ b/src/main/java/com/gr4vy/api/model/PaymentOption.java
@@ -208,6 +208,8 @@ public enum MethodEnum {
SMARTPAY("smartpay"),
SOFORT("sofort"),
+
+ SPEI("spei"),
STRIPEDD("stripedd"),
diff --git a/src/main/java/com/gr4vy/sdk/Gr4vyClient.java b/src/main/java/com/gr4vy/sdk/Gr4vyClient.java
index b630503..027a764 100644
--- a/src/main/java/com/gr4vy/sdk/Gr4vyClient.java
+++ b/src/main/java/com/gr4vy/sdk/Gr4vyClient.java
@@ -622,9 +622,9 @@ public PaymentServiceToken newPaymentServiceToken(String paymentMethodId, Paymen
return this.gson.fromJson(response, PaymentServiceToken.class);
}
- public PaymentServiceToken getPaymentServiceTokens(String paymentMethodId) {
+ public PaymentServiceTokens getPaymentServiceTokens(String paymentMethodId) {
String response = this.get("/payment-methods/" + paymentMethodId + "/payment-service-tokens");
- return this.gson.fromJson(response, PaymentServiceToken.class);
+ return this.gson.fromJson(response, PaymentServiceTokens.class);
}
public boolean deletePaymentServiceToken(String paymentMethodId, String paymentServiceTokenId) {
diff --git a/src/test/java/com/gr4vy/sdk/Gr4vyClientTest.java b/src/test/java/com/gr4vy/sdk/Gr4vyClientTest.java
index c2b5a0c..e9633e8 100644
--- a/src/test/java/com/gr4vy/sdk/Gr4vyClientTest.java
+++ b/src/test/java/com/gr4vy/sdk/Gr4vyClientTest.java
@@ -160,7 +160,6 @@ public void addShippingDetailsToBuyerTest() throws Gr4vyException {
shippingDetails.emailAddress("shipping@test.com");
ShippingDetail shippingResponse = shared.addShippingDetailsToBuyer(response.getId().toString(), shippingDetails);
- System.out.println(shippingResponse);
assert shippingResponse.getId() != null;
ShippingDetails details = shared.listShippingDetailsForBuyer(response.getId().toString());
@@ -211,7 +210,7 @@ public void newFailTransactionTest() throws Gr4vyException {
.method(MethodEnum.CARD)
.number("4111111111111111")
.securityCode("123")
- .expirationDate("12/23");
+ .expirationDate("12/26");
TransactionRequest request = new TransactionRequest()
.amount(100)
@@ -234,7 +233,7 @@ public void newTransactionTest() throws Gr4vyException {
.method(MethodEnum.CARD)
.number("4111111111111111")
.securityCode("123")
- .expirationDate("12/23");
+ .expirationDate("12/26");
TransactionRequest request = new TransactionRequest()
.amount(100)
@@ -251,7 +250,7 @@ public void newTransactionWithIdempotencyTest() throws Gr4vyException {
.method(MethodEnum.CARD)
.number("4111111111111111")
.securityCode("123")
- .expirationDate("12/23");
+ .expirationDate("12/26");
TransactionRequest request = new TransactionRequest()
.amount(100)
@@ -293,7 +292,7 @@ public void captureTransactionTest() throws Gr4vyException {
.method(MethodEnum.CARD)
.number("4111111111111111")
.securityCode("123")
- .expirationDate("12/23")
+ .expirationDate("12/26")
.redirectUrl("https://gr4vy.com");
TransactionRequest request = new TransactionRequest()
@@ -317,7 +316,7 @@ public void voidTransactionTest() throws Gr4vyException {
.method(MethodEnum.CARD)
.number("4111111111111111")
.securityCode("123")
- .expirationDate("12/23")
+ .expirationDate("12/26")
.redirectUrl("https://gr4vy.com");
TransactionRequest request = new TransactionRequest()
@@ -339,7 +338,7 @@ public void refundTransactionTest() throws Gr4vyException {
.method(MethodEnum.CARD)
.number("4111111111111111")
.securityCode("123")
- .expirationDate("12/23")
+ .expirationDate("12/26")
.redirectUrl("https://gr4vy.com");
TransactionRequest request = new TransactionRequest()
@@ -483,4 +482,12 @@ public void listPaymentOptionsTest() throws Gr4vyException {
assert response != null;
}
+ @Test
+ public void getPaymentServiceTokensTest() throws Gr4vyException {
+ PaymentMethods paymentMethods = shared.listPaymentMethods();
+ PaymentMethod paymentMethod = paymentMethods.getItems().get(0);
+ PaymentServiceTokens response = shared.getPaymentServiceTokens(paymentMethod.getId().toString());
+ assert response != null;
+ }
+
}
\ No newline at end of file