• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Adyen / adyen-java-api-library / #2775

30 Oct 2023 03:06PM CUT coverage: 12.824%. First build
#2775

push

web-flow
Merge 9921af673 into 891748f22

112 of 112 new or added lines in 12 files covered. (100.0%)

12346 of 96273 relevant lines covered (12.82%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 70
5
 * 
6
 *
7
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8
 * https://openapi-generator.tech
9
 * Do not edit the class manually.
10
 */
11

12

13
package com.adyen.model.checkout;
14

15
import java.util.Objects;
16
import java.util.Arrays;
17
import java.util.Map;
18
import java.util.HashMap;
19
import com.adyen.model.checkout.Amount;
20
import com.adyen.model.checkout.ApplicationInfo;
21
import com.adyen.model.checkout.LineItem;
22
import com.adyen.model.checkout.Split;
23
import com.fasterxml.jackson.annotation.JsonInclude;
24
import com.fasterxml.jackson.annotation.JsonProperty;
25
import com.fasterxml.jackson.annotation.JsonCreator;
26
import com.fasterxml.jackson.annotation.JsonTypeName;
27
import com.fasterxml.jackson.annotation.JsonValue;
28
import io.swagger.annotations.ApiModel;
29
import io.swagger.annotations.ApiModelProperty;
30
import java.util.ArrayList;
31
import java.util.List;
32
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
33
import com.fasterxml.jackson.core.JsonProcessingException;
34

35

36
/**
37
 * PaymentRefundRequest
38
 */
39
@JsonPropertyOrder({
40
  PaymentRefundRequest.JSON_PROPERTY_AMOUNT,
41
  PaymentRefundRequest.JSON_PROPERTY_APPLICATION_INFO,
42
  PaymentRefundRequest.JSON_PROPERTY_LINE_ITEMS,
43
  PaymentRefundRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
44
  PaymentRefundRequest.JSON_PROPERTY_MERCHANT_REFUND_REASON,
45
  PaymentRefundRequest.JSON_PROPERTY_REFERENCE,
46
  PaymentRefundRequest.JSON_PROPERTY_SPLITS
47
})
48

49
public class PaymentRefundRequest {
50
  public static final String JSON_PROPERTY_AMOUNT = "amount";
51
  private Amount amount;
52

53
  public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo";
54
  private ApplicationInfo applicationInfo;
55

56
  public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems";
57
  private List<LineItem> lineItems = null;
×
58

59
  public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
60
  private String merchantAccount;
61

62
  /**
63
   * Your reason for the refund request
64
   */
65
  public enum MerchantRefundReasonEnum {
×
66
    FRAUD("FRAUD"),
×
67
    
68
    CUSTOMER_REQUEST("CUSTOMER REQUEST"),
×
69
    
70
    RETURN("RETURN"),
×
71
    
72
    DUPLICATE("DUPLICATE"),
×
73
    
74
    OTHER("OTHER");
×
75

76
    private String value;
77

78
    MerchantRefundReasonEnum(String value) {
×
79
      this.value = value;
×
80
    }
×
81

82
    @JsonValue
83
    public String getValue() {
84
      return value;
×
85
    }
86

87
    @Override
88
    public String toString() {
89
      return String.valueOf(value);
×
90
    }
91

92
    @JsonCreator
93
    public static MerchantRefundReasonEnum fromValue(String value) {
94
      for (MerchantRefundReasonEnum b : MerchantRefundReasonEnum.values()) {
×
95
        if (b.value.equals(value)) {
×
96
          return b;
×
97
        }
98
      }
99
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
100
    }
101
  }
102

103
  public static final String JSON_PROPERTY_MERCHANT_REFUND_REASON = "merchantRefundReason";
104
  private MerchantRefundReasonEnum merchantRefundReason;
105

106
  public static final String JSON_PROPERTY_REFERENCE = "reference";
107
  private String reference;
108

109
  public static final String JSON_PROPERTY_SPLITS = "splits";
110
  private List<Split> splits = null;
×
111

112
  public PaymentRefundRequest() { 
×
113
  }
×
114

115
  public PaymentRefundRequest amount(Amount amount) {
116
    this.amount = amount;
×
117
    return this;
×
118
  }
119

120
   /**
121
   * Get amount
122
   * @return amount
123
  **/
124
  @ApiModelProperty(required = true, value = "")
125
  @JsonProperty(JSON_PROPERTY_AMOUNT)
126
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
127

128
  public Amount getAmount() {
129
    return amount;
×
130
  }
131

132

133
  @JsonProperty(JSON_PROPERTY_AMOUNT)
134
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
135
  public void setAmount(Amount amount) {
136
    this.amount = amount;
×
137
  }
×
138

139

140
  public PaymentRefundRequest applicationInfo(ApplicationInfo applicationInfo) {
141
    this.applicationInfo = applicationInfo;
×
142
    return this;
×
143
  }
144

145
   /**
146
   * Get applicationInfo
147
   * @return applicationInfo
148
  **/
149
  @ApiModelProperty(value = "")
150
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
151
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
152

153
  public ApplicationInfo getApplicationInfo() {
154
    return applicationInfo;
×
155
  }
156

157

158
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
159
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
160
  public void setApplicationInfo(ApplicationInfo applicationInfo) {
161
    this.applicationInfo = applicationInfo;
×
162
  }
×
163

164

165
  public PaymentRefundRequest lineItems(List<LineItem> lineItems) {
166
    this.lineItems = lineItems;
×
167
    return this;
×
168
  }
169

170
  public PaymentRefundRequest addLineItemsItem(LineItem lineItemsItem) {
171
    if (this.lineItems == null) {
×
172
      this.lineItems = new ArrayList<>();
×
173
    }
174
    this.lineItems.add(lineItemsItem);
×
175
    return this;
×
176
  }
177

178
   /**
179
   * Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). &gt; This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.
180
   * @return lineItems
181
  **/
182
  @ApiModelProperty(value = "Price and product information of the refunded items, required for [partial refunds](https://docs.adyen.com/online-payments/refund#refund-a-payment). > This field is required for partial refunds with 3x 4x Oney, Affirm, Afterpay, Atome, Clearpay, Klarna, Ratepay, Walley, and Zip.")
183
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
184
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
185

186
  public List<LineItem> getLineItems() {
187
    return lineItems;
×
188
  }
189

190

191
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
192
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
193
  public void setLineItems(List<LineItem> lineItems) {
194
    this.lineItems = lineItems;
×
195
  }
×
196

197

198
  public PaymentRefundRequest merchantAccount(String merchantAccount) {
199
    this.merchantAccount = merchantAccount;
×
200
    return this;
×
201
  }
202

203
   /**
204
   * The merchant account that is used to process the payment.
205
   * @return merchantAccount
206
  **/
207
  @ApiModelProperty(required = true, value = "The merchant account that is used to process the payment.")
208
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
209
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
210

211
  public String getMerchantAccount() {
212
    return merchantAccount;
×
213
  }
214

215

216
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
217
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
218
  public void setMerchantAccount(String merchantAccount) {
219
    this.merchantAccount = merchantAccount;
×
220
  }
×
221

222

223
  public PaymentRefundRequest merchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) {
224
    this.merchantRefundReason = merchantRefundReason;
×
225
    return this;
×
226
  }
227

228
   /**
229
   * Your reason for the refund request
230
   * @return merchantRefundReason
231
  **/
232
  @ApiModelProperty(value = "Your reason for the refund request")
233
  @JsonProperty(JSON_PROPERTY_MERCHANT_REFUND_REASON)
234
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
235

236
  public MerchantRefundReasonEnum getMerchantRefundReason() {
237
    return merchantRefundReason;
×
238
  }
239

240

241
  @JsonProperty(JSON_PROPERTY_MERCHANT_REFUND_REASON)
242
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
243
  public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) {
244
    this.merchantRefundReason = merchantRefundReason;
×
245
  }
