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

stripe / stripe-java / #16562

18 Oct 2024 07:00PM UTC coverage: 12.614% (-0.1%) from 12.74%
#16562

push

github

web-flow
Merge pull request #1897 from stripe/latest-codegen-beta

Update generated code for beta

49 of 1978 new or added lines in 47 files covered. (2.48%)

68 existing lines in 20 files now uncovered.

18798 of 149026 relevant lines covered (12.61%)

0.13 hits per line

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

0.0
/src/main/java/com/stripe/model/PaymentMethodDomain.java
1
// File generated from our OpenAPI spec
2
package com.stripe.model;
3

4
import com.google.gson.annotations.SerializedName;
5
import com.stripe.exception.StripeException;
6
import com.stripe.net.ApiRequest;
7
import com.stripe.net.ApiRequestParams;
8
import com.stripe.net.ApiResource;
9
import com.stripe.net.BaseAddress;
10
import com.stripe.net.RequestOptions;
11
import com.stripe.net.StripeResponseGetter;
12
import com.stripe.param.PaymentMethodDomainCreateParams;
13
import com.stripe.param.PaymentMethodDomainListParams;
14
import com.stripe.param.PaymentMethodDomainRetrieveParams;
15
import com.stripe.param.PaymentMethodDomainUpdateParams;
16
import com.stripe.param.PaymentMethodDomainValidateParams;
17
import java.util.Map;
18
import lombok.EqualsAndHashCode;
19
import lombok.Getter;
20
import lombok.Setter;
21

22
/**
23
 * A payment method domain represents a web domain that you have registered with Stripe. Stripe
24
 * Elements use registered payment method domains to control where certain payment methods are
25
 * shown.
26
 *
27
 * <p>Related guide: <a
28
 * href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method
29
 * domains</a>.
30
 */
31
@Getter
32
@Setter
33
@EqualsAndHashCode(callSuper = false)
34
public class PaymentMethodDomain extends ApiResource implements HasId {
×
35
  /** Indicates the status of a specific payment method on a payment method domain. */
36
  @SerializedName("amazon_pay")
37
  AmazonPay amazonPay;
38

39
  /** Indicates the status of a specific payment method on a payment method domain. */
40
  @SerializedName("apple_pay")
41
  ApplePay applePay;
42

43
  /** Time at which the object was created. Measured in seconds since the Unix epoch. */
44
  @SerializedName("created")
45
  Long created;
46

47
  /** The domain name that this payment method domain object represents. */
48
  @SerializedName("domain_name")
49
  String domainName;
50

51
  /**
52
   * Whether this payment method domain is enabled. If the domain is not enabled, payment methods
53
   * that require a payment method domain will not appear in Elements.
54
   */
55
  @SerializedName("enabled")
56
  Boolean enabled;
57

58
  /** Indicates the status of a specific payment method on a payment method domain. */
59
  @SerializedName("google_pay")
60
  GooglePay googlePay;
61

62
  /** Unique identifier for the object. */
63
  @Getter(onMethod_ = {@Override})
64
  @SerializedName("id")
65
  String id;
66

67
  /** Indicates the status of a specific payment method on a payment method domain. */
68
  @SerializedName("link")
69
  Link link;
70

71
  /**
72
   * Has the value {@code true} if the object exists in live mode or the value {@code false} if the
73
   * object exists in test mode.
74
   */
75
  @SerializedName("livemode")
76
  Boolean livemode;
77

78
  /**
79
   * String representing the object's type. Objects of the same type share the same value.
80
   *
81
   * <p>Equal to {@code payment_method_domain}.
82
   */
83
  @SerializedName("object")
84
  String object;
85

86
  /** Indicates the status of a specific payment method on a payment method domain. */
87
  @SerializedName("paypal")
88
  Paypal paypal;
89

90
  /** Creates a payment method domain. */
91
  public static PaymentMethodDomain create(Map<String, Object> params) throws StripeException {
92
    return create(params, (RequestOptions) null);
×
93
  }
94

95
  /** Creates a payment method domain. */
96
  public static PaymentMethodDomain create(Map<String, Object> params, RequestOptions options)
97
      throws StripeException {
98
    String path = "/v1/payment_method_domains";
×
99
    ApiRequest request =
×
100
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
101
    return getGlobalResponseGetter().request(request, PaymentMethodDomain.class);
×
102
  }
103

104
  /** Creates a payment method domain. */
105
  public static PaymentMethodDomain create(PaymentMethodDomainCreateParams params)
106
      throws StripeException {
107
    return create(params, (RequestOptions) null);
×
108
  }
109

110
  /** Creates a payment method domain. */
111
  public static PaymentMethodDomain create(
112
      PaymentMethodDomainCreateParams params, RequestOptions options) throws StripeException {
113
    String path = "/v1/payment_method_domains";
×
114
    ApiResource.checkNullTypedParams(path, params);
×
115
    ApiRequest request =
×
116
        new ApiRequest(
117
            BaseAddress.API,
118
            ApiResource.RequestMethod.POST,
119
            path,
120
            ApiRequestParams.paramsToMap(params),
×
121
            options);
122
    return getGlobalResponseGetter().request(request, PaymentMethodDomain.class);
×
123
  }
124

125
  /** Lists the details of existing payment method domains. */
126
  public static PaymentMethodDomainCollection list(Map<String, Object> params)
127
      throws StripeException {
128
    return list(params, (RequestOptions) null);
×
129
  }
130

131
  /** Lists the details of existing payment method domains. */
132
  public static PaymentMethodDomainCollection list(
133
      Map<String, Object> params, RequestOptions options) throws StripeException {
134
    String path = "/v1/payment_method_domains";
×
135
    ApiRequest request =
×
136
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
137
    return getGlobalResponseGetter().request(request, PaymentMethodDomainCollection.class);
×
138
  }
139

140
  /** Lists the details of existing payment method domains. */
141
  public static PaymentMethodDomainCollection list(PaymentMethodDomainListParams params)
142
      throws StripeException {
143
    return list(params, (RequestOptions) null);
×
144
  }
145

146
  /** Lists the details of existing payment method domains. */
147
  public static PaymentMethodDomainCollection list(
148
      PaymentMethodDomainListParams params, RequestOptions options) throws StripeException {
149
    String path = "/v1/payment_method_domains";
×
150
    ApiResource.checkNullTypedParams(path, params);
×
151
    ApiRequest request =
×
152
        new ApiRequest(
153
            BaseAddress.API,
154
            ApiResource.RequestMethod.GET,
155
            path,
156
            ApiRequestParams.paramsToMap(params),
×
157
            options);
158
    return getGlobalResponseGetter().request(request, PaymentMethodDomainCollection.class);
×
159
  }
160

161
  /** Retrieves the details of an existing payment method domain. */
162
  public static PaymentMethodDomain retrieve(String paymentMethodDomain) throws StripeException {
163
    return retrieve(paymentMethodDomain, (Map<String, Object>) null, (RequestOptions) null);
×
164
  }
165

166
  /** Retrieves the details of an existing payment method domain. */
167
  public static PaymentMethodDomain retrieve(String paymentMethodDomain, RequestOptions options)
168
      throws StripeException {
169
    return retrieve(paymentMethodDomain, (Map<String, Object>) null, options);
×
170
  }
171

172
  /** Retrieves the details of an existing payment method domain. */
173
  public static PaymentMethodDomain retrieve(
174
      String paymentMethodDomain, Map<String, Object> params, RequestOptions options)
175
      throws StripeException {
176
    String path =
×
177
        String.format(
×
178
            "/v1/payment_method_domains/%s", ApiResource.urlEncodeId(paymentMethodDomain));
×
179
    ApiRequest request =
×
180
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
181
    return getGlobalResponseGetter().request(request, PaymentMethodDomain.class);
×
182
  }
183

184
  /** Retrieves the details of an existing payment method domain. */
185
  public static PaymentMethodDomain retrieve(
186
      String paymentMethodDomain, PaymentMethodDomainRetrieveParams params, RequestOptions options)
187
      throws StripeException {
188
    String path =
×
189
        String.format(
×
190
            "/v1/payment_method_domains/%s", ApiResource.urlEncodeId(paymentMethodDomain));
×
191
    ApiResource.checkNullTypedParams(path, params);
×
192
    ApiRequest request =
×
193
        new ApiRequest(
194
            BaseAddress.API,
195
            ApiResource.RequestMethod.GET,
196
            path,
197
            ApiRequestParams.paramsToMap(params),
×
198
            options);
199
    return getGlobalResponseGetter().request(request, PaymentMethodDomain.class);
×
200
  }
201

202
  /** Updates an existing payment method domain. */
203
  public PaymentMethodDomain update(Map<String, Object> params) throws StripeException {
204
    return update(params, (RequestOptions) null);
×
205
  }
206

207
  /** Updates an existing payment method domain. */
208
  public PaymentMethodDomain update(Map<String, Object> params, RequestOptions options)
209
      throws StripeException {
210
    String path =
×
211
        String.format("/v1/payment_method_domains/%s", ApiResource.urlEncodeId(this.getId()));
×
212
    ApiRequest request =
×
213
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
214
    return getResponseGetter().request(request, PaymentMethodDomain.class);
×
215
  }
216

217
  /** Updates an existing payment method domain. */
218
  public PaymentMethodDomain update(PaymentMethodDomainUpdateParams params) throws StripeException {
219
    return update(params, (RequestOptions) null);
×
220
  }
221

222
  /** Updates an existing payment method domain. */
223
  public PaymentMethodDomain update(PaymentMethodDomainUpdateParams params, RequestOptions options)
224
      throws StripeException {
225
    String path =
×
226
        String.format("/v1/payment_method_domains/%s", ApiResource.urlEncodeId(this.getId()));
×
227
    ApiResource.checkNullTypedParams(path, params);
×
228
    ApiRequest request =
×
229
        new ApiRequest(
230
            BaseAddress.API,
231
            ApiResource.RequestMethod.POST,
232
            path,
233
            ApiRequestParams.paramsToMap(params),
×
234
            options);
235
    return getResponseGetter().request(request, PaymentMethodDomain.class);
×
236
  }
237

238
  /**
239
   * Some payment methods such as Apple Pay require additional steps to verify a domain. If the
240
   * requirements weren’t satisfied when the domain was created, the payment method will be inactive
241
   * on the domain. The payment method doesn’t appear in Elements for this domain until it is
242
   * active.
243
   *
244
   * <p>To activate a payment method on an existing payment method domain, complete the required
245
   * validation steps specific to the payment method, and then validate the payment method domain
246
   * with this endpoint.
247
   *
248
   * <p>Related guides: <a
249
   * href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method
250
   * domains</a>.
251
   */
252
  public PaymentMethodDomain validate() throws StripeException {
253
    return validate((Map<String, Object>) null, (RequestOptions) null);
×
254
  }
255

256
  /**
257
   * Some payment methods such as Apple Pay require additional steps to verify a domain. If the
258
   * requirements weren’t satisfied when the domain was created, the payment method will be inactive
259
   * on the domain. The payment method doesn’t appear in Elements for this domain until it is
260
   * active.
261
   *
262
   * <p>To activate a payment method on an existing payment method domain, complete the required
263
   * validation steps specific to the payment method, and then validate the payment method domain
264
   * with this endpoint.
265
   *
266
   * <p>Related guides: <a
267
   * href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method
268
   * domains</a>.
269
   */
270
  public PaymentMethodDomain validate(RequestOptions options) throws StripeException {
271
    return validate((Map<String, Object>) null, options);
×
272
  }
273

274
  /**
275
   * Some payment methods such as Apple Pay require additional steps to verify a domain. If the
276
   * requirements weren’t satisfied when the domain was created, the payment method will be inactive
277
   * on the domain. The payment method doesn’t appear in Elements for this domain until it is
278
   * active.
279
   *
280
   * <p>To activate a payment method on an existing payment method domain, complete the required
281
   * validation steps specific to the payment method, and then validate the payment method domain
282
   * with this endpoint.
283
   *
284
   * <p>Related guides: <a
285
   * href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method
286
   * domains</a>.
287
   */
288
  public PaymentMethodDomain validate(Map<String, Object> params) throws StripeException {
289
    return validate(params, (RequestOptions) null);
×
290
  }
291

292
  /**
293
   * Some payment methods such as Apple Pay require additional steps to verify a domain. If the
294
   * requirements weren’t satisfied when the domain was created, the payment method will be inactive
295
   * on the domain. The payment method doesn’t appear in Elements for this domain until it is
296
   * active.
297
   *
298
   * <p>To activate a payment method on an existing payment method domain, complete the required
299
   * validation steps specific to the payment method, and then validate the payment method domain
300
   * with this endpoint.
301
   *
302
   * <p>Related guides: <a
303
   * href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method
304
   * domains</a>.
305
   */
306
  public PaymentMethodDomain validate(Map<String, Object> params, RequestOptions options)
307
      throws StripeException {
308
    String path =
×
309
        String.format(
×
310
            "/v1/payment_method_domains/%s/validate", ApiResource.urlEncodeId(this.getId()));
×
311
    ApiRequest request =
×
312
        new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
313
    return getResponseGetter().request(request, PaymentMethodDomain.class);
×
314
  }
315

316
  /**
317
   * Some payment methods such as Apple Pay require additional steps to verify a domain. If the
318
   * requirements weren’t satisfied when the domain was created, the payment method will be inactive
319
   * on the domain. The payment method doesn’t appear in Elements for this domain until it is
320
   * active.
321
   *
322
   * <p>To activate a payment method on an existing payment method domain, complete the required
323
   * validation steps specific to the payment method, and then validate the payment method domain
324
   * with this endpoint.
325
   *
326
   * <p>Related guides: <a
327
   * href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method
328
   * domains</a>.
329
   */
330
  public PaymentMethodDomain validate(PaymentMethodDomainValidateParams params)
331
      throws StripeException {
332
    return validate(params, (RequestOptions) null);
×
333
  }
334

335
  /**
336
   * Some payment methods such as Apple Pay require additional steps to verify a domain. If the
337
   * requirements weren’t satisfied when the domain was created, the payment method will be inactive
338
   * on the domain. The payment method doesn’t appear in Elements for this domain until it is
339
   * active.
340
   *
341
   * <p>To activate a payment method on an existing payment method domain, complete the required
342
   * validation steps specific to the payment method, and then validate the payment method domain
343
   * with this endpoint.
344
   *
345
   * <p>Related guides: <a
346
   * href="https://stripe.com/docs/payments/payment-methods/pmd-registration">Payment method
347
   * domains</a>.
348
   */
349
  public PaymentMethodDomain validate(
350
      PaymentMethodDomainValidateParams params, RequestOptions options) throws StripeException {
351
    String path =
×
352
        String.format(
×
353
            "/v1/payment_method_domains/%s/validate", ApiResource.urlEncodeId(this.getId()));
×
354
    ApiResource.checkNullTypedParams(path, params);
×
355
    ApiRequest request =
×
356
        new ApiRequest(
357
            BaseAddress.API,
358
            ApiResource.RequestMethod.POST,
359
            path,
360
            ApiRequestParams.paramsToMap(params),
×
361
            options);
362
    return getResponseGetter().request(request, PaymentMethodDomain.class);
×
363
  }
364

365
  /** Indicates the status of a specific payment method on a payment method domain. */
366
  @Getter
367
  @Setter
368
  @EqualsAndHashCode(callSuper = false)
NEW
369
  public static class AmazonPay extends StripeObject {
×
370
    /**
371
     * The status of the payment method on the domain.
372
     *
373
     * <p>One of {@code active}, or {@code inactive}.
374
     */
375
    @SerializedName("status")
376
    String status;
377

378
    /**
379
     * Contains additional details about the status of a payment method for a specific payment
380
     * method domain.
381
     */
382
    @SerializedName("status_details")
383
    StatusDetails statusDetails;
384

385
    /**
386
     * Contains additional details about the status of a payment method for a specific payment
387
     * method domain.
388
     */
389
    @Getter
390
    @Setter
391
    @EqualsAndHashCode(callSuper = false)
NEW
392
    public static class StatusDetails extends StripeObject {
×
393
      /** The error message associated with the status of the payment method on the domain. */
394
      @SerializedName("error_message")
395
      String errorMessage;
396
    }
397
  }
398

399
  /** Indicates the status of a specific payment method on a payment method domain. */
400
  @Getter
401
  @Setter
402
  @EqualsAndHashCode(callSuper = false)
403
  public static class ApplePay extends StripeObject {
×
404
    /**
405
     * The status of the payment method on the domain.
406
     *
407
     * <p>One of {@code active}, or {@code inactive}.
408
     */
409
    @SerializedName("status")
410
    String status;
411

412
    /**
413
     * Contains additional details about the status of a payment method for a specific payment
414
     * method domain.
415
     */
416
    @SerializedName("status_details")
417
    StatusDetails statusDetails;
418

419
    /**
420
     * Contains additional details about the status of a payment method for a specific payment
421
     * method domain.
422
     */
423
    @Getter
424
    @Setter
425
    @EqualsAndHashCode(callSuper = false)
426
    public static class StatusDetails extends StripeObject {
×
427
      /** The error message associated with the status of the payment method on the domain. */
428
      @SerializedName("error_message")
429
      String errorMessage;
430
    }
431
  }
432

433
  /** Indicates the status of a specific payment method on a payment method domain. */
434
  @Getter
435
  @Setter
436
  @EqualsAndHashCode(callSuper = false)
437
  public static class GooglePay extends StripeObject {
×
438
    /**
439
     * The status of the payment method on the domain.
440
     *
441
     * <p>One of {@code active}, or {@code inactive}.
442
     */
443
    @SerializedName("status")
444
    String status;
445

446
    /**
447
     * Contains additional details about the status of a payment method for a specific payment
448
     * method domain.
449
     */
450
    @SerializedName("status_details")
451
    StatusDetails statusDetails;
452

453
    /**
454
     * Contains additional details about the status of a payment method for a specific payment
455
     * method domain.
456
     */
457
    @Getter
458
    @Setter
459
    @EqualsAndHashCode(callSuper = false)
460
    public static class StatusDetails extends StripeObject {
×
461
      /** The error message associated with the status of the payment method on the domain. */
462
      @SerializedName("error_message")
463
      String errorMessage;
464
    }
465
  }
466

467
  /** Indicates the status of a specific payment method on a payment method domain. */
468
  @Getter
469
  @Setter
470
  @EqualsAndHashCode(callSuper = false)
471
  public static class Link extends StripeObject {
×
472
    /**
473
     * The status of the payment method on the domain.
474
     *
475
     * <p>One of {@code active}, or {@code inactive}.
476
     */
477
    @SerializedName("status")
478
    String status;
479

480
    /**
481
     * Contains additional details about the status of a payment method for a specific payment
482
     * method domain.
483
     */
484
    @SerializedName("status_details")
485
    StatusDetails statusDetails;
486

487
    /**
488
     * Contains additional details about the status of a payment method for a specific payment
489
     * method domain.
490
     */
491
    @Getter
492
    @Setter
493
    @EqualsAndHashCode(callSuper = false)
494
    public static class StatusDetails extends StripeObject {
×
495
      /** The error message associated with the status of the payment method on the domain. */
496
      @SerializedName("error_message")
497
      String errorMessage;
498
    }
499
  }
500

501
  /** Indicates the status of a specific payment method on a payment method domain. */
502
  @Getter
503
  @Setter
504
  @EqualsAndHashCode(callSuper = false)
505
  public static class Paypal extends StripeObject {
×
506
    /**
507
     * The status of the payment method on the domain.
508
     *
509
     * <p>One of {@code active}, or {@code inactive}.
510
     */
511
    @SerializedName("status")
512
    String status;
513

514
    /**
515
     * Contains additional details about the status of a payment method for a specific payment
516
     * method domain.
517
     */
518
    @SerializedName("status_details")
519
    StatusDetails statusDetails;
520

521
    /**
522
     * Contains additional details about the status of a payment method for a specific payment
523
     * method domain.
524
     */
525
    @Getter
526
    @Setter
527
    @EqualsAndHashCode(callSuper = false)
528
    public static class StatusDetails extends StripeObject {
×
529
      /** The error message associated with the status of the payment method on the domain. */
530
      @SerializedName("error_message")
531
      String errorMessage;
532
    }
533
  }
534

535
  @Override
536
  public void setResponseGetter(StripeResponseGetter responseGetter) {
537
    super.setResponseGetter(responseGetter);
×
NEW
538
    trySetResponseGetter(amazonPay, responseGetter);
×
539
    trySetResponseGetter(applePay, responseGetter);
×
540
    trySetResponseGetter(googlePay, responseGetter);
×
541
    trySetResponseGetter(link, responseGetter);
×
542
    trySetResponseGetter(paypal, responseGetter);
×
543
  }
×
544
}
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

© 2026 Coveralls, Inc