Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
@JsonPropertyOrder({
CheckoutForwardRequest.JSON_PROPERTY_BASE_URL,
CheckoutForwardRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
CheckoutForwardRequest.JSON_PROPERTY_MERCHANT_REFERENCE,
CheckoutForwardRequest.JSON_PROPERTY_OPTIONS,
CheckoutForwardRequest.JSON_PROPERTY_PAYMENT_METHOD,
CheckoutForwardRequest.JSON_PROPERTY_REQUEST,
Expand All @@ -42,6 +43,12 @@ public class CheckoutForwardRequest {
/** Mark when the attribute has been explicitly set. */
private boolean isSetMerchantAccount = false;

public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference";
private String merchantReference;

/** Mark when the attribute has been explicitly set. */
private boolean isSetMerchantReference = false;

public static final String JSON_PROPERTY_OPTIONS = "options";
private CheckoutForwardRequestOptions options;

Expand Down Expand Up @@ -156,6 +163,41 @@ public void setMerchantAccount(String merchantAccount) {
isSetMerchantAccount = true; // mark as set
}

/**
* Merchant defined payment reference.
*
* @param merchantReference Merchant defined payment reference.
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest merchantReference(String merchantReference) {
this.merchantReference = merchantReference;
isSetMerchantReference = true; // mark as set
return this;
}

/**
* Merchant defined payment reference.
*
* @return merchantReference Merchant defined payment reference.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getMerchantReference() {
return merchantReference;
}

/**
* Merchant defined payment reference.
*
* @param merchantReference Merchant defined payment reference.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMerchantReference(String merchantReference) {
this.merchantReference = merchantReference;
isSetMerchantReference = true; // mark as set
}

/**
* options
*
Expand Down Expand Up @@ -389,6 +431,9 @@ public boolean equals(Object o) {
&& Objects.equals(this.isSetBaseUrl, checkoutForwardRequest.isSetBaseUrl)
&& Objects.equals(this.merchantAccount, checkoutForwardRequest.merchantAccount)
&& Objects.equals(this.isSetMerchantAccount, checkoutForwardRequest.isSetMerchantAccount)
&& Objects.equals(this.merchantReference, checkoutForwardRequest.merchantReference)
&& Objects.equals(
this.isSetMerchantReference, checkoutForwardRequest.isSetMerchantReference)
&& Objects.equals(this.options, checkoutForwardRequest.options)
&& Objects.equals(this.isSetOptions, checkoutForwardRequest.isSetOptions)
&& Objects.equals(this.paymentMethod, checkoutForwardRequest.paymentMethod)
Expand All @@ -409,6 +454,8 @@ public int hashCode() {
isSetBaseUrl,
merchantAccount,
isSetMerchantAccount,
merchantReference,
isSetMerchantReference,
options,
isSetOptions,
paymentMethod,
Expand All @@ -427,6 +474,7 @@ public String toString() {
sb.append("class CheckoutForwardRequest {\n");
sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n");
sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
sb.append(" merchantReference: ").append(toIndentedString(merchantReference)).append("\n");
sb.append(" options: ").append(toIndentedString(options)).append("\n");
sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n");
sb.append(" request: ").append(toIndentedString(request)).append("\n");
Expand Down Expand Up @@ -464,6 +512,9 @@ public Map<String, Object> getExplicitNulls() {
if (isSetMerchantAccount) {
addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount);
}
if (isSetMerchantReference) {
addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference);
}
if (isSetOptions) {
addIfNull(nulls, JSON_PROPERTY_OPTIONS, this.options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@

/** CheckoutForwardResponse */
@JsonPropertyOrder({
CheckoutForwardResponse.JSON_PROPERTY_MERCHANT_REFERENCE,
CheckoutForwardResponse.JSON_PROPERTY_PSP_REFERENCE,
CheckoutForwardResponse.JSON_PROPERTY_RESPONSE,
CheckoutForwardResponse.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID
})
public class CheckoutForwardResponse {
public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference";
private String merchantReference;

/** Mark when the attribute has been explicitly set. */
private boolean isSetMerchantReference = false;

public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference";
private String pspReference;

Expand All @@ -52,6 +59,41 @@ public class CheckoutForwardResponse {

public CheckoutForwardResponse() {}

/**
* Merchant defined payment reference.
*
* @param merchantReference Merchant defined payment reference.
* @return the current {@code CheckoutForwardResponse} instance, allowing for method chaining
*/
public CheckoutForwardResponse merchantReference(String merchantReference) {
this.merchantReference = merchantReference;
isSetMerchantReference = true; // mark as set
return this;
}

/**
* Merchant defined payment reference.
*
* @return merchantReference Merchant defined payment reference.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getMerchantReference() {
return merchantReference;
}

/**
* Merchant defined payment reference.
*
* @param merchantReference Merchant defined payment reference.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMerchantReference(String merchantReference) {
this.merchantReference = merchantReference;
isSetMerchantReference = true; // mark as set
}

/**
* Adyen&#39;s 16-character reference associated with the transaction/request. This value is
* globally unique. Use this reference when you communicate with us about this request.
Expand Down Expand Up @@ -196,7 +238,10 @@ public boolean equals(Object o) {
return false;
}
CheckoutForwardResponse checkoutForwardResponse = (CheckoutForwardResponse) o;
return Objects.equals(this.pspReference, checkoutForwardResponse.pspReference)
return Objects.equals(this.merchantReference, checkoutForwardResponse.merchantReference)
&& Objects.equals(
this.isSetMerchantReference, checkoutForwardResponse.isSetMerchantReference)
&& Objects.equals(this.pspReference, checkoutForwardResponse.pspReference)
&& Objects.equals(this.isSetPspReference, checkoutForwardResponse.isSetPspReference)
&& Objects.equals(this.response, checkoutForwardResponse.response)
&& Objects.equals(this.isSetResponse, checkoutForwardResponse.isSetResponse)
Expand All @@ -208,6 +253,8 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
merchantReference,
isSetMerchantReference,
pspReference,
isSetPspReference,
response,
Expand All @@ -220,6 +267,7 @@ public int hashCode() {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CheckoutForwardResponse {\n");
sb.append(" merchantReference: ").append(toIndentedString(merchantReference)).append("\n");
sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n");
sb.append(" response: ").append(toIndentedString(response)).append("\n");
sb.append(" storedPaymentMethodId: ")
Expand Down Expand Up @@ -249,6 +297,9 @@ public Map<String, Object> getExplicitNulls() {

Map<String, Object> nulls = new HashMap<>();

if (isSetMerchantReference) {
addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference);
}
if (isSetPspReference) {
addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,30 @@ public class StoredPaymentMethodDetails {

/** The payment method type. */
public enum TypeEnum {
ALIPAY_PLUS(String.valueOf("alipay_plus")),

ALIPAY_PLUS_ALIPAY_CN(String.valueOf("alipay_plus_alipay_cn")),

ALIPAY_PLUS_ALIPAY_HK(String.valueOf("alipay_plus_alipay_hk")),

ALIPAY_PLUS_DANA(String.valueOf("alipay_plus_dana")),

ALIPAY_PLUS_GCASH(String.valueOf("alipay_plus_gcash")),

ALIPAY_PLUS_KAKAOPAY(String.valueOf("alipay_plus_kakaopay")),

ALIPAY_PLUS_KPLUS(String.valueOf("alipay_plus_kplus")),

ALIPAY_PLUS_NAVERPAY(String.valueOf("alipay_plus_naverpay")),

ALIPAY_PLUS_RABBITLINEPAY(String.valueOf("alipay_plus_rabbitlinepay")),

ALIPAY_PLUS_TOSSPAY(String.valueOf("alipay_plus_tosspay")),

ALIPAY_PLUS_TOUCHNGO(String.valueOf("alipay_plus_touchngo")),

ALIPAY_PLUS_TRUEMONEY(String.valueOf("alipay_plus_truemoney")),

BCMC_MOBILE(String.valueOf("bcmc_mobile")),

BCMC_MOBILE_QR(String.valueOf("bcmc_mobile_QR")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/** StoredPaymentMethodResource */
@JsonPropertyOrder({
StoredPaymentMethodResource.JSON_PROPERTY_BRAND,
StoredPaymentMethodResource.JSON_PROPERTY_CARD_BIN,
StoredPaymentMethodResource.JSON_PROPERTY_EXPIRY_MONTH,
StoredPaymentMethodResource.JSON_PROPERTY_EXPIRY_YEAR,
StoredPaymentMethodResource.JSON_PROPERTY_EXTERNAL_RESPONSE_CODE,
Expand All @@ -49,6 +50,12 @@ public class StoredPaymentMethodResource {
/** Mark when the attribute has been explicitly set. */
private boolean isSetBrand = false;

public static final String JSON_PROPERTY_CARD_BIN = "cardBin";
private String cardBin;

/** Mark when the attribute has been explicitly set. */
private boolean isSetCardBin = false;

public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth";
private String expiryMonth;

Expand Down Expand Up @@ -195,6 +202,41 @@ public void setBrand(String brand) {
isSetBrand = true; // mark as set
}

/**
* The bank identification number (BIN) of the card.
*
* @param cardBin The bank identification number (BIN) of the card.
* @return the current {@code StoredPaymentMethodResource} instance, allowing for method chaining
*/
public StoredPaymentMethodResource cardBin(String cardBin) {
this.cardBin = cardBin;
isSetCardBin = true; // mark as set
return this;
}

/**
* The bank identification number (BIN) of the card.
*
* @return cardBin The bank identification number (BIN) of the card.
*/
@JsonProperty(JSON_PROPERTY_CARD_BIN)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getCardBin() {
return cardBin;
}

/**
* The bank identification number (BIN) of the card.
*
* @param cardBin The bank identification number (BIN) of the card.
*/
@JsonProperty(JSON_PROPERTY_CARD_BIN)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setCardBin(String cardBin) {
this.cardBin = cardBin;
isSetCardBin = true; // mark as set
}

/**
* The month the card expires.
*
Expand Down Expand Up @@ -917,6 +959,8 @@ public boolean equals(Object o) {
StoredPaymentMethodResource storedPaymentMethodResource = (StoredPaymentMethodResource) o;
return Objects.equals(this.brand, storedPaymentMethodResource.brand)
&& Objects.equals(this.isSetBrand, storedPaymentMethodResource.isSetBrand)
&& Objects.equals(this.cardBin, storedPaymentMethodResource.cardBin)
&& Objects.equals(this.isSetCardBin, storedPaymentMethodResource.isSetCardBin)
&& Objects.equals(this.expiryMonth, storedPaymentMethodResource.expiryMonth)
&& Objects.equals(this.isSetExpiryMonth, storedPaymentMethodResource.isSetExpiryMonth)
&& Objects.equals(this.expiryYear, storedPaymentMethodResource.expiryYear)
Expand Down Expand Up @@ -969,6 +1013,8 @@ public int hashCode() {
return Objects.hash(
brand,
isSetBrand,
cardBin,
isSetCardBin,
expiryMonth,
isSetExpiryMonth,
expiryYear,
Expand Down Expand Up @@ -1010,6 +1056,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StoredPaymentMethodResource {\n");
sb.append(" brand: ").append(toIndentedString(brand)).append("\n");
sb.append(" cardBin: ").append(toIndentedString(cardBin)).append("\n");
sb.append(" expiryMonth: ").append(toIndentedString(expiryMonth)).append("\n");
sb.append(" expiryYear: ").append(toIndentedString(expiryYear)).append("\n");
sb.append(" externalResponseCode: ")
Expand Down Expand Up @@ -1060,6 +1107,9 @@ public Map<String, Object> getExplicitNulls() {
if (isSetBrand) {
addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand);
}
if (isSetCardBin) {
addIfNull(nulls, JSON_PROPERTY_CARD_BIN, this.cardBin);
}
if (isSetExpiryMonth) {
addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/adyen/CheckoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ public void testForwardCardDetails() throws Exception {

CheckoutForwardResponse response = recurringApi.forward(checkoutForwardRequest);

assertNull(response.getStoredPaymentMethodId()); // card is not tokenized
assertNull(response.getStoredPaymentMethodId()); // card is not tokenized
assertNotNull(response.getResponse());
assertEquals(200, (int) response.getResponse().getStatus());
assertTrue(response.getResponse().getBody().contains("PAYMENT_METHOD_ID"));
Expand Down