• 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/Recurring.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.fasterxml.jackson.annotation.JsonInclude;
20
import com.fasterxml.jackson.annotation.JsonProperty;
21
import com.fasterxml.jackson.annotation.JsonCreator;
22
import com.fasterxml.jackson.annotation.JsonTypeName;
23
import com.fasterxml.jackson.annotation.JsonValue;
24
import io.swagger.annotations.ApiModel;
25
import io.swagger.annotations.ApiModelProperty;
26
import java.time.OffsetDateTime;
27
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
28
import com.fasterxml.jackson.core.JsonProcessingException;
29

30

31
/**
32
 * Recurring
33
 */
34
@JsonPropertyOrder({
35
  Recurring.JSON_PROPERTY_CONTRACT,
36
  Recurring.JSON_PROPERTY_RECURRING_DETAIL_NAME,
37
  Recurring.JSON_PROPERTY_RECURRING_EXPIRY,
38
  Recurring.JSON_PROPERTY_RECURRING_FREQUENCY,
39
  Recurring.JSON_PROPERTY_TOKEN_SERVICE
40
})
41

42
public class Recurring {
43
  /**
44
   * The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).
45
   */
46
  public enum ContractEnum {
×
47
    ONECLICK("ONECLICK"),
×
48
    
49
    RECURRING("RECURRING"),
×
50
    
51
    PAYOUT("PAYOUT");
×
52

53
    private String value;
54

55
    ContractEnum(String value) {
×
56
      this.value = value;
×
57
    }
×
58

59
    @JsonValue
60
    public String getValue() {
61
      return value;
×
62
    }
63

64
    @Override
65
    public String toString() {
66
      return String.valueOf(value);
×
67
    }
68

69
    @JsonCreator
70
    public static ContractEnum fromValue(String value) {
71
      for (ContractEnum b : ContractEnum.values()) {
×
72
        if (b.value.equals(value)) {
×
73
          return b;
×
74
        }
75
      }
76
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
77
    }
78
  }
79

80
  public static final String JSON_PROPERTY_CONTRACT = "contract";
81
  private ContractEnum contract;
82

83
  public static final String JSON_PROPERTY_RECURRING_DETAIL_NAME = "recurringDetailName";
84
  private String recurringDetailName;
85

86
  public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry";
87
  private OffsetDateTime recurringExpiry;
88

89
  public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency";
90
  private String recurringFrequency;
91

92
  /**
93
   * The name of the token service.
94
   */
95
  public enum TokenServiceEnum {
×
96
    VISATOKENSERVICE("VISATOKENSERVICE"),
×
97
    
98
    MCTOKENSERVICE("MCTOKENSERVICE"),
×
99
    
100
    AMEXTOKENSERVICE("AMEXTOKENSERVICE"),
×
101
    
102
    TOKEN_SHARING("TOKEN_SHARING");
×
103

104
    private String value;
105

106
    TokenServiceEnum(String value) {
×
107
      this.value = value;
×
108
    }
×
109

110
    @JsonValue
111
    public String getValue() {
112
      return value;
×
113
    }
114

115
    @Override
116
    public String toString() {
117
      return String.valueOf(value);
×
118
    }
119

120
    @JsonCreator
121
    public static TokenServiceEnum fromValue(String value) {
122
      for (TokenServiceEnum b : TokenServiceEnum.values()) {
×
123
        if (b.value.equals(value)) {
×
124
          return b;
×
125
        }
126
      }
127
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
×
128
    }
129
  }
130

131
  public static final String JSON_PROPERTY_TOKEN_SERVICE = "tokenService";
132
  private TokenServiceEnum tokenService;
133

134
  public Recurring() { 
×
135
  }
×
136

137
  public Recurring contract(ContractEnum contract) {
138
    this.contract = contract;
×
139
    return this;
×
140
  }
141

142
   /**
143
   * The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).
144
   * @return contract
145
  **/
146
  @ApiModelProperty(value = "The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/online-payments/online-payouts).")
147
  @JsonProperty(JSON_PROPERTY_CONTRACT)
148
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
149

150
  public ContractEnum getContract() {
151
    return contract;
×
152
  }
153

154

155
  @JsonProperty(JSON_PROPERTY_CONTRACT)
156
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
157
  public void setContract(ContractEnum contract) {
158
    this.contract = contract;
×
159
  }
×
160

161

162
  public Recurring recurringDetailName(String recurringDetailName) {
163
    this.recurringDetailName = recurringDetailName;
×
164
    return this;
×
165
  }
166

167
   /**
168
   * A descriptive name for this detail.
169
   * @return recurringDetailName
170
  **/
171
  @ApiModelProperty(value = "A descriptive name for this detail.")
172
  @JsonProperty(JSON_PROPERTY_RECURRING_DETAIL_NAME)
173
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
174

175
  public String getRecurringDetailName() {
176
    return recurringDetailName;
×
177
  }
178

179

180
  @JsonProperty(JSON_PROPERTY_RECURRING_DETAIL_NAME)
181
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
182
  public void setRecurringDetailName(String recurringDetailName) {
183
    this.recurringDetailName = recurringDetailName;
×
184
  }
×
185

186

187
  public Recurring recurringExpiry(OffsetDateTime recurringExpiry) {
188
    this.recurringExpiry = recurringExpiry;
×
189
    return this;
×
190
  }
191

192
   /**
193
   * Date after which no further authorisations shall be performed. Only for 3D Secure 2.
194
   * @return recurringExpiry
195
  **/
196
  @ApiModelProperty(value = "Date after which no further authorisations shall be performed. Only for 3D Secure 2.")
197
  @JsonProperty(JSON_PROPERTY_RECURRING_EXPIRY)
198
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
199

200
  public OffsetDateTime getRecurringExpiry() {
201
    return recurringExpiry;
×
202
  }
203

204

205
  @JsonProperty(JSON_PROPERTY_RECURRING_EXPIRY)
206
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
207
  public void setRecurringExpiry(OffsetDateTime recurringExpiry) {
208
    this.recurringExpiry = recurringExpiry;
×
209
  }
×
210

211

212
  public Recurring recurringFrequency(String recurringFrequency) {
213
    this.recurringFrequency = recurringFrequency;
×
214
    return this;
×
215
  }
216

217
   /**
218
   * Minimum number of days between authorisations. Only for 3D Secure 2.
219
   * @return recurringFrequency
220
  **/
221
  @ApiModelProperty(value = "Minimum number of days between authorisations. Only for 3D Secure 2.")
222
  @JsonProperty(JSON_PROPERTY_RECURRING_FREQUENCY)
223
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
224

225
  public String getRecurringFrequency() {
226
    return recurringFrequency;
×
227
  }
228

229

230
  @JsonProperty(JSON_PROPERTY_RECURRING_FREQUENCY)
231
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
232
  public void setRecurringFrequency(String recurringFrequency) {
233
    this.recurringFrequency = recurringFrequency;
×
234
  }
×
235

236

237
  public Recurring tokenService(TokenServiceEnum tokenService) {
238
    this.tokenService = tokenService;
×
239
    return this;
×
240
  }
241

242
   /**
243
   * The name of the token service.
244
   * @return tokenService
245
  **/
246
  @ApiModelProperty(value = "The name of the token service.")
247
  @JsonProperty(JSON_PROPERTY_TOKEN_SERVICE)
248
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
249

250
  public TokenServiceEnum getTokenService() {
251
    return tokenService;
×
252
  }
253

254

255
  @JsonProperty(JSON_PROPERTY_TOKEN_SERVICE)
256
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
257
  public void setTokenService(TokenServiceEnum tokenService) {
258
    this.tokenService = tokenService;
×
259
  }
×
260

261

262
  /**
263
   * Return true if this Recurring object is equal to o.
264
   */
265
  @Override
266
  public boolean equals(Object o) {
267
    if (this == o) {
×
268
      return true;
×
269
    }
270
    if (o == null || getClass() != o.getClass()) {
×
271
      return false;
×
272
    }
273
    Recurring recurring = (Recurring) o;
×
274
    return Objects.equals(this.contract, recurring.contract) &&
×
275
        Objects.equals(this.recurringDetailName, recurring.recurringDetailName) &&
×
276
        Objects.equals(this.recurringExpiry, recurring.recurringExpiry) &&
×
277
        Objects.equals(this.recurringFrequency, recurring.recurringFrequency) &&
×
278
        Objects.equals(this.tokenService, recurring.tokenService);
×
279
  }
280

281
  @Override
282
  public int hashCode() {
283
    return Objects.hash(contract, recurringDetailName, recurringExpiry, recurringFrequency, tokenService);
×
284
  }
285

286
  @Override
287
  public String toString() {
288
    StringBuilder sb = new StringBuilder();
×
289
    sb.append("class Recurring {\n");
×
290
    sb.append("    contract: ").append(toIndentedString(contract)).append("\n");
×
291
    sb.append("    recurringDetailName: ").append(toIndentedString(recurringDetailName)).append("\n");
×
292
    sb.append("    recurringExpiry: ").append(toIndentedString(recurringExpiry)).append("\n");
×
293
    sb.append("    recurringFrequency: ").append(toIndentedString(recurringFrequency)).append("\n");
×
294
    sb.append("    tokenService: ").append(toIndentedString(tokenService)).append("\n");
×
295
    sb.append("}");
×
296
    return sb.toString();
×
297
  }
298

299
  /**
300
   * Convert the given object to string with each line indented by 4 spaces
301
   * (except the first line).
302
   */
303
  private String toIndentedString(Object o) {
304
    if (o == null) {
×
305
      return "null";
×
306
    }
307
    return o.toString().replace("\n", "\n    ");
×
308
  }
309

310
/**
311
   * Create an instance of Recurring given an JSON string
312
   *
313
   * @param jsonString JSON string
314
   * @return An instance of Recurring
315
   * @throws JsonProcessingException if the JSON string is invalid with respect to Recurring
316
   */
317
  public static Recurring fromJson(String jsonString) throws JsonProcessingException {
318
    return JSON.getMapper().readValue(jsonString, Recurring.class);
×
319
  }
320
/**
321
  * Convert an instance of Recurring to an JSON string
322
  *
323
  * @return JSON string
324
  */
325
  public String toJson() throws JsonProcessingException {
326
    return JSON.getMapper().writeValueAsString(this);
×
327
  }
328
}
329

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