×
246

247

248
  public PaymentRefundRequest reference(String reference) {
249
    this.reference = reference;
×
250
    return this;
×
251
  }
252

253
   /**
254
   * Your reference for the refund request. Maximum length: 80 characters.
255
   * @return reference
256
  **/
257
  @ApiModelProperty(value = "Your reference for the refund request. Maximum length: 80 characters.")
258
  @JsonProperty(JSON_PROPERTY_REFERENCE)
259
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
260

261
  public String getReference() {
262
    return reference;
×
263
  }
264

265

266
  @JsonProperty(JSON_PROPERTY_REFERENCE)
267
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
268
  public void setReference(String reference) {
269
    this.reference = reference;
×
270
  }
×
271

272

273
  public PaymentRefundRequest splits(List<Split> splits) {
274
    this.splits = splits;
×
275
    return this;
×
276
  }
277

278
  public PaymentRefundRequest addSplitsItem(Split splitsItem) {
279
    if (this.splits == null) {
×
280
      this.splits = new ArrayList<>();
×
281
    }
282
    this.splits.add(splitsItem);
×
283
    return this;
×
284
  }
285

286
   /**
287
   * 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/marketplaces-and-platforms/processing-payments#providing-split-information).
288
   * @return splits
289
  **/
290
  @ApiModelProperty(value = "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/marketplaces-and-platforms/processing-payments#providing-split-information).")
