-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #640 from Adyen/develop
Release 17.2.0
- Loading branch information
Showing
37 changed files
with
4,139 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
264 changes: 264 additions & 0 deletions
264
src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,264 @@ | ||
/* | ||
* ###### | ||
* ###### | ||
* ############ ####( ###### #####. ###### ############ ############ | ||
* ############# #####( ###### #####. ###### ############# ############# | ||
* ###### #####( ###### #####. ###### ##### ###### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### | ||
* ###### ###### #####( ###### #####. ###### ##### ##### ###### | ||
* ############# ############# ############# ############# ##### ###### | ||
* ############ ############ ############# ############ ##### ###### | ||
* ###### | ||
* ############# | ||
* ############ | ||
* | ||
* Adyen Java API Library | ||
* | ||
* Copyright (c) 2021 Adyen B.V. | ||
* This file is open source and available under the MIT license. | ||
* See the LICENSE file for more info. | ||
*/ | ||
package com.adyen.model.checkout; | ||
|
||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import com.google.gson.TypeAdapter; | ||
import com.google.gson.annotations.JsonAdapter; | ||
import com.google.gson.annotations.SerializedName; | ||
import com.google.gson.stream.JsonReader; | ||
import com.google.gson.stream.JsonWriter; | ||
import java.io.IOException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import com.adyen.model.Amount; | ||
import com.adyen.model.Split; | ||
|
||
/** | ||
* CreatePaymentAmountUpdateRequest | ||
*/ | ||
public class CreatePaymentAmountUpdateRequest { | ||
public static final String SERIALIZED_NAME_AMOUNT = "amount"; | ||
@SerializedName(SERIALIZED_NAME_AMOUNT) | ||
private Amount amount; | ||
|
||
public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; | ||
@SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) | ||
private String merchantAccount; | ||
|
||
/** | ||
* The reason for the amount update. Possible values: * **delayedCharge** * **noShow** | ||
*/ | ||
@JsonAdapter(ReasonEnum.Adapter.class) | ||
public enum ReasonEnum { | ||
DELAYEDCHARGE("delayedCharge"), | ||
|
||
NOSHOW("noShow"); | ||
|
||
@JsonValue | ||
private String value; | ||
|
||
ReasonEnum(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
} | ||
|
||
public static ReasonEnum fromValue(String value) { | ||
for (ReasonEnum b : ReasonEnum.values()) { | ||
if (b.value.equals(value)) { | ||
return b; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unexpected value '" + value + "'"); | ||
} | ||
|
||
public static class Adapter extends TypeAdapter<ReasonEnum> { | ||
@Override | ||
public void write(final JsonWriter jsonWriter, final ReasonEnum enumeration) throws IOException { | ||
jsonWriter.value(enumeration.getValue()); | ||
} | ||
|
||
@Override | ||
public ReasonEnum read(final JsonReader jsonReader) throws IOException { | ||
String value = jsonReader.nextString(); | ||
return ReasonEnum.fromValue(value); | ||
} | ||
} | ||
} | ||
|
||
public static final String SERIALIZED_NAME_REASON = "reason"; | ||
@SerializedName(SERIALIZED_NAME_REASON) | ||
private ReasonEnum reason; | ||
|
||
public static final String SERIALIZED_NAME_REFERENCE = "reference"; | ||
@SerializedName(SERIALIZED_NAME_REFERENCE) | ||
private String reference; | ||
|
||
public static final String SERIALIZED_NAME_SPLITS = "splits"; | ||
@SerializedName(SERIALIZED_NAME_SPLITS) | ||
private List<Split> splits = null; | ||
|
||
|
||
public CreatePaymentAmountUpdateRequest amount(Amount amount) { | ||
|
||
this.amount = amount; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get amount | ||
* @return amount | ||
**/ | ||
public Amount getAmount() { | ||
return amount; | ||
} | ||
|
||
|
||
public void setAmount(Amount amount) { | ||
this.amount = amount; | ||
} | ||
|
||
|
||
public CreatePaymentAmountUpdateRequest merchantAccount(String merchantAccount) { | ||
|
||
this.merchantAccount = merchantAccount; | ||
return this; | ||
} | ||
|
||
/** | ||
* The merchant account that is used to process the payment. | ||
* @return merchantAccount | ||
**/ | ||
public String getMerchantAccount() { | ||
return merchantAccount; | ||
} | ||
|
||
|
||
public void setMerchantAccount(String merchantAccount) { | ||
this.merchantAccount = merchantAccount; | ||
} | ||
|
||
|
||
public CreatePaymentAmountUpdateRequest reason(ReasonEnum reason) { | ||
|
||
this.reason = reason; | ||
return this; | ||
} | ||
|
||
/** | ||
* The reason for the amount update. Possible values: * **delayedCharge** * **noShow** | ||
* @return reason | ||
**/ | ||
public ReasonEnum getReason() { | ||
return reason; | ||
} | ||
|
||
|
||
public void setReason(ReasonEnum reason) { | ||
this.reason = reason; | ||
} | ||
|
||
|
||
public CreatePaymentAmountUpdateRequest reference(String reference) { | ||
|
||
this.reference = reference; | ||
return this; | ||
} | ||
|
||
/** | ||
* Your reference for the amount update request. Maximum length: 80 characters. | ||
* @return reference | ||
**/ | ||
public String getReference() { | ||
return reference; | ||
} | ||
|
||
|
||
public void setReference(String reference) { | ||
this.reference = reference; | ||
} | ||
|
||
|
||
public CreatePaymentAmountUpdateRequest splits(List<Split> splits) { | ||
|
||
this.splits = splits; | ||
return this; | ||
} | ||
|
||
public CreatePaymentAmountUpdateRequest addSplitsItem(Split splitsItem) { | ||
if (this.splits == null) { | ||
this.splits = new ArrayList<Split>(); | ||
} | ||
this.splits.add(splitsItem); | ||
return this; | ||
} | ||
|
||
/** | ||
* An array of objects specifying how the amount should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/platforms/processing-payments#providing-split-information). | ||
* @return splits | ||
**/ | ||
public List<Split> getSplits() { | ||
return splits; | ||
} | ||
|
||
|
||
public void setSplits(List<Split> splits) { | ||
this.splits = splits; | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
CreatePaymentAmountUpdateRequest createPaymentAmountUpdateRequest = (CreatePaymentAmountUpdateRequest) o; | ||
return Objects.equals(this.amount, createPaymentAmountUpdateRequest.amount) && | ||
Objects.equals(this.merchantAccount, createPaymentAmountUpdateRequest.merchantAccount) && | ||
Objects.equals(this.reason, createPaymentAmountUpdateRequest.reason) && | ||
Objects.equals(this.reference, createPaymentAmountUpdateRequest.reference) && | ||
Objects.equals(this.splits, createPaymentAmountUpdateRequest.splits); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(amount, merchantAccount, reason, reference, splits); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class CreatePaymentAmountUpdateRequest {\n"); | ||
sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); | ||
sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); | ||
sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); | ||
sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); | ||
sb.append(" splits: ").append(toIndentedString(splits)).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 "); | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.