-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathCheckoutForwardRequest.java
More file actions
564 lines (506 loc) · 19.8 KB
/
CheckoutForwardRequest.java
File metadata and controls
564 lines (506 loc) · 19.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
/*
* Adyen Checkout API
*
* The version of the OpenAPI document: 71
*
*
* 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.checkout;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
/** CheckoutForwardRequest */
@JsonPropertyOrder({
CheckoutForwardRequest.JSON_PROPERTY_BASE_URL,
CheckoutForwardRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
CheckoutForwardRequest.JSON_PROPERTY_MERCHANT_REFERENCE,
CheckoutForwardRequest.JSON_PROPERTY_OPTIONS,
CheckoutForwardRequest.JSON_PROPERTY_PAYMENT_METHOD,
CheckoutForwardRequest.JSON_PROPERTY_REQUEST,
CheckoutForwardRequest.JSON_PROPERTY_SHOPPER_REFERENCE,
CheckoutForwardRequest.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID
})
public class CheckoutForwardRequest {
public static final String JSON_PROPERTY_BASE_URL = "baseUrl";
private String baseUrl;
/** Mark when the attribute has been explicitly set. */
private boolean isSetBaseUrl = false;
public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount";
private String merchantAccount;
/** Mark when the attribute has been explicitly set. */
private boolean isSetMerchantAccount = false;
public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference";
private String merchantReference;
/** Mark when the attribute has been explicitly set. */
private boolean isSetMerchantReference = false;
public static final String JSON_PROPERTY_OPTIONS = "options";
private CheckoutForwardRequestOptions options;
/** Mark when the attribute has been explicitly set. */
private boolean isSetOptions = false;
public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod";
private CheckoutForwardRequestCard paymentMethod;
/** Mark when the attribute has been explicitly set. */
private boolean isSetPaymentMethod = false;
public static final String JSON_PROPERTY_REQUEST = "request";
private CheckoutOutgoingForwardRequest request;
/** Mark when the attribute has been explicitly set. */
private boolean isSetRequest = false;
public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference";
private String shopperReference;
/** Mark when the attribute has been explicitly set. */
private boolean isSetShopperReference = false;
public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId";
private String storedPaymentMethodId;
/** Mark when the attribute has been explicitly set. */
private boolean isSetStoredPaymentMethodId = false;
/**
* Sets whether attributes with null values should be explicitly included in the JSON payload.
* Default is false.
*/
@JsonIgnore private boolean includeNullValues = false;
public CheckoutForwardRequest() {}
/**
* The base URL of the third party API, where Adyen will send the request to forward the payment
* details.
*
* @param baseUrl The base URL of the third party API, where Adyen will send the request to
* forward the payment details.
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest baseUrl(String baseUrl) {
this.baseUrl = baseUrl;
isSetBaseUrl = true; // mark as set
return this;
}
/**
* The base URL of the third party API, where Adyen will send the request to forward the payment
* details.
*
* @return baseUrl The base URL of the third party API, where Adyen will send the request to
* forward the payment details.
*/
@JsonProperty(JSON_PROPERTY_BASE_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getBaseUrl() {
return baseUrl;
}
/**
* The base URL of the third party API, where Adyen will send the request to forward the payment
* details.
*
* @param baseUrl The base URL of the third party API, where Adyen will send the request to
* forward the payment details.
*/
@JsonProperty(JSON_PROPERTY_BASE_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
isSetBaseUrl = true; // mark as set
}
/**
* Your merchant account.
*
* @param merchantAccount Your merchant account.
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest merchantAccount(String merchantAccount) {
this.merchantAccount = merchantAccount;
isSetMerchantAccount = true; // mark as set
return this;
}
/**
* Your merchant account.
*
* @return merchantAccount Your merchant account.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getMerchantAccount() {
return merchantAccount;
}
/**
* Your merchant account.
*
* @param merchantAccount Your merchant account.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMerchantAccount(String merchantAccount) {
this.merchantAccount = merchantAccount;
isSetMerchantAccount = true; // mark as set
}
/**
* Merchant defined payment reference.
*
* @param merchantReference Merchant defined payment reference.
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest merchantReference(String merchantReference) {
this.merchantReference = merchantReference;
isSetMerchantReference = true; // mark as set
return this;
}
/**
* Merchant defined payment reference.
*
* @return merchantReference Merchant defined payment reference.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getMerchantReference() {
return merchantReference;
}
/**
* Merchant defined payment reference.
*
* @param merchantReference Merchant defined payment reference.
*/
@JsonProperty(JSON_PROPERTY_MERCHANT_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMerchantReference(String merchantReference) {
this.merchantReference = merchantReference;
isSetMerchantReference = true; // mark as set
}
/**
* options
*
* @param options
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest options(CheckoutForwardRequestOptions options) {
this.options = options;
isSetOptions = true; // mark as set
return this;
}
/**
* Get options
*
* @return options
*/
@JsonProperty(JSON_PROPERTY_OPTIONS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CheckoutForwardRequestOptions getOptions() {
return options;
}
/**
* options
*
* @param options
*/
@JsonProperty(JSON_PROPERTY_OPTIONS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setOptions(CheckoutForwardRequestOptions options) {
this.options = options;
isSetOptions = true; // mark as set
}
/**
* paymentMethod
*
* @param paymentMethod
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest paymentMethod(CheckoutForwardRequestCard paymentMethod) {
this.paymentMethod = paymentMethod;
isSetPaymentMethod = true; // mark as set
return this;
}
/**
* Get paymentMethod
*
* @return paymentMethod
*/
@JsonProperty(JSON_PROPERTY_PAYMENT_METHOD)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CheckoutForwardRequestCard getPaymentMethod() {
return paymentMethod;
}
/**
* paymentMethod
*
* @param paymentMethod
*/
@JsonProperty(JSON_PROPERTY_PAYMENT_METHOD)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPaymentMethod(CheckoutForwardRequestCard paymentMethod) {
this.paymentMethod = paymentMethod;
isSetPaymentMethod = true; // mark as set
}
/**
* request
*
* @param request
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest request(CheckoutOutgoingForwardRequest request) {
this.request = request;
isSetRequest = true; // mark as set
return this;
}
/**
* Get request
*
* @return request
*/
@JsonProperty(JSON_PROPERTY_REQUEST)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CheckoutOutgoingForwardRequest getRequest() {
return request;
}
/**
* request
*
* @param request
*/
@JsonProperty(JSON_PROPERTY_REQUEST)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setRequest(CheckoutOutgoingForwardRequest request) {
this.request = request;
isSetRequest = true; // mark as set
}
/**
* Your reference to uniquely identify this shopper, for example user ID or account ID. The value
* is case-sensitive and must be at least three characters. > Your reference must not include
* personally identifiable information (PII) such as name or email address.
*
* @param shopperReference Your reference to uniquely identify this shopper, for example user ID
* or account ID. The value is case-sensitive and must be at least three characters. > Your
* reference must not include personally identifiable information (PII) such as name or email
* address.
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest shopperReference(String shopperReference) {
this.shopperReference = shopperReference;
isSetShopperReference = true; // mark as set
return this;
}
/**
* Your reference to uniquely identify this shopper, for example user ID or account ID. The value
* is case-sensitive and must be at least three characters. > Your reference must not include
* personally identifiable information (PII) such as name or email address.
*
* @return shopperReference Your reference to uniquely identify this shopper, for example user ID
* or account ID. The value is case-sensitive and must be at least three characters. > Your
* reference must not include personally identifiable information (PII) such as name or email
* address.
*/
@JsonProperty(JSON_PROPERTY_SHOPPER_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getShopperReference() {
return shopperReference;
}
/**
* Your reference to uniquely identify this shopper, for example user ID or account ID. The value
* is case-sensitive and must be at least three characters. > Your reference must not include
* personally identifiable information (PII) such as name or email address.
*
* @param shopperReference Your reference to uniquely identify this shopper, for example user ID
* or account ID. The value is case-sensitive and must be at least three characters. > Your
* reference must not include personally identifiable information (PII) such as name or email
* address.
*/
@JsonProperty(JSON_PROPERTY_SHOPPER_REFERENCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setShopperReference(String shopperReference) {
this.shopperReference = shopperReference;
isSetShopperReference = true; // mark as set
}
/**
* The unique identifier of the token that you want to forward to the third party. This is the
* `storedPaymentMethodId` you received in the webhook after you created the token.
*
* @param storedPaymentMethodId The unique identifier of the token that you want to forward to the
* third party. This is the `storedPaymentMethodId` you received in the webhook
* after you created the token.
* @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining
*/
public CheckoutForwardRequest storedPaymentMethodId(String storedPaymentMethodId) {
this.storedPaymentMethodId = storedPaymentMethodId;
isSetStoredPaymentMethodId = true; // mark as set
return this;
}
/**
* The unique identifier of the token that you want to forward to the third party. This is the
* `storedPaymentMethodId` you received in the webhook after you created the token.
*
* @return storedPaymentMethodId The unique identifier of the token that you want to forward to
* the third party. This is the `storedPaymentMethodId` you received in the webhook
* after you created the token.
*/
@JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getStoredPaymentMethodId() {
return storedPaymentMethodId;
}
/**
* The unique identifier of the token that you want to forward to the third party. This is the
* `storedPaymentMethodId` you received in the webhook after you created the token.
*
* @param storedPaymentMethodId The unique identifier of the token that you want to forward to the
* third party. This is the `storedPaymentMethodId` you received in the webhook
* after you created the token.
*/
@JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStoredPaymentMethodId(String storedPaymentMethodId) {
this.storedPaymentMethodId = storedPaymentMethodId;
isSetStoredPaymentMethodId = true; // mark as set
}
/**
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
*/
public CheckoutForwardRequest includeNullValues(boolean includeNullValues) {
this.includeNullValues = includeNullValues;
return this;
}
/** Returns whether null values are explicitly serialized in the JSON payload. */
public boolean isIncludeNullValues() {
return includeNullValues;
}
/**
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
*/
public void setIncludeNullValues(boolean includeNullValues) {
this.includeNullValues = includeNullValues;
}
/** Return true if this CheckoutForwardRequest object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CheckoutForwardRequest checkoutForwardRequest = (CheckoutForwardRequest) o;
return Objects.equals(this.baseUrl, checkoutForwardRequest.baseUrl)
&& Objects.equals(this.isSetBaseUrl, checkoutForwardRequest.isSetBaseUrl)
&& Objects.equals(this.merchantAccount, checkoutForwardRequest.merchantAccount)
&& Objects.equals(this.isSetMerchantAccount, checkoutForwardRequest.isSetMerchantAccount)
&& Objects.equals(this.merchantReference, checkoutForwardRequest.merchantReference)
&& Objects.equals(
this.isSetMerchantReference, checkoutForwardRequest.isSetMerchantReference)
&& Objects.equals(this.options, checkoutForwardRequest.options)
&& Objects.equals(this.isSetOptions, checkoutForwardRequest.isSetOptions)
&& Objects.equals(this.paymentMethod, checkoutForwardRequest.paymentMethod)
&& Objects.equals(this.isSetPaymentMethod, checkoutForwardRequest.isSetPaymentMethod)
&& Objects.equals(this.request, checkoutForwardRequest.request)
&& Objects.equals(this.isSetRequest, checkoutForwardRequest.isSetRequest)
&& Objects.equals(this.shopperReference, checkoutForwardRequest.shopperReference)
&& Objects.equals(this.isSetShopperReference, checkoutForwardRequest.isSetShopperReference)
&& Objects.equals(this.storedPaymentMethodId, checkoutForwardRequest.storedPaymentMethodId)
&& Objects.equals(
this.isSetStoredPaymentMethodId, checkoutForwardRequest.isSetStoredPaymentMethodId);
}
@Override
public int hashCode() {
return Objects.hash(
baseUrl,
isSetBaseUrl,
merchantAccount,
isSetMerchantAccount,
merchantReference,
isSetMerchantReference,
options,
isSetOptions,
paymentMethod,
isSetPaymentMethod,
request,
isSetRequest,
shopperReference,
isSetShopperReference,
storedPaymentMethodId,
isSetStoredPaymentMethodId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CheckoutForwardRequest {\n");
sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n");
sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
sb.append(" merchantReference: ").append(toIndentedString(merchantReference)).append("\n");
sb.append(" options: ").append(toIndentedString(options)).append("\n");
sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n");
sb.append(" request: ").append(toIndentedString(request)).append("\n");
sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n");
sb.append(" storedPaymentMethodId: ")
.append(toIndentedString(storedPaymentMethodId))
.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 ");
}
/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
@JsonInclude(JsonInclude.Include.ALWAYS)
@JsonAnyGetter
public Map<String, Object> getExplicitNulls() {
if (!this.includeNullValues) {
return Collections.emptyMap();
}
Map<String, Object> nulls = new HashMap<>();
if (isSetBaseUrl) {
addIfNull(nulls, JSON_PROPERTY_BASE_URL, this.baseUrl);
}
if (isSetMerchantAccount) {
addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount);
}
if (isSetMerchantReference) {
addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference);
}
if (isSetOptions) {
addIfNull(nulls, JSON_PROPERTY_OPTIONS, this.options);
}
if (isSetPaymentMethod) {
addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod);
}
if (isSetRequest) {
addIfNull(nulls, JSON_PROPERTY_REQUEST, this.request);
}
if (isSetShopperReference) {
addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference);
}
if (isSetStoredPaymentMethodId) {
addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId);
}
return nulls;
}
// add to map when value is null
private void addIfNull(Map<String, Object> map, String key, Object value) {
if (value == null) {
map.put(key, null);
}
}
/**
* Create an instance of CheckoutForwardRequest given an JSON string
*
* @param jsonString JSON string
* @return An instance of CheckoutForwardRequest
* @throws JsonProcessingException if the JSON string is invalid with respect to
* CheckoutForwardRequest
*/
public static CheckoutForwardRequest fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, CheckoutForwardRequest.class);
}
/**
* Convert an instance of CheckoutForwardRequest to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}