From 9d5834acf4de93f979d6556cf5f4761fb24d5388 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 19:33:52 +0000 Subject: [PATCH 1/3] Update generated code for v2255 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/StripeClient.java | 12 + .../java/com/stripe/model/Capability.java | 41 ++ .../com/stripe/model/ConfirmationToken.java | 56 ++- .../stripe/model/EventDataClassLookup.java | 1 + .../java/com/stripe/model/InvoiceItem.java | 51 +++ .../com/stripe/model/PaymentLocation.java | 162 ++++++++ .../java/com/stripe/model/PaymentMethod.java | 59 ++- .../com/stripe/model/issuing/Dispute.java | 93 +++++ .../model/sharedpayment/GrantedToken.java | 56 ++- .../com/stripe/param/AccountCreateParams.java | 173 +++++++- .../com/stripe/param/AccountUpdateParams.java | 173 +++++++- .../param/ConfirmationTokenCreateParams.java | 97 +++++ .../CustomerListPaymentMethodsParams.java | 3 + .../CustomerPaymentMethodListParams.java | 3 + .../param/PaymentIntentConfirmParams.java | 99 +++++ .../param/PaymentIntentCreateParams.java | 99 +++++ .../param/PaymentIntentUpdateParams.java | 105 +++++ .../param/PaymentLocationCreateParams.java | 382 ++++++++++++++++++ .../param/PaymentMethodCreateParams.java | 93 +++++ .../stripe/param/PaymentMethodListParams.java | 3 + .../param/SetupIntentConfirmParams.java | 96 +++++ .../stripe/param/SetupIntentCreateParams.java | 99 +++++ .../stripe/param/SetupIntentUpdateParams.java | 105 +++++ .../RequestedSessionConfirmParams.java | 50 +++ .../service/PaymentLocationService.java | 37 ++ .../java/com/stripe/service/V1Services.java | 4 + 28 files changed, 2125 insertions(+), 31 deletions(-) create mode 100644 src/main/java/com/stripe/model/PaymentLocation.java create mode 100644 src/main/java/com/stripe/param/PaymentLocationCreateParams.java create mode 100644 src/main/java/com/stripe/service/PaymentLocationService.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index c82dcaeaa3f..575860e41ec 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -1263d72c2687be8ce737cfb363690b8da0a0d552 \ No newline at end of file +f0187e75a5c663247a7e8d02c02e8f3c69c9b144 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1ae2e8d30e4..bb151480971 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2254 \ No newline at end of file +v2255 \ No newline at end of file diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index c17b6823a3f..8e3e5c9fac0 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -693,6 +693,18 @@ public com.stripe.service.PaymentLinkService paymentLinks() { return new com.stripe.service.PaymentLinkService(this.getResponseGetter()); } + /** + * @deprecated StripeClient.paymentLocations() is deprecated, use + * StripeClient.v1().paymentLocations() instead. All functionality under it has been copied + * over to StripeClient.v1().paymentLocations(). See migration + * guide for more on this and tips on migrating to the new v1 namespace. + */ + @Deprecated + public com.stripe.service.PaymentLocationService paymentLocations() { + return new com.stripe.service.PaymentLocationService(this.getResponseGetter()); + } + /** * @deprecated StripeClient.paymentMethodConfigurations() is deprecated, use * StripeClient.v1().paymentMethodConfigurations() instead. All functionality under it has diff --git a/src/main/java/com/stripe/model/Capability.java b/src/main/java/com/stripe/model/Capability.java index 119b3b5de09..4638164624d 100644 --- a/src/main/java/com/stripe/model/Capability.java +++ b/src/main/java/com/stripe/model/Capability.java @@ -48,6 +48,9 @@ public class Capability extends ApiResource implements HasId { @SerializedName("object") String object; + @SerializedName("protections") + Protections protections; + /** Whether the capability has been requested. */ @SerializedName("requested") Boolean requested; @@ -326,6 +329,43 @@ public static class Errors extends StripeObject { } } + /** + * For more details about Protections, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Protections extends StripeObject { + @SerializedName("psp_migration") + PspMigration pspMigration; + + /** + * For more details about PspMigration, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PspMigration extends StripeObject { + /** Time at which the protection expires. Measured in seconds since the Unix epoch. */ + @SerializedName("expires_at") + Long expiresAt; + + /** Time at which the protection was requested. Measured in seconds since the Unix epoch. */ + @SerializedName("requested_at") + Long requestedAt; + + /** + * The status of the capability protection. + * + *

One of {@code active}, {@code disrupted}, {@code expired}, or {@code inactive}. + */ + @SerializedName("status") + String status; + } + } + /** * For more details about Requirements, please refer to the API Reference. @@ -520,6 +560,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(account, responseGetter); trySetResponseGetter(futureRequirements, responseGetter); + trySetResponseGetter(protections, responseGetter); trySetResponseGetter(requirements, responseGetter); } } diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index a8d5f392476..cf6ac32b313 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -350,6 +350,9 @@ public static class PaymentMethodPreview extends StripeObject { @SerializedName("fpx") Fpx fpx; + @SerializedName("gift_card") + GiftCard giftCard; + @SerializedName("giropay") Giropay giropay; @@ -473,14 +476,14 @@ public static class PaymentMethodPreview extends StripeObject { * {@code alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code * bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code card}, {@code * card_present}, {@code cashapp}, {@code crypto}, {@code custom}, {@code customer_balance}, - * {@code eps}, {@code fpx}, {@code giropay}, {@code gopay}, {@code grabpay}, {@code - * id_bank_transfer}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, - * {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code - * multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, {@code - * pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code paypay}, {@code payto}, - * {@code pix}, {@code promptpay}, {@code qris}, {@code rechnung}, {@code revolut_pay}, {@code - * samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code shopeepay}, {@code sofort}, {@code - * stripe_balance}, {@code sunbit}, {@code swish}, {@code twint}, {@code upi}, {@code + * {@code eps}, {@code fpx}, {@code gift_card}, {@code giropay}, {@code gopay}, {@code grabpay}, + * {@code id_bank_transfer}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code + * klarna}, {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, + * {@code multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, + * {@code pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code paypay}, {@code + * payto}, {@code pix}, {@code promptpay}, {@code qris}, {@code rechnung}, {@code revolut_pay}, + * {@code samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code shopeepay}, {@code sofort}, + * {@code stripe_balance}, {@code sunbit}, {@code swish}, {@code twint}, {@code upi}, {@code * us_bank_account}, {@code wechat_pay}, or {@code zip}. */ @SerializedName("type") @@ -1738,6 +1741,43 @@ public static class Fpx extends StripeObject { String bank; } + /** + * For more details about GiftCard, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard extends StripeObject { + /** + * The brand of the gift card. + * + *

One of {@code fiserv_valuelink}, {@code givex}, or {@code svs}. + */ + @SerializedName("brand") + String brand; + + /** The expiration month of the gift card. */ + @SerializedName("exp_month") + Long expMonth; + + /** The expiration year of the gift card. */ + @SerializedName("exp_year") + Long expYear; + + /** Uniquely identifies the gift card. */ + @SerializedName("fingerprint") + String fingerprint; + + /** The first six digits of the gift card number. */ + @SerializedName("first6") + String first6; + + /** The last four digits of the gift card number. */ + @SerializedName("last4") + String last4; + } + /** * For more details about Giropay, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index e5ba41dcdf3..33a084b8443 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -71,6 +71,7 @@ public final class EventDataClassLookup { "payment_intent_amount_details_line_item", com.stripe.model.PaymentIntentAmountDetailsLineItem.class); classLookup.put("payment_link", com.stripe.model.PaymentLink.class); + classLookup.put("payment_location", com.stripe.model.PaymentLocation.class); classLookup.put("payment_method", com.stripe.model.PaymentMethod.class); classLookup.put("payment_method_balance", com.stripe.model.PaymentMethodBalance.class); classLookup.put( diff --git a/src/main/java/com/stripe/model/InvoiceItem.java b/src/main/java/com/stripe/model/InvoiceItem.java index c77b5e2ec52..d4b4323c64f 100644 --- a/src/main/java/com/stripe/model/InvoiceItem.java +++ b/src/main/java/com/stripe/model/InvoiceItem.java @@ -818,10 +818,61 @@ public static class RateCardRateDetails extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class ProrationDetails extends StripeObject { + @SerializedName("credited_items") + CreditedItems creditedItems; + /** Discount amounts applied when the proration was created. */ @SerializedName("discount_amounts") List discountAmounts; + /** + * For more details about CreditedItems, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CreditedItems extends StripeObject { + /** + * When {@code type} is {@code invoice_item}, the invoice item id for the debited invoice item + * corresponding to this credit proration. + */ + @SerializedName("invoice_item") + String invoiceItem; + + @SerializedName("invoice_line_items") + InvoiceLineItems invoiceLineItems; + + /** + * Whether the credit references a pending invoice item or one or more invoice line items on + * an invoice. + * + *

One of {@code invoice_item}, or {@code invoice_line_items}. + */ + @SerializedName("type") + String type; + + /** + * For more details about InvoiceLineItems, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InvoiceLineItems extends StripeObject { + /** The invoice id for the debited line item(s). */ + @SerializedName("invoice") + String invoice; + + /** + * IDs of the debited invoice line item(s) on the invoice that correspond to the credit + * proration. + */ + @SerializedName("invoice_line_items") + List invoiceLineItems; + } + } + /** * For more details about DiscountAmount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentLocation.java b/src/main/java/com/stripe/model/PaymentLocation.java new file mode 100644 index 00000000000..073fda4a5cc --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentLocation.java @@ -0,0 +1,162 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.PaymentLocationCreateParams; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** A Payment Location represents a physical location where payments take place. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentLocation extends ApiResource implements HasId { + @SerializedName("address") + Address address; + + /** Identification numbers associated with the location. */ + @SerializedName("business_registration") + BusinessRegistration businessRegistration; + + /** + * The capability settings for the location. Only applicable for locations with requested Payment + * Location Capabilities. + */ + @SerializedName("capability_settings") + CapabilitySettings capabilitySettings; + + /** The display name of the location. */ + @SerializedName("display_name") + String displayName; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * If the object exists in live mode, the value is {@code true}. If the object exists in test + * mode, the value is {@code false}. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code payment_location}. + */ + @SerializedName("object") + String object; + + /** Create a Payment Location. */ + public static PaymentLocation create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Create a Payment Location. */ + public static PaymentLocation create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/payment_locations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, PaymentLocation.class); + } + + /** Create a Payment Location. */ + public static PaymentLocation create(PaymentLocationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Create a Payment Location. */ + public static PaymentLocation create(PaymentLocationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/payment_locations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentLocation.class); + } + + /** + * For more details about BusinessRegistration, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BusinessRegistration extends StripeObject { + /** + * 14-digit SIRET (Système d'identification du répertoire des établissements) number for the + * location. + */ + @SerializedName("siret") + String siret; + } + + /** + * For more details about CapabilitySettings, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CapabilitySettings extends StripeObject { + /** Settings for Conecs French meal voucher capability. */ + @SerializedName("fr_meal_vouchers_conecs_payments") + FrMealVouchersConecsPayments frMealVouchersConecsPayments; + + /** + * For more details about FrMealVouchersConecsPayments, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class FrMealVouchersConecsPayments extends StripeObject { + /** Supported meal voucher issuers. */ + @SerializedName("supported_issuers") + SupportedIssuers supportedIssuers; + + /** + * For more details about SupportedIssuers, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SupportedIssuers extends StripeObject { + /** Supported meal voucher issuers for card payments. */ + @SerializedName("card") + List card; + + /** Supported meal voucher issuers for card present payments. */ + @SerializedName("card_present") + List cardPresent; + } + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(address, responseGetter); + trySetResponseGetter(businessRegistration, responseGetter); + trySetResponseGetter(capabilitySettings, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 8270aaa0aa1..65b93191d11 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -124,6 +124,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard extends StripeObject { + /** + * The brand of the gift card. + * + *

One of {@code fiserv_valuelink}, {@code givex}, or {@code svs}. + */ + @SerializedName("brand") + String brand; + + /** The expiration month of the gift card. */ + @SerializedName("exp_month") + Long expMonth; + + /** The expiration year of the gift card. */ + @SerializedName("exp_year") + Long expYear; + + /** Uniquely identifies the gift card. */ + @SerializedName("fingerprint") + String fingerprint; + + /** The first six digits of the gift card number. */ + @SerializedName("first6") + String first6; + + /** The last four digits of the gift card number. */ + @SerializedName("last4") + String last4; + } + /** * For more details about Giropay, please refer to the API * Reference. @@ -3036,6 +3076,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(customerBalance, responseGetter); trySetResponseGetter(eps, responseGetter); trySetResponseGetter(fpx, responseGetter); + trySetResponseGetter(giftCard, responseGetter); trySetResponseGetter(giropay, responseGetter); trySetResponseGetter(gopay, responseGetter); trySetResponseGetter(grabpay, responseGetter); diff --git a/src/main/java/com/stripe/model/issuing/Dispute.java b/src/main/java/com/stripe/model/issuing/Dispute.java index 6f9f738cf73..5a27fd2e989 100644 --- a/src/main/java/com/stripe/model/issuing/Dispute.java +++ b/src/main/java/com/stripe/model/issuing/Dispute.java @@ -104,6 +104,13 @@ public class Dispute extends ApiResource @SerializedName("metadata") Map metadata; + /** + * Incoming information from the card network for this dispute. Includes the acquiring merchant's + * initial response, pre-arbitration submission, and pre-arbitration response to the dispute. + */ + @SerializedName("network_lifecycle") + NetworkLifecycle networkLifecycle; + /** * String representing the object's type. Objects of the same type share the same value. * @@ -1168,6 +1175,91 @@ public void setAdditionalDocumentationObject(File expandableObject) { } } + /** + * For more details about NetworkLifecycle, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NetworkLifecycle extends StripeObject { + /** Information related to the acquiring merchant's initial response to this dispute. */ + @SerializedName("dispute_response") + DisputeResponse disputeResponse; + + /** + * Information related to the acquiring merchant's pre-arbitration response for this dispute. + */ + @SerializedName("pre_arbitration_response") + PreArbitrationResponse preArbitrationResponse; + + /** + * Information related to the acquiring merchant's pre-arbitration submission for this dispute. + */ + @SerializedName("pre_arbitration_submission") + PreArbitrationSubmission preArbitrationSubmission; + + /** + * For more details about DisputeResponse, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisputeResponse extends StripeObject { + /** Error message if processing the acquiring merchant's initial dispute response failed. */ + @SerializedName("error") + String error; + + /** + * Array of File ids containing evidence the + * acquiring merchant provided in support of their initial dispute response. + */ + @SerializedName("merchant_evidence_files") + List merchantEvidenceFiles; + } + + /** + * For more details about PreArbitrationResponse, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PreArbitrationResponse extends StripeObject { + /** Error message if processing the acquiring merchant's pre-arbitration response failed. */ + @SerializedName("error") + String error; + + /** + * Array of File ids containing evidence the + * acquiring merchant provided with their pre-arbitration response. + */ + @SerializedName("merchant_evidence_files") + List merchantEvidenceFiles; + } + + /** + * For more details about PreArbitrationSubmission, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PreArbitrationSubmission extends StripeObject { + /** Error message if processing the acquiring merchant's pre-arbitration submission failed. */ + @SerializedName("error") + String error; + + /** + * Array of File ids containing evidence the + * acquiring merchant provided with their pre-arbitration submission. + */ + @SerializedName("merchant_evidence_files") + List merchantEvidenceFiles; + } + } + /** * For more details about Treasury, please refer to the API * Reference. @@ -1195,6 +1287,7 @@ public static class Treasury extends StripeObject { public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(evidence, responseGetter); + trySetResponseGetter(networkLifecycle, responseGetter); trySetResponseGetter(transaction, responseGetter); trySetResponseGetter(treasury, responseGetter); } diff --git a/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java b/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java index 193b3a4f8a3..17037bbb19b 100644 --- a/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java +++ b/src/main/java/com/stripe/model/sharedpayment/GrantedToken.java @@ -224,6 +224,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("fpx") Fpx fpx; + @SerializedName("gift_card") + GiftCard giftCard; + @SerializedName("giropay") Giropay giropay; @@ -347,14 +350,14 @@ public static class PaymentMethodDetails extends StripeObject { * {@code alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code * bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code card}, {@code * card_present}, {@code cashapp}, {@code crypto}, {@code custom}, {@code customer_balance}, - * {@code eps}, {@code fpx}, {@code giropay}, {@code gopay}, {@code grabpay}, {@code - * id_bank_transfer}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, - * {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code - * multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, {@code - * pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code paypay}, {@code payto}, - * {@code pix}, {@code promptpay}, {@code qris}, {@code rechnung}, {@code revolut_pay}, {@code - * samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code shopeepay}, {@code sofort}, {@code - * stripe_balance}, {@code sunbit}, {@code swish}, {@code twint}, {@code upi}, {@code + * {@code eps}, {@code fpx}, {@code gift_card}, {@code giropay}, {@code gopay}, {@code grabpay}, + * {@code id_bank_transfer}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code + * klarna}, {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, + * {@code multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, + * {@code pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code paypay}, {@code + * payto}, {@code pix}, {@code promptpay}, {@code qris}, {@code rechnung}, {@code revolut_pay}, + * {@code samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code shopeepay}, {@code sofort}, + * {@code stripe_balance}, {@code sunbit}, {@code swish}, {@code twint}, {@code upi}, {@code * us_bank_account}, {@code wechat_pay}, or {@code zip}. */ @SerializedName("type") @@ -1154,6 +1157,43 @@ public static class Fpx extends StripeObject { String bank; } + /** + * For more details about GiftCard, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard extends StripeObject { + /** + * The brand of the gift card. + * + *

One of {@code fiserv_valuelink}, {@code givex}, or {@code svs}. + */ + @SerializedName("brand") + String brand; + + /** The expiration month of the gift card. */ + @SerializedName("exp_month") + Long expMonth; + + /** The expiration year of the gift card. */ + @SerializedName("exp_year") + Long expYear; + + /** Uniquely identifies the gift card. */ + @SerializedName("fingerprint") + String fingerprint; + + /** The first six digits of the gift card number. */ + @SerializedName("first6") + String first6; + + /** The last four digits of the gift card number. */ + @SerializedName("last4") + String last4; + } + /** * For more details about Giropay, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index e50af5d67e6..55fdb2c4cea 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -3821,6 +3821,10 @@ public static class CardPayments { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Protections to apply to this capability. */ + @SerializedName("protections") + Protections protections; + /** * Passing true requests the capability for the account, if it is not already requested. A * requested capability may not immediately become active. Any requirements to activate the @@ -3829,8 +3833,10 @@ public static class CardPayments { @SerializedName("requested") Boolean requested; - private CardPayments(Map extraParams, Boolean requested) { + private CardPayments( + Map extraParams, Protections protections, Boolean requested) { this.extraParams = extraParams; + this.protections = protections; this.requested = requested; } @@ -3841,12 +3847,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Protections protections; + private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Capabilities.CardPayments build() { return new AccountCreateParams.Capabilities.CardPayments( - this.extraParams, this.requested); + this.extraParams, this.protections, this.requested); } /** @@ -3877,6 +3885,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Protections to apply to this capability. */ + public Builder setProtections( + AccountCreateParams.Capabilities.CardPayments.Protections protections) { + this.protections = protections; + return this; + } + /** * Passing true requests the capability for the account, if it is not already requested. A * requested capability may not immediately become active. Any requirements to activate the @@ -3887,6 +3902,160 @@ public Builder setRequested(Boolean requested) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Protections { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Protection for connected accounts migrating from another PSP. + */ + @SerializedName("psp_migration") + PspMigration pspMigration; + + private Protections(Map extraParams, PspMigration pspMigration) { + this.extraParams = extraParams; + this.pspMigration = pspMigration; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PspMigration pspMigration; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Capabilities.CardPayments.Protections build() { + return new AccountCreateParams.Capabilities.CardPayments.Protections( + this.extraParams, this.pspMigration); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Capabilities.CardPayments.Protections#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Capabilities.CardPayments.Protections#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Protection for connected accounts migrating from another + * PSP. + */ + public Builder setPspMigration( + AccountCreateParams.Capabilities.CardPayments.Protections.PspMigration pspMigration) { + this.pspMigration = pspMigration; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PspMigration { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Passing true requests the protection. */ + @SerializedName("requested") + Boolean requested; + + private PspMigration(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Capabilities.CardPayments.Protections.PspMigration build() { + return new AccountCreateParams.Capabilities.CardPayments.Protections.PspMigration( + this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountCreateParams.Capabilities.CardPayments.Protections.PspMigration#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountCreateParams.Capabilities.CardPayments.Protections.PspMigration#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Passing true requests the protection. */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 7b8dae58917..3c8e09b2b9e 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -3919,6 +3919,10 @@ public static class CardPayments { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Protections to apply to this capability. */ + @SerializedName("protections") + Protections protections; + /** * Passing true requests the capability for the account, if it is not already requested. A * requested capability may not immediately become active. Any requirements to activate the @@ -3927,8 +3931,10 @@ public static class CardPayments { @SerializedName("requested") Boolean requested; - private CardPayments(Map extraParams, Boolean requested) { + private CardPayments( + Map extraParams, Protections protections, Boolean requested) { this.extraParams = extraParams; + this.protections = protections; this.requested = requested; } @@ -3939,12 +3945,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Protections protections; + private Boolean requested; /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Capabilities.CardPayments build() { return new AccountUpdateParams.Capabilities.CardPayments( - this.extraParams, this.requested); + this.extraParams, this.protections, this.requested); } /** @@ -3975,6 +3983,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Protections to apply to this capability. */ + public Builder setProtections( + AccountUpdateParams.Capabilities.CardPayments.Protections protections) { + this.protections = protections; + return this; + } + /** * Passing true requests the capability for the account, if it is not already requested. A * requested capability may not immediately become active. Any requirements to activate the @@ -3985,6 +4000,160 @@ public Builder setRequested(Boolean requested) { return this; } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Protections { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. Protection for connected accounts migrating from another PSP. + */ + @SerializedName("psp_migration") + PspMigration pspMigration; + + private Protections(Map extraParams, PspMigration pspMigration) { + this.extraParams = extraParams; + this.pspMigration = pspMigration; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private PspMigration pspMigration; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Capabilities.CardPayments.Protections build() { + return new AccountUpdateParams.Capabilities.CardPayments.Protections( + this.extraParams, this.pspMigration); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Capabilities.CardPayments.Protections#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Capabilities.CardPayments.Protections#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. Protection for connected accounts migrating from another + * PSP. + */ + public Builder setPspMigration( + AccountUpdateParams.Capabilities.CardPayments.Protections.PspMigration pspMigration) { + this.pspMigration = pspMigration; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PspMigration { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Passing true requests the protection. */ + @SerializedName("requested") + Boolean requested; + + private PspMigration(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Capabilities.CardPayments.Protections.PspMigration build() { + return new AccountUpdateParams.Capabilities.CardPayments.Protections.PspMigration( + this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountUpdateParams.Capabilities.CardPayments.Protections.PspMigration#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountUpdateParams.Capabilities.CardPayments.Protections.PspMigration#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Passing true requests the protection. */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + } } @Getter diff --git a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java index 8217fc29aac..f976267170e 100644 --- a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java +++ b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java @@ -357,6 +357,13 @@ public static class PaymentMethodData { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -695,6 +702,7 @@ private PaymentMethodData( Eps eps, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -761,6 +769,7 @@ private PaymentMethodData( this.eps = eps; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -854,6 +863,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -969,6 +980,7 @@ public ConfirmationTokenCreateParams.PaymentMethodData build() { this.eps, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -1225,6 +1237,16 @@ public Builder setFpx(ConfirmationTokenCreateParams.PaymentMethodData.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift + * card payment method. + */ + public Builder setGiftCard( + ConfirmationTokenCreateParams.PaymentMethodData.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -3336,6 +3358,78 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + String giftCard; + + private GiftCard(Map extraParams, String giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfirmationTokenCreateParams.PaymentMethodData.GiftCard build() { + return new ConfirmationTokenCreateParams.PaymentMethodData.GiftCard( + this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfirmationTokenCreateParams.PaymentMethodData.GiftCard#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfirmationTokenCreateParams.PaymentMethodData.GiftCard#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -6914,6 +7008,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index 0d88f42003e..5961f09c913 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -297,6 +297,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java index 73ffa3c3048..1a73ff1aa2c 100644 --- a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java @@ -297,6 +297,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 6378daf5044..2d07457ac66 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -16327,6 +16327,13 @@ public static class PaymentMethodData { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -16665,6 +16672,7 @@ private PaymentMethodData( Eps eps, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -16731,6 +16739,7 @@ private PaymentMethodData( this.eps = eps; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -16824,6 +16833,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -16939,6 +16950,7 @@ public PaymentIntentConfirmParams.PaymentMethodData build() { this.eps, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -17195,6 +17207,15 @@ public Builder setFpx(PaymentIntentConfirmParams.PaymentMethodData.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift + * card payment method. + */ + public Builder setGiftCard(PaymentIntentConfirmParams.PaymentMethodData.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -19295,6 +19316,78 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + String giftCard; + + private GiftCard(Map extraParams, String giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodData.GiftCard build() { + return new PaymentIntentConfirmParams.PaymentMethodData.GiftCard( + this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodData.GiftCard#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodData.GiftCard#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -22859,6 +22952,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), @@ -49479,6 +49575,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index aef263c7d4f..3df332d9d09 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -16826,6 +16826,13 @@ public static class PaymentMethodData { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -17164,6 +17171,7 @@ private PaymentMethodData( Eps eps, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -17230,6 +17238,7 @@ private PaymentMethodData( this.eps = eps; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -17323,6 +17332,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -17438,6 +17449,7 @@ public PaymentIntentCreateParams.PaymentMethodData build() { this.eps, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -17691,6 +17703,15 @@ public Builder setFpx(PaymentIntentCreateParams.PaymentMethodData.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift + * card payment method. + */ + public Builder setGiftCard(PaymentIntentCreateParams.PaymentMethodData.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -19782,6 +19803,78 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + String giftCard; + + private GiftCard(Map extraParams, String giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodData.GiftCard build() { + return new PaymentIntentCreateParams.PaymentMethodData.GiftCard( + this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -23344,6 +23437,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), @@ -50127,6 +50223,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 004b259907d..02958767e1b 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -17770,6 +17770,13 @@ public static class PaymentMethodData { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -18108,6 +18115,7 @@ private PaymentMethodData( Eps eps, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -18174,6 +18182,7 @@ private PaymentMethodData( this.eps = eps; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -18267,6 +18276,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -18382,6 +18393,7 @@ public PaymentIntentUpdateParams.PaymentMethodData build() { this.eps, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -18635,6 +18647,15 @@ public Builder setFpx(PaymentIntentUpdateParams.PaymentMethodData.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift + * card payment method. + */ + public Builder setGiftCard(PaymentIntentUpdateParams.PaymentMethodData.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -20834,6 +20855,84 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + Object giftCard; + + private GiftCard(Map extraParams, Object giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodData.GiftCard build() { + return new PaymentIntentUpdateParams.PaymentMethodData.GiftCard( + this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(EmptyParam giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -24501,6 +24600,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), @@ -52226,6 +52328,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/PaymentLocationCreateParams.java b/src/main/java/com/stripe/param/PaymentLocationCreateParams.java new file mode 100644 index 00000000000..daa48e8af86 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentLocationCreateParams.java @@ -0,0 +1,382 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentLocationCreateParams extends ApiRequestParams { + /** Required. The full address of the location. */ + @SerializedName("address") + Address address; + + /** Identification numbers associated with the location. */ + @SerializedName("business_registration") + BusinessRegistration businessRegistration; + + /** Required. A name for the location. */ + @SerializedName("display_name") + String displayName; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private PaymentLocationCreateParams( + Address address, + BusinessRegistration businessRegistration, + String displayName, + List expand, + Map extraParams) { + this.address = address; + this.businessRegistration = businessRegistration; + this.displayName = displayName; + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private BusinessRegistration businessRegistration; + + private String displayName; + + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLocationCreateParams build() { + return new PaymentLocationCreateParams( + this.address, this.businessRegistration, this.displayName, this.expand, this.extraParams); + } + + /** Required. The full address of the location. */ + public Builder setAddress(PaymentLocationCreateParams.Address address) { + this.address = address; + return this; + } + + /** Identification numbers associated with the location. */ + public Builder setBusinessRegistration( + PaymentLocationCreateParams.BusinessRegistration businessRegistration) { + this.businessRegistration = businessRegistration; + return this; + } + + /** Required. A name for the location. */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentLocationCreateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentLocationCreateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLocationCreateParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLocationCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** + * State, county, province, or region (ISO + * 3166-2). + */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLocationCreateParams.Address build() { + return new PaymentLocationCreateParams.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLocationCreateParams.Address#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLocationCreateParams.Address#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State, county, province, or region (ISO + * 3166-2). + */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BusinessRegistration { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * 14-digit SIRET (Système d'identification du répertoire des établissements) number for the + * location. + */ + @SerializedName("siret") + String siret; + + private BusinessRegistration(Map extraParams, String siret) { + this.extraParams = extraParams; + this.siret = siret; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String siret; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLocationCreateParams.BusinessRegistration build() { + return new PaymentLocationCreateParams.BusinessRegistration(this.extraParams, this.siret); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLocationCreateParams.BusinessRegistration#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLocationCreateParams.BusinessRegistration#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 14-digit SIRET (Système d'identification du répertoire des établissements) number for the + * location. + */ + public Builder setSiret(String siret) { + this.siret = siret; + return this; + } + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index 4cac6a6b46d..ebaa56615d5 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -180,6 +180,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -519,6 +526,7 @@ private PaymentMethodCreateParams( List expand, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -589,6 +597,7 @@ private PaymentMethodCreateParams( this.expand = expand; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -690,6 +699,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -809,6 +820,7 @@ public PaymentMethodCreateParams build() { this.expand, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -1123,6 +1135,15 @@ public Builder setFpx(PaymentMethodCreateParams.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + public Builder setGiftCard(PaymentMethodCreateParams.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -3466,6 +3487,75 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + String giftCard; + + private GiftCard(Map extraParams, String giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.GiftCard build() { + return new PaymentMethodCreateParams.GiftCard(this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.GiftCard#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.GiftCard#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -7011,6 +7101,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index 0ff519d8043..e7aeb42a16f 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -325,6 +325,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 220a3ed383e..9b235422f44 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -786,6 +786,13 @@ public static class PaymentMethodData { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -1124,6 +1131,7 @@ private PaymentMethodData( Eps eps, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -1190,6 +1198,7 @@ private PaymentMethodData( this.eps = eps; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -1283,6 +1292,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -1398,6 +1409,7 @@ public SetupIntentConfirmParams.PaymentMethodData build() { this.eps, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -1651,6 +1663,15 @@ public Builder setFpx(SetupIntentConfirmParams.PaymentMethodData.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift + * card payment method. + */ + public Builder setGiftCard(SetupIntentConfirmParams.PaymentMethodData.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -3742,6 +3763,78 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + String giftCard; + + private GiftCard(Map extraParams, String giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.GiftCard build() { + return new SetupIntentConfirmParams.PaymentMethodData.GiftCard( + this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -7303,6 +7396,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index c4f4d42d7eb..1c87ab9827f 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -1324,6 +1324,13 @@ public static class PaymentMethodData { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -1662,6 +1669,7 @@ private PaymentMethodData( Eps eps, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -1728,6 +1736,7 @@ private PaymentMethodData( this.eps = eps; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -1821,6 +1830,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -1936,6 +1947,7 @@ public SetupIntentCreateParams.PaymentMethodData build() { this.eps, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -2189,6 +2201,15 @@ public Builder setFpx(SetupIntentCreateParams.PaymentMethodData.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift + * card payment method. + */ + public Builder setGiftCard(SetupIntentCreateParams.PaymentMethodData.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -4278,6 +4299,78 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + String giftCard; + + private GiftCard(Map extraParams, String giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.GiftCard build() { + return new SetupIntentCreateParams.PaymentMethodData.GiftCard( + this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -7837,6 +7930,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), @@ -13747,6 +13843,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index f523acbff19..dd234de1581 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -693,6 +693,13 @@ public static class PaymentMethodData { @SerializedName("fpx") Fpx fpx; + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift card + * payment method. + */ + @SerializedName("gift_card") + GiftCard giftCard; + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -1031,6 +1038,7 @@ private PaymentMethodData( Eps eps, Map extraParams, Fpx fpx, + GiftCard giftCard, Giropay giropay, Gopay gopay, Grabpay grabpay, @@ -1097,6 +1105,7 @@ private PaymentMethodData( this.eps = eps; this.extraParams = extraParams; this.fpx = fpx; + this.giftCard = giftCard; this.giropay = giropay; this.gopay = gopay; this.grabpay = grabpay; @@ -1190,6 +1199,8 @@ public static class Builder { private Fpx fpx; + private GiftCard giftCard; + private Giropay giropay; private Gopay gopay; @@ -1305,6 +1316,7 @@ public SetupIntentUpdateParams.PaymentMethodData build() { this.eps, this.extraParams, this.fpx, + this.giftCard, this.giropay, this.gopay, this.grabpay, @@ -1558,6 +1570,15 @@ public Builder setFpx(SetupIntentUpdateParams.PaymentMethodData.Fpx fpx) { return this; } + /** + * If this is a {@code gift_card} PaymentMethod, this hash contains details about the gift + * card payment method. + */ + public Builder setGiftCard(SetupIntentUpdateParams.PaymentMethodData.GiftCard giftCard) { + this.giftCard = giftCard; + return this; + } + /** * If this is a {@code giropay} PaymentMethod, this hash contains details about the Giropay * payment method. @@ -3755,6 +3776,84 @@ public enum Bank implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class GiftCard { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The gift card ID to redeem */ + @SerializedName("gift_card") + Object giftCard; + + private GiftCard(Map extraParams, Object giftCard) { + this.extraParams = extraParams; + this.giftCard = giftCard; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object giftCard; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.GiftCard build() { + return new SetupIntentUpdateParams.PaymentMethodData.GiftCard( + this.extraParams, this.giftCard); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodData.GiftCard#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(String giftCard) { + this.giftCard = giftCard; + return this; + } + + /** Required. The gift card ID to redeem */ + public Builder setGiftCard(EmptyParam giftCard) { + this.giftCard = giftCard; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Giropay { @@ -7419,6 +7518,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), @@ -13419,6 +13521,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("fpx") FPX("fpx"), + @SerializedName("gift_card") + GIFT_CARD("gift_card"), + @SerializedName("giropay") GIROPAY("giropay"), diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionConfirmParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionConfirmParams.java index a38fc2355e7..553e480769d 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionConfirmParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionConfirmParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -34,6 +35,10 @@ public class RequestedSessionConfirmParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** The metadata for this requested session. */ + @SerializedName("metadata") + Object metadata; + /** The PaymentMethod to use with the requested session. */ @SerializedName("payment_method") String paymentMethod; @@ -54,6 +59,7 @@ private RequestedSessionConfirmParams( BuyerConsents buyerConsents, List expand, Map extraParams, + Object metadata, String paymentMethod, String returnUrl, RiskDetails riskDetails) { @@ -61,6 +67,7 @@ private RequestedSessionConfirmParams( this.buyerConsents = buyerConsents; this.expand = expand; this.extraParams = extraParams; + this.metadata = metadata; this.paymentMethod = paymentMethod; this.returnUrl = returnUrl; this.riskDetails = riskDetails; @@ -79,6 +86,8 @@ public static class Builder { private Map extraParams; + private Object metadata; + private String paymentMethod; private String returnUrl; @@ -92,6 +101,7 @@ public RequestedSessionConfirmParams build() { this.buyerConsents, this.expand, this.extraParams, + this.metadata, this.paymentMethod, this.returnUrl, this.riskDetails); @@ -162,6 +172,46 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * RequestedSessionConfirmParams#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link RequestedSessionConfirmParams#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** The metadata for this requested session. */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** The metadata for this requested session. */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + /** The PaymentMethod to use with the requested session. */ public Builder setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; diff --git a/src/main/java/com/stripe/service/PaymentLocationService.java b/src/main/java/com/stripe/service/PaymentLocationService.java new file mode 100644 index 00000000000..cc52f7d7777 --- /dev/null +++ b/src/main/java/com/stripe/service/PaymentLocationService.java @@ -0,0 +1,37 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.stripe.exception.StripeException; +import com.stripe.model.PaymentLocation; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.PaymentLocationCreateParams; + +public final class PaymentLocationService extends ApiService { + public PaymentLocationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Create a Payment Location. */ + public PaymentLocation create(PaymentLocationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Create a Payment Location. */ + public PaymentLocation create(PaymentLocationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/payment_locations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentLocation.class); + } +} diff --git a/src/main/java/com/stripe/service/V1Services.java b/src/main/java/com/stripe/service/V1Services.java index a710222f790..ad9438bde9c 100644 --- a/src/main/java/com/stripe/service/V1Services.java +++ b/src/main/java/com/stripe/service/V1Services.java @@ -205,6 +205,10 @@ public com.stripe.service.PaymentLinkService paymentLinks() { return new com.stripe.service.PaymentLinkService(this.getResponseGetter()); } + public com.stripe.service.PaymentLocationService paymentLocations() { + return new com.stripe.service.PaymentLocationService(this.getResponseGetter()); + } + public com.stripe.service.PaymentMethodConfigurationService paymentMethodConfigurations() { return new com.stripe.service.PaymentMethodConfigurationService(this.getResponseGetter()); } From c059cf90181e917067763cdc83f8567caaaccaa0 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 00:37:42 +0000 Subject: [PATCH 2/3] Update generated code for v2255 and --- CODEGEN_VERSION | 2 +- .../StripeEventNotificationHandler.java | 2960 +++++++++++++++++ .../events/UnknownEventNotification.java | 1 + .../EventNotificationHandlerEndpoint.java | 108 + .../EventNotificationWebhookHandler.java | 1 + .../model/v2/core/EventNotification.java | 1 + .../StripeEventNotificationHandlerTest.java | 518 +++ 7 files changed, 3590 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/stripe/StripeEventNotificationHandler.java create mode 100644 src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java create mode 100644 src/test/java/com/stripe/StripeEventNotificationHandlerTest.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 575860e41ec..d19d890c6af 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -f0187e75a5c663247a7e8d02c02e8f3c69c9b144 \ No newline at end of file +f02038df5433a605fce164b9af1b8b445252ee4f \ No newline at end of file diff --git a/src/main/java/com/stripe/StripeEventNotificationHandler.java b/src/main/java/com/stripe/StripeEventNotificationHandler.java new file mode 100644 index 00000000000..bbf671f0729 --- /dev/null +++ b/src/main/java/com/stripe/StripeEventNotificationHandler.java @@ -0,0 +1,2960 @@ +// File copied from our code generator; changes here will be overwritten. +package com.stripe; + +// event-notification-class-imports: The beginning of the section generated from our OpenAPI spec +// - hack because we can't format java files whose imports aren't a single contiguous block +// - so _any_ imports in this file have to come from codegen +// - as do these comments, explaining the whole thing +import com.stripe.events.V1AccountApplicationAuthorizedEventNotification; +import com.stripe.events.V1AccountApplicationDeauthorizedEventNotification; +import com.stripe.events.V1AccountExternalAccountCreatedEventNotification; +import com.stripe.events.V1AccountExternalAccountDeletedEventNotification; +import com.stripe.events.V1AccountExternalAccountUpdatedEventNotification; +import com.stripe.events.V1AccountSignalsIncludingDelinquencyCreatedEventNotification; +import com.stripe.events.V1AccountUpdatedEventNotification; +import com.stripe.events.V1ApplicationFeeCreatedEventNotification; +import com.stripe.events.V1ApplicationFeeRefundUpdatedEventNotification; +import com.stripe.events.V1ApplicationFeeRefundedEventNotification; +import com.stripe.events.V1BalanceAvailableEventNotification; +import com.stripe.events.V1BillingAlertTriggeredEventNotification; +import com.stripe.events.V1BillingMeterErrorReportTriggeredEventNotification; +import com.stripe.events.V1BillingMeterNoMeterFoundEventNotification; +import com.stripe.events.V1BillingPortalConfigurationCreatedEventNotification; +import com.stripe.events.V1BillingPortalConfigurationUpdatedEventNotification; +import com.stripe.events.V1BillingPortalSessionCreatedEventNotification; +import com.stripe.events.V1CapabilityUpdatedEventNotification; +import com.stripe.events.V1CashBalanceFundsAvailableEventNotification; +import com.stripe.events.V1ChargeCapturedEventNotification; +import com.stripe.events.V1ChargeDisputeClosedEventNotification; +import com.stripe.events.V1ChargeDisputeCreatedEventNotification; +import com.stripe.events.V1ChargeDisputeFundsReinstatedEventNotification; +import com.stripe.events.V1ChargeDisputeFundsWithdrawnEventNotification; +import com.stripe.events.V1ChargeDisputeUpdatedEventNotification; +import com.stripe.events.V1ChargeExpiredEventNotification; +import com.stripe.events.V1ChargeFailedEventNotification; +import com.stripe.events.V1ChargePendingEventNotification; +import com.stripe.events.V1ChargeRefundUpdatedEventNotification; +import com.stripe.events.V1ChargeRefundedEventNotification; +import com.stripe.events.V1ChargeSucceededEventNotification; +import com.stripe.events.V1ChargeUpdatedEventNotification; +import com.stripe.events.V1CheckoutSessionAsyncPaymentFailedEventNotification; +import com.stripe.events.V1CheckoutSessionAsyncPaymentSucceededEventNotification; +import com.stripe.events.V1CheckoutSessionCompletedEventNotification; +import com.stripe.events.V1CheckoutSessionExpiredEventNotification; +import com.stripe.events.V1ClimateOrderCanceledEventNotification; +import com.stripe.events.V1ClimateOrderCreatedEventNotification; +import com.stripe.events.V1ClimateOrderDelayedEventNotification; +import com.stripe.events.V1ClimateOrderDeliveredEventNotification; +import com.stripe.events.V1ClimateOrderProductSubstitutedEventNotification; +import com.stripe.events.V1ClimateProductCreatedEventNotification; +import com.stripe.events.V1ClimateProductPricingUpdatedEventNotification; +import com.stripe.events.V1CouponCreatedEventNotification; +import com.stripe.events.V1CouponDeletedEventNotification; +import com.stripe.events.V1CouponUpdatedEventNotification; +import com.stripe.events.V1CreditNoteCreatedEventNotification; +import com.stripe.events.V1CreditNoteUpdatedEventNotification; +import com.stripe.events.V1CreditNoteVoidedEventNotification; +import com.stripe.events.V1CustomerCashBalanceTransactionCreatedEventNotification; +import com.stripe.events.V1CustomerCreatedEventNotification; +import com.stripe.events.V1CustomerDeletedEventNotification; +import com.stripe.events.V1CustomerSubscriptionCreatedEventNotification; +import com.stripe.events.V1CustomerSubscriptionDeletedEventNotification; +import com.stripe.events.V1CustomerSubscriptionPausedEventNotification; +import com.stripe.events.V1CustomerSubscriptionPendingUpdateAppliedEventNotification; +import com.stripe.events.V1CustomerSubscriptionPendingUpdateExpiredEventNotification; +import com.stripe.events.V1CustomerSubscriptionResumedEventNotification; +import com.stripe.events.V1CustomerSubscriptionTrialWillEndEventNotification; +import com.stripe.events.V1CustomerSubscriptionUpdatedEventNotification; +import com.stripe.events.V1CustomerTaxIdCreatedEventNotification; +import com.stripe.events.V1CustomerTaxIdDeletedEventNotification; +import com.stripe.events.V1CustomerTaxIdUpdatedEventNotification; +import com.stripe.events.V1CustomerUpdatedEventNotification; +import com.stripe.events.V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification; +import com.stripe.events.V1FileCreatedEventNotification; +import com.stripe.events.V1FinancialConnectionsAccountCreatedEventNotification; +import com.stripe.events.V1FinancialConnectionsAccountDeactivatedEventNotification; +import com.stripe.events.V1FinancialConnectionsAccountDisconnectedEventNotification; +import com.stripe.events.V1FinancialConnectionsAccountReactivatedEventNotification; +import com.stripe.events.V1FinancialConnectionsAccountRefreshedBalanceEventNotification; +import com.stripe.events.V1FinancialConnectionsAccountRefreshedOwnershipEventNotification; +import com.stripe.events.V1FinancialConnectionsAccountRefreshedTransactionsEventNotification; +import com.stripe.events.V1IdentityVerificationSessionCanceledEventNotification; +import com.stripe.events.V1IdentityVerificationSessionCreatedEventNotification; +import com.stripe.events.V1IdentityVerificationSessionProcessingEventNotification; +import com.stripe.events.V1IdentityVerificationSessionRedactedEventNotification; +import com.stripe.events.V1IdentityVerificationSessionRequiresInputEventNotification; +import com.stripe.events.V1IdentityVerificationSessionVerifiedEventNotification; +import com.stripe.events.V1InvoiceCreatedEventNotification; +import com.stripe.events.V1InvoiceDeletedEventNotification; +import com.stripe.events.V1InvoiceFinalizationFailedEventNotification; +import com.stripe.events.V1InvoiceFinalizedEventNotification; +import com.stripe.events.V1InvoiceMarkedUncollectibleEventNotification; +import com.stripe.events.V1InvoiceOverdueEventNotification; +import com.stripe.events.V1InvoiceOverpaidEventNotification; +import com.stripe.events.V1InvoicePaidEventNotification; +import com.stripe.events.V1InvoicePaymentActionRequiredEventNotification; +import com.stripe.events.V1InvoicePaymentFailedEventNotification; +import com.stripe.events.V1InvoicePaymentPaidEventNotification; +import com.stripe.events.V1InvoicePaymentSucceededEventNotification; +import com.stripe.events.V1InvoiceSentEventNotification; +import com.stripe.events.V1InvoiceUpcomingEventNotification; +import com.stripe.events.V1InvoiceUpdatedEventNotification; +import com.stripe.events.V1InvoiceVoidedEventNotification; +import com.stripe.events.V1InvoiceWillBeDueEventNotification; +import com.stripe.events.V1InvoiceitemCreatedEventNotification; +import com.stripe.events.V1InvoiceitemDeletedEventNotification; +import com.stripe.events.V1IssuingAuthorizationCreatedEventNotification; +import com.stripe.events.V1IssuingAuthorizationRequestEventNotification; +import com.stripe.events.V1IssuingAuthorizationUpdatedEventNotification; +import com.stripe.events.V1IssuingCardCreatedEventNotification; +import com.stripe.events.V1IssuingCardUpdatedEventNotification; +import com.stripe.events.V1IssuingCardholderCreatedEventNotification; +import com.stripe.events.V1IssuingCardholderUpdatedEventNotification; +import com.stripe.events.V1IssuingDisputeClosedEventNotification; +import com.stripe.events.V1IssuingDisputeCreatedEventNotification; +import com.stripe.events.V1IssuingDisputeFundsReinstatedEventNotification; +import com.stripe.events.V1IssuingDisputeFundsRescindedEventNotification; +import com.stripe.events.V1IssuingDisputeSubmittedEventNotification; +import com.stripe.events.V1IssuingDisputeUpdatedEventNotification; +import com.stripe.events.V1IssuingPersonalizationDesignActivatedEventNotification; +import com.stripe.events.V1IssuingPersonalizationDesignDeactivatedEventNotification; +import com.stripe.events.V1IssuingPersonalizationDesignRejectedEventNotification; +import com.stripe.events.V1IssuingPersonalizationDesignUpdatedEventNotification; +import com.stripe.events.V1IssuingTokenCreatedEventNotification; +import com.stripe.events.V1IssuingTokenUpdatedEventNotification; +import com.stripe.events.V1IssuingTransactionCreatedEventNotification; +import com.stripe.events.V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification; +import com.stripe.events.V1IssuingTransactionUpdatedEventNotification; +import com.stripe.events.V1MandateUpdatedEventNotification; +import com.stripe.events.V1PaymentIntentAmountCapturableUpdatedEventNotification; +import com.stripe.events.V1PaymentIntentCanceledEventNotification; +import com.stripe.events.V1PaymentIntentCreatedEventNotification; +import com.stripe.events.V1PaymentIntentPartiallyFundedEventNotification; +import com.stripe.events.V1PaymentIntentPaymentFailedEventNotification; +import com.stripe.events.V1PaymentIntentProcessingEventNotification; +import com.stripe.events.V1PaymentIntentRequiresActionEventNotification; +import com.stripe.events.V1PaymentIntentSucceededEventNotification; +import com.stripe.events.V1PaymentLinkCreatedEventNotification; +import com.stripe.events.V1PaymentLinkUpdatedEventNotification; +import com.stripe.events.V1PaymentMethodAttachedEventNotification; +import com.stripe.events.V1PaymentMethodAutomaticallyUpdatedEventNotification; +import com.stripe.events.V1PaymentMethodDetachedEventNotification; +import com.stripe.events.V1PaymentMethodUpdatedEventNotification; +import com.stripe.events.V1PayoutCanceledEventNotification; +import com.stripe.events.V1PayoutCreatedEventNotification; +import com.stripe.events.V1PayoutFailedEventNotification; +import com.stripe.events.V1PayoutPaidEventNotification; +import com.stripe.events.V1PayoutReconciliationCompletedEventNotification; +import com.stripe.events.V1PayoutUpdatedEventNotification; +import com.stripe.events.V1PersonCreatedEventNotification; +import com.stripe.events.V1PersonDeletedEventNotification; +import com.stripe.events.V1PersonUpdatedEventNotification; +import com.stripe.events.V1PlanCreatedEventNotification; +import com.stripe.events.V1PlanDeletedEventNotification; +import com.stripe.events.V1PlanUpdatedEventNotification; +import com.stripe.events.V1PriceCreatedEventNotification; +import com.stripe.events.V1PriceDeletedEventNotification; +import com.stripe.events.V1PriceUpdatedEventNotification; +import com.stripe.events.V1ProductCreatedEventNotification; +import com.stripe.events.V1ProductDeletedEventNotification; +import com.stripe.events.V1ProductUpdatedEventNotification; +import com.stripe.events.V1PromotionCodeCreatedEventNotification; +import com.stripe.events.V1PromotionCodeUpdatedEventNotification; +import com.stripe.events.V1QuoteAcceptedEventNotification; +import com.stripe.events.V1QuoteCanceledEventNotification; +import com.stripe.events.V1QuoteCreatedEventNotification; +import com.stripe.events.V1QuoteFinalizedEventNotification; +import com.stripe.events.V1RadarEarlyFraudWarningCreatedEventNotification; +import com.stripe.events.V1RadarEarlyFraudWarningUpdatedEventNotification; +import com.stripe.events.V1RefundCreatedEventNotification; +import com.stripe.events.V1RefundFailedEventNotification; +import com.stripe.events.V1RefundUpdatedEventNotification; +import com.stripe.events.V1ReviewClosedEventNotification; +import com.stripe.events.V1ReviewOpenedEventNotification; +import com.stripe.events.V1SetupIntentCanceledEventNotification; +import com.stripe.events.V1SetupIntentCreatedEventNotification; +import com.stripe.events.V1SetupIntentRequiresActionEventNotification; +import com.stripe.events.V1SetupIntentSetupFailedEventNotification; +import com.stripe.events.V1SetupIntentSucceededEventNotification; +import com.stripe.events.V1SigmaScheduledQueryRunCreatedEventNotification; +import com.stripe.events.V1SourceCanceledEventNotification; +import com.stripe.events.V1SourceChargeableEventNotification; +import com.stripe.events.V1SourceFailedEventNotification; +import com.stripe.events.V1SourceRefundAttributesRequiredEventNotification; +import com.stripe.events.V1SubscriptionScheduleAbortedEventNotification; +import com.stripe.events.V1SubscriptionScheduleCanceledEventNotification; +import com.stripe.events.V1SubscriptionScheduleCompletedEventNotification; +import com.stripe.events.V1SubscriptionScheduleCreatedEventNotification; +import com.stripe.events.V1SubscriptionScheduleExpiringEventNotification; +import com.stripe.events.V1SubscriptionScheduleReleasedEventNotification; +import com.stripe.events.V1SubscriptionScheduleUpdatedEventNotification; +import com.stripe.events.V1TaxRateCreatedEventNotification; +import com.stripe.events.V1TaxRateUpdatedEventNotification; +import com.stripe.events.V1TaxSettingsUpdatedEventNotification; +import com.stripe.events.V1TerminalReaderActionFailedEventNotification; +import com.stripe.events.V1TerminalReaderActionSucceededEventNotification; +import com.stripe.events.V1TerminalReaderActionUpdatedEventNotification; +import com.stripe.events.V1TestHelpersTestClockAdvancingEventNotification; +import com.stripe.events.V1TestHelpersTestClockCreatedEventNotification; +import com.stripe.events.V1TestHelpersTestClockDeletedEventNotification; +import com.stripe.events.V1TestHelpersTestClockInternalFailureEventNotification; +import com.stripe.events.V1TestHelpersTestClockReadyEventNotification; +import com.stripe.events.V1TopupCanceledEventNotification; +import com.stripe.events.V1TopupCreatedEventNotification; +import com.stripe.events.V1TopupFailedEventNotification; +import com.stripe.events.V1TopupReversedEventNotification; +import com.stripe.events.V1TopupSucceededEventNotification; +import com.stripe.events.V1TransferCreatedEventNotification; +import com.stripe.events.V1TransferReversedEventNotification; +import com.stripe.events.V1TransferUpdatedEventNotification; +import com.stripe.events.V2BillingCadenceBilledEventNotification; +import com.stripe.events.V2BillingCadenceCanceledEventNotification; +import com.stripe.events.V2BillingCadenceCreatedEventNotification; +import com.stripe.events.V2BillingLicenseFeeCreatedEventNotification; +import com.stripe.events.V2BillingLicenseFeeUpdatedEventNotification; +import com.stripe.events.V2BillingLicenseFeeVersionCreatedEventNotification; +import com.stripe.events.V2BillingLicensedItemCreatedEventNotification; +import com.stripe.events.V2BillingLicensedItemUpdatedEventNotification; +import com.stripe.events.V2BillingMeteredItemCreatedEventNotification; +import com.stripe.events.V2BillingMeteredItemUpdatedEventNotification; +import com.stripe.events.V2BillingPricingPlanComponentCreatedEventNotification; +import com.stripe.events.V2BillingPricingPlanComponentUpdatedEventNotification; +import com.stripe.events.V2BillingPricingPlanCreatedEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionCollectionAwaitingCustomerActionEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionCollectionCurrentEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionCollectionPastDueEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionCollectionPausedEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionCollectionUnpaidEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionServicingActivatedEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionServicingCanceledEventNotification; +import com.stripe.events.V2BillingPricingPlanSubscriptionServicingPausedEventNotification; +import com.stripe.events.V2BillingPricingPlanUpdatedEventNotification; +import com.stripe.events.V2BillingPricingPlanVersionCreatedEventNotification; +import com.stripe.events.V2BillingRateCardCreatedEventNotification; +import com.stripe.events.V2BillingRateCardCustomPricingUnitOverageRateCreatedEventNotification; +import com.stripe.events.V2BillingRateCardRateCreatedEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionActivatedEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionCanceledEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionCollectionAwaitingCustomerActionEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionCollectionCurrentEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionCollectionPastDueEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionCollectionPausedEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionCollectionUnpaidEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionServicingActivatedEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionServicingCanceledEventNotification; +import com.stripe.events.V2BillingRateCardSubscriptionServicingPausedEventNotification; +import com.stripe.events.V2BillingRateCardUpdatedEventNotification; +import com.stripe.events.V2BillingRateCardVersionCreatedEventNotification; +import com.stripe.events.V2CommerceProductCatalogImportsFailedEventNotification; +import com.stripe.events.V2CommerceProductCatalogImportsProcessingEventNotification; +import com.stripe.events.V2CommerceProductCatalogImportsSucceededEventNotification; +import com.stripe.events.V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification; +import com.stripe.events.V2CoreAccountClosedEventNotification; +import com.stripe.events.V2CoreAccountCreatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationCardCreatorCapabilityStatusUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationCardCreatorUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingConfigurationStorerUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingDefaultsUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingIdentityUpdatedEventNotification; +import com.stripe.events.V2CoreAccountIncludingRequirementsUpdatedEventNotification; +import com.stripe.events.V2CoreAccountLinkReturnedEventNotification; +import com.stripe.events.V2CoreAccountPersonCreatedEventNotification; +import com.stripe.events.V2CoreAccountPersonDeletedEventNotification; +import com.stripe.events.V2CoreAccountPersonUpdatedEventNotification; +import com.stripe.events.V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification; +import com.stripe.events.V2CoreAccountUpdatedEventNotification; +import com.stripe.events.V2CoreApprovalRequestApprovedEventNotification; +import com.stripe.events.V2CoreApprovalRequestCanceledEventNotification; +import com.stripe.events.V2CoreApprovalRequestCreatedEventNotification; +import com.stripe.events.V2CoreApprovalRequestExpiredEventNotification; +import com.stripe.events.V2CoreApprovalRequestFailedEventNotification; +import com.stripe.events.V2CoreApprovalRequestRejectedEventNotification; +import com.stripe.events.V2CoreApprovalRequestSucceededEventNotification; +import com.stripe.events.V2CoreBatchJobBatchFailedEventNotification; +import com.stripe.events.V2CoreBatchJobCanceledEventNotification; +import com.stripe.events.V2CoreBatchJobCompletedEventNotification; +import com.stripe.events.V2CoreBatchJobCreatedEventNotification; +import com.stripe.events.V2CoreBatchJobReadyForUploadEventNotification; +import com.stripe.events.V2CoreBatchJobTimeoutEventNotification; +import com.stripe.events.V2CoreBatchJobUpdatedEventNotification; +import com.stripe.events.V2CoreBatchJobUploadTimeoutEventNotification; +import com.stripe.events.V2CoreBatchJobValidatingEventNotification; +import com.stripe.events.V2CoreBatchJobValidationFailedEventNotification; +import com.stripe.events.V2CoreClaimableSandboxClaimedEventNotification; +import com.stripe.events.V2CoreClaimableSandboxCreatedEventNotification; +import com.stripe.events.V2CoreClaimableSandboxExpiredEventNotification; +import com.stripe.events.V2CoreClaimableSandboxExpiringEventNotification; +import com.stripe.events.V2CoreClaimableSandboxUpdatedEventNotification; +import com.stripe.events.V2CoreEventDestinationPingEventNotification; +import com.stripe.events.V2CoreHealthApiErrorFiringEventNotification; +import com.stripe.events.V2CoreHealthApiErrorResolvedEventNotification; +import com.stripe.events.V2CoreHealthApiLatencyFiringEventNotification; +import com.stripe.events.V2CoreHealthApiLatencyResolvedEventNotification; +import com.stripe.events.V2CoreHealthAuthorizationRateDropFiringEventNotification; +import com.stripe.events.V2CoreHealthAuthorizationRateDropResolvedEventNotification; +import com.stripe.events.V2CoreHealthEventGenerationFailureResolvedEventNotification; +import com.stripe.events.V2CoreHealthFraudRateIncreasedEventNotification; +import com.stripe.events.V2CoreHealthIssuingAuthorizationRequestErrorsFiringEventNotification; +import com.stripe.events.V2CoreHealthIssuingAuthorizationRequestErrorsResolvedEventNotification; +import com.stripe.events.V2CoreHealthIssuingAuthorizationRequestTimeoutFiringEventNotification; +import com.stripe.events.V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEventNotification; +import com.stripe.events.V2CoreHealthMeterEventSummariesDelayedFiringEventNotification; +import com.stripe.events.V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification; +import com.stripe.events.V2CoreHealthPaymentMethodErrorFiringEventNotification; +import com.stripe.events.V2CoreHealthPaymentMethodErrorResolvedEventNotification; +import com.stripe.events.V2CoreHealthSepaDebitDelayedFiringEventNotification; +import com.stripe.events.V2CoreHealthSepaDebitDelayedResolvedEventNotification; +import com.stripe.events.V2CoreHealthTrafficVolumeDropFiringEventNotification; +import com.stripe.events.V2CoreHealthTrafficVolumeDropResolvedEventNotification; +import com.stripe.events.V2CoreHealthWebhookLatencyFiringEventNotification; +import com.stripe.events.V2CoreHealthWebhookLatencyResolvedEventNotification; +import com.stripe.events.V2DataReportingQueryRunCreatedEventNotification; +import com.stripe.events.V2DataReportingQueryRunFailedEventNotification; +import com.stripe.events.V2DataReportingQueryRunSucceededEventNotification; +import com.stripe.events.V2DataReportingQueryRunUpdatedEventNotification; +import com.stripe.events.V2ExtendExtensionRunFailedEventNotification; +import com.stripe.events.V2ExtendWorkflowRunFailedEventNotification; +import com.stripe.events.V2ExtendWorkflowRunStartedEventNotification; +import com.stripe.events.V2ExtendWorkflowRunSucceededEventNotification; +import com.stripe.events.V2IamApiKeyCreatedEventNotification; +import com.stripe.events.V2IamApiKeyDefaultSecretRevealedEventNotification; +import com.stripe.events.V2IamApiKeyExpiredEventNotification; +import com.stripe.events.V2IamApiKeyPermissionsUpdatedEventNotification; +import com.stripe.events.V2IamApiKeyRotatedEventNotification; +import com.stripe.events.V2IamApiKeyUpdatedEventNotification; +import com.stripe.events.V2IamStripeAccessGrantApprovedEventNotification; +import com.stripe.events.V2IamStripeAccessGrantCanceledEventNotification; +import com.stripe.events.V2IamStripeAccessGrantDeniedEventNotification; +import com.stripe.events.V2IamStripeAccessGrantRemovedEventNotification; +import com.stripe.events.V2IamStripeAccessGrantRequestedEventNotification; +import com.stripe.events.V2IamStripeAccessGrantUpdatedEventNotification; +import com.stripe.events.V2MoneyManagementAdjustmentCreatedEventNotification; +import com.stripe.events.V2MoneyManagementFinancialAccountCreatedEventNotification; +import com.stripe.events.V2MoneyManagementFinancialAccountUpdatedEventNotification; +import com.stripe.events.V2MoneyManagementFinancialAddressActivatedEventNotification; +import com.stripe.events.V2MoneyManagementFinancialAddressFailedEventNotification; +import com.stripe.events.V2MoneyManagementInboundTransferAvailableEventNotification; +import com.stripe.events.V2MoneyManagementInboundTransferBankDebitFailedEventNotification; +import com.stripe.events.V2MoneyManagementInboundTransferBankDebitProcessingEventNotification; +import com.stripe.events.V2MoneyManagementInboundTransferBankDebitQueuedEventNotification; +import com.stripe.events.V2MoneyManagementInboundTransferBankDebitReturnedEventNotification; +import com.stripe.events.V2MoneyManagementInboundTransferBankDebitSucceededEventNotification; +import com.stripe.events.V2MoneyManagementOutboundPaymentCanceledEventNotification; +import com.stripe.events.V2MoneyManagementOutboundPaymentCreatedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundPaymentFailedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundPaymentPostedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundPaymentReturnedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundPaymentUpdatedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundTransferCanceledEventNotification; +import com.stripe.events.V2MoneyManagementOutboundTransferCreatedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundTransferFailedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundTransferPostedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundTransferReturnedEventNotification; +import com.stripe.events.V2MoneyManagementOutboundTransferUpdatedEventNotification; +import com.stripe.events.V2MoneyManagementPayoutMethodCreatedEventNotification; +import com.stripe.events.V2MoneyManagementPayoutMethodUpdatedEventNotification; +import com.stripe.events.V2MoneyManagementReceivedCreditAvailableEventNotification; +import com.stripe.events.V2MoneyManagementReceivedCreditFailedEventNotification; +import com.stripe.events.V2MoneyManagementReceivedCreditReturnedEventNotification; +import com.stripe.events.V2MoneyManagementReceivedCreditSucceededEventNotification; +import com.stripe.events.V2MoneyManagementReceivedDebitCanceledEventNotification; +import com.stripe.events.V2MoneyManagementReceivedDebitFailedEventNotification; +import com.stripe.events.V2MoneyManagementReceivedDebitPendingEventNotification; +import com.stripe.events.V2MoneyManagementReceivedDebitSucceededEventNotification; +import com.stripe.events.V2MoneyManagementReceivedDebitUpdatedEventNotification; +import com.stripe.events.V2MoneyManagementRecipientVerificationCreatedEventNotification; +import com.stripe.events.V2MoneyManagementRecipientVerificationUpdatedEventNotification; +import com.stripe.events.V2MoneyManagementTransactionCreatedEventNotification; +import com.stripe.events.V2MoneyManagementTransactionUpdatedEventNotification; +import com.stripe.events.V2OrchestratedCommerceAgreementConfirmedEventNotification; +import com.stripe.events.V2OrchestratedCommerceAgreementCreatedEventNotification; +import com.stripe.events.V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification; +import com.stripe.events.V2OrchestratedCommerceAgreementTerminatedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentAttemptFailedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentAttemptStartedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentAuthorizationAttemptStartedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentCanceledEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentCreatedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentFailedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentPausedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentRequiresCaptureEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentResumedEventNotification; +import com.stripe.events.V2PaymentsOffSessionPaymentSucceededEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentCanceledEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentCreatedEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentErroredEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentFundsNotReceivedEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentMatchedEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentNotFoundEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentSettledEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentSplitCanceledEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentSplitCreatedEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentSplitSettledEventNotification; +import com.stripe.events.V2PaymentsSettlementAllocationIntentSubmittedEventNotification; +import com.stripe.events.V2ReportingReportRunCreatedEventNotification; +import com.stripe.events.V2ReportingReportRunFailedEventNotification; +import com.stripe.events.V2ReportingReportRunSucceededEventNotification; +import com.stripe.events.V2ReportingReportRunUpdatedEventNotification; +import com.stripe.events.V2SignalsAccountSignalFraudulentMerchantReadyEventNotification; +import com.stripe.exception.SignatureVerificationException; +import com.stripe.model.v2.core.EventNotification; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; + +// event-notification-class-imports: The end of the section generated from our OpenAPI spec + +public class StripeEventNotificationHandler { + /** + * Functional interface for callback functions. It describes the signature of the functions you'll + * register on the StripeEventRouter to process incoming event notifications. + */ + @FunctionalInterface + public interface Callback { + // this is an internal-facing method name that dictates how we call the stored method + void process(T event, StripeClient client); + } + + /** + * Functional interface for handling otherwise unhandled events. It's similar to {@link Callback}, + * but includes additional information about the unhandled event to help debug it. + */ + @FunctionalInterface + public interface FallbackCallback { + // this is an internal-facing method name that dictates how we call the stored method + void process( + EventNotification event, StripeClient client, UnhandledNotificationDetails details); + } + + /** + * Information about an unhandled event notification to make it easier to respond (and potentially + * update your integration). + */ + public static class UnhandledNotificationDetails { + private boolean isKnownEventType; + + private UnhandledNotificationDetails(boolean isKnownEventType) { + this.isKnownEventType = isKnownEventType; + } + + /** + * If true, the unhandled event's type is known to the SDK (i.e., it was successfully + * deserialized into a specific `EventNotification` subclass). + */ + public boolean isKnownEventType() { + return isKnownEventType; + } + } + + // this is intentionally naiive to avoid the performance cost of interacting with `volatile`. We + // expect that registrations are done synchronously at startup time and handling will happen + // async, so thread-safe reads aren't important here. + private boolean hasHandledEvent = false; + + private final String webhookSecret; + private final StripeClient client; + private final FallbackCallback fallbackCallback; + private final HashMap> registeredHandlers = + new HashMap<>(); + + public StripeEventNotificationHandler( + String webhookSecret, StripeClient client, FallbackCallback fallbackCallback) { + this.webhookSecret = webhookSecret; + this.client = client; + this.fallbackCallback = fallbackCallback; + } + + private StripeEventNotificationHandler register( + String eventType, Callback handler) { + if (hasHandledEvent) { + throw new IllegalStateException("Cannot register handlers after handling an event"); + } + + if (this.registeredHandlers.containsKey(eventType)) { + throw new IllegalArgumentException("Handler already registered for event type: " + eventType); + } + this.registeredHandlers.put(eventType, handler); + return this; + } + + /** + * Handle an incoming webhook event notification. + * + * @param webhookBody the incoming webhook body + * @param sigHeader the incoming webhook signature header + * @throws SignatureVerificationException if the validation of the webhook signature fails + * @throws IllegalArgumentException if no handler is registered for the event type + */ + @SuppressWarnings("unchecked") + public void handle(String webhookBody, String sigHeader) throws SignatureVerificationException { + // setting this naiively isn't technically thread-safe, but we expect the all callbacks to be + // registered syncronously on startup, so this should be fine + hasHandledEvent = true; + + EventNotification eventNotification = + this.client.parseEventNotification(webhookBody, sigHeader, this.webhookSecret); + + Callback handler = + registeredHandlers.get(eventNotification.getType()); + + // Create a new client with the event's context for thread-safe processing + StripeClient eventClient = this.client.withStripeContext(eventNotification.context); + + if (handler == null) { + boolean isKnownEventType = + !(eventNotification instanceof com.stripe.events.UnknownEventNotification); + UnhandledNotificationDetails details = new UnhandledNotificationDetails(isKnownEventType); + + this.fallbackCallback.process(eventNotification, eventClient, details); + } else { + // this is technically unsafe but we control the registration API so should be ok + ((Callback) handler).process(eventNotification, eventClient); + } + } + + // notification-handler-methods: The beginning of the section generated from our OpenAPI spec + public StripeEventNotificationHandler onV1AccountApplicationAuthorized( + Callback callback) { + this.register("v1.account.application.authorized", callback); + return this; + } + + public StripeEventNotificationHandler onV1AccountApplicationDeauthorized( + Callback callback) { + this.register("v1.account.application.deauthorized", callback); + return this; + } + + public StripeEventNotificationHandler onV1AccountExternalAccountCreated( + Callback callback) { + this.register("v1.account.external_account.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1AccountExternalAccountDeleted( + Callback callback) { + this.register("v1.account.external_account.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1AccountExternalAccountUpdated( + Callback callback) { + this.register("v1.account.external_account.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1AccountUpdated( + Callback callback) { + this.register("v1.account.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1AccountSignalsIncludingDelinquencyCreated( + Callback callback) { + this.register("v1.account_signals[delinquency].created", callback); + return this; + } + + public StripeEventNotificationHandler onV1ApplicationFeeCreated( + Callback callback) { + this.register("v1.application_fee.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1ApplicationFeeRefundUpdated( + Callback callback) { + this.register("v1.application_fee.refund.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1ApplicationFeeRefunded( + Callback callback) { + this.register("v1.application_fee.refunded", callback); + return this; + } + + public StripeEventNotificationHandler onV1BalanceAvailable( + Callback callback) { + this.register("v1.balance.available", callback); + return this; + } + + public StripeEventNotificationHandler onV1BillingAlertTriggered( + Callback callback) { + this.register("v1.billing.alert.triggered", callback); + return this; + } + + public StripeEventNotificationHandler onV1BillingMeterErrorReportTriggered( + Callback callback) { + this.register("v1.billing.meter.error_report_triggered", callback); + return this; + } + + public StripeEventNotificationHandler onV1BillingMeterNoMeterFound( + Callback callback) { + this.register("v1.billing.meter.no_meter_found", callback); + return this; + } + + public StripeEventNotificationHandler onV1BillingPortalConfigurationCreated( + Callback callback) { + this.register("v1.billing_portal.configuration.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1BillingPortalConfigurationUpdated( + Callback callback) { + this.register("v1.billing_portal.configuration.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1BillingPortalSessionCreated( + Callback callback) { + this.register("v1.billing_portal.session.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1CapabilityUpdated( + Callback callback) { + this.register("v1.capability.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CashBalanceFundsAvailable( + Callback callback) { + this.register("v1.cash_balance.funds_available", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeCaptured( + Callback callback) { + this.register("v1.charge.captured", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeDisputeClosed( + Callback callback) { + this.register("v1.charge.dispute.closed", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeDisputeCreated( + Callback callback) { + this.register("v1.charge.dispute.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeDisputeFundsReinstated( + Callback callback) { + this.register("v1.charge.dispute.funds_reinstated", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeDisputeFundsWithdrawn( + Callback callback) { + this.register("v1.charge.dispute.funds_withdrawn", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeDisputeUpdated( + Callback callback) { + this.register("v1.charge.dispute.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeExpired( + Callback callback) { + this.register("v1.charge.expired", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeFailed( + Callback callback) { + this.register("v1.charge.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargePending( + Callback callback) { + this.register("v1.charge.pending", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeRefundUpdated( + Callback callback) { + this.register("v1.charge.refund.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeRefunded( + Callback callback) { + this.register("v1.charge.refunded", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeSucceeded( + Callback callback) { + this.register("v1.charge.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV1ChargeUpdated( + Callback callback) { + this.register("v1.charge.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CheckoutSessionAsyncPaymentFailed( + Callback callback) { + this.register("v1.checkout.session.async_payment_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1CheckoutSessionAsyncPaymentSucceeded( + Callback callback) { + this.register("v1.checkout.session.async_payment_succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV1CheckoutSessionCompleted( + Callback callback) { + this.register("v1.checkout.session.completed", callback); + return this; + } + + public StripeEventNotificationHandler onV1CheckoutSessionExpired( + Callback callback) { + this.register("v1.checkout.session.expired", callback); + return this; + } + + public StripeEventNotificationHandler onV1ClimateOrderCanceled( + Callback callback) { + this.register("v1.climate.order.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1ClimateOrderCreated( + Callback callback) { + this.register("v1.climate.order.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1ClimateOrderDelayed( + Callback callback) { + this.register("v1.climate.order.delayed", callback); + return this; + } + + public StripeEventNotificationHandler onV1ClimateOrderDelivered( + Callback callback) { + this.register("v1.climate.order.delivered", callback); + return this; + } + + public StripeEventNotificationHandler onV1ClimateOrderProductSubstituted( + Callback callback) { + this.register("v1.climate.order.product_substituted", callback); + return this; + } + + public StripeEventNotificationHandler onV1ClimateProductCreated( + Callback callback) { + this.register("v1.climate.product.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1ClimateProductPricingUpdated( + Callback callback) { + this.register("v1.climate.product.pricing_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CouponCreated( + Callback callback) { + this.register("v1.coupon.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1CouponDeleted( + Callback callback) { + this.register("v1.coupon.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1CouponUpdated( + Callback callback) { + this.register("v1.coupon.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CreditNoteCreated( + Callback callback) { + this.register("v1.credit_note.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1CreditNoteUpdated( + Callback callback) { + this.register("v1.credit_note.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CreditNoteVoided( + Callback callback) { + this.register("v1.credit_note.voided", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerCreated( + Callback callback) { + this.register("v1.customer.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerDeleted( + Callback callback) { + this.register("v1.customer.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionCreated( + Callback callback) { + this.register("v1.customer.subscription.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionDeleted( + Callback callback) { + this.register("v1.customer.subscription.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionPaused( + Callback callback) { + this.register("v1.customer.subscription.paused", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionPendingUpdateApplied( + Callback callback) { + this.register("v1.customer.subscription.pending_update_applied", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionPendingUpdateExpired( + Callback callback) { + this.register("v1.customer.subscription.pending_update_expired", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionResumed( + Callback callback) { + this.register("v1.customer.subscription.resumed", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionTrialWillEnd( + Callback callback) { + this.register("v1.customer.subscription.trial_will_end", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerSubscriptionUpdated( + Callback callback) { + this.register("v1.customer.subscription.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerTaxIdCreated( + Callback callback) { + this.register("v1.customer.tax_id.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerTaxIdDeleted( + Callback callback) { + this.register("v1.customer.tax_id.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerTaxIdUpdated( + Callback callback) { + this.register("v1.customer.tax_id.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerUpdated( + Callback callback) { + this.register("v1.customer.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1CustomerCashBalanceTransactionCreated( + Callback callback) { + this.register("v1.customer_cash_balance_transaction.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1EntitlementsActiveEntitlementSummaryUpdated( + Callback callback) { + this.register("v1.entitlements.active_entitlement_summary.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1FileCreated( + Callback callback) { + this.register("v1.file.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1FinancialConnectionsAccountCreated( + Callback callback) { + this.register("v1.financial_connections.account.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1FinancialConnectionsAccountDeactivated( + Callback callback) { + this.register("v1.financial_connections.account.deactivated", callback); + return this; + } + + public StripeEventNotificationHandler onV1FinancialConnectionsAccountDisconnected( + Callback callback) { + this.register("v1.financial_connections.account.disconnected", callback); + return this; + } + + public StripeEventNotificationHandler onV1FinancialConnectionsAccountReactivated( + Callback callback) { + this.register("v1.financial_connections.account.reactivated", callback); + return this; + } + + public StripeEventNotificationHandler onV1FinancialConnectionsAccountRefreshedBalance( + Callback callback) { + this.register("v1.financial_connections.account.refreshed_balance", callback); + return this; + } + + public StripeEventNotificationHandler onV1FinancialConnectionsAccountRefreshedOwnership( + Callback callback) { + this.register("v1.financial_connections.account.refreshed_ownership", callback); + return this; + } + + public StripeEventNotificationHandler onV1FinancialConnectionsAccountRefreshedTransactions( + Callback callback) { + this.register("v1.financial_connections.account.refreshed_transactions", callback); + return this; + } + + public StripeEventNotificationHandler onV1IdentityVerificationSessionCanceled( + Callback callback) { + this.register("v1.identity.verification_session.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1IdentityVerificationSessionCreated( + Callback callback) { + this.register("v1.identity.verification_session.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1IdentityVerificationSessionProcessing( + Callback callback) { + this.register("v1.identity.verification_session.processing", callback); + return this; + } + + public StripeEventNotificationHandler onV1IdentityVerificationSessionRedacted( + Callback callback) { + this.register("v1.identity.verification_session.redacted", callback); + return this; + } + + public StripeEventNotificationHandler onV1IdentityVerificationSessionRequiresInput( + Callback callback) { + this.register("v1.identity.verification_session.requires_input", callback); + return this; + } + + public StripeEventNotificationHandler onV1IdentityVerificationSessionVerified( + Callback callback) { + this.register("v1.identity.verification_session.verified", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceCreated( + Callback callback) { + this.register("v1.invoice.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceDeleted( + Callback callback) { + this.register("v1.invoice.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceFinalizationFailed( + Callback callback) { + this.register("v1.invoice.finalization_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceFinalized( + Callback callback) { + this.register("v1.invoice.finalized", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceMarkedUncollectible( + Callback callback) { + this.register("v1.invoice.marked_uncollectible", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceOverdue( + Callback callback) { + this.register("v1.invoice.overdue", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceOverpaid( + Callback callback) { + this.register("v1.invoice.overpaid", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoicePaid( + Callback callback) { + this.register("v1.invoice.paid", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoicePaymentActionRequired( + Callback callback) { + this.register("v1.invoice.payment_action_required", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoicePaymentFailed( + Callback callback) { + this.register("v1.invoice.payment_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoicePaymentSucceeded( + Callback callback) { + this.register("v1.invoice.payment_succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceSent( + Callback callback) { + this.register("v1.invoice.sent", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceUpcoming( + Callback callback) { + this.register("v1.invoice.upcoming", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceUpdated( + Callback callback) { + this.register("v1.invoice.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceVoided( + Callback callback) { + this.register("v1.invoice.voided", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceWillBeDue( + Callback callback) { + this.register("v1.invoice.will_be_due", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoicePaymentPaid( + Callback callback) { + this.register("v1.invoice_payment.paid", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceitemCreated( + Callback callback) { + this.register("v1.invoiceitem.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1InvoiceitemDeleted( + Callback callback) { + this.register("v1.invoiceitem.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingAuthorizationCreated( + Callback callback) { + this.register("v1.issuing_authorization.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingAuthorizationRequest( + Callback callback) { + this.register("v1.issuing_authorization.request", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingAuthorizationUpdated( + Callback callback) { + this.register("v1.issuing_authorization.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingCardCreated( + Callback callback) { + this.register("v1.issuing_card.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingCardUpdated( + Callback callback) { + this.register("v1.issuing_card.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingCardholderCreated( + Callback callback) { + this.register("v1.issuing_cardholder.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingCardholderUpdated( + Callback callback) { + this.register("v1.issuing_cardholder.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingDisputeClosed( + Callback callback) { + this.register("v1.issuing_dispute.closed", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingDisputeCreated( + Callback callback) { + this.register("v1.issuing_dispute.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingDisputeFundsReinstated( + Callback callback) { + this.register("v1.issuing_dispute.funds_reinstated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingDisputeFundsRescinded( + Callback callback) { + this.register("v1.issuing_dispute.funds_rescinded", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingDisputeSubmitted( + Callback callback) { + this.register("v1.issuing_dispute.submitted", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingDisputeUpdated( + Callback callback) { + this.register("v1.issuing_dispute.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingPersonalizationDesignActivated( + Callback callback) { + this.register("v1.issuing_personalization_design.activated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingPersonalizationDesignDeactivated( + Callback callback) { + this.register("v1.issuing_personalization_design.deactivated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingPersonalizationDesignRejected( + Callback callback) { + this.register("v1.issuing_personalization_design.rejected", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingPersonalizationDesignUpdated( + Callback callback) { + this.register("v1.issuing_personalization_design.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingTokenCreated( + Callback callback) { + this.register("v1.issuing_token.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingTokenUpdated( + Callback callback) { + this.register("v1.issuing_token.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingTransactionCreated( + Callback callback) { + this.register("v1.issuing_transaction.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingTransactionPurchaseDetailsReceiptUpdated( + Callback callback) { + this.register("v1.issuing_transaction.purchase_details_receipt_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1IssuingTransactionUpdated( + Callback callback) { + this.register("v1.issuing_transaction.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1MandateUpdated( + Callback callback) { + this.register("v1.mandate.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentAmountCapturableUpdated( + Callback callback) { + this.register("v1.payment_intent.amount_capturable_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentCanceled( + Callback callback) { + this.register("v1.payment_intent.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentCreated( + Callback callback) { + this.register("v1.payment_intent.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentPartiallyFunded( + Callback callback) { + this.register("v1.payment_intent.partially_funded", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentPaymentFailed( + Callback callback) { + this.register("v1.payment_intent.payment_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentProcessing( + Callback callback) { + this.register("v1.payment_intent.processing", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentRequiresAction( + Callback callback) { + this.register("v1.payment_intent.requires_action", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentIntentSucceeded( + Callback callback) { + this.register("v1.payment_intent.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentLinkCreated( + Callback callback) { + this.register("v1.payment_link.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentLinkUpdated( + Callback callback) { + this.register("v1.payment_link.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentMethodAttached( + Callback callback) { + this.register("v1.payment_method.attached", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentMethodAutomaticallyUpdated( + Callback callback) { + this.register("v1.payment_method.automatically_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentMethodDetached( + Callback callback) { + this.register("v1.payment_method.detached", callback); + return this; + } + + public StripeEventNotificationHandler onV1PaymentMethodUpdated( + Callback callback) { + this.register("v1.payment_method.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PayoutCanceled( + Callback callback) { + this.register("v1.payout.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1PayoutCreated( + Callback callback) { + this.register("v1.payout.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1PayoutFailed( + Callback callback) { + this.register("v1.payout.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1PayoutPaid( + Callback callback) { + this.register("v1.payout.paid", callback); + return this; + } + + public StripeEventNotificationHandler onV1PayoutReconciliationCompleted( + Callback callback) { + this.register("v1.payout.reconciliation_completed", callback); + return this; + } + + public StripeEventNotificationHandler onV1PayoutUpdated( + Callback callback) { + this.register("v1.payout.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PersonCreated( + Callback callback) { + this.register("v1.person.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1PersonDeleted( + Callback callback) { + this.register("v1.person.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1PersonUpdated( + Callback callback) { + this.register("v1.person.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PlanCreated( + Callback callback) { + this.register("v1.plan.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1PlanDeleted( + Callback callback) { + this.register("v1.plan.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1PlanUpdated( + Callback callback) { + this.register("v1.plan.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PriceCreated( + Callback callback) { + this.register("v1.price.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1PriceDeleted( + Callback callback) { + this.register("v1.price.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1PriceUpdated( + Callback callback) { + this.register("v1.price.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1ProductCreated( + Callback callback) { + this.register("v1.product.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1ProductDeleted( + Callback callback) { + this.register("v1.product.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1ProductUpdated( + Callback callback) { + this.register("v1.product.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1PromotionCodeCreated( + Callback callback) { + this.register("v1.promotion_code.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1PromotionCodeUpdated( + Callback callback) { + this.register("v1.promotion_code.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1QuoteAccepted( + Callback callback) { + this.register("v1.quote.accepted", callback); + return this; + } + + public StripeEventNotificationHandler onV1QuoteCanceled( + Callback callback) { + this.register("v1.quote.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1QuoteCreated( + Callback callback) { + this.register("v1.quote.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1QuoteFinalized( + Callback callback) { + this.register("v1.quote.finalized", callback); + return this; + } + + public StripeEventNotificationHandler onV1RadarEarlyFraudWarningCreated( + Callback callback) { + this.register("v1.radar.early_fraud_warning.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1RadarEarlyFraudWarningUpdated( + Callback callback) { + this.register("v1.radar.early_fraud_warning.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1RefundCreated( + Callback callback) { + this.register("v1.refund.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1RefundFailed( + Callback callback) { + this.register("v1.refund.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1RefundUpdated( + Callback callback) { + this.register("v1.refund.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1ReviewClosed( + Callback callback) { + this.register("v1.review.closed", callback); + return this; + } + + public StripeEventNotificationHandler onV1ReviewOpened( + Callback callback) { + this.register("v1.review.opened", callback); + return this; + } + + public StripeEventNotificationHandler onV1SetupIntentCanceled( + Callback callback) { + this.register("v1.setup_intent.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1SetupIntentCreated( + Callback callback) { + this.register("v1.setup_intent.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1SetupIntentRequiresAction( + Callback callback) { + this.register("v1.setup_intent.requires_action", callback); + return this; + } + + public StripeEventNotificationHandler onV1SetupIntentSetupFailed( + Callback callback) { + this.register("v1.setup_intent.setup_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1SetupIntentSucceeded( + Callback callback) { + this.register("v1.setup_intent.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV1SigmaScheduledQueryRunCreated( + Callback callback) { + this.register("v1.sigma.scheduled_query_run.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1SourceCanceled( + Callback callback) { + this.register("v1.source.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1SourceChargeable( + Callback callback) { + this.register("v1.source.chargeable", callback); + return this; + } + + public StripeEventNotificationHandler onV1SourceFailed( + Callback callback) { + this.register("v1.source.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1SourceRefundAttributesRequired( + Callback callback) { + this.register("v1.source.refund_attributes_required", callback); + return this; + } + + public StripeEventNotificationHandler onV1SubscriptionScheduleAborted( + Callback callback) { + this.register("v1.subscription_schedule.aborted", callback); + return this; + } + + public StripeEventNotificationHandler onV1SubscriptionScheduleCanceled( + Callback callback) { + this.register("v1.subscription_schedule.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1SubscriptionScheduleCompleted( + Callback callback) { + this.register("v1.subscription_schedule.completed", callback); + return this; + } + + public StripeEventNotificationHandler onV1SubscriptionScheduleCreated( + Callback callback) { + this.register("v1.subscription_schedule.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1SubscriptionScheduleExpiring( + Callback callback) { + this.register("v1.subscription_schedule.expiring", callback); + return this; + } + + public StripeEventNotificationHandler onV1SubscriptionScheduleReleased( + Callback callback) { + this.register("v1.subscription_schedule.released", callback); + return this; + } + + public StripeEventNotificationHandler onV1SubscriptionScheduleUpdated( + Callback callback) { + this.register("v1.subscription_schedule.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1TaxSettingsUpdated( + Callback callback) { + this.register("v1.tax.settings.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1TaxRateCreated( + Callback callback) { + this.register("v1.tax_rate.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1TaxRateUpdated( + Callback callback) { + this.register("v1.tax_rate.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1TerminalReaderActionFailed( + Callback callback) { + this.register("v1.terminal.reader.action_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1TerminalReaderActionSucceeded( + Callback callback) { + this.register("v1.terminal.reader.action_succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV1TerminalReaderActionUpdated( + Callback callback) { + this.register("v1.terminal.reader.action_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV1TestHelpersTestClockAdvancing( + Callback callback) { + this.register("v1.test_helpers.test_clock.advancing", callback); + return this; + } + + public StripeEventNotificationHandler onV1TestHelpersTestClockCreated( + Callback callback) { + this.register("v1.test_helpers.test_clock.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1TestHelpersTestClockDeleted( + Callback callback) { + this.register("v1.test_helpers.test_clock.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV1TestHelpersTestClockInternalFailure( + Callback callback) { + this.register("v1.test_helpers.test_clock.internal_failure", callback); + return this; + } + + public StripeEventNotificationHandler onV1TestHelpersTestClockReady( + Callback callback) { + this.register("v1.test_helpers.test_clock.ready", callback); + return this; + } + + public StripeEventNotificationHandler onV1TopupCanceled( + Callback callback) { + this.register("v1.topup.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV1TopupCreated( + Callback callback) { + this.register("v1.topup.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1TopupFailed( + Callback callback) { + this.register("v1.topup.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV1TopupReversed( + Callback callback) { + this.register("v1.topup.reversed", callback); + return this; + } + + public StripeEventNotificationHandler onV1TopupSucceeded( + Callback callback) { + this.register("v1.topup.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV1TransferCreated( + Callback callback) { + this.register("v1.transfer.created", callback); + return this; + } + + public StripeEventNotificationHandler onV1TransferReversed( + Callback callback) { + this.register("v1.transfer.reversed", callback); + return this; + } + + public StripeEventNotificationHandler onV1TransferUpdated( + Callback callback) { + this.register("v1.transfer.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingCadenceBilled( + Callback callback) { + this.register("v2.billing.cadence.billed", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingCadenceCanceled( + Callback callback) { + this.register("v2.billing.cadence.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingCadenceCreated( + Callback callback) { + this.register("v2.billing.cadence.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingLicenseFeeCreated( + Callback callback) { + this.register("v2.billing.license_fee.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingLicenseFeeUpdated( + Callback callback) { + this.register("v2.billing.license_fee.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingLicenseFeeVersionCreated( + Callback callback) { + this.register("v2.billing.license_fee_version.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingLicensedItemCreated( + Callback callback) { + this.register("v2.billing.licensed_item.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingLicensedItemUpdated( + Callback callback) { + this.register("v2.billing.licensed_item.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingMeteredItemCreated( + Callback callback) { + this.register("v2.billing.metered_item.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingMeteredItemUpdated( + Callback callback) { + this.register("v2.billing.metered_item.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanCreated( + Callback callback) { + this.register("v2.billing.pricing_plan.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanUpdated( + Callback callback) { + this.register("v2.billing.pricing_plan.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanComponentCreated( + Callback callback) { + this.register("v2.billing.pricing_plan_component.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanComponentUpdated( + Callback callback) { + this.register("v2.billing.pricing_plan_component.updated", callback); + return this; + } + + public StripeEventNotificationHandler + onV2BillingPricingPlanSubscriptionCollectionAwaitingCustomerAction( + Callback< + V2BillingPricingPlanSubscriptionCollectionAwaitingCustomerActionEventNotification> + callback) { + this.register( + "v2.billing.pricing_plan_subscription.collection_awaiting_customer_action", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanSubscriptionCollectionCurrent( + Callback callback) { + this.register("v2.billing.pricing_plan_subscription.collection_current", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanSubscriptionCollectionPastDue( + Callback callback) { + this.register("v2.billing.pricing_plan_subscription.collection_past_due", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanSubscriptionCollectionPaused( + Callback callback) { + this.register("v2.billing.pricing_plan_subscription.collection_paused", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanSubscriptionCollectionUnpaid( + Callback callback) { + this.register("v2.billing.pricing_plan_subscription.collection_unpaid", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanSubscriptionServicingActivated( + Callback callback) { + this.register("v2.billing.pricing_plan_subscription.servicing_activated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanSubscriptionServicingCanceled( + Callback callback) { + this.register("v2.billing.pricing_plan_subscription.servicing_canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanSubscriptionServicingPaused( + Callback callback) { + this.register("v2.billing.pricing_plan_subscription.servicing_paused", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingPricingPlanVersionCreated( + Callback callback) { + this.register("v2.billing.pricing_plan_version.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardCreated( + Callback callback) { + this.register("v2.billing.rate_card.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardUpdated( + Callback callback) { + this.register("v2.billing.rate_card.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardCustomPricingUnitOverageRateCreated( + Callback callback) { + this.register("v2.billing.rate_card_custom_pricing_unit_overage_rate.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardRateCreated( + Callback callback) { + this.register("v2.billing.rate_card_rate.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionActivated( + Callback callback) { + this.register("v2.billing.rate_card_subscription.activated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionCanceled( + Callback callback) { + this.register("v2.billing.rate_card_subscription.canceled", callback); + return this; + } + + public StripeEventNotificationHandler + onV2BillingRateCardSubscriptionCollectionAwaitingCustomerAction( + Callback + callback) { + this.register( + "v2.billing.rate_card_subscription.collection_awaiting_customer_action", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionCollectionCurrent( + Callback callback) { + this.register("v2.billing.rate_card_subscription.collection_current", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionCollectionPastDue( + Callback callback) { + this.register("v2.billing.rate_card_subscription.collection_past_due", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionCollectionPaused( + Callback callback) { + this.register("v2.billing.rate_card_subscription.collection_paused", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionCollectionUnpaid( + Callback callback) { + this.register("v2.billing.rate_card_subscription.collection_unpaid", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionServicingActivated( + Callback callback) { + this.register("v2.billing.rate_card_subscription.servicing_activated", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionServicingCanceled( + Callback callback) { + this.register("v2.billing.rate_card_subscription.servicing_canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardSubscriptionServicingPaused( + Callback callback) { + this.register("v2.billing.rate_card_subscription.servicing_paused", callback); + return this; + } + + public StripeEventNotificationHandler onV2BillingRateCardVersionCreated( + Callback callback) { + this.register("v2.billing.rate_card_version.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2CommerceProductCatalogImportsFailed( + Callback callback) { + this.register("v2.commerce.product_catalog.imports.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CommerceProductCatalogImportsProcessing( + Callback callback) { + this.register("v2.commerce.product_catalog.imports.processing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CommerceProductCatalogImportsSucceeded( + Callback callback) { + this.register("v2.commerce.product_catalog.imports.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2CommerceProductCatalogImportsSucceededWithErrors( + Callback callback) { + this.register("v2.commerce.product_catalog.imports.succeeded_with_errors", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountClosed( + Callback callback) { + this.register("v2.core.account.closed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountCreated( + Callback callback) { + this.register("v2.core.account.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountUpdated( + Callback callback) { + this.register("v2.core.account.updated", callback); + return this; + } + + public StripeEventNotificationHandler + onV2CoreAccountIncludingConfigurationCardCreatorCapabilityStatusUpdated( + Callback< + V2CoreAccountIncludingConfigurationCardCreatorCapabilityStatusUpdatedEventNotification> + callback) { + this.register( + "v2.core.account[configuration.card_creator].capability_status_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingConfigurationCardCreatorUpdated( + Callback callback) { + this.register("v2.core.account[configuration.card_creator].updated", callback); + return this; + } + + public StripeEventNotificationHandler + onV2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdated( + Callback< + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification> + callback) { + this.register("v2.core.account[configuration.customer].capability_status_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingConfigurationCustomerUpdated( + Callback callback) { + this.register("v2.core.account[configuration.customer].updated", callback); + return this; + } + + public StripeEventNotificationHandler + onV2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdated( + Callback< + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification> + callback) { + this.register("v2.core.account[configuration.merchant].capability_status_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingConfigurationMerchantUpdated( + Callback callback) { + this.register("v2.core.account[configuration.merchant].updated", callback); + return this; + } + + public StripeEventNotificationHandler + onV2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdated( + Callback< + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification> + callback) { + this.register("v2.core.account[configuration.recipient].capability_status_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingConfigurationRecipientUpdated( + Callback callback) { + this.register("v2.core.account[configuration.recipient].updated", callback); + return this; + } + + public StripeEventNotificationHandler + onV2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdated( + Callback< + V2CoreAccountIncludingConfigurationStorerCapabilityStatusUpdatedEventNotification> + callback) { + this.register("v2.core.account[configuration.storer].capability_status_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingConfigurationStorerUpdated( + Callback callback) { + this.register("v2.core.account[configuration.storer].updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingDefaultsUpdated( + Callback callback) { + this.register("v2.core.account[defaults].updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingFutureRequirementsUpdated( + Callback callback) { + this.register("v2.core.account[future_requirements].updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingIdentityUpdated( + Callback callback) { + this.register("v2.core.account[identity].updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountIncludingRequirementsUpdated( + Callback callback) { + this.register("v2.core.account[requirements].updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountLinkReturned( + Callback callback) { + this.register("v2.core.account_link.returned", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountPersonCreated( + Callback callback) { + this.register("v2.core.account_person.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountPersonDeleted( + Callback callback) { + this.register("v2.core.account_person.deleted", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountPersonUpdated( + Callback callback) { + this.register("v2.core.account_person.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreAccountSignalsFraudulentWebsiteReady( + Callback callback) { + this.register("v2.core.account_signals.fraudulent_website_ready", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreApprovalRequestApproved( + Callback callback) { + this.register("v2.core.approval_request.approved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreApprovalRequestCanceled( + Callback callback) { + this.register("v2.core.approval_request.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreApprovalRequestCreated( + Callback callback) { + this.register("v2.core.approval_request.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreApprovalRequestExpired( + Callback callback) { + this.register("v2.core.approval_request.expired", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreApprovalRequestFailed( + Callback callback) { + this.register("v2.core.approval_request.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreApprovalRequestRejected( + Callback callback) { + this.register("v2.core.approval_request.rejected", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreApprovalRequestSucceeded( + Callback callback) { + this.register("v2.core.approval_request.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobBatchFailed( + Callback callback) { + this.register("v2.core.batch_job.batch_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobCanceled( + Callback callback) { + this.register("v2.core.batch_job.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobCompleted( + Callback callback) { + this.register("v2.core.batch_job.completed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobCreated( + Callback callback) { + this.register("v2.core.batch_job.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobReadyForUpload( + Callback callback) { + this.register("v2.core.batch_job.ready_for_upload", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobTimeout( + Callback callback) { + this.register("v2.core.batch_job.timeout", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobUpdated( + Callback callback) { + this.register("v2.core.batch_job.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobUploadTimeout( + Callback callback) { + this.register("v2.core.batch_job.upload_timeout", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobValidating( + Callback callback) { + this.register("v2.core.batch_job.validating", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreBatchJobValidationFailed( + Callback callback) { + this.register("v2.core.batch_job.validation_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreClaimableSandboxClaimed( + Callback callback) { + this.register("v2.core.claimable_sandbox.claimed", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreClaimableSandboxCreated( + Callback callback) { + this.register("v2.core.claimable_sandbox.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreClaimableSandboxExpired( + Callback callback) { + this.register("v2.core.claimable_sandbox.expired", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreClaimableSandboxExpiring( + Callback callback) { + this.register("v2.core.claimable_sandbox.expiring", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreClaimableSandboxUpdated( + Callback callback) { + this.register("v2.core.claimable_sandbox.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreEventDestinationPing( + Callback callback) { + this.register("v2.core.event_destination.ping", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthApiErrorFiring( + Callback callback) { + this.register("v2.core.health.api_error.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthApiErrorResolved( + Callback callback) { + this.register("v2.core.health.api_error.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthApiLatencyFiring( + Callback callback) { + this.register("v2.core.health.api_latency.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthApiLatencyResolved( + Callback callback) { + this.register("v2.core.health.api_latency.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthAuthorizationRateDropFiring( + Callback callback) { + this.register("v2.core.health.authorization_rate_drop.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthAuthorizationRateDropResolved( + Callback callback) { + this.register("v2.core.health.authorization_rate_drop.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthEventGenerationFailureResolved( + Callback callback) { + this.register("v2.core.health.event_generation_failure.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthFraudRateIncreased( + Callback callback) { + this.register("v2.core.health.fraud_rate.increased", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthIssuingAuthorizationRequestErrorsFiring( + Callback callback) { + this.register("v2.core.health.issuing_authorization_request_errors.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthIssuingAuthorizationRequestErrorsResolved( + Callback callback) { + this.register("v2.core.health.issuing_authorization_request_errors.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthIssuingAuthorizationRequestTimeoutFiring( + Callback callback) { + this.register("v2.core.health.issuing_authorization_request_timeout.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthIssuingAuthorizationRequestTimeoutResolved( + Callback callback) { + this.register("v2.core.health.issuing_authorization_request_timeout.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthMeterEventSummariesDelayedFiring( + Callback callback) { + this.register("v2.core.health.meter_event_summaries_delayed.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthMeterEventSummariesDelayedResolved( + Callback callback) { + this.register("v2.core.health.meter_event_summaries_delayed.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthPaymentMethodErrorFiring( + Callback callback) { + this.register("v2.core.health.payment_method_error.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthPaymentMethodErrorResolved( + Callback callback) { + this.register("v2.core.health.payment_method_error.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthSepaDebitDelayedFiring( + Callback callback) { + this.register("v2.core.health.sepa_debit_delayed.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthSepaDebitDelayedResolved( + Callback callback) { + this.register("v2.core.health.sepa_debit_delayed.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthTrafficVolumeDropFiring( + Callback callback) { + this.register("v2.core.health.traffic_volume_drop.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthTrafficVolumeDropResolved( + Callback callback) { + this.register("v2.core.health.traffic_volume_drop.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthWebhookLatencyFiring( + Callback callback) { + this.register("v2.core.health.webhook_latency.firing", callback); + return this; + } + + public StripeEventNotificationHandler onV2CoreHealthWebhookLatencyResolved( + Callback callback) { + this.register("v2.core.health.webhook_latency.resolved", callback); + return this; + } + + public StripeEventNotificationHandler onV2DataReportingQueryRunCreated( + Callback callback) { + this.register("v2.data.reporting.query_run.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2DataReportingQueryRunFailed( + Callback callback) { + this.register("v2.data.reporting.query_run.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2DataReportingQueryRunSucceeded( + Callback callback) { + this.register("v2.data.reporting.query_run.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2DataReportingQueryRunUpdated( + Callback callback) { + this.register("v2.data.reporting.query_run.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2ExtendExtensionRunFailed( + Callback callback) { + this.register("v2.extend.extension_run.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2ExtendWorkflowRunFailed( + Callback callback) { + this.register("v2.extend.workflow_run.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2ExtendWorkflowRunStarted( + Callback callback) { + this.register("v2.extend.workflow_run.started", callback); + return this; + } + + public StripeEventNotificationHandler onV2ExtendWorkflowRunSucceeded( + Callback callback) { + this.register("v2.extend.workflow_run.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamApiKeyCreated( + Callback callback) { + this.register("v2.iam.api_key.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamApiKeyDefaultSecretRevealed( + Callback callback) { + this.register("v2.iam.api_key.default_secret_revealed", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamApiKeyExpired( + Callback callback) { + this.register("v2.iam.api_key.expired", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamApiKeyPermissionsUpdated( + Callback callback) { + this.register("v2.iam.api_key.permissions_updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamApiKeyRotated( + Callback callback) { + this.register("v2.iam.api_key.rotated", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamApiKeyUpdated( + Callback callback) { + this.register("v2.iam.api_key.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamStripeAccessGrantApproved( + Callback callback) { + this.register("v2.iam.stripe_access_grant.approved", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamStripeAccessGrantCanceled( + Callback callback) { + this.register("v2.iam.stripe_access_grant.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamStripeAccessGrantDenied( + Callback callback) { + this.register("v2.iam.stripe_access_grant.denied", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamStripeAccessGrantRemoved( + Callback callback) { + this.register("v2.iam.stripe_access_grant.removed", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamStripeAccessGrantRequested( + Callback callback) { + this.register("v2.iam.stripe_access_grant.requested", callback); + return this; + } + + public StripeEventNotificationHandler onV2IamStripeAccessGrantUpdated( + Callback callback) { + this.register("v2.iam.stripe_access_grant.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementAdjustmentCreated( + Callback callback) { + this.register("v2.money_management.adjustment.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementFinancialAccountCreated( + Callback callback) { + this.register("v2.money_management.financial_account.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementFinancialAccountUpdated( + Callback callback) { + this.register("v2.money_management.financial_account.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementFinancialAddressActivated( + Callback callback) { + this.register("v2.money_management.financial_address.activated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementFinancialAddressFailed( + Callback callback) { + this.register("v2.money_management.financial_address.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementInboundTransferAvailable( + Callback callback) { + this.register("v2.money_management.inbound_transfer.available", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementInboundTransferBankDebitFailed( + Callback callback) { + this.register("v2.money_management.inbound_transfer.bank_debit_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementInboundTransferBankDebitProcessing( + Callback callback) { + this.register("v2.money_management.inbound_transfer.bank_debit_processing", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementInboundTransferBankDebitQueued( + Callback callback) { + this.register("v2.money_management.inbound_transfer.bank_debit_queued", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementInboundTransferBankDebitReturned( + Callback callback) { + this.register("v2.money_management.inbound_transfer.bank_debit_returned", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementInboundTransferBankDebitSucceeded( + Callback callback) { + this.register("v2.money_management.inbound_transfer.bank_debit_succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundPaymentCanceled( + Callback callback) { + this.register("v2.money_management.outbound_payment.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundPaymentCreated( + Callback callback) { + this.register("v2.money_management.outbound_payment.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundPaymentFailed( + Callback callback) { + this.register("v2.money_management.outbound_payment.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundPaymentPosted( + Callback callback) { + this.register("v2.money_management.outbound_payment.posted", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundPaymentReturned( + Callback callback) { + this.register("v2.money_management.outbound_payment.returned", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundPaymentUpdated( + Callback callback) { + this.register("v2.money_management.outbound_payment.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundTransferCanceled( + Callback callback) { + this.register("v2.money_management.outbound_transfer.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundTransferCreated( + Callback callback) { + this.register("v2.money_management.outbound_transfer.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundTransferFailed( + Callback callback) { + this.register("v2.money_management.outbound_transfer.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundTransferPosted( + Callback callback) { + this.register("v2.money_management.outbound_transfer.posted", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundTransferReturned( + Callback callback) { + this.register("v2.money_management.outbound_transfer.returned", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementOutboundTransferUpdated( + Callback callback) { + this.register("v2.money_management.outbound_transfer.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementPayoutMethodCreated( + Callback callback) { + this.register("v2.money_management.payout_method.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementPayoutMethodUpdated( + Callback callback) { + this.register("v2.money_management.payout_method.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedCreditAvailable( + Callback callback) { + this.register("v2.money_management.received_credit.available", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedCreditFailed( + Callback callback) { + this.register("v2.money_management.received_credit.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedCreditReturned( + Callback callback) { + this.register("v2.money_management.received_credit.returned", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedCreditSucceeded( + Callback callback) { + this.register("v2.money_management.received_credit.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedDebitCanceled( + Callback callback) { + this.register("v2.money_management.received_debit.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedDebitFailed( + Callback callback) { + this.register("v2.money_management.received_debit.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedDebitPending( + Callback callback) { + this.register("v2.money_management.received_debit.pending", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedDebitSucceeded( + Callback callback) { + this.register("v2.money_management.received_debit.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementReceivedDebitUpdated( + Callback callback) { + this.register("v2.money_management.received_debit.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementRecipientVerificationCreated( + Callback callback) { + this.register("v2.money_management.recipient_verification.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementRecipientVerificationUpdated( + Callback callback) { + this.register("v2.money_management.recipient_verification.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementTransactionCreated( + Callback callback) { + this.register("v2.money_management.transaction.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2MoneyManagementTransactionUpdated( + Callback callback) { + this.register("v2.money_management.transaction.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2OrchestratedCommerceAgreementConfirmed( + Callback callback) { + this.register("v2.orchestrated_commerce.agreement.confirmed", callback); + return this; + } + + public StripeEventNotificationHandler onV2OrchestratedCommerceAgreementCreated( + Callback callback) { + this.register("v2.orchestrated_commerce.agreement.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2OrchestratedCommerceAgreementPartiallyConfirmed( + Callback callback) { + this.register("v2.orchestrated_commerce.agreement.partially_confirmed", callback); + return this; + } + + public StripeEventNotificationHandler onV2OrchestratedCommerceAgreementTerminated( + Callback callback) { + this.register("v2.orchestrated_commerce.agreement.terminated", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentAttemptFailed( + Callback callback) { + this.register("v2.payments.off_session_payment.attempt_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentAttemptStarted( + Callback callback) { + this.register("v2.payments.off_session_payment.attempt_started", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentAuthorizationAttemptFailed( + Callback callback) { + this.register("v2.payments.off_session_payment.authorization_attempt_failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentAuthorizationAttemptStarted( + Callback callback) { + this.register("v2.payments.off_session_payment.authorization_attempt_started", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentCanceled( + Callback callback) { + this.register("v2.payments.off_session_payment.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentCreated( + Callback callback) { + this.register("v2.payments.off_session_payment.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentFailed( + Callback callback) { + this.register("v2.payments.off_session_payment.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentPaused( + Callback callback) { + this.register("v2.payments.off_session_payment.paused", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentRequiresCapture( + Callback callback) { + this.register("v2.payments.off_session_payment.requires_capture", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentResumed( + Callback callback) { + this.register("v2.payments.off_session_payment.resumed", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsOffSessionPaymentSucceeded( + Callback callback) { + this.register("v2.payments.off_session_payment.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentCanceled( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentCreated( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentErrored( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.errored", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentFundsNotReceived( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.funds_not_received", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentMatched( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.matched", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentNotFound( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.not_found", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentSettled( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.settled", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentSubmitted( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent.submitted", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentSplitCanceled( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent_split.canceled", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentSplitCreated( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent_split.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2PaymentsSettlementAllocationIntentSplitSettled( + Callback callback) { + this.register("v2.payments.settlement_allocation_intent_split.settled", callback); + return this; + } + + public StripeEventNotificationHandler onV2ReportingReportRunCreated( + Callback callback) { + this.register("v2.reporting.report_run.created", callback); + return this; + } + + public StripeEventNotificationHandler onV2ReportingReportRunFailed( + Callback callback) { + this.register("v2.reporting.report_run.failed", callback); + return this; + } + + public StripeEventNotificationHandler onV2ReportingReportRunSucceeded( + Callback callback) { + this.register("v2.reporting.report_run.succeeded", callback); + return this; + } + + public StripeEventNotificationHandler onV2ReportingReportRunUpdated( + Callback callback) { + this.register("v2.reporting.report_run.updated", callback); + return this; + } + + public StripeEventNotificationHandler onV2SignalsAccountSignalFraudulentMerchantReady( + Callback callback) { + this.register("v2.signals.account_signal.fraudulent_merchant_ready", callback); + return this; + } + // notification-handler-methods: The end of the section generated from our OpenAPI spec + + /** + * Get a sorted list of all registered event types. + * + * @return A sorted list of event type strings + */ + public List getRegisteredEventTypes() { + List eventTypes = new ArrayList<>(this.registeredHandlers.keySet()); + Collections.sort(eventTypes); + return eventTypes; + } +} diff --git a/src/main/java/com/stripe/events/UnknownEventNotification.java b/src/main/java/com/stripe/events/UnknownEventNotification.java index c70a4cca034..a91141b59fc 100644 --- a/src/main/java/com/stripe/events/UnknownEventNotification.java +++ b/src/main/java/com/stripe/events/UnknownEventNotification.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe.events; import com.google.gson.annotations.SerializedName; diff --git a/src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java b/src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java new file mode 100644 index 00000000000..6a0288f4098 --- /dev/null +++ b/src/main/java/com/stripe/examples/EventNotificationHandlerEndpoint.java @@ -0,0 +1,108 @@ +// File copied from our code generator; changes here will be overwritten. +package com.stripe.examples; + +import com.stripe.StripeClient; +import com.stripe.StripeEventNotificationHandler; +import com.stripe.StripeEventNotificationHandler.UnhandledNotificationDetails; +import com.stripe.events.V1BillingMeterErrorReportTriggeredEventNotification; +import com.stripe.exception.StripeException; +import com.stripe.model.billing.Meter; +import com.stripe.model.v2.core.EventNotification; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; + +/** + * Receive and process event notifications (AKA thin events) like + * "v1.billing.meter.error_report_triggered" using EventNotificationHandler. + * + *

In this example, we: + * + *

+ */ +public class EventNotificationHandlerEndpoint { + private static final String API_KEY = System.getenv("STRIPE_API_KEY"); + private static final String WEBHOOK_SECRET = System.getenv("WEBHOOK_SECRET"); + + private static final StripeClient client = new StripeClient(API_KEY); + private static final StripeEventNotificationHandler handler = + client.notificationHandler( + WEBHOOK_SECRET, EventNotificationHandlerEndpoint::fallbackCallback); + + public static void main(String[] args) throws IOException { + handler.onV1BillingMeterErrorReportTriggered( + EventNotificationHandlerEndpoint::handleMeterErrors); + + HttpServer server = HttpServer.create(new InetSocketAddress(4242), 0); + server.createContext("/webhook", new WebhookHandler()); + server.setExecutor(null); + server.start(); + } + + private static void fallbackCallback( + EventNotification notif, StripeClient client, UnhandledNotificationDetails details) { + System.out.println("Received unhandled event notification type: " + notif.getType()); + } + + private static void handleMeterErrors( + V1BillingMeterErrorReportTriggeredEventNotification notif, StripeClient client) { + Meter meter; + try { + meter = notif.fetchRelatedObject(); + } catch (StripeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return; + } + System.out.println("Handling meter error for meter: " + meter.getDisplayName()); + } + + static class WebhookHandler implements HttpHandler { + // For Java 1.8 compatibility + public static byte[] readAllBytes(InputStream inputStream) throws IOException { + final int bufLen = 1024; + byte[] buf = new byte[bufLen]; + int readLen; + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + + while ((readLen = inputStream.read(buf, 0, bufLen)) != -1) + outputStream.write(buf, 0, readLen); + + return outputStream.toByteArray(); + } + + @Override + public void handle(HttpExchange exchange) throws IOException { + if ("POST".equals(exchange.getRequestMethod())) { + InputStream requestBody = exchange.getRequestBody(); + String webhookBody = new String(readAllBytes(requestBody), StandardCharsets.UTF_8); + String sigHeader = exchange.getRequestHeaders().getFirst("Stripe-Signature"); + + try { + handler.handle(webhookBody, sigHeader); + + exchange.sendResponseHeaders(200, -1); + } catch (StripeException e) { + exchange.sendResponseHeaders(400, -1); + } + } else { + exchange.sendResponseHeaders(405, -1); + } + exchange.close(); + } + } +} diff --git a/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java b/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java index 728b786d83f..82829cb1901 100644 --- a/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java +++ b/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe.examples; import com.stripe.StripeClient; diff --git a/src/main/java/com/stripe/model/v2/core/EventNotification.java b/src/main/java/com/stripe/model/v2/core/EventNotification.java index 374abbb60f8..a56742d3a4a 100644 --- a/src/main/java/com/stripe/model/v2/core/EventNotification.java +++ b/src/main/java/com/stripe/model/v2/core/EventNotification.java @@ -1,3 +1,4 @@ +// File copied from our code generator; changes here will be overwritten. package com.stripe.model.v2.core; import com.google.gson.JsonObject; diff --git a/src/test/java/com/stripe/StripeEventNotificationHandlerTest.java b/src/test/java/com/stripe/StripeEventNotificationHandlerTest.java new file mode 100644 index 00000000000..31c567d6468 --- /dev/null +++ b/src/test/java/com/stripe/StripeEventNotificationHandlerTest.java @@ -0,0 +1,518 @@ +// File copied from our code generator; changes here will be overwritten. +package com.stripe; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import com.stripe.events.UnknownEventNotification; +import com.stripe.events.V1BillingMeterErrorReportTriggeredEventNotification; +import com.stripe.events.V2CoreAccountCreatedEventNotification; +import com.stripe.exception.SignatureVerificationException; +import com.stripe.model.v2.core.EventNotification; +import com.stripe.net.Webhook; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class StripeEventNotificationHandlerTest { + private static final String DUMMY_WEBHOOK_SECRET = "whsec_test_secret"; + + private StripeClient stripeClient; + private StripeEventNotificationHandler.FallbackCallback fallbackCallback; + private StripeEventNotificationHandler eventNotificationHandler; + + private String v1BillingMeterPayload; + private String v2AccountCreatedPayload; + private String unknownEventPayload; + + @BeforeEach + public void setUp() { + // Create a StripeClient with context + stripeClient = + StripeClient.builder() + .setApiKey("sk_test_1234") + .setStripeContext("original_context_123") + .build(); + + // Create mock handler for unhandled events + fallbackCallback = mock(StripeEventNotificationHandler.FallbackCallback.class); + + // Create event router + eventNotificationHandler = + new StripeEventNotificationHandler(DUMMY_WEBHOOK_SECRET, stripeClient, fallbackCallback); + + // Set up test payloads + v1BillingMeterPayload = + "{" + + "\"id\": \"evt_123\"," + + "\"object\": \"v2.core.event\"," + + "\"type\": \"v1.billing.meter.error_report_triggered\"," + + "\"livemode\": false," + + "\"created\": \"2022-02-15T00:27:45.330Z\"," + + "\"context\": \"event_context_456\"," + + "\"related_object\": {" + + "\"id\": \"mtr_123\"," + + "\"type\": \"billing.meter\"," + + "\"url\": \"/v1/billing/meters/mtr_123\"" + + "}" + + "}"; + + v2AccountCreatedPayload = + "{" + + "\"id\": \"evt_789\"," + + "\"object\": \"v2.core.event\"," + + "\"type\": \"v2.core.account.created\"," + + "\"livemode\": false," + + "\"created\": \"2022-02-15T00:27:45.330Z\"," + + "\"context\": null," + + "\"related_object\": {" + + "\"id\": \"acct_abc\"," + + "\"type\": \"account\"," + + "\"url\": \"/v2/core/accounts/acct_abc\"" + + "}" + + "}"; + + unknownEventPayload = + "{" + + "\"id\": \"evt_unknown\"," + + "\"object\": \"v2.core.event\"," + + "\"type\": \"llama.created\"," + + "\"livemode\": false," + + "\"created\": \"2022-02-15T00:27:45.330Z\"," + + "\"context\": \"event_context_unknown\"," + + "\"related_object\": {" + + "\"id\": \"llama_123\"," + + "\"type\": \"llama\"," + + "\"url\": \"/v1/llamas/llama_123\"" + + "}" + + "}"; + } + + private String generateSigHeader(String payload) + throws NoSuchAlgorithmException, InvalidKeyException { + Map options = new HashMap<>(); + options.put("payload", payload); + options.put("secret", DUMMY_WEBHOOK_SECRET); + return generateSigHeader(options); + } + + private String generateSigHeader(Map options) + throws NoSuchAlgorithmException, InvalidKeyException { + final long timestamp = + (options.get("timestamp") != null) + ? ((Long) options.get("timestamp")).longValue() + : Webhook.Util.getTimeNow(); + final String payload = (String) options.get("payload"); + final String secret = (String) options.get("secret"); + final String scheme = + (options.get("scheme") != null) + ? (String) options.get("scheme") + : Webhook.Signature.EXPECTED_SCHEME; + String signature = (String) options.get("signature"); + + if (signature == null) { + final String payloadToSign = String.format("%d.%s", timestamp, payload); + signature = Webhook.Util.computeHmacSha256(secret, payloadToSign); + } + + return String.format("t=%d,%s=%s", timestamp, scheme, signature); + } + + @Test + public void testRoutesEventToRegisteredHandler() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that a registered event type is routed to the correct handler + @SuppressWarnings("unchecked") + StripeEventNotificationHandler.Callback + handler = mock(StripeEventNotificationHandler.Callback.class); + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + verify(handler, times(1)) + .process(org.mockito.ArgumentMatchers.any(), org.mockito.ArgumentMatchers.any()); + verify(fallbackCallback, never()) + .process( + org.mockito.ArgumentMatchers.any(), + org.mockito.ArgumentMatchers.any(), + org.mockito.ArgumentMatchers.any()); + } + + @SuppressWarnings("unchecked") + @Test + public void testRoutesDifferentEventsToCorrectHandlers() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that different event types route to their respective handlers + StripeEventNotificationHandler.Callback + billingHandler = mock(StripeEventNotificationHandler.Callback.class); + StripeEventNotificationHandler.Callback accountHandler = + mock(StripeEventNotificationHandler.Callback.class); + + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(billingHandler); + eventNotificationHandler.onV2CoreAccountCreated(accountHandler); + + String sigHeader1 = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader1); + + String sigHeader2 = generateSigHeader(v2AccountCreatedPayload); + eventNotificationHandler.handle(v2AccountCreatedPayload, sigHeader2); + + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader1); + + verify(billingHandler, times(2)) + .process(org.mockito.ArgumentMatchers.any(), org.mockito.ArgumentMatchers.any()); + verify(accountHandler, times(1)) + .process(org.mockito.ArgumentMatchers.any(), org.mockito.ArgumentMatchers.any()); + verify(fallbackCallback, never()) + .process( + org.mockito.ArgumentMatchers.any(), + org.mockito.ArgumentMatchers.any(), + org.mockito.ArgumentMatchers.any()); + } + + @Test + public void testHandlerReceivesCorrectRuntimeType() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that handlers receive the correctly typed event notification + AtomicReference receivedEvent = new AtomicReference<>(); + AtomicReference receivedClient = new AtomicReference<>(); + + StripeEventNotificationHandler.Callback + handler = + (event, client) -> { + receivedEvent.set(event); + receivedClient.set(client); + }; + + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + assertInstanceOf( + V1BillingMeterErrorReportTriggeredEventNotification.class, receivedEvent.get()); + V1BillingMeterErrorReportTriggeredEventNotification notification = + (V1BillingMeterErrorReportTriggeredEventNotification) receivedEvent.get(); + assertEquals("v1.billing.meter.error_report_triggered", notification.getType()); + assertEquals("evt_123", notification.getId()); + assertEquals("mtr_123", notification.getRelatedObject().getId()); + assertNotNull(receivedClient.get()); + } + + @SuppressWarnings("unchecked") + @Test + public void testCannotRegisterHandlerAfterHandling() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that registering handlers after handle() raises IllegalStateException + StripeEventNotificationHandler.Callback + handler = mock(StripeEventNotificationHandler.Callback.class); + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + IllegalStateException exception = + assertThrows( + IllegalStateException.class, + () -> + eventNotificationHandler.onV2CoreAccountCreated( + mock(StripeEventNotificationHandler.Callback.class))); + + assertTrue(exception.getMessage().contains("Cannot register handlers after handling an event")); + } + + @SuppressWarnings("unchecked") + @Test + public void testCannotRegisterDuplicateHandler() { + // Test that registering the same event type twice raises IllegalArgumentException + StripeEventNotificationHandler.Callback + handler1 = mock(StripeEventNotificationHandler.Callback.class); + StripeEventNotificationHandler.Callback + handler2 = mock(StripeEventNotificationHandler.Callback.class); + + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler1); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler2)); + + assertTrue( + exception + .getMessage() + .contains( + "Handler already registered for event type: v1.billing.meter.error_report_triggered")); + } + + @Test + public void testHandlerUsesEventStripeContext() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that the handler receives a client with stripe_context from the event + AtomicReference receivedContext = new AtomicReference<>(); + + StripeEventNotificationHandler.Callback + handler = + (event, client) -> { + receivedContext.set(client.getContext()); + }; + + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + assertEquals("original_context_123", stripeClient.getContext()); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + assertEquals("event_context_456", receivedContext.get()); + } + + @Test + public void testStripeContextRestoredAfterHandlerSuccess() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that the original stripe_context is restored after successful handler execution + StripeEventNotificationHandler.Callback + handler = + (event, client) -> { + assertEquals("event_context_456", client.getContext()); + }; + + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + assertEquals("original_context_123", stripeClient.getContext()); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + assertEquals("original_context_123", stripeClient.getContext()); + } + + @Test + public void testStripeContextRestoredAfterHandlerError() + throws NoSuchAlgorithmException, InvalidKeyException { + // Test that the original stripe_context is restored even when handler raises an exception + StripeEventNotificationHandler.Callback + handler = + (event, client) -> { + assertEquals("event_context_456", client.getContext()); + throw new RuntimeException("Handler error!"); + }; + + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + assertEquals("original_context_123", stripeClient.getContext()); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + + RuntimeException exception = + assertThrows( + RuntimeException.class, + () -> eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader)); + assertEquals("Handler error!", exception.getMessage()); + + assertEquals("original_context_123", stripeClient.getContext()); + } + + @Test + public void testStripeContextSetToNullWhenEventHasNoContext() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that stripe_context is set to null when event context is null + AtomicReference receivedContext = new AtomicReference<>(); + + StripeEventNotificationHandler.Callback handler = + (event, client) -> { + receivedContext.set(client.getContext()); + }; + + eventNotificationHandler.onV2CoreAccountCreated(handler); + + assertEquals("original_context_123", stripeClient.getContext()); + + String sigHeader = generateSigHeader(v2AccountCreatedPayload); + eventNotificationHandler.handle(v2AccountCreatedPayload, sigHeader); + + assertNull(receivedContext.get()); + assertEquals("original_context_123", stripeClient.getContext()); + } + + @Test + public void testUnknownEventRoutesToOnUnhandled() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that events without SDK types rout handler + String sigHeader = generateSigHeader(unknownEventPayload); + eventNotificationHandler.handle(unknownEventPayload, sigHeader); + + verify(fallbackCallback, times(1)) + .process( + org.mockito.ArgumentMatchers.argThat( + event -> + event instanceof UnknownEventNotification + && event.getType().equals("llama.created")), + org.mockito.ArgumentMatchers.any(StripeClient.class), + org.mockito.ArgumentMatchers.argThat(info -> info.isKnownEventType() == false)); + } + + @Test + public void testKnownUnregisteredEventRoutesToOnUnhandled() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that known event types without a registered handler rout + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + verify(fallbackCallback, times(1)) + .process( + org.mockito.ArgumentMatchers.argThat( + event -> + event instanceof V1BillingMeterErrorReportTriggeredEventNotification + && event.getType().equals("v1.billing.meter.error_report_triggered")), + org.mockito.ArgumentMatchers.any(StripeClient.class), + org.mockito.ArgumentMatchers.argThat(info -> info.isKnownEventType() == true)); + } + + @SuppressWarnings("unchecked") + @Test + public void testRegisteredEventDoesNotCallOnUnhandled() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that registered events don't tri + StripeEventNotificationHandler.Callback + handler = mock(StripeEventNotificationHandler.Callback.class); + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + verify(handler, times(1)) + .process(org.mockito.ArgumentMatchers.any(), org.mockito.ArgumentMatchers.any()); + verify(fallbackCallback, never()) + .process( + org.mockito.ArgumentMatchers.any(), + org.mockito.ArgumentMatchers.any(), + org.mockito.ArgumentMatchers.any()); + } + + @Test + public void testHandlerClientRetainsConfiguration() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test that the client passed to handlers retains all configuration except stripe_context + String originalContext = "original_context_xyz"; + + StripeClient customClient = + StripeClient.builder() + .setApiKey("sk_test_custom_key") + .setStripeContext(originalContext) + .build(); + + StripeEventNotificationHandler customRouter = + new StripeEventNotificationHandler(DUMMY_WEBHOOK_SECRET, customClient, fallbackCallback); + + AtomicReference receivedContext = new AtomicReference<>(); + + StripeEventNotificationHandler.Callback + handler = + (event, client) -> { + receivedContext.set(client.getContext()); + }; + + customRouter.onV1BillingMeterErrorReportTriggered(handler); + + String sigHeader = generateSigHeader(v1BillingMeterPayload); + customRouter.handle(v1BillingMeterPayload, sigHeader); + + assertEquals("event_context_456", receivedContext.get()); + assertEquals(originalContext, customClient.getContext()); + } + + @Test + public void testOnUnhandledReceivesCorrectInfoForUnknown() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test receives correct UnhandledNotificationDetails for unknown events + String sigHeader = generateSigHeader(unknownEventPayload); + eventNotificationHandler.handle(unknownEventPayload, sigHeader); + + verify(fallbackCallback, times(1)) + .process( + org.mockito.ArgumentMatchers.any(EventNotification.class), + org.mockito.ArgumentMatchers.any(StripeClient.class), + org.mockito.ArgumentMatchers.argThat(info -> info.isKnownEventType() == false)); + } + + @Test + public void testOnUnhandledReceivesCorrectInfoForKnownUnregistered() + throws SignatureVerificationException, NoSuchAlgorithmException, InvalidKeyException { + // Test receives correct UnhandledNotificationDetails for known unregistered + // events + String sigHeader = generateSigHeader(v1BillingMeterPayload); + eventNotificationHandler.handle(v1BillingMeterPayload, sigHeader); + + verify(fallbackCallback, times(1)) + .process( + org.mockito.ArgumentMatchers.any(EventNotification.class), + org.mockito.ArgumentMatchers.any(StripeClient.class), + org.mockito.ArgumentMatchers.argThat(info -> info.isKnownEventType() == true)); + } + + @Test + public void testValidatesWebhookSignature() { + // Test that invalid webhook signatures are rejected + assertThrows( + SignatureVerificationException.class, + () -> eventNotificationHandler.handle(v1BillingMeterPayload, "invalid_signature")); + } + + @Test + public void testRegisteredEventTypesEmpty() { + // Test that registered_event_types returns empty list when no handlers are registered + List eventTypes = eventNotificationHandler.getRegisteredEventTypes(); + assertNotNull(eventTypes); + assertTrue(eventTypes.isEmpty()); + } + + @SuppressWarnings("unchecked") + @Test + public void testRegisteredEventTypesSingle() { + // Test that registered_event_types returns a single event type + StripeEventNotificationHandler.Callback + handler = mock(StripeEventNotificationHandler.Callback.class); + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + + List eventTypes = eventNotificationHandler.getRegisteredEventTypes(); + assertEquals(1, eventTypes.size()); + assertEquals("v1.billing.meter.error_report_triggered", eventTypes.get(0)); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + @Test + public void testRegisteredEventTypesMultipleAlphabetized() { + // Test that registered_event_types returns multiple event types in alphabetical order + StripeEventNotificationHandler.Callback handler = + mock(StripeEventNotificationHandler.Callback.class); + + // Register in non-alphabetical order + eventNotificationHandler.onV2CoreAccountUpdated(handler); + eventNotificationHandler.onV1BillingMeterErrorReportTriggered(handler); + eventNotificationHandler.onV2CoreAccountCreated(handler); + + List expected = + Arrays.asList( + "v1.billing.meter.error_report_triggered", + "v2.core.account.created", + "v2.core.account.updated"); + + List eventTypes = eventNotificationHandler.getRegisteredEventTypes(); + assertEquals(expected, eventTypes); + } +} From 0cf1766f209497e9bc96367cdc726ac494e446f7 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 17:04:59 +0000 Subject: [PATCH 3/3] Update generated code for v2256 and --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- .../com/stripe/model/PaymentLocation.java | 99 ++++ .../java/com/stripe/model/Subscription.java | 54 +++ .../param/PaymentLocationRetrieveParams.java | 100 ++++ .../param/PaymentLocationUpdateParams.java | 440 ++++++++++++++++++ .../service/PaymentLocationService.java | 67 +++ 7 files changed, 762 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/stripe/param/PaymentLocationRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/PaymentLocationUpdateParams.java diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index d19d890c6af..9b119c6dec0 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -f02038df5433a605fce164b9af1b8b445252ee4f \ No newline at end of file +6b817716b60b32636770d4c1bd7863bbdb6f5f7a \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index bb151480971..59e8e7ab354 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2255 \ No newline at end of file +v2256 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/PaymentLocation.java b/src/main/java/com/stripe/model/PaymentLocation.java index 073fda4a5cc..79610638a10 100644 --- a/src/main/java/com/stripe/model/PaymentLocation.java +++ b/src/main/java/com/stripe/model/PaymentLocation.java @@ -10,6 +10,8 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.PaymentLocationCreateParams; +import com.stripe.param.PaymentLocationRetrieveParams; +import com.stripe.param.PaymentLocationUpdateParams; import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; @@ -35,6 +37,10 @@ public class PaymentLocation extends ApiResource implements HasId { @SerializedName("capability_settings") CapabilitySettings capabilitySettings; + /** Always true for a deleted object. */ + @SerializedName("deleted") + Boolean deleted; + /** The display name of the location. */ @SerializedName("display_name") String displayName; @@ -93,6 +99,99 @@ public static PaymentLocation create(PaymentLocationCreateParams params, Request return getGlobalResponseGetter().request(request, PaymentLocation.class); } + /** Delete a Payment Location. */ + public PaymentLocation delete() throws StripeException { + return delete((Map) null, (RequestOptions) null); + } + + /** Delete a Payment Location. */ + public PaymentLocation delete(RequestOptions options) throws StripeException { + return delete((Map) null, options); + } + + /** Delete a Payment Location. */ + public PaymentLocation delete(Map params) throws StripeException { + return delete(params, (RequestOptions) null); + } + + /** Delete a Payment Location. */ + public PaymentLocation delete(Map params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, params, options); + return getResponseGetter().request(request, PaymentLocation.class); + } + + /** Retrieve a Payment Location. */ + public static PaymentLocation retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieve a Payment Location. */ + public static PaymentLocation retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieve a Payment Location. */ + public static PaymentLocation retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentLocation.class); + } + + /** Retrieve a Payment Location. */ + public static PaymentLocation retrieve( + String id, PaymentLocationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentLocation.class); + } + + /** Update a Payment Location. */ + public PaymentLocation update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Update a Payment Location. */ + public PaymentLocation update(Map params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentLocation.class); + } + + /** Update a Payment Location. */ + public PaymentLocation update(PaymentLocationUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Update a Payment Location. */ + public PaymentLocation update(PaymentLocationUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, PaymentLocation.class); + } + /** * For more details about BusinessRegistration, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index 75535462e2c..c90703f63e7 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -386,6 +386,10 @@ public class Subscription extends ApiResource implements HasId, MetadataStoreEqual to {@code subscription}. + */ + @SerializedName("type") + String type; + + /** Information on the {@code type=subscription} pause. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InnerSubscription extends StripeObject { + /** + * The reason that the subscription was paused. + * + *

One of {@code pause_requested}, {@code system}, or {@code + * trial_end_without_payment_method}. + */ + @SerializedName("type") + String type; + } + } + } + /** * For more details about TransferData, please refer to the API Reference. @@ -2818,6 +2871,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(prebilling, responseGetter); trySetResponseGetter(presentmentDetails, responseGetter); trySetResponseGetter(schedule, responseGetter); + trySetResponseGetter(statusDetails, responseGetter); trySetResponseGetter(testClock, responseGetter); trySetResponseGetter(transferData, responseGetter); trySetResponseGetter(trialSettings, responseGetter); diff --git a/src/main/java/com/stripe/param/PaymentLocationRetrieveParams.java b/src/main/java/com/stripe/param/PaymentLocationRetrieveParams.java new file mode 100644 index 00000000000..197452e4932 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentLocationRetrieveParams.java @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentLocationRetrieveParams extends ApiRequestParams { + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private PaymentLocationRetrieveParams(List expand, Map extraParams) { + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLocationRetrieveParams build() { + return new PaymentLocationRetrieveParams(this.expand, this.extraParams); + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentLocationRetrieveParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentLocationRetrieveParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLocationRetrieveParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLocationRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentLocationUpdateParams.java b/src/main/java/com/stripe/param/PaymentLocationUpdateParams.java new file mode 100644 index 00000000000..b05cf3cb470 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentLocationUpdateParams.java @@ -0,0 +1,440 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentLocationUpdateParams extends ApiRequestParams { + /** The full address of the location. */ + @SerializedName("address") + Address address; + + /** Identification numbers associated with the location. */ + @SerializedName("business_registration") + BusinessRegistration businessRegistration; + + /** A name for the location. */ + @SerializedName("display_name") + Object displayName; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private PaymentLocationUpdateParams( + Address address, + BusinessRegistration businessRegistration, + Object displayName, + List expand, + Map extraParams) { + this.address = address; + this.businessRegistration = businessRegistration; + this.displayName = displayName; + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private BusinessRegistration businessRegistration; + + private Object displayName; + + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLocationUpdateParams build() { + return new PaymentLocationUpdateParams( + this.address, this.businessRegistration, this.displayName, this.expand, this.extraParams); + } + + /** The full address of the location. */ + public Builder setAddress(PaymentLocationUpdateParams.Address address) { + this.address = address; + return this; + } + + /** Identification numbers associated with the location. */ + public Builder setBusinessRegistration( + PaymentLocationUpdateParams.BusinessRegistration businessRegistration) { + this.businessRegistration = businessRegistration; + return this; + } + + /** A name for the location. */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** A name for the location. */ + public Builder setDisplayName(EmptyParam displayName) { + this.displayName = displayName; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentLocationUpdateParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentLocationUpdateParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLocationUpdateParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLocationUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + Object city; + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + @SerializedName("country") + Object country; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + Object line1; + + /** Address line 2, such as the apartment, suite, unit, or building. */ + @SerializedName("line2") + Object line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + Object postalCode; + + /** + * State, county, province, or region (ISO + * 3166-2). + */ + @SerializedName("state") + Object state; + + private Address( + Object city, + Object country, + Map extraParams, + Object line1, + Object line2, + Object postalCode, + Object state) { + this.city = city; + this.country = country; + this.extraParams = extraParams; + this.line1 = line1; + this.line2 = line2; + this.postalCode = postalCode; + this.state = state; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object city; + + private Object country; + + private Map extraParams; + + private Object line1; + + private Object line2; + + private Object postalCode; + + private Object state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLocationUpdateParams.Address build() { + return new PaymentLocationUpdateParams.Address( + this.city, + this.country, + this.extraParams, + this.line1, + this.line2, + this.postalCode, + this.state); + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(String city) { + this.city = city; + return this; + } + + /** City, district, suburb, town, or village. */ + public Builder setCity(EmptyParam city) { + this.city = city; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(String country) { + this.country = country; + return this; + } + + /** + * Required. Two-letter country code (ISO 3166-1 alpha-2). + */ + public Builder setCountry(EmptyParam country) { + this.country = country; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLocationUpdateParams.Address#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLocationUpdateParams.Address#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 1, such as the street, PO Box, or company name. */ + public Builder setLine1(EmptyParam line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(EmptyParam line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(EmptyParam postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * State, county, province, or region (ISO + * 3166-2). + */ + public Builder setState(String state) { + this.state = state; + return this; + } + + /** + * State, county, province, or region (ISO + * 3166-2). + */ + public Builder setState(EmptyParam state) { + this.state = state; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BusinessRegistration { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * 14-digit SIRET (Système d'identification du répertoire des établissements) number for the + * location. + */ + @SerializedName("siret") + Object siret; + + private BusinessRegistration(Map extraParams, Object siret) { + this.extraParams = extraParams; + this.siret = siret; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object siret; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLocationUpdateParams.BusinessRegistration build() { + return new PaymentLocationUpdateParams.BusinessRegistration(this.extraParams, this.siret); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLocationUpdateParams.BusinessRegistration#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLocationUpdateParams.BusinessRegistration#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 14-digit SIRET (Système d'identification du répertoire des établissements) number for the + * location. + */ + public Builder setSiret(String siret) { + this.siret = siret; + return this; + } + + /** + * 14-digit SIRET (Système d'identification du répertoire des établissements) number for the + * location. + */ + public Builder setSiret(EmptyParam siret) { + this.siret = siret; + return this; + } + } + } +} diff --git a/src/main/java/com/stripe/service/PaymentLocationService.java b/src/main/java/com/stripe/service/PaymentLocationService.java index cc52f7d7777..100fb3cb05c 100644 --- a/src/main/java/com/stripe/service/PaymentLocationService.java +++ b/src/main/java/com/stripe/service/PaymentLocationService.java @@ -11,12 +11,79 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.PaymentLocationCreateParams; +import com.stripe.param.PaymentLocationRetrieveParams; +import com.stripe.param.PaymentLocationUpdateParams; public final class PaymentLocationService extends ApiService { public PaymentLocationService(StripeResponseGetter responseGetter) { super(responseGetter); } + /** Delete a Payment Location. */ + public PaymentLocation delete(String id) throws StripeException { + return delete(id, (RequestOptions) null); + } + /** Delete a Payment Location. */ + public PaymentLocation delete(String id, RequestOptions options) throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, null, options); + return this.request(request, PaymentLocation.class); + } + /** Retrieve a Payment Location. */ + public PaymentLocation retrieve(String id, PaymentLocationRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieve a Payment Location. */ + public PaymentLocation retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PaymentLocationRetrieveParams) null, options); + } + /** Retrieve a Payment Location. */ + public PaymentLocation retrieve(String id) throws StripeException { + return retrieve(id, (PaymentLocationRetrieveParams) null, (RequestOptions) null); + } + /** Retrieve a Payment Location. */ + public PaymentLocation retrieve( + String id, PaymentLocationRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentLocation.class); + } + /** Update a Payment Location. */ + public PaymentLocation update(String id, PaymentLocationUpdateParams params) + throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Update a Payment Location. */ + public PaymentLocation update(String id, RequestOptions options) throws StripeException { + return update(id, (PaymentLocationUpdateParams) null, options); + } + /** Update a Payment Location. */ + public PaymentLocation update(String id) throws StripeException { + return update(id, (PaymentLocationUpdateParams) null, (RequestOptions) null); + } + /** Update a Payment Location. */ + public PaymentLocation update( + String id, PaymentLocationUpdateParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_locations/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentLocation.class); + } /** Create a Payment Location. */ public PaymentLocation create(PaymentLocationCreateParams params) throws StripeException { return create(params, (RequestOptions) null);