com.adyen.model.payment.DonationRequest Maven / Gradle / Ivy
/*
* Adyen Payment API
*
* The version of the OpenAPI document: 68
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.adyen.model.payment;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.adyen.model.payment.Amount;
import com.adyen.model.payment.PlatformChargebackLogic;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
/**
* DonationRequest
*/
@JsonPropertyOrder({
DonationRequest.JSON_PROPERTY_DONATION_ACCOUNT,
DonationRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
DonationRequest.JSON_PROPERTY_MODIFICATION_AMOUNT,
DonationRequest.JSON_PROPERTY_ORIGINAL_REFERENCE,
DonationRequest.JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC,
DonationRequest.JSON_PROPERTY_REFERENCE
})
public class DonationRequest {
public static final String JSON_PROPERTY_DONATION_ACCOUNT = "donationAccount";
private String donationAccount;
public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
private String merchantAccount;
public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount";
private Amount modificationAmount;
public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference";
private String originalReference;
public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic";
private PlatformChargebackLogic platformChargebackLogic;
public static final String JSON_PROPERTY_REFERENCE = "reference";
private String reference;
public DonationRequest() {
}
public DonationRequest donationAccount(String donationAccount) {
this.donationAccount = donationAccount;
return this;
}
/**
* The Adyen account name of the charity.
* @return donationAccount
**/
@ApiModelProperty(required = true, value = "The Adyen account name of the charity.")
@JsonProperty(JSON_PROPERTY_DONATION_ACCOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getDonationAccount() {
return donationAccount;
}
/**
* The Adyen account name of the charity.
*
* @param donationAccount
*/
@JsonProperty(JSON_PROPERTY_DONATION_ACCOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDonationAccount(String donationAccount) {
this.donationAccount = donationAccount;
}
public DonationRequest merchantAccount(String merchantAccount) {
this.merchantAccount = merchantAccount;
return this;
}
/**
* The merchant account that is used to process the payment.
* @return merchantAccount
**/
@ApiModelProperty(required = true, value = "The merchant account that is used to process the payment.")
@JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getMerchantAccount() {
return merchantAccount;
}
/**
* The merchant account that is used to process the payment.
*
* @param merchantAccount
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMerchantAccount(String merchantAccount) {
this.merchantAccount = merchantAccount;
}
public DonationRequest modificationAmount(Amount modificationAmount) {
this.modificationAmount = modificationAmount;
return this;
}
/**
* Get modificationAmount
* @return modificationAmount
**/
@ApiModelProperty(required = true, value = "")
@JsonProperty(JSON_PROPERTY_MODIFICATION_AMOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Amount getModificationAmount() {
return modificationAmount;
}
/**
* modificationAmount
*
* @param modificationAmount
*/
@JsonProperty(JSON_PROPERTY_MODIFICATION_AMOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setModificationAmount(Amount modificationAmount) {
this.modificationAmount = modificationAmount;
}
public DonationRequest originalReference(String originalReference) {
this.originalReference = originalReference;
return this;
}
/**
* The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification
* @return originalReference
**/
@ApiModelProperty(value = "The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification ")
@JsonProperty(JSON_PROPERTY_ORIGINAL_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getOriginalReference() {
return originalReference;
}
/**
* The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification
*
* @param originalReference
*/
@JsonProperty(JSON_PROPERTY_ORIGINAL_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setOriginalReference(String originalReference) {
this.originalReference = originalReference;
}
public DonationRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) {
this.platformChargebackLogic = platformChargebackLogic;
return this;
}
/**
* Get platformChargebackLogic
* @return platformChargebackLogic
**/
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public PlatformChargebackLogic getPlatformChargebackLogic() {
return platformChargebackLogic;
}
/**
* platformChargebackLogic
*
* @param platformChargebackLogic
*/
@JsonProperty(JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) {
this.platformChargebackLogic = platformChargebackLogic;
}
public DonationRequest reference(String reference) {
this.reference = reference;
return this;
}
/**
* Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters.
* @return reference
**/
@ApiModelProperty(value = "Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters.")
@JsonProperty(JSON_PROPERTY_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getReference() {
return reference;
}
/**
* Your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters.
*
* @param reference
*/
@JsonProperty(JSON_PROPERTY_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setReference(String reference) {
this.reference = reference;
}
/**
* Return true if this DonationRequest object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DonationRequest donationRequest = (DonationRequest) o;
return Objects.equals(this.donationAccount, donationRequest.donationAccount) &&
Objects.equals(this.merchantAccount, donationRequest.merchantAccount) &&
Objects.equals(this.modificationAmount, donationRequest.modificationAmount) &&
Objects.equals(this.originalReference, donationRequest.originalReference) &&
Objects.equals(this.platformChargebackLogic, donationRequest.platformChargebackLogic) &&
Objects.equals(this.reference, donationRequest.reference);
}
@Override
public int hashCode() {
return Objects.hash(donationAccount, merchantAccount, modificationAmount, originalReference, platformChargebackLogic, reference);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DonationRequest {\n");
sb.append(" donationAccount: ").append(toIndentedString(donationAccount)).append("\n");
sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
sb.append(" modificationAmount: ").append(toIndentedString(modificationAmount)).append("\n");
sb.append(" originalReference: ").append(toIndentedString(originalReference)).append("\n");
sb.append(" platformChargebackLogic: ").append(toIndentedString(platformChargebackLogic)).append("\n");
sb.append(" reference: ").append(toIndentedString(reference)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Create an instance of DonationRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of DonationRequest
* @throws JsonProcessingException if the JSON string is invalid with respect to DonationRequest
*/
public static DonationRequest fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, DonationRequest.class);
}
/**
* Convert an instance of DonationRequest to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}