• 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/PaymentRefundRequest.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.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
  PaymentRefundRequest.JSON_PROPERTY_STORE
48
})
49

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

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

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

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

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

77
    private String value;
78

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

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

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

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

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

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

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

113
  public static final String JSON_PROPERTY_STORE = "store";
114
  private String store;
115

116
  public PaymentRefundRequest() { 
×
117
  }
×
118

119
  public PaymentRefundRequest amount(Amount amount) {
120
    this.amount = amount;
×
121
    return this;
×
122
  }
123

124
   /**
125
   * Get amount
126
   * @return amount
127
  **/
128
  @ApiModelProperty(required = true, value = "")
129
  @JsonProperty(JSON_PROPERTY_AMOUNT)
130
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
131

132
  public Amount getAmount() {
133
    return amount;
×
134
  }
135

136

137
  @JsonProperty(JSON_PROPERTY_AMOUNT)
138
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
139
  public void setAmount(Amount amount) {
140
    this.amount = amount;
×
141
  }
×
142

143

144
  public PaymentRefundRequest applicationInfo(ApplicationInfo applicationInfo) {
145
    this.applicationInfo = applicationInfo;
×
146
    return this;
×
147
  }
148

149
   /**
150
   * Get applicationInfo
151
   * @return applicationInfo
152
  **/
153
  @ApiModelProperty(value = "")
154
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
155
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
156

157
  public ApplicationInfo getApplicationInfo() {
158
    return applicationInfo;
×
159
  }
160

161

162
  @JsonProperty(JSON_PROPERTY_APPLICATION_INFO)
163
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
164
  public void setApplicationInfo(ApplicationInfo applicationInfo) {
165
    this.applicationInfo = applicationInfo;
×
166
  }
×
167

168

169
  public PaymentRefundRequest lineItems(List<LineItem> lineItems) {
170
    this.lineItems = lineItems;
×
171
    return this;
×
172
  }
173

174
  public PaymentRefundRequest addLineItemsItem(LineItem lineItemsItem) {
175
    if (this.lineItems == null) {
×
176
      this.lineItems = new ArrayList<>();
×
177
    }
178
    this.lineItems.add(lineItemsItem);
×
179
    return this;
×
180
  }
181

182
   /**
183
   * 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.
184
   * @return lineItems
185
  **/
186
  @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.")
187
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
188
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
189

190
  public List<LineItem> getLineItems() {
191
    return lineItems;
×
192
  }
193

194

195
  @JsonProperty(JSON_PROPERTY_LINE_ITEMS)
196
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
197
  public void setLineItems(List<LineItem> lineItems) {
198
    this.lineItems = lineItems;
×
199
  }
×
200

201

202
  public PaymentRefundRequest merchantAccount(String merchantAccount) {
203
    this.merchantAccount = merchantAccount;
×
204
    return this;
×
205
  }
206

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

215
  public String getMerchantAccount() {
216
    return merchantAccount;
×
217
  }
218

219

220
  @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
221
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
222
  public void setMerchantAccount(String merchantAccount) {
223
    this.merchantAccount = merchantAccount;
×
224
  }
×
225

226

227
  public PaymentRefundRequest merchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) {
228
    this.merchantRefundReason = merchantRefundReason;
×
229
    return this;
×
230
  }
231

232
   /**
233
   * Your reason for the refund request
234
   * @return merchantRefundReason
235
  **/
236
  @ApiModelProperty(value = "Your reason for the refund request")
237
  @JsonProperty(JSON_PROPERTY_MERCHANT_REFUND_REASON)
238
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
239

240
  public MerchantRefundReasonEnum getMerchantRefundReason() {
241
    return merchantRefundReason;
×
242
  }
243

244

245
  @JsonProperty(JSON_PROPERTY_MERCHANT_REFUND_REASON)
246
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
247
  public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) {
248
    this.merchantRefundReason = merchantRefundReason;
×
249
  }
×
250

251

252
  public PaymentRefundRequest reference(String reference) {
253
    this.reference = reference;
×
254
    return this;
×
255
  }
256

257
   /**
258
   * Your reference for the refund request. Maximum length: 80 characters.
259
   * @return reference
260
  **/
261
  @ApiModelProperty(value = "Your reference for the refund request. Maximum length: 80 characters.")
262
  @JsonProperty(JSON_PROPERTY_REFERENCE)
263
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
264

265
  public String getReference() {
266
    return reference;
×
267
  }
268

269

270
  @JsonProperty(JSON_PROPERTY_REFERENCE)
271
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
272
  public void setReference(String reference) {
273
    this.reference = reference;
×
274
  }
×
275

276

277
  public PaymentRefundRequest splits(List<Split> splits) {
278
    this.splits = splits;
×
279
    return this;
×
280
  }
281

282
  public PaymentRefundRequest addSplitsItem(Split splitsItem) {
283
    if (this.splits == null) {
×
284
      this.splits = new ArrayList<>();
×
285
    }
286
    this.splits.add(splitsItem);
×
287
    return this;
×
288
  }
289

290
   /**
291
   * 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).
292
   * @return splits
293
  **/
294
  @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).")
295
  @JsonProperty(JSON_PROPERTY_SPLITS)
296
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
297

298
  public List<Split> getSplits() {
299
    return splits;
×
300
  }
301

302

303
  @JsonProperty(JSON_PROPERTY_SPLITS)
304
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
305
  public void setSplits(List<Split> splits) {
306
    this.splits = splits;
×
307
  }
×
308

309

310
  public PaymentRefundRequest store(String store) {
NEW
311
    this.store = store;
×
NEW
312
    return this;
×
313
  }
314

315
   /**
316
   * 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.
317
   * @return store
318
  **/
319
  @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.")
320
  @JsonProperty(JSON_PROPERTY_STORE)
321
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
322

323
  public String getStore() {
NEW
324
    return store;
×
325
  }
326

327

328
  @JsonProperty(JSON_PROPERTY_STORE)
329
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
330
  public void setStore(String store) {
NEW
331
    this.store = store;
×
NEW
332
  }
×
333

334

335
  /**
336
   * Return true if this PaymentRefundRequest object is equal to o.
337
   */
338
  @Override
339
  public boolean equals(Object o) {
340
    if (this == o) {
×
341
      return true;
×
342
    }
343
    if (o == null || getClass() != o.getClass()) {
×
344
      return false;
×
345
    }
346
    PaymentRefundRequest paymentRefundRequest = (PaymentRefundRequest) o;
×
347
    return Objects.equals(this.amount, paymentRefundRequest.amount) &&
×
348
        Objects.equals(this.applicationInfo, paymentRefundRequest.applicationInfo) &&
×
349
        Objects.equals(this.lineItems, paymentRefundRequest.lineItems) &&
×
350
        Objects.equals(this.merchantAccount, paymentRefundRequest.merchantAccount) &&
×
351
        Objects.equals(this.merchantRefundReason, paymentRefundRequest.merchantRefundReason) &&
×
352
        Objects.equals(this.reference, paymentRefundRequest.reference) &&
×
NEW
353
        Objects.equals(this.splits, paymentRefundRequest.splits) &&
×
NEW
354
        Objects.equals(this.store, paymentRefundRequest.store);
×
355
  }
356

357
  @Override
358
  public int hashCode() {
NEW
359
    return Objects.hash(amount, applicationInfo, lineItems, merchantAccount, merchantRefundReason, reference, splits, store);
×
360
  }
361

362
  @Override
363
  public String toString() {
364
    StringBuilder sb = new StringBuilder();
×
365
    sb.append("class PaymentRefundRequest {\n");
×
366
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
×
367
    sb.append("    applicationInfo: ").append(toIndentedString(applicationInfo)).append("\n");
×
368
    sb.append("    lineItems: ").append(toIndentedString(lineItems)).append("\n");
×
369
    sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
×
370
    sb.append("    merchantRefundReason: ").append(toIndentedString(merchantRefundReason)).append("\n");
×
371
    sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
×
372
    sb.append("    splits: ").append(toIndentedString(splits)).append("\n");
×
NEW
373
    sb.append("    store: ").append(toIndentedString(store)).append("\n");
×
374
    sb.append("}");
×
375
    return sb.toString();
×
376
  }
377

378
  /**
379
   * Convert the given object to string with each line indented by 4 spaces
380
   * (except the first line).
381
   */
382
  private String toIndentedString(Object o) {
383
    if (o == null) {
×
384
      return "null";
×
385
    }
386
    return o.toString().replace("\n", "\n    ");
×
387
  }
388

389
/**
390
   * Create an instance of PaymentRefundRequest given an JSON string
391
   *
392
   * @param jsonString JSON string
393
   * @return An instance of PaymentRefundRequest
394
   * @throws JsonProcessingException if the JSON string is invalid with respect to PaymentRefundRequest
395
   */
396
  public static PaymentRefundRequest fromJson(String jsonString) throws JsonProcessingException {
397
    return JSON.getMapper().readValue(jsonString, PaymentRefundRequest.class);
×
398
  }
399
/**
400
  * Convert an instance of PaymentRefundRequest to an JSON string
401
  *
402
  * @return JSON string
403
  */
404
  public String toJson() throws JsonProcessingException {
405
    return JSON.getMapper().writeValueAsString(this);
×
406
  }
407
}
408

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