291
  @JsonProperty(JSON_PROPERTY_SPLITS)
292
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
293

294
  public List<Split> getSplits() {
295
    return splits;
×
296
  }
297

298

299
  @JsonProperty(JSON_PROPERTY_SPLITS)
300
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
301
  public void setSplits(List<Split> splits) {
302
    this.splits = splits;
×
303
  }
×
304

305

306
  /**
307
   * Return true if this PaymentRefundRequest object is equal to o.
308
   */
309
  @Override
310
  public boolean equals(Object o) {
311
    if (this == o) {
×
312
      return true;
×
313
    }
314
    if (o == null || getClass() != o.getClass()) {
×
315
      return false;
×
316
    }
317
    PaymentRefundRequest paymentRefundRequest = (PaymentRefundRequest) o;
×
318
    return Objects.equals(this.amount, paymentRefundRequest.amount) &&
×
319
        Objects.equals(this.applicationInfo, paymentRefundRequest.applicationInfo) &&
×
320
        Objects.equals(this.lineItems, paymentRefundRequest.lineItems) &&
×
321
        Objects.equals(this.merchantAccount, paymentRefundRequest.merchantAccount) &&
×
322
        Objects.equals(this.merchantRefundReason, paymentRefundRequest.merchantRefundReason) &&
×
323
        Objects.equals(this.reference, paymentRefundRequest.reference) &&
×
324
        Objects.equals(this.splits, paymentRefundRequest.splits);
×
325
  }
326

327
  @Override
328
  public int hashCode() {
329
    return Objects.hash(amount, applicationInfo, lineItems, merchantAccount, merchantRefundReason, reference, splits);
×
330
  }
331

332
  @Override
333
  public String toString() {
334
    StringBuilder sb = new StringBuilder();
×
335
    sb.append("class PaymentRefundRequest {\n");
×
336
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
337
    sb.append("    applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n");
×
338
    sb.append("    lineItems: ").append(toIndentedString(lineItems)).append("\n");
×
339
    sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
×
340
    sb.append("    merchantRefundReason: ").append(toIndentedString(merchantRefundReason)).append("\n");
×
341
    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
×
342
    sb.append("    splits: ").append(toIndentedString(splits)).append("\n");
×
343
    sb.append("}");
×
344
    return sb.toString();
×
345
  }
346

347
  /**
348
   * Convert the given object to string with each line indented by 4 spaces
349
   * (except the first line).
350
   */
351
  private String toIndentedString(Object o) {
352
    if (o == null) {
×
353
      return "null";
×
354
    }
355
    return o.toString().replace("\n", "\n    ");
×
356
  }
357

358
/**
359
   * Create an instance of PaymentRefundRequest given an JSON string
360
   *
361
   * @param jsonString JSON string
362
   * @return An instance of PaymentRefundRequest
363
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentRefundRequest
364
   */
365
  public static PaymentRefundRequest fromJson(String jsonString) throws JsonProcessingException {
366
    return JSON.getMapper().readValue(jsonString, PaymentRefundRequest.class);
×
367
  }
368
/**
369
  * Convert an instance of PaymentRefundRequest to an JSON string
370
  *
371
  * @return JSON string
372
  */
373
  public String toJson() throws JsonProcessingException {
374
    return JSON.getMapper().writeValueAsString(this);
×
375
  }
376
}
377

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc