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

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

08 Dec 2023 12:05PM UTC coverage: 12.838%. First build
#2905

push

web-flow
Merge caa3554a7 into ec0c20882

1 of 151 new or added lines in 12 files covered. (0.66%)

12463 of 97080 relevant lines covered (12.84%)

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/PaymentRefundResponse.java
1
/*
2
 * Adyen Checkout API
3
 *
4
 * The version of the OpenAPI document: 71
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.LineItem;
21
import com.adyen.model.checkout.Split;
22
import com.fasterxml.jackson.annotation.JsonInclude;
23
import com.fasterxml.jackson.annotation.JsonProperty;
24
import com.fasterxml.jackson.annotation.JsonCreator;
25
import com.fasterxml.jackson.annotation.JsonTypeName;
26
import com.fasterxml.jackson.annotation.JsonValue;
27
import io.swagger.annotations.ApiModel;
28
import io.swagger.annotations.ApiModelProperty;
29
import java.util.ArrayList;
30
import java.util.List;
31
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
32
import com.fasterxml.jackson.core.JsonProcessingException;
33

34

35
/**
36
 * PaymentRefundResponse
37
 */
38
@JsonPropertyOrder({
39
  PaymentRefundResponse.JSON_PROPERTY_AMOUNT,
40
  PaymentRefundResponse.JSON_PROPERTY_LINE_ITEMS,
41
  PaymentRefundResponse.JSON_PROPERTY_MERCHANT_ACCOUNT,
42
  PaymentRefundResponse.JSON_PROPERTY_MERCHANT_REFUND_REASON,
43
  PaymentRefundResponse.JSON_PROPERTY_PAYMENT_PSP_REFERENCE,
44
  PaymentRefundResponse.JSON_PROPERTY_PSP_REFERENCE,
45
  PaymentRefundResponse.JSON_PROPERTY_REFERENCE,
46
  PaymentRefundResponse.JSON_PROPERTY_SPLITS,
47
  PaymentRefundResponse.JSON_PROPERTY_STATUS,
48
  PaymentRefundResponse.JSON_PROPERTY_STORE
49
})
50

51
public class PaymentRefundResponse {
52
  public static final String JSON_PROPERTY_AMOUNT = "amount";
53
  private Amount amount;
54

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

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

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

75
    private String value;
76

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

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

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

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

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

105
  public static final String JSON_PROPERTY_PAYMENT_PSP_REFERENCE = "paymentPspReference";
106
  private String paymentPspReference;
107

108
  public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference";
109
  private String pspReference;
110

111
  public static final String JSON_PROPERTY_REFERENCE = "reference";
112
  private String reference;
113

114
  public static final String JSON_PROPERTY_SPLITS = "splits";
115
  private List<Split> splits = null;
×
116

117
  /**
118
   * The status of your request. This will always have the value **received**.
119
   */
120
  public enum StatusEnum {
×
121
    RECEIVED("received");
×
122

123
    private String value;
124

125
    StatusEnum(String value) {
×
126
      this.value = value;
×
127
    }
×
128

129
    @JsonValue
130
    public String getValue() {
131
      return value;
×
132
    }
133

134
    @Override
135
    public String toString() {
136
      return String.valueOf(value);
×
137
    }
138

139
    @JsonCreator
140
    public static StatusEnum fromValue(String value) {
141
      for (StatusEnum b : StatusEnum.values()) {
×
142
        if (b.value.equals(value)) {
×
143
          return b;
×
144
        }
145
      }
146
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
147
    }
148
  }
149

150
  public static final String JSON_PROPERTY_STATUS = "status";
151
  private StatusEnum status;
152

153
  public static final String JSON_PROPERTY_STORE = "store";
154
  private String store;
155

156
  public PaymentRefundResponse() { 
×
157
  }
×
158

159
  public PaymentRefundResponse amount(Amount amount) {
160
    this.amount = amount;
×
161
    return this;
×
162
  }
163

164
   /**
165
   * Get amount
166
   * @return amount
167
  **/
168
  @ApiModelProperty(required = true, value = "")
169
  @JsonProperty(JSON_PROPERTY_AMOUNT)
170
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
171

172
  public Amount getAmount() {
173
    return amount;
×
174
  }
175

176

177
  @JsonProperty(JSON_PROPERTY_AMOUNT)
178
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
179
  public void setAmount(Amount amount) {
180
    this.amount = amount;
×
181
  }
×
182

183

184
  public PaymentRefundResponse lineItems(List<LineItem> lineItems) {
185
    this.lineItems = lineItems;
×
186
    return this;
×
187
  }
188

189
  public PaymentRefundResponse addLineItemsItem(LineItem lineItemsItem) {
190
    if (this.lineItems == null) {
×
191
      this.lineItems = new ArrayList<>();
×
192
    }
193
    this.lineItems.add(lineItemsItem);
×
194
    return this;
×
195
  }
196

197
   /**
198
   * 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.
199
   * @return lineItems
200
  **/
201
  @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.")
202
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
203
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
204

205
  public List<LineItem> getLineItems() {
206
    return lineItems;
×
207
  }
208

209

210
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
211
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
212
  public void setLineItems(List<LineItem> lineItems) {
213
    this.lineItems = lineItems;
×
214
  }
×
215

216

217
  public PaymentRefundResponse merchantAccount(String merchantAccount) {
218
    this.merchantAccount = merchantAccount;
×
219
    return this;
×
220
  }
221

222
   /**
223
   * The merchant account that is used to process the payment.
224
   * @return merchantAccount
225
  **/
226
  @ApiModelProperty(required = true, value = "The merchant account that is used to process the payment.")
227
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
228
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
229

230
  public String getMerchantAccount() {
231
    return merchantAccount;
×
232
  }
233

234

235
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
236
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
237
  public void setMerchantAccount(String merchantAccount) {
238
    this.merchantAccount = merchantAccount;
×
239
  }
×
240

241

242
  public PaymentRefundResponse merchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) {
243
    this.merchantRefundReason = merchantRefundReason;
×
244
    return this;
×
245
  }
246

247
   /**
248
   * Your reason for the refund request.
249
   * @return merchantRefundReason
250
  **/
251
  @ApiModelProperty(value = "Your reason for the refund request.")
252
  @JsonProperty(JSON_PROPERTY_MERCHANT_REFUND_REASON)
253
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
254

255
  public MerchantRefundReasonEnum getMerchantRefundReason() {
256
    return merchantRefundReason;
×
257
  }
258

259

260
  @JsonProperty(JSON_PROPERTY_MERCHANT_REFUND_REASON)
261
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
262
  public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) {
263
    this.merchantRefundReason = merchantRefundReason;
×
264
  }
×
265

266

267
  public PaymentRefundResponse paymentPspReference(String paymentPspReference) {
268
    this.paymentPspReference = paymentPspReference;
×
269
    return this;
×
270
  }
271

272
   /**
273
   * The [&#x60;pspReference&#x60;](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. 
274
   * @return paymentPspReference
275
  **/
276
  @ApiModelProperty(required = true, value = "The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment to refund. ")
277
  @JsonProperty(JSON_PROPERTY_PAYMENT_PSP_REFERENCE)
278
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
279

280
  public String getPaymentPspReference() {
281
    return paymentPspReference;
×
282
  }
283

284

285
  @JsonProperty(JSON_PROPERTY_PAYMENT_PSP_REFERENCE)
286
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
287
  public void setPaymentPspReference(String paymentPspReference) {
288
    this.paymentPspReference = paymentPspReference;
×
289
  }
×
290

291

292
  public PaymentRefundResponse pspReference(String pspReference) {
293
    this.pspReference = pspReference;
×
294
    return this;
×
295
  }
296

297
   /**
298
   * Adyen&#39;s 16-character reference associated with the refund request.
299
   * @return pspReference
300
  **/
301
  @ApiModelProperty(required = true, value = "Adyen's 16-character reference associated with the refund request.")
302
  @JsonProperty(JSON_PROPERTY_PSP_REFERENCE)
303
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
304

305
  public String getPspReference() {
306
    return pspReference;
×
307
  }
308

309

310
  @JsonProperty(JSON_PROPERTY_PSP_REFERENCE)
311
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
312
  public void setPspReference(String pspReference) {
313
    this.pspReference = pspReference;
×
314
  }
×
315

316

317
  public PaymentRefundResponse reference(String reference) {
318
    this.reference = reference;
×
319
    return this;
×
320
  }
321

322
   /**
323
   * Your reference for the refund request.
324
   * @return reference
325
  **/
326
  @ApiModelProperty(value = "Your reference for the refund request.")
327
  @JsonProperty(JSON_PROPERTY_REFERENCE)
328
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
329

330
  public String getReference() {
331
    return reference;
×
332
  }
333

334

335
  @JsonProperty(JSON_PROPERTY_REFERENCE)
336
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
337
  public void setReference(String reference) {
338
    this.reference = reference;
×
339
  }
×
340

341

342
  public PaymentRefundResponse splits(List<Split> splits) {
343
    this.splits = splits;
×
344
    return this;
×
345
  }
346

347
  public PaymentRefundResponse addSplitsItem(Split splitsItem) {
348
    if (this.splits == null) {
×
349
      this.splits = new ArrayList<>();
×
350
    }
351
    this.splits.add(splitsItem);
×
352
    return this;
×
353
  }
354

355
   /**
356
   * 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).
357
   * @return splits
358
  **/
359
  @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).")
360
  @JsonProperty(JSON_PROPERTY_SPLITS)
361
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
362

363
  public List<Split> getSplits() {
364
    return splits;
×
365
  }
366

367

368
  @JsonProperty(JSON_PROPERTY_SPLITS)
369
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
370
  public void setSplits(List<Split> splits) {
371
    this.splits = splits;
×
372
  }
×
373

374

375
  public PaymentRefundResponse status(StatusEnum status) {
376
    this.status = status;
×
377
    return this;
×
378
  }
379

380
   /**
381
   * The status of your request. This will always have the value **received**.
382
   * @return status
383
  **/
384
  @ApiModelProperty(required = true, value = "The status of your request. This will always have the value **received**.")
385
  @JsonProperty(JSON_PROPERTY_STATUS)
386
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
387

388
  public StatusEnum getStatus() {
389
    return status;
×
390
  }
391

392

393
  @JsonProperty(JSON_PROPERTY_STATUS)
394
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
395
  public void setStatus(StatusEnum status) {
396
    this.status = status;
×
397
  }
×
398

399

400
  public PaymentRefundResponse store(String store) {
NEW
401
    this.store = store;
×
NEW
402
    return this;
×
403
  }
404

405
   /**
406
   * The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area.  Otherwise, you get an error and the refund fails.
407
   * @return store
408
  **/
409
  @ApiModelProperty(value = "The online store or [physical store](https://docs.adyen.com/point-of-sale/design-your-integration/determine-account-structure/#create-stores) that is processing the refund. This must be the same as the store name configured in your Customer Area.  Otherwise, you get an error and the refund fails.")
410
  @JsonProperty(JSON_PROPERTY_STORE)
411
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
412

413
  public String getStore() {
NEW
414
    return store;
×
415
  }
416

417

418
  @JsonProperty(JSON_PROPERTY_STORE)
419
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
420
  public void setStore(String store) {
NEW
421
    this.store = store;
×
NEW
422
  }
×
423

424

425
  /**
426
   * Return true if this PaymentRefundResponse object is equal to o.
427
   */
428
  @Override
429
  public boolean equals(Object o) {
430
    if (this == o) {
×
431
      return true;
×
432
    }
433
    if (o == null || getClass() != o.getClass()) {
×
434
      return false;
×
435
    }
436
    PaymentRefundResponse paymentRefundResponse = (PaymentRefundResponse) o;
×
437
    return Objects.equals(this.amount, paymentRefundResponse.amount) &&
×
438
        Objects.equals(this.lineItems, paymentRefundResponse.lineItems) &&
×
439
        Objects.equals(this.merchantAccount, paymentRefundResponse.merchantAccount) &&
×
440
        Objects.equals(this.merchantRefundReason, paymentRefundResponse.merchantRefundReason) &&
×
441
        Objects.equals(this.paymentPspReference, paymentRefundResponse.paymentPspReference) &&
×
442
        Objects.equals(this.pspReference, paymentRefundResponse.pspReference) &&
×
443
        Objects.equals(this.reference, paymentRefundResponse.reference) &&
×
444
        Objects.equals(this.splits, paymentRefundResponse.splits) &&
×
NEW
445
        Objects.equals(this.status, paymentRefundResponse.status) &&
×
NEW
446
        Objects.equals(this.store, paymentRefundResponse.store);
×
447
  }
448

449
  @Override
450
  public int hashCode() {
NEW
451
    return Objects.hash(amount, lineItems, merchantAccount, merchantRefundReason, paymentPspReference, pspReference, reference, splits, status, store);
×
452
  }
453

454
  @Override
455
  public String toString() {
456
    StringBuilder sb = new StringBuilder();
×
457
    sb.append("class PaymentRefundResponse {\n");
×
458
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
459
    sb.append("    lineItems: ").append(toIndentedString(lineItems)).append("\n");
×
460
    sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
×
461
    sb.append("    merchantRefundReason: ").append(toIndentedString(merchantRefundReason)).append("\n");
×
462
    sb.append("    paymentPspReference: ").append(toIndentedString(paymentPspReference)).append("\n");
×
463
    sb.append("    pspReference: ").append(toIndentedString(pspReference)).append("\n");
×
464
    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
×
465
    sb.append("    splits: ").append(toIndentedString(splits)).append("\n");
×
466
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
×
NEW
467
    sb.append("    store: ").append(toIndentedString(store)).append("\n");
×
468
    sb.append("}");
×
469
    return sb.toString();
×
470
  }
471

472
  /**
473
   * Convert the given object to string with each line indented by 4 spaces
474
   * (except the first line).
475
   */
476
  private String toIndentedString(Object o) {
477
    if (o == null) {
×
478
      return "null";
×
479
    }
480
    return o.toString().replace("\n", "\n    ");
×
481
  }
482

483
/**
484
   * Create an instance of PaymentRefundResponse given an JSON string
485
   *
486
   * @param jsonString JSON string
487
   * @return An instance of PaymentRefundResponse
488
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentRefundResponse
489
   */
490
  public static PaymentRefundResponse fromJson(String jsonString) throws JsonProcessingException {
491
    return JSON.getMapper().readValue(jsonString, PaymentRefundResponse.class);
×
492
  }
493
/**
494
  * Convert an instance of PaymentRefundResponse to an JSON string
495
  *
496
  * @return JSON string
497
  */
498
  public String toJson() throws JsonProcessingException {
499
    return JSON.getMapper().writeValueAsString(this);
×
500
  }
501
}
502

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