Skip to content

Commit

Permalink
task: add paymentMethod fingerprint (#42)
Browse files Browse the repository at this point in the history
**Description:** Updates `paymentMethod` to include the new
`fingerprint` property in the response.

**Ticket:** https://gr4vy.atlassian.net/browse/TA-6189
  • Loading branch information
luca-gr4vy authored Feb 12, 2024
1 parent 0a21e26 commit e819a85
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public SchemeEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName(SERIALIZED_NAME_DETAILS)
private CheckoutSessionPaymentMethodDetails details;

public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint";
@SerializedName(SERIALIZED_NAME_FINGERPRINT)
private String fingerprint;


public CheckoutSessionPaymentMethod type(String type) {

Expand Down Expand Up @@ -326,6 +330,29 @@ public void setDetails(CheckoutSessionPaymentMethodDetails details) {
}


public CheckoutSessionPaymentMethod fingerprint(String fingerprint) {

this.fingerprint = fingerprint;
return this;
}

/**
* The unique hash derived from the payment method identifier (e.g. card number).
* @return fingerprint
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "20eb353620155d2b5fc864cc46a73ea77cb92c725238650839da1813fa987a17", value = "The unique hash derived from the payment method identifier (e.g. card number).")

public String getFingerprint() {
return fingerprint;
}


public void setFingerprint(String fingerprint) {
this.fingerprint = fingerprint;
}


@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -340,12 +367,13 @@ public boolean equals(Object o) {
Objects.equals(this.method, checkoutSessionPaymentMethod.method) &&
Objects.equals(this.scheme, checkoutSessionPaymentMethod.scheme) &&
Objects.equals(this.label, checkoutSessionPaymentMethod.label) &&
Objects.equals(this.details, checkoutSessionPaymentMethod.details);
Objects.equals(this.details, checkoutSessionPaymentMethod.details) &&
Objects.equals(this.fingerprint, checkoutSessionPaymentMethod.fingerprint);
}

@Override
public int hashCode() {
return Objects.hash(type, id, method, scheme, label, details);
return Objects.hash(type, id, method, scheme, label, details, fingerprint);
}

@Override
Expand All @@ -358,6 +386,7 @@ public String toString() {
sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n");
sb.append(" label: ").append(toIndentedString(label)).append("\n");
sb.append(" details: ").append(toIndentedString(details)).append("\n");
sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
33 changes: 31 additions & 2 deletions src/main/java/com/gr4vy/api/model/PaymentMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
private String updatedAt;

public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint";
@SerializedName(SERIALIZED_NAME_FINGERPRINT)
private String fingerprint;


public PaymentMethod type(TypeEnum type) {

Expand Down Expand Up @@ -1145,6 +1149,29 @@ public void setUpdatedAt(String updatedAt) {
}


public PaymentMethod fingerprint(String fingerprint) {

this.fingerprint = fingerprint;
return this;
}

/**
* The unique hash derived from the payment method identifier (e.g. card number).
* @return fingerprint
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "20eb353620155d2b5fc864cc46a73ea77cb92c725238650839da1813fa987a17", value = "The unique hash derived from the payment method identifier (e.g. card number).")

public String getFingerprint() {
return fingerprint;
}


public void setFingerprint(String fingerprint) {
this.fingerprint = fingerprint;
}


@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down Expand Up @@ -1174,12 +1201,13 @@ public boolean equals(Object o) {
Objects.equals(this.mode, paymentMethod.mode) &&
Objects.equals(this.scheme, paymentMethod.scheme) &&
Objects.equals(this.status, paymentMethod.status) &&
Objects.equals(this.updatedAt, paymentMethod.updatedAt);
Objects.equals(this.updatedAt, paymentMethod.updatedAt) &&
Objects.equals(this.fingerprint, paymentMethod.fingerprint);
}

@Override
public int hashCode() {
return Objects.hash(type, id, additionalSchemes, approvalTarget, approvalUrl, buyer, country, createdAt, currency, details, expirationDate, externalIdentifier, hasReplacement, label, lastReplacedAt, merchantAccountId, method, mode, scheme, status, updatedAt);
return Objects.hash(type, id, additionalSchemes, approvalTarget, approvalUrl, buyer, country, createdAt, currency, details, expirationDate, externalIdentifier, hasReplacement, label, lastReplacedAt, merchantAccountId, method, mode, scheme, status, updatedAt, fingerprint);
}

@Override
Expand Down Expand Up @@ -1207,6 +1235,7 @@ public String toString() {
sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
33 changes: 31 additions & 2 deletions src/main/java/com/gr4vy/api/model/PaymentMethodSnapshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ public SchemeEnum read(final JsonReader jsonReader) throws IOException {
@SerializedName(SERIALIZED_NAME_SCHEME)
private SchemeEnum scheme;

public static final String SERIALIZED_NAME_FINGERPRINT = "fingerprint";
@SerializedName(SERIALIZED_NAME_FINGERPRINT)
private String fingerprint;


public PaymentMethodSnapshot type(TypeEnum type) {

Expand Down Expand Up @@ -756,6 +760,29 @@ public void setScheme(SchemeEnum scheme) {
}


public PaymentMethodSnapshot fingerprint(String fingerprint) {

this.fingerprint = fingerprint;
return this;
}

/**
* The unique hash derived from the payment method identifier (e.g. card number).
* @return fingerprint
**/
@javax.annotation.Nullable
@ApiModelProperty(example = "20eb353620155d2b5fc864cc46a73ea77cb92c725238650839da1813fa987a17", value = "The unique hash derived from the payment method identifier (e.g. card number).")

public String getFingerprint() {
return fingerprint;
}


public void setFingerprint(String fingerprint) {
this.fingerprint = fingerprint;
}


@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -778,12 +805,13 @@ public boolean equals(Object o) {
Objects.equals(this.lastReplacedAt, paymentMethodSnapshot.lastReplacedAt) &&
Objects.equals(this.method, paymentMethodSnapshot.method) &&
Objects.equals(this.paymentAccountReference, paymentMethodSnapshot.paymentAccountReference) &&
Objects.equals(this.scheme, paymentMethodSnapshot.scheme);
Objects.equals(this.scheme, paymentMethodSnapshot.scheme) &&
Objects.equals(this.fingerprint, paymentMethodSnapshot.fingerprint);
}

@Override
public int hashCode() {
return Objects.hash(type, id, approvalTarget, approvalUrl, country, currency, details, expirationDate, externalIdentifier, label, lastReplacedAt, method, paymentAccountReference, scheme);
return Objects.hash(type, id, approvalTarget, approvalUrl, country, currency, details, expirationDate, externalIdentifier, label, lastReplacedAt, method, paymentAccountReference, scheme, fingerprint);
}

@Override
Expand All @@ -804,6 +832,7 @@ public String toString() {
sb.append(" method: ").append(toIndentedString(method)).append("\n");
sb.append(" paymentAccountReference: ").append(toIndentedString(paymentAccountReference)).append("\n");
sb.append(" scheme: ").append(toIndentedString(scheme)).append("\n");
sb.append(" fingerprint: ").append(toIndentedString(fingerprint)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down

0 comments on commit e819a85

Please sign in to comment.