diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index f5f04d71b05..8576feb6a93 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -2feaeea9e3c2b01dd5b7e4092d8364af4bf1e740 \ No newline at end of file +9e950cbf7b5a814a98f27d1a94b72cd6f1df2078 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 466b261db46..8110841c8f5 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2190 \ No newline at end of file +v2202 \ No newline at end of file diff --git a/README.md b/README.md index 0cb829db980..20c1f383a29 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) +> [!TIP] +> Want to chat live with Stripe engineers? Join us on our [Discord server](https://stripe.com/go/discord/java). + The official [Stripe][stripe] Java client library. ## Installation diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index ed34024675b..6092c3c23cf 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -634,6 +634,18 @@ public com.stripe.service.MarginService margins() { return new com.stripe.service.MarginService(this.getResponseGetter()); } + /** + * @deprecated StripeClient.orchestration() is deprecated, use StripeClient.v1().orchestration() + * instead. All functionality under it has been copied over to + * StripeClient.v1().orchestration(). See migration + * guide for more on this and tips on migrating to the new v1 namespace. + */ + @Deprecated + public com.stripe.service.OrchestrationService orchestration() { + return new com.stripe.service.OrchestrationService(this.getResponseGetter()); + } + /** * @deprecated StripeClient.orders() is deprecated, use StripeClient.v1().orders() instead. All * functionality under it has been copied over to StripeClient.v1().orders(). See One of {@code license_fee_subscription_details}, {@code rate_card_subscription_details}, + *

One of {@code pricing_plan_subscription_details}, {@code rate_card_subscription_details}, * {@code schedule_details}, or {@code subscription_details}. */ @SerializedName("type") String type; /** - * For more details about LicenseFeeSubscriptionDetails, please refer to the API Reference. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class LicenseFeeSubscriptionDetails extends StripeObject { - /** The license fee subscription that generated this invoice item. */ - @SerializedName("license_fee_subscription") - String licenseFeeSubscription; - - /** The license fee version that generated this invoice item. */ - @SerializedName("license_fee_version") - String licenseFeeVersion; - - /** The pricing plan subscription that manages the license fee subscription. */ + public static class PricingPlanSubscriptionDetails extends StripeObject { + /** The pricing plan subscription that manages this charge. */ @SerializedName("pricing_plan_subscription") String pricingPlanSubscription; - /** The pricing plan version at the time this invoice item was generated. */ + /** The pricing plan version at the time this charge was generated. */ @SerializedName("pricing_plan_version") String pricingPlanVersion; } @@ -604,14 +596,6 @@ public static class LicenseFeeSubscriptionDetails extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class RateCardSubscriptionDetails extends StripeObject { - /** The pricing plan subscription that manages the rate card subscription. */ - @SerializedName("pricing_plan_subscription") - String pricingPlanSubscription; - - /** The pricing plan version at the time this invoice item was generated. */ - @SerializedName("pricing_plan_version") - String pricingPlanVersion; - /** The rate card subscription that generated this invoice item. */ @SerializedName("rate_card_subscription") String rateCardSubscription; diff --git a/src/main/java/com/stripe/model/InvoiceLineItem.java b/src/main/java/com/stripe/model/InvoiceLineItem.java index 6bedb4053c7..18eae958ab1 100644 --- a/src/main/java/com/stripe/model/InvoiceLineItem.java +++ b/src/main/java/com/stripe/model/InvoiceLineItem.java @@ -401,9 +401,9 @@ public static class Parent extends StripeObject { @SerializedName("invoice_item_details") InvoiceItemDetails invoiceItemDetails; - /** Details about the license fee subscription that generated this line item. */ - @SerializedName("license_fee_subscription_details") - LicenseFeeSubscriptionDetails licenseFeeSubscriptionDetails; + /** Details about the pricing plan subscription that generated this line item. */ + @SerializedName("pricing_plan_subscription_details") + PricingPlanSubscriptionDetails pricingPlanSubscriptionDetails; /** Details about the rate card subscription that generated this line item. */ @SerializedName("rate_card_subscription_details") @@ -420,7 +420,7 @@ public static class Parent extends StripeObject { /** * The type of parent that generated this line item * - *

One of {@code invoice_item_details}, {@code license_fee_subscription_details}, {@code + *

One of {@code invoice_item_details}, {@code pricing_plan_subscription_details}, {@code * rate_card_subscription_details}, {@code schedule_details}, or {@code * subscription_item_details}. */ @@ -486,30 +486,22 @@ public static class CreditedItems extends StripeObject { } /** - * For more details about LicenseFeeSubscriptionDetails, please refer to the API Reference. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class LicenseFeeSubscriptionDetails extends StripeObject { + public static class PricingPlanSubscriptionDetails extends StripeObject { /** The invoice item that generated this line item. */ @SerializedName("invoice_item") String invoiceItem; - /** The license fee subscription that generated this line item. */ - @SerializedName("license_fee_subscription") - String licenseFeeSubscription; - - /** The license fee version at the time this line item was generated. */ - @SerializedName("license_fee_version") - String licenseFeeVersion; - - /** The pricing plan subscription that manages the license fee subscription. */ + /** The pricing plan subscription that manages this charge. */ @SerializedName("pricing_plan_subscription") String pricingPlanSubscription; - /** The pricing plan version at the time this line item was generated. */ + /** The pricing plan version at the time this charge was generated. */ @SerializedName("pricing_plan_version") String pricingPlanVersion; } @@ -526,14 +518,6 @@ public static class RateCardSubscriptionDetails extends StripeObject { @SerializedName("invoice_item") String invoiceItem; - /** The pricing plan subscription that manages the rate card subscription. */ - @SerializedName("pricing_plan_subscription") - String pricingPlanSubscription; - - /** The pricing plan version at the time this line item was generated. */ - @SerializedName("pricing_plan_version") - String pricingPlanVersion; - /** The rate card subscription that generated this line item. */ @SerializedName("rate_card_subscription") String rateCardSubscription; diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java index 753f31823de..5115659da61 100644 --- a/src/main/java/com/stripe/model/PaymentAttemptRecord.java +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -10,6 +10,12 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.PaymentAttemptRecordListParams; +import com.stripe.param.PaymentAttemptRecordReportAuthenticatedParams; +import com.stripe.param.PaymentAttemptRecordReportCanceledParams; +import com.stripe.param.PaymentAttemptRecordReportFailedParams; +import com.stripe.param.PaymentAttemptRecordReportGuaranteedParams; +import com.stripe.param.PaymentAttemptRecordReportInformationalParams; +import com.stripe.param.PaymentAttemptRecordReportRefundParams; import com.stripe.param.PaymentAttemptRecordRetrieveParams; import java.util.List; import java.util.Map; @@ -167,6 +173,306 @@ public static PaymentAttemptRecordCollection list( return getGlobalResponseGetter().request(request, PaymentAttemptRecordCollection.class); } + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated() throws StripeException { + return reportAuthenticated((Map) null, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated(RequestOptions options) throws StripeException { + return reportAuthenticated((Map) null, options); + } + + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated(Map params) + throws StripeException { + return reportAuthenticated(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_authenticated", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated( + PaymentAttemptRecordReportAuthenticatedParams params) throws StripeException { + return reportAuthenticated(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated( + PaymentAttemptRecordReportAuthenticatedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_authenticated", + 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, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled() throws StripeException { + return reportCanceled((Map) null, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled(RequestOptions options) throws StripeException { + return reportCanceled((Map) null, options); + } + + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled(Map params) throws StripeException { + return reportCanceled(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_canceled", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled(PaymentAttemptRecordReportCanceledParams params) + throws StripeException { + return reportCanceled(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled( + PaymentAttemptRecordReportCanceledParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_canceled", + 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, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed() throws StripeException { + return reportFailed((Map) null, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed(RequestOptions options) throws StripeException { + return reportFailed((Map) null, options); + } + + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed(Map params) throws StripeException { + return reportFailed(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_failed", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed(PaymentAttemptRecordReportFailedParams params) + throws StripeException { + return reportFailed(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed( + PaymentAttemptRecordReportFailedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_failed", 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, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed() throws StripeException { + return reportGuaranteed((Map) null, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed(RequestOptions options) throws StripeException { + return reportGuaranteed((Map) null, options); + } + + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed(Map params) throws StripeException { + return reportGuaranteed(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_guaranteed", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed(PaymentAttemptRecordReportGuaranteedParams params) + throws StripeException { + return reportGuaranteed(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed( + PaymentAttemptRecordReportGuaranteedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_guaranteed", + 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, PaymentAttemptRecord.class); + } + + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational() throws StripeException { + return reportInformational((Map) null, (RequestOptions) null); + } + + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational(RequestOptions options) throws StripeException { + return reportInformational((Map) null, options); + } + + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational(Map params) + throws StripeException { + return reportInformational(params, (RequestOptions) null); + } + + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_informational", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational( + PaymentAttemptRecordReportInformationalParams params) throws StripeException { + return reportInformational(params, (RequestOptions) null); + } + + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational( + PaymentAttemptRecordReportInformationalParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_informational", + 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, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record was refunded. */ + public PaymentAttemptRecord reportRefund(Map params) throws StripeException { + return reportRefund(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was refunded. */ + public PaymentAttemptRecord reportRefund(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_refund", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Report that the specified Payment Attempt Record was refunded. */ + public PaymentAttemptRecord reportRefund(PaymentAttemptRecordReportRefundParams params) + throws StripeException { + return reportRefund(params, (RequestOptions) null); + } + + /** Report that the specified Payment Attempt Record was refunded. */ + public PaymentAttemptRecord reportRefund( + PaymentAttemptRecordReportRefundParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_refund", 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, PaymentAttemptRecord.class); + } + /** Retrieves a Payment Attempt Record with the given ID. */ public static PaymentAttemptRecord retrieve(String id) throws StripeException { return retrieve(id, (Map) null, (RequestOptions) null); diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index f6b686675e2..685007cc099 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -241,6 +241,16 @@ public PaymentRecord reportPaymentAttempt( return getResponseGetter().request(request, PaymentRecord.class); } + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled() throws StripeException { + return reportPaymentAttemptCanceled((Map) null, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled(RequestOptions options) throws StripeException { + return reportPaymentAttemptCanceled((Map) null, options); + } + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ public PaymentRecord reportPaymentAttemptCanceled(Map params) throws StripeException { @@ -284,6 +294,20 @@ public PaymentRecord reportPaymentAttemptCanceled( return getResponseGetter().request(request, PaymentRecord.class); } + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed() throws StripeException { + return reportPaymentAttemptFailed((Map) null, (RequestOptions) null); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed(RequestOptions options) throws StripeException { + return reportPaymentAttemptFailed((Map) null, options); + } + /** * Report that the most recent payment attempt on the specified Payment Record failed or errored. */ @@ -335,6 +359,17 @@ public PaymentRecord reportPaymentAttemptFailed( return getResponseGetter().request(request, PaymentRecord.class); } + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed() throws StripeException { + return reportPaymentAttemptGuaranteed((Map) null, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed(RequestOptions options) + throws StripeException { + return reportPaymentAttemptGuaranteed((Map) null, options); + } + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ public PaymentRecord reportPaymentAttemptGuaranteed(Map params) throws StripeException { diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 01565a2a2cd..9cbc0bffc0d 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -26,6 +26,7 @@ import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; +import com.stripe.param.checkout.SessionApproveParams; import com.stripe.param.checkout.SessionCreateParams; import com.stripe.param.checkout.SessionExpireParams; import com.stripe.param.checkout.SessionListLineItemsParams; @@ -82,6 +83,20 @@ public class Session extends ApiResource implements HasId, MetadataStoreDefault is {@code auto}, when the customer's attempt to pay is approved automatically with + * no action required on your server. + * + *

When set to {@code manual}, you must approve the customer's attempt to pay by calling approve from your server. + * + *

One of {@code auto}, or {@code manual}. + */ + @SerializedName("approval_method") + String approvalMethod; + @SerializedName("automatic_tax") AutomaticTax automaticTax; @@ -158,6 +173,13 @@ public class Session extends ApiResource implements HasId, MetadataStore(expandableObject.getId(), expandableObject); } + /** + * Approves a customer’s attempt to pay for a Checkout Session with {@code approval_method} set to + * {@code manual}. + */ + public Session approve(Map params) throws StripeException { + return approve(params, (RequestOptions) null); + } + + /** + * Approves a customer’s attempt to pay for a Checkout Session with {@code approval_method} set to + * {@code manual}. + */ + public Session approve(Map params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/checkout/sessions/%s/approve", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Session.class); + } + + /** + * Approves a customer’s attempt to pay for a Checkout Session with {@code approval_method} set to + * {@code manual}. + */ + public Session approve(SessionApproveParams params) throws StripeException { + return approve(params, (RequestOptions) null); + } + + /** + * Approves a customer’s attempt to pay for a Checkout Session with {@code approval_method} set to + * {@code manual}. + */ + public Session approve(SessionApproveParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/checkout/sessions/%s/approve", 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, Session.class); + } + /** Creates a Checkout Session object. */ public static Session create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -1432,6 +1502,191 @@ public static class CurrencyConversion extends StripeObject { String sourceCurrency; } + /** + * For more details about CurrentAttempt, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CurrentAttempt extends StripeObject implements HasId { + /** The customer's billing information, if provided. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** The customer's email. */ + @SerializedName("email") + String email; + + /** + * The attempt ID you will pass to the Checkout Session + * approve endpoint to approve the attempt. + */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** Information about the payment method the customer is attempting to pay with. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + + /** The customer's shipping information, if provided. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** + * For more details about BillingDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails extends StripeObject { + @SerializedName("address") + Address address; + + /** Customer name. */ + @SerializedName("name") + String name; + } + + /** + * For more details about PaymentMethodDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails extends StripeObject { + /** + * Indicates whether this payment method can be shown again to its customer in a checkout + * flow. + * + *

One of {@code always}, {@code limited}, or {@code unspecified}. + */ + @SerializedName("allow_redisplay") + String allowRedisplay; + + @SerializedName("card") + Card card; + + /** + * The type of payment method the customer is attempting to pay with. An additional hash is + * included in the payment method details with a name matching this value. It contains + * additional information specific to the payment method type. + */ + @SerializedName("type") + String type; + + /** + * For more details about Card, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * The brand of the card, accounting for customer's brand choice on dual-branded cards. + * + *

One of {@code accel}, {@code amex}, {@code carnet}, {@code cartes_bancaires}, {@code + * conecs}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code elo}, {@code + * girocard}, {@code interac}, {@code jcb}, {@code link}, {@code maestro}, {@code + * mastercard}, {@code nyce}, {@code pulse}, {@code rupay}, {@code star}, {@code unionpay}, + * {@code unknown}, or {@code visa}. + */ + @SerializedName("brand") + String brand; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to + * get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check + * whether two customers who’ve signed up with you are using the same card number, for + * example. For payment methods that tokenize card information (Apple Pay, Google Pay), the + * tokenized number might be provided instead of the underlying card number. + * + *

As of May 1, 2021, card fingerprint in India for Connect changed to allow two + * fingerprints for the same card---one for India and one for the rest of the world. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** + * Issuer identification number of the card. (For internal use only and not typically + * available in standard API requests.) + */ + @SerializedName("iin") + String iin; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + + /** If this Card is part of a card wallet, this contains the details of the card wallet. */ + @SerializedName("wallet") + Wallet wallet; + + /** + * For more details about Wallet, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Wallet extends StripeObject { + /** + * The type of the wallet, one of {@code amex_express_checkout}, {@code apple_pay}, {@code + * google_pay}, {@code masterpass}, {@code samsung_pay}, {@code visa_checkout}, {@code + * meta_pay}, or {@code link}. + */ + @SerializedName("type") + String type; + } + } + } + + /** + * For more details about ShippingDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails extends StripeObject { + @SerializedName("address") + Address address; + + /** Customer name. */ + @SerializedName("name") + String name; + } + } + /** * For more details about CustomField, please refer to the API Reference. @@ -4730,6 +4985,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(consent, responseGetter); trySetResponseGetter(consentCollection, responseGetter); trySetResponseGetter(currencyConversion, responseGetter); + trySetResponseGetter(currentAttempt, responseGetter); trySetResponseGetter(customText, responseGetter); trySetResponseGetter(customer, responseGetter); trySetResponseGetter(customerDetails, responseGetter); diff --git a/src/main/java/com/stripe/model/issuing/Authorization.java b/src/main/java/com/stripe/model/issuing/Authorization.java index 80c1efef7f7..4e48b8d3bbd 100644 --- a/src/main/java/com/stripe/model/issuing/Authorization.java +++ b/src/main/java/com/stripe/model/issuing/Authorization.java @@ -214,6 +214,9 @@ public class Authorization extends ApiResource @Setter(lombok.AccessLevel.NONE) ExpandableField token; + @SerializedName("token_details") + TokenDetails tokenDetails; + /** * List of transactions associated * with this authorization. @@ -1158,6 +1161,203 @@ public static class AmountDetails extends StripeObject { } } + /** + * For more details about TokenDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TokenDetails extends StripeObject { + /** The card associated with this token. */ + @SerializedName("card") + String card; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** The hashed ID derived from the device ID from the card network associated with the token. */ + @SerializedName("device_fingerprint") + String deviceFingerprint; + + @SerializedName("network_data") + NetworkData networkData; + + /** + * For more details about NetworkData, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NetworkData extends StripeObject { + @SerializedName("device") + Device device; + + @SerializedName("mastercard") + Mastercard mastercard; + + /** + * The card network for this token. + * + *

One of {@code mastercard}, or {@code visa}. + */ + @SerializedName("type") + String type; + + @SerializedName("visa") + Visa visa; + + @SerializedName("wallet_provider") + WalletProvider walletProvider; + + /** + * For more details about Device, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Device extends StripeObject { + /** The IP address of the device at provisioning time. */ + @SerializedName("ip_address") + String ipAddress; + + /** + * The ISO 639-1 language code of the device associated with the tokenization request. + * + *

One of {@code aa}, {@code ab}, {@code ae}, {@code af}, {@code ak}, {@code am}, {@code + * an}, {@code ar}, {@code as}, {@code av}, {@code ay}, {@code az}, {@code ba}, {@code be}, + * {@code bg}, {@code bi}, {@code bm}, {@code bn}, {@code bo}, {@code br}, {@code bs}, + * {@code ca}, {@code ce}, {@code ch}, {@code co}, {@code cr}, {@code cs}, {@code cu}, + * {@code cv}, {@code cy}, {@code da}, {@code de}, {@code dv}, {@code dz}, {@code ee}, + * {@code el}, {@code en}, {@code eo}, {@code es}, {@code et}, {@code eu}, {@code fa}, + * {@code ff}, {@code fi}, {@code fj}, {@code fo}, {@code fr}, {@code fy}, {@code ga}, + * {@code gd}, {@code gl}, {@code gn}, {@code gu}, {@code gv}, {@code ha}, {@code he}, + * {@code hi}, {@code ho}, {@code hr}, {@code ht}, {@code hu}, {@code hy}, {@code hz}, + * {@code ia}, {@code id}, {@code ie}, {@code ig}, {@code ii}, {@code ik}, {@code io}, + * {@code is}, {@code it}, {@code iu}, {@code ja}, {@code jv}, {@code ka}, {@code kg}, + * {@code ki}, {@code kj}, {@code kk}, {@code kl}, {@code km}, {@code kn}, {@code ko}, + * {@code kr}, {@code ks}, {@code ku}, {@code kv}, {@code kw}, {@code ky}, {@code la}, + * {@code lb}, {@code lg}, {@code li}, {@code ln}, {@code lo}, {@code lt}, {@code lu}, + * {@code lv}, {@code mg}, {@code mh}, {@code mi}, {@code mk}, {@code ml}, {@code mn}, + * {@code mr}, {@code ms}, {@code mt}, {@code my}, {@code na}, {@code nb}, {@code nd}, + * {@code ne}, {@code ng}, {@code nl}, {@code nn}, {@code no}, {@code nr}, {@code nv}, + * {@code ny}, {@code oc}, {@code oj}, {@code om}, {@code or}, {@code os}, {@code pa}, + * {@code pi}, {@code pl}, {@code ps}, {@code pt}, {@code qu}, {@code rm}, {@code rn}, + * {@code ro}, {@code ru}, {@code rw}, {@code sa}, {@code sc}, {@code sd}, {@code se}, + * {@code sg}, {@code si}, {@code sk}, {@code sl}, {@code sm}, {@code sn}, {@code so}, + * {@code sq}, {@code sr}, {@code ss}, {@code st}, {@code su}, {@code sv}, {@code sw}, + * {@code ta}, {@code te}, {@code tg}, {@code th}, {@code ti}, {@code tk}, {@code tl}, + * {@code tn}, {@code to}, {@code tr}, {@code ts}, {@code tt}, {@code tw}, {@code ty}, + * {@code ug}, {@code uk}, {@code ur}, {@code uz}, {@code ve}, {@code vi}, {@code vo}, + * {@code wa}, {@code wo}, {@code xh}, {@code yi}, {@code yo}, {@code za}, {@code zh}, or + * {@code zu}. + */ + @SerializedName("language") + String language; + + /** The phone number of the device used for tokenization. */ + @SerializedName("phone_number") + String phoneNumber; + } + + /** + * For more details about Mastercard, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Mastercard extends StripeObject { + /** A unique reference ID from the network to represent the card account number. */ + @SerializedName("card_reference_id") + String cardReferenceId; + + /** The network-unique identifier for the token. */ + @SerializedName("token_reference_id") + String tokenReferenceId; + + /** The ID of the entity requesting tokenization. */ + @SerializedName("token_requestor_id") + String tokenRequestorId; + } + + /** + * For more details about Visa, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Visa extends StripeObject { + /** A unique reference ID from the network to represent the card account number. */ + @SerializedName("card_reference_id") + String cardReferenceId; + + /** The network-unique identifier for the token. */ + @SerializedName("token_reference_id") + String tokenReferenceId; + + /** The ID of the entity requesting tokenization. */ + @SerializedName("token_requestor_id") + String tokenRequestorId; + + /** + * Degree of risk associated with the token between {@code 01} and {@code 99}, with higher + * number indicating higher risk. A {@code 00} value indicates the token was not scored by + * Visa. + */ + @SerializedName("token_risk_score") + String tokenRiskScore; + } + + /** + * For more details about WalletProvider, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class WalletProvider extends StripeObject { + /** + * An evaluation on the trustworthiness of the wallet account between 1 and 5. A higher + * score indicates more trustworthy. + */ + @SerializedName("account_trust_score") + Long accountTrustScore; + + /** + * The method used for tokenizing a card. + * + *

One of {@code app}, {@code manual}, {@code on_file}, or {@code other}. + */ + @SerializedName("card_number_source") + String cardNumberSource; + + /** + * An evaluation on the trustworthiness of the device. A higher score indicates more + * trustworthy. + */ + @SerializedName("device_trust_score") + Long deviceTrustScore; + + /** The reasons for suggested tokenization given by the card network. */ + @SerializedName("reason_codes") + List reasonCodes; + + /** + * The recommendation on responding to the tokenization request. + * + *

One of {@code approve}, {@code decline}, or {@code require_auth}. + */ + @SerializedName("suggested_decision") + String suggestedDecision; + } + } + } + /** * For more details about Treasury, please refer to the API * Reference. @@ -1642,6 +1842,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(networkData, responseGetter); trySetResponseGetter(pendingRequest, responseGetter); trySetResponseGetter(token, responseGetter); + trySetResponseGetter(tokenDetails, responseGetter); trySetResponseGetter(treasury, responseGetter); trySetResponseGetter(verificationData, responseGetter); } diff --git a/src/main/java/com/stripe/model/orchestration/PaymentAttempt.java b/src/main/java/com/stripe/model/orchestration/PaymentAttempt.java new file mode 100644 index 00000000000..ba82c1ab212 --- /dev/null +++ b/src/main/java/com/stripe/model/orchestration/PaymentAttempt.java @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec +package com.stripe.model.orchestration; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.HasId; +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.param.orchestration.PaymentAttemptRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** Represents orchestration information for a payment attempt record (e.g. return url). */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentAttempt extends ApiResource implements HasId { + /** 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 orchestration.payment_attempt}. + */ + @SerializedName("object") + String object; + + /** If present, the return URL for this payment attempt. */ + @SerializedName("return_url") + String returnUrl; + + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public static PaymentAttempt retrieve(String paymentAttemptRecord) throws StripeException { + return retrieve(paymentAttemptRecord, (Map) null, (RequestOptions) null); + } + + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public static PaymentAttempt retrieve(String paymentAttemptRecord, RequestOptions options) + throws StripeException { + return retrieve(paymentAttemptRecord, (Map) null, options); + } + + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public static PaymentAttempt retrieve( + String paymentAttemptRecord, Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/orchestration/payment_attempts/%s", ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentAttempt.class); + } + + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public static PaymentAttempt retrieve( + String paymentAttemptRecord, PaymentAttemptRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/orchestration/payment_attempts/%s", ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentAttempt.class); + } +} diff --git a/src/main/java/com/stripe/model/radar/CustomerEvaluation.java b/src/main/java/com/stripe/model/radar/CustomerEvaluation.java new file mode 100644 index 00000000000..27c22cadc9a --- /dev/null +++ b/src/main/java/com/stripe/model/radar/CustomerEvaluation.java @@ -0,0 +1,242 @@ +// File generated from our OpenAPI spec +package com.stripe.model.radar; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +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.radar.CustomerEvaluationCreateParams; +import com.stripe.param.radar.CustomerEvaluationUpdateParams; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** Customer Evaluation resource returned by the Radar Customer Evaluations API. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class CustomerEvaluation extends ApiResource implements HasId { + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created_at") + Long createdAt; + + /** The ID of the Stripe customer the customer evaluation is associated with. */ + @SerializedName("customer") + String customer; + + /** The type of evaluation event. */ + @SerializedName("event_type") + String eventType; + + /** A list of events that have been reported on this customer evaluation. */ + @SerializedName("events") + List events; + + /** 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 radar.customer_evaluation}. + */ + @SerializedName("object") + String object; + + /** A hash of signal objects providing Radar's evaluation for the lifecycle event. */ + @SerializedName("signals") + Signals signals; + + /** Creates a new {@code CustomerEvaluation} object. */ + public static CustomerEvaluation create(Map params) throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new {@code CustomerEvaluation} object. */ + public static CustomerEvaluation create(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/radar/customer_evaluations"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, CustomerEvaluation.class); + } + + /** Creates a new {@code CustomerEvaluation} object. */ + public static CustomerEvaluation create(CustomerEvaluationCreateParams params) + throws StripeException { + return create(params, (RequestOptions) null); + } + + /** Creates a new {@code CustomerEvaluation} object. */ + public static CustomerEvaluation create( + CustomerEvaluationCreateParams params, RequestOptions options) throws StripeException { + String path = "/v1/radar/customer_evaluations"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, CustomerEvaluation.class); + } + + /** Reports an event on a {@code CustomerEvaluation} object. */ + public CustomerEvaluation update(Map params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Reports an event on a {@code CustomerEvaluation} object. */ + public CustomerEvaluation update(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/radar/customer_evaluations/%s/report", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, CustomerEvaluation.class); + } + + /** Reports an event on a {@code CustomerEvaluation} object. */ + public CustomerEvaluation update(CustomerEvaluationUpdateParams params) throws StripeException { + return update(params, (RequestOptions) null); + } + + /** Reports an event on a {@code CustomerEvaluation} object. */ + public CustomerEvaluation update(CustomerEvaluationUpdateParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/radar/customer_evaluations/%s/report", 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, CustomerEvaluation.class); + } + + /** Event object representing an event reported for a Customer Evaluation via the report API. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Event extends StripeObject { + /** Data about a failed login event. */ + @SerializedName("login_failed") + LoginFailed loginFailed; + + /** Time at which the event occurred. Measured in seconds since the Unix epoch. */ + @SerializedName("occurred_at") + Long occurredAt; + + /** Data about a failed registration event. */ + @SerializedName("registration_failed") + RegistrationFailed registrationFailed; + + /** The type of event that occurred. */ + @SerializedName("type") + String type; + + /** Data about a failed login event. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LoginFailed extends StripeObject { + /** The reason why this login failed. */ + @SerializedName("reason") + String reason; + } + + /** Data about a failed registration event. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RegistrationFailed extends StripeObject { + /** The reason why this registration failed. */ + @SerializedName("reason") + String reason; + } + } + + /** Customer Evaluation Signals resource returned by the Radar Customer Evaluations API. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Signals extends StripeObject { + @SerializedName("account_sharing") + AccountSharing accountSharing; + + @SerializedName("multi_accounting") + MultiAccounting multiAccounting; + + /** + * For more details about AccountSharing, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AccountSharing extends StripeObject { + /** Time at which the signal was evaluated. Measured in seconds since the Unix epoch. */ + @SerializedName("evaluated_at") + Long evaluatedAt; + + /** The risk level for this signal. */ + @SerializedName("risk_level") + String riskLevel; + + /** Score for this signal (float between 0.0-100.0). */ + @SerializedName("score") + BigDecimal score; + } + + /** + * For more details about MultiAccounting, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MultiAccounting extends StripeObject { + /** Time at which the signal was evaluated. Measured in seconds since the Unix epoch. */ + @SerializedName("evaluated_at") + Long evaluatedAt; + + /** The risk level for this signal. */ + @SerializedName("risk_level") + String riskLevel; + + /** Score for this signal (float between 0.0-100.0). */ + @SerializedName("score") + BigDecimal score; + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(signals, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/radar/IssuingAuthorizationEvaluation.java b/src/main/java/com/stripe/model/radar/IssuingAuthorizationEvaluation.java index 0464af5bbb1..b1111d327e8 100644 --- a/src/main/java/com/stripe/model/radar/IssuingAuthorizationEvaluation.java +++ b/src/main/java/com/stripe/model/radar/IssuingAuthorizationEvaluation.java @@ -26,7 +26,7 @@ @Setter @EqualsAndHashCode(callSuper = false) public class IssuingAuthorizationEvaluation extends ApiResource implements HasId { - /** Details about the authorization transaction. */ + /** Details about the authorization. */ @SerializedName("authorization_details") AuthorizationDetails authorizationDetails; @@ -50,7 +50,10 @@ public class IssuingAuthorizationEvaluation extends ApiResource implements HasId @SerializedName("livemode") Boolean livemode; - /** Details about the merchant where the authorization occurred. */ + /** + * Details about the seller (grocery store, e-commerce website, etc.) where the card authorization + * happened. + */ @SerializedName("merchant_details") MerchantDetails merchantDetails; @@ -61,7 +64,7 @@ public class IssuingAuthorizationEvaluation extends ApiResource implements HasId @SerializedName("metadata") Map metadata; - /** Details about the card network processing. */ + /** Details about the authorization, such as identifiers, set by the card network. */ @SerializedName("network_details") NetworkDetails networkDetails; @@ -77,11 +80,11 @@ public class IssuingAuthorizationEvaluation extends ApiResource implements HasId @SerializedName("signals") Signals signals; - /** Details about the token, if a tokenized payment method was used. */ + /** Details about the token, if a tokenized payment method was used for the authorization. */ @SerializedName("token_details") TokenDetails tokenDetails; - /** Details about verification checks performed. */ + /** Details about verification data for the authorization. */ @SerializedName("verification_details") VerificationDetails verificationDetails; @@ -122,17 +125,20 @@ public static IssuingAuthorizationEvaluation create( return getGlobalResponseGetter().request(request, IssuingAuthorizationEvaluation.class); } - /** Details about the authorization transaction. */ + /** Details about the authorization. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class AuthorizationDetails extends StripeObject { - /** The authorization amount in the smallest currency unit. */ + /** + * The total amount of the authorization in the smallest currency unit. + */ @SerializedName("amount") Long amount; /** - * The method used for authorization. + * How the card details were provided. * *

One of {@code chip}, {@code contactless}, {@code keyed_in}, {@code online}, or {@code * swipe}. @@ -140,12 +146,16 @@ public static class AuthorizationDetails extends StripeObject { @SerializedName("authorization_method") String authorizationMethod; - /** Three-letter ISO currency code in lowercase. */ + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ @SerializedName("currency") String currency; /** - * The card entry mode. + * Defines how the card's information was entered for the authorization. * *

One of {@code contactless}, {@code contactless_magstripe}, {@code credential_on_file}, * {@code integrated_circuit_card}, {@code magstripe}, {@code magstripe_no_cvv}, {@code manual}, @@ -154,16 +164,16 @@ public static class AuthorizationDetails extends StripeObject { @SerializedName("entry_mode") String entryMode; - /** The raw code for the card entry mode. */ + /** Raw code indicating the entry mode from the network message. */ @SerializedName("entry_mode_raw_code") String entryModeRawCode; - /** The time when the authorization was initiated. */ + /** The timestamp of the authorization initiated in seconds. */ @SerializedName("initiated_at") Long initiatedAt; /** - * The point of sale condition. + * Defines how the card was read at the point of sale. * *

One of {@code account_verification}, {@code card_not_present}, {@code card_present}, * {@code e_commerce}, {@code key_entered_pos}, {@code missing}, {@code moto}, {@code other}, @@ -172,11 +182,13 @@ public static class AuthorizationDetails extends StripeObject { @SerializedName("point_of_sale_condition") String pointOfSaleCondition; - /** The raw code for the point of sale condition. */ + /** Raw code indicating the point of sale condition from the network message. */ @SerializedName("point_of_sale_condition_raw_code") String pointOfSaleConditionRawCode; - /** External reference for the authorization. */ + /** + * User's specified unique ID for this authorization attempt (e.g., RRN or internal reference). + */ @SerializedName("reference") String reference; } @@ -190,19 +202,19 @@ public static class CardDetails extends StripeObject { @SerializedName("bin") String bin; - /** The country code associated with the card BIN. */ + /** The two-letter country code of the BIN issuer. */ @SerializedName("bin_country") String binCountry; /** - * The type of card (physical or virtual). + * The type of the card. * *

One of {@code physical}, or {@code virtual}. */ @SerializedName("card_type") String cardType; - /** The time when the card was created. */ + /** The timestamp when the card was created. */ @SerializedName("created_at") Long createdAt; @@ -210,7 +222,10 @@ public static class CardDetails extends StripeObject { @SerializedName("last4") String last4; - /** External reference for the card. */ + /** + * User's specified unique ID of the card for this authorization attempt (e.g., RRN or internal + * reference). + */ @SerializedName("reference") String reference; } @@ -220,52 +235,64 @@ public static class CardDetails extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class CardholderDetails extends StripeObject { - /** The time when the cardholder was created. */ + /** The timestamp when the cardholder was created. */ @SerializedName("created_at") Long createdAt; - /** External reference for the cardholder. */ + /** + * User's specified unique ID of the cardholder for this authorization attempt (e.g., RRN or + * internal reference). + */ @SerializedName("reference") String reference; } - /** Details about the merchant where the authorization occurred. */ + /** + * Details about the seller (grocery store, e-commerce website, etc.) where the card authorization + * happened. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class MerchantDetails extends StripeObject { - /** The merchant category code (MCC). */ + /** The merchant category code for the seller's business. */ @SerializedName("category_code") String categoryCode; - /** The merchant country code. */ + /** Country where the seller is located. */ @SerializedName("country") String country; - /** The merchant name. */ + /** Name of the seller. */ @SerializedName("name") String name; - /** The merchant identifier from the card network. */ + /** + * Identifier assigned to the seller by the card network. Different card networks may assign + * different network_id fields to the same merchant. + */ @SerializedName("network_id") String networkId; - /** The terminal identifier. */ + /** An ID assigned by the seller to the location of the sale. */ @SerializedName("terminal_id") String terminalId; } - /** Details about the card network processing. */ + /** Details about the authorization, such as identifiers, set by the card network. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class NetworkDetails extends StripeObject { - /** The acquiring institution identifier. */ + /** + * Identifier assigned to the acquirer by the card network. Sometimes this value is not provided + * by the network; in this case, the value will be null. + */ @SerializedName("acquiring_institution_id") String acquiringInstitutionId; /** - * The card network that processed the authorization. + * The card network over which Stripe received the authorization. * *

One of {@code cirrus}, {@code interlink}, {@code maestro}, {@code mastercard}, {@code * other}, {@code plus}, or {@code visa}. @@ -332,35 +359,37 @@ public static class Data extends StripeObject { } } - /** Details about the token, if a tokenized payment method was used. */ + /** Details about the token, if a tokenized payment method was used for the authorization. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class TokenDetails extends StripeObject { - /** The time when the token was created. */ + /** The timestamp when the network token was created. */ @SerializedName("created_at") Long createdAt; - /** External reference for the token. */ + /** + * User's specified unique ID of the card token for this authorization attempt (e.g., RRN or + * internal reference). + */ @SerializedName("reference") String reference; /** - * The wallet provider, if applicable. - * - *

One of {@code apple_pay}, {@code google_pay}, or {@code samsung_pay}. + * The digital wallet used for this transaction. One of {@code apple_pay}, {@code google_pay}, + * or {@code samsung_pay}. */ @SerializedName("wallet") String wallet; } - /** Details about verification checks performed. */ + /** Details about verification data for the authorization. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class VerificationDetails extends StripeObject { /** - * The result of the 3D Secure verification. + * The outcome of the 3D Secure authentication request. * *

One of {@code attempt_acknowledged}, {@code authenticated}, {@code exempted}, {@code * failed}, or {@code required}. diff --git a/src/main/java/com/stripe/model/tax/Registration.java b/src/main/java/com/stripe/model/tax/Registration.java index c6b684df3f3..8546c0f8ca9 100644 --- a/src/main/java/com/stripe/model/tax/Registration.java +++ b/src/main/java/com/stripe/model/tax/Registration.java @@ -2895,6 +2895,9 @@ public static class Us extends StripeObject { @SerializedName("gross_receipts_tax") GrossReceiptsTax grossReceiptsTax; + @SerializedName("home_rule_tax") + HomeRuleTax homeRuleTax; + @SerializedName("hospitality_tax") HospitalityTax hospitalityTax; @@ -2927,9 +2930,10 @@ public static class Us extends StripeObject { * Type of registration in the US. * *

One of {@code admissions_tax}, {@code attendance_tax}, {@code entertainment_tax}, {@code - * gross_receipts_tax}, {@code hospitality_tax}, {@code local_amusement_tax}, {@code - * local_lease_tax}, {@code luxury_tax}, {@code resort_tax}, {@code state_communications_tax}, - * {@code state_retail_delivery_fee}, {@code state_sales_tax}, or {@code tourism_tax}. + * gross_receipts_tax}, {@code home_rule_tax}, {@code hospitality_tax}, {@code + * local_amusement_tax}, {@code local_lease_tax}, {@code luxury_tax}, {@code resort_tax}, + * {@code state_communications_tax}, {@code state_retail_delivery_fee}, {@code + * state_sales_tax}, or {@code tourism_tax}. */ @SerializedName("type") String type; @@ -3002,6 +3006,23 @@ public static class GrossReceiptsTax extends StripeObject { String jurisdiction; } + /** + * For more details about HomeRuleTax, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class HomeRuleTax extends StripeObject { + /** + * A jurisdiction + * code representing the local jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + } + /** * For more details about HospitalityTax, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java index f665af59399..0024fda7cac 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java @@ -108,7 +108,7 @@ public class ReceivedDebit extends StripeObject implements HasId { StripeBalancePayment stripeBalancePayment; /** - * Open enum, the type of the received debit. + * Open Enum. The type of the ReceivedDebit. * *

One of {@code balance_transfer}, {@code bank_transfer}, {@code card_spend}, {@code * external_debit}, or {@code stripe_balance_payment}. diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index 20e79ef289a..58e266ee965 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -2852,7 +2852,7 @@ public static class CheckScanning { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** An empty list, because this embedded component has no features. */ + /** The list of features enabled in the embedded component. */ @SerializedName("features") Features features; @@ -2913,7 +2913,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** An empty list, because this embedded component has no features. */ + /** The list of features enabled in the embedded component. */ public Builder setFeatures( AccountSessionCreateParams.Components.CheckScanning.Features features) { this.features = features; @@ -2924,6 +2924,9 @@ public Builder setFeatures( @Getter @EqualsAndHashCode(callSuper = false) public static class Features { + @SerializedName("create_us_paper_check_on_application") + Boolean createUsPaperCheckOnApplication; + /** * 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. @@ -2934,7 +2937,8 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Features(Map extraParams) { + private Features(Boolean createUsPaperCheckOnApplication, Map extraParams) { + this.createUsPaperCheckOnApplication = createUsPaperCheckOnApplication; this.extraParams = extraParams; } @@ -2943,12 +2947,20 @@ public static Builder builder() { } public static class Builder { + private Boolean createUsPaperCheckOnApplication; + private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public AccountSessionCreateParams.Components.CheckScanning.Features build() { return new AccountSessionCreateParams.Components.CheckScanning.Features( - this.extraParams); + this.createUsPaperCheckOnApplication, this.extraParams); + } + + public Builder setCreateUsPaperCheckOnApplication( + Boolean createUsPaperCheckOnApplication) { + this.createUsPaperCheckOnApplication = createUsPaperCheckOnApplication; + return this; } /** diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordReportAuthenticatedParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordReportAuthenticatedParams.java new file mode 100644 index 00000000000..90b00a720fe --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordReportAuthenticatedParams.java @@ -0,0 +1,180 @@ +// 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 PaymentAttemptRecordReportAuthenticatedParams extends ApiRequestParams { + /** When the reported payment was authenticated. Measured in seconds since the Unix epoch. */ + @SerializedName("authenticated_at") + Long authenticatedAt; + + /** 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + private PaymentAttemptRecordReportAuthenticatedParams( + Long authenticatedAt, List expand, Map extraParams, Object metadata) { + this.authenticatedAt = authenticatedAt; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long authenticatedAt; + + private List expand; + + private Map extraParams; + + private Object metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportAuthenticatedParams build() { + return new PaymentAttemptRecordReportAuthenticatedParams( + this.authenticatedAt, this.expand, this.extraParams, this.metadata); + } + + /** When the reported payment was authenticated. Measured in seconds since the Unix epoch. */ + public Builder setAuthenticatedAt(Long authenticatedAt) { + this.authenticatedAt = authenticatedAt; + 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 + * PaymentAttemptRecordReportAuthenticatedParams#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 + * PaymentAttemptRecordReportAuthenticatedParams#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 + * PaymentAttemptRecordReportAuthenticatedParams#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 PaymentAttemptRecordReportAuthenticatedParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(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 + * PaymentAttemptRecordReportAuthenticatedParams#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 PaymentAttemptRecordReportAuthenticatedParams#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; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordReportCanceledParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordReportCanceledParams.java new file mode 100644 index 00000000000..4dfdf8cd7fd --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordReportCanceledParams.java @@ -0,0 +1,178 @@ +// 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 PaymentAttemptRecordReportCanceledParams extends ApiRequestParams { + /** When the reported payment was canceled. Measured in seconds since the Unix epoch. */ + @SerializedName("canceled_at") + Long canceledAt; + + /** 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + private PaymentAttemptRecordReportCanceledParams( + Long canceledAt, List expand, Map extraParams, Object metadata) { + this.canceledAt = canceledAt; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long canceledAt; + + private List expand; + + private Map extraParams; + + private Object metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportCanceledParams build() { + return new PaymentAttemptRecordReportCanceledParams( + this.canceledAt, this.expand, this.extraParams, this.metadata); + } + + /** When the reported payment was canceled. Measured in seconds since the Unix epoch. */ + public Builder setCanceledAt(Long canceledAt) { + this.canceledAt = canceledAt; + 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 + * PaymentAttemptRecordReportCanceledParams#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 + * PaymentAttemptRecordReportCanceledParams#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 + * PaymentAttemptRecordReportCanceledParams#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 PaymentAttemptRecordReportCanceledParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(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 + * PaymentAttemptRecordReportCanceledParams#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 PaymentAttemptRecordReportCanceledParams#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; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordReportFailedParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordReportFailedParams.java new file mode 100644 index 00000000000..5cdb21a6ed5 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordReportFailedParams.java @@ -0,0 +1,216 @@ +// 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 PaymentAttemptRecordReportFailedParams 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; + + /** When the reported payment failed. Measured in seconds since the Unix epoch. */ + @SerializedName("failed_at") + Long failedAt; + + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + @SerializedName("failure_code") + FailureCode failureCode; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + private PaymentAttemptRecordReportFailedParams( + List expand, + Map extraParams, + Long failedAt, + FailureCode failureCode, + Object metadata) { + this.expand = expand; + this.extraParams = extraParams; + this.failedAt = failedAt; + this.failureCode = failureCode; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Long failedAt; + + private FailureCode failureCode; + + private Object metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportFailedParams build() { + return new PaymentAttemptRecordReportFailedParams( + this.expand, this.extraParams, this.failedAt, this.failureCode, this.metadata); + } + + /** + * 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 + * PaymentAttemptRecordReportFailedParams#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 + * PaymentAttemptRecordReportFailedParams#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 + * PaymentAttemptRecordReportFailedParams#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 PaymentAttemptRecordReportFailedParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** When the reported payment failed. Measured in seconds since the Unix epoch. */ + public Builder setFailedAt(Long failedAt) { + this.failedAt = failedAt; + return this; + } + + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + public Builder setFailureCode(PaymentAttemptRecordReportFailedParams.FailureCode failureCode) { + this.failureCode = failureCode; + 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 + * PaymentAttemptRecordReportFailedParams#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 PaymentAttemptRecordReportFailedParams#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; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + } + + public enum FailureCode implements ApiRequestParams.EnumParam { + @SerializedName("payment_method_customer_decline") + PAYMENT_METHOD_CUSTOMER_DECLINE("payment_method_customer_decline"), + + @SerializedName("payment_method_provider_unknown_outcome") + PAYMENT_METHOD_PROVIDER_UNKNOWN_OUTCOME("payment_method_provider_unknown_outcome"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + FailureCode(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordReportGuaranteedParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordReportGuaranteedParams.java new file mode 100644 index 00000000000..62648e04445 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordReportGuaranteedParams.java @@ -0,0 +1,179 @@ +// 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 PaymentAttemptRecordReportGuaranteedParams 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; + + /** When the reported payment was guaranteed. Measured in seconds since the Unix epoch. */ + @SerializedName("guaranteed_at") + Long guaranteedAt; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + private PaymentAttemptRecordReportGuaranteedParams( + List expand, Map extraParams, Long guaranteedAt, Object metadata) { + this.expand = expand; + this.extraParams = extraParams; + this.guaranteedAt = guaranteedAt; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Long guaranteedAt; + + private Object metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportGuaranteedParams build() { + return new PaymentAttemptRecordReportGuaranteedParams( + this.expand, this.extraParams, this.guaranteedAt, this.metadata); + } + + /** + * 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 + * PaymentAttemptRecordReportGuaranteedParams#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 + * PaymentAttemptRecordReportGuaranteedParams#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 + * PaymentAttemptRecordReportGuaranteedParams#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 PaymentAttemptRecordReportGuaranteedParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** When the reported payment was guaranteed. Measured in seconds since the Unix epoch. */ + public Builder setGuaranteedAt(Long guaranteedAt) { + this.guaranteedAt = guaranteedAt; + 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 + * PaymentAttemptRecordReportGuaranteedParams#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 PaymentAttemptRecordReportGuaranteedParams#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; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordReportInformationalParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordReportInformationalParams.java new file mode 100644 index 00000000000..3e056e6fc89 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordReportInformationalParams.java @@ -0,0 +1,606 @@ +// 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 PaymentAttemptRecordReportInformationalParams extends ApiRequestParams { + /** Customer information for this payment. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + Object description; + + /** 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + Object shippingDetails; + + private PaymentAttemptRecordReportInformationalParams( + CustomerDetails customerDetails, + Object description, + List expand, + Map extraParams, + Object metadata, + Object shippingDetails) { + this.customerDetails = customerDetails; + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + this.shippingDetails = shippingDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomerDetails customerDetails; + + private Object description; + + private List expand; + + private Map extraParams; + + private Object metadata; + + private Object shippingDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportInformationalParams build() { + return new PaymentAttemptRecordReportInformationalParams( + this.customerDetails, + this.description, + this.expand, + this.extraParams, + this.metadata, + this.shippingDetails); + } + + /** Customer information for this payment. */ + public Builder setCustomerDetails( + PaymentAttemptRecordReportInformationalParams.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + return this; + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + public Builder setDescription(EmptyParam description) { + this.description = description; + 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 + * PaymentAttemptRecordReportInformationalParams#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 + * PaymentAttemptRecordReportInformationalParams#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 + * PaymentAttemptRecordReportInformationalParams#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 PaymentAttemptRecordReportInformationalParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(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 + * PaymentAttemptRecordReportInformationalParams#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 PaymentAttemptRecordReportInformationalParams#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; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails( + PaymentAttemptRecordReportInformationalParams.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails(EmptyParam shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails { + /** The customer who made the payment. */ + @SerializedName("customer") + String customer; + + /** The customer's phone number. */ + @SerializedName("email") + String email; + + /** + * 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; + + /** The customer's name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + + private CustomerDetails( + String customer, String email, Map extraParams, String name, String phone) { + this.customer = customer; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportInformationalParams.CustomerDetails build() { + return new PaymentAttemptRecordReportInformationalParams.CustomerDetails( + this.customer, this.email, this.extraParams, this.name, this.phone); + } + + /** The customer who made the payment. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** The customer's phone number. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentAttemptRecordReportInformationalParams.CustomerDetails#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 PaymentAttemptRecordReportInformationalParams.CustomerDetails#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The customer's name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The customer's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails { + /** The physical shipping address. */ + @SerializedName("address") + Address address; + + /** + * 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; + + /** The shipping recipient's name. */ + @SerializedName("name") + String name; + + /** The shipping recipient's phone number. */ + @SerializedName("phone") + String phone; + + private ShippingDetails( + Address address, Map extraParams, String name, String phone) { + this.address = address; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportInformationalParams.ShippingDetails build() { + return new PaymentAttemptRecordReportInformationalParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** The physical shipping address. */ + public Builder setAddress( + PaymentAttemptRecordReportInformationalParams.ShippingDetails.Address address) { + this.address = address; + 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 + * PaymentAttemptRecordReportInformationalParams.ShippingDetails#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 PaymentAttemptRecordReportInformationalParams.ShippingDetails#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The shipping recipient's name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The shipping recipient's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * 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 PaymentAttemptRecordReportInformationalParams.ShippingDetails.Address build() { + return new PaymentAttemptRecordReportInformationalParams.ShippingDetails.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; + } + + /** + * 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 + * PaymentAttemptRecordReportInformationalParams.ShippingDetails.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 + * PaymentAttemptRecordReportInformationalParams.ShippingDetails.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; + } + } + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordReportRefundParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordReportRefundParams.java new file mode 100644 index 00000000000..4619c9197ae --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordReportRefundParams.java @@ -0,0 +1,628 @@ +// 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 PaymentAttemptRecordReportRefundParams extends ApiRequestParams { + /** + * A positive integer in the smallest + * currency unit representing how much of this payment to refund. Can refund only up to the + * remaining, unrefunded amount of the payment. + */ + @SerializedName("amount") + Amount amount; + + /** 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; + + /** When the reported refund was initiated. Measured in seconds since the Unix epoch. */ + @SerializedName("initiated_at") + Long initiatedAt; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + /** Required. The outcome of the reported refund. */ + @SerializedName("outcome") + Outcome outcome; + + /** Required. Processor information for this refund. */ + @SerializedName("processor_details") + ProcessorDetails processorDetails; + + /** Information about the payment attempt refund. */ + @SerializedName("refunded") + Refunded refunded; + + private PaymentAttemptRecordReportRefundParams( + Amount amount, + List expand, + Map extraParams, + Long initiatedAt, + Object metadata, + Outcome outcome, + ProcessorDetails processorDetails, + Refunded refunded) { + this.amount = amount; + this.expand = expand; + this.extraParams = extraParams; + this.initiatedAt = initiatedAt; + this.metadata = metadata; + this.outcome = outcome; + this.processorDetails = processorDetails; + this.refunded = refunded; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Amount amount; + + private List expand; + + private Map extraParams; + + private Long initiatedAt; + + private Object metadata; + + private Outcome outcome; + + private ProcessorDetails processorDetails; + + private Refunded refunded; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportRefundParams build() { + return new PaymentAttemptRecordReportRefundParams( + this.amount, + this.expand, + this.extraParams, + this.initiatedAt, + this.metadata, + this.outcome, + this.processorDetails, + this.refunded); + } + + /** + * A positive integer in the smallest + * currency unit representing how much of this payment to refund. Can refund only up to the + * remaining, unrefunded amount of the payment. + */ + public Builder setAmount(PaymentAttemptRecordReportRefundParams.Amount amount) { + this.amount = amount; + 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 + * PaymentAttemptRecordReportRefundParams#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 + * PaymentAttemptRecordReportRefundParams#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 + * PaymentAttemptRecordReportRefundParams#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 PaymentAttemptRecordReportRefundParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** When the reported refund was initiated. Measured in seconds since the Unix epoch. */ + public Builder setInitiatedAt(Long initiatedAt) { + this.initiatedAt = initiatedAt; + 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 + * PaymentAttemptRecordReportRefundParams#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 PaymentAttemptRecordReportRefundParams#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; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** Required. The outcome of the reported refund. */ + public Builder setOutcome(PaymentAttemptRecordReportRefundParams.Outcome outcome) { + this.outcome = outcome; + return this; + } + + /** Required. Processor information for this refund. */ + public Builder setProcessorDetails( + PaymentAttemptRecordReportRefundParams.ProcessorDetails processorDetails) { + this.processorDetails = processorDetails; + return this; + } + + /** Information about the payment attempt refund. */ + public Builder setRefunded(PaymentAttemptRecordReportRefundParams.Refunded refunded) { + this.refunded = refunded; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Amount { + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** + * 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. A positive integer representing the amount in the currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @SerializedName("value") + Long value; + + private Amount(String currency, Map extraParams, Long value) { + this.currency = currency; + this.extraParams = extraParams; + this.value = value; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + private Long value; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportRefundParams.Amount build() { + return new PaymentAttemptRecordReportRefundParams.Amount( + this.currency, this.extraParams, this.value); + } + + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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 + * PaymentAttemptRecordReportRefundParams.Amount#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 PaymentAttemptRecordReportRefundParams.Amount#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. A positive integer representing the amount in the currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + public Builder setValue(Long value) { + this.value = value; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ProcessorDetails { + /** Information about the custom processor used to make this refund. */ + @SerializedName("custom") + Custom custom; + + /** + * 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 type of the processor details. An additional hash is included + * on processor_details with a name matching this value. It contains additional information + * specific to the processor. + */ + @SerializedName("type") + Type type; + + private ProcessorDetails(Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportRefundParams.ProcessorDetails build() { + return new PaymentAttemptRecordReportRefundParams.ProcessorDetails( + this.custom, this.extraParams, this.type); + } + + /** Information about the custom processor used to make this refund. */ + public Builder setCustom( + PaymentAttemptRecordReportRefundParams.ProcessorDetails.Custom custom) { + this.custom = custom; + 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 + * PaymentAttemptRecordReportRefundParams.ProcessorDetails#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 PaymentAttemptRecordReportRefundParams.ProcessorDetails#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 type of the processor details. An additional hash is + * included on processor_details with a name matching this value. It contains additional + * information specific to the processor. + */ + public Builder setType(PaymentAttemptRecordReportRefundParams.ProcessorDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * 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. A reference to the external refund. This field must be unique + * across all refunds. + */ + @SerializedName("refund_reference") + String refundReference; + + private Custom(Map extraParams, String refundReference) { + this.extraParams = extraParams; + this.refundReference = refundReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String refundReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportRefundParams.ProcessorDetails.Custom build() { + return new PaymentAttemptRecordReportRefundParams.ProcessorDetails.Custom( + this.extraParams, this.refundReference); + } + + /** + * 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 + * PaymentAttemptRecordReportRefundParams.ProcessorDetails.Custom#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 + * PaymentAttemptRecordReportRefundParams.ProcessorDetails.Custom#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. A reference to the external refund. This field must be unique + * across all refunds. + */ + public Builder setRefundReference(String refundReference) { + this.refundReference = refundReference; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Refunded { + /** + * 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. When the reported refund completed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("refunded_at") + Long refundedAt; + + private Refunded(Map extraParams, Long refundedAt) { + this.extraParams = extraParams; + this.refundedAt = refundedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long refundedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordReportRefundParams.Refunded build() { + return new PaymentAttemptRecordReportRefundParams.Refunded( + this.extraParams, this.refundedAt); + } + + /** + * 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 + * PaymentAttemptRecordReportRefundParams.Refunded#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 PaymentAttemptRecordReportRefundParams.Refunded#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. When the reported refund completed. Measured in seconds since + * the Unix epoch. + */ + public Builder setRefundedAt(Long refundedAt) { + this.refundedAt = refundedAt; + return this; + } + } + } + + public enum Outcome implements ApiRequestParams.EnumParam { + @SerializedName("refunded") + REFUNDED("refunded"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Outcome(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java index 3b0884e6813..4930d6c02a3 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java @@ -14,10 +14,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class PaymentRecordReportPaymentAttemptCanceledParams extends ApiRequestParams { - /** - * Required. When the reported payment was canceled. Measured in seconds since - * the Unix epoch. - */ + /** When the reported payment was canceled. Measured in seconds since the Unix epoch. */ @SerializedName("canceled_at") Long canceledAt; @@ -70,10 +67,7 @@ public PaymentRecordReportPaymentAttemptCanceledParams build() { this.canceledAt, this.expand, this.extraParams, this.metadata); } - /** - * Required. When the reported payment was canceled. Measured in seconds since - * the Unix epoch. - */ + /** When the reported payment was canceled. Measured in seconds since the Unix epoch. */ public Builder setCanceledAt(Long canceledAt) { this.canceledAt = canceledAt; return this; diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java index 5b4bf31506f..714b8647cab 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java @@ -27,13 +27,17 @@ public class PaymentRecordReportPaymentAttemptFailedParams extends ApiRequestPar @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Required. When the reported payment failed. Measured in seconds since the Unix - * epoch. - */ + /** When the reported payment failed. Measured in seconds since the Unix epoch. */ @SerializedName("failed_at") Long failedAt; + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + @SerializedName("failure_code") + FailureCode failureCode; + /** * Set of key-value pairs that you can attach * to an object. This can be useful for storing additional information about the object in a @@ -44,10 +48,15 @@ public class PaymentRecordReportPaymentAttemptFailedParams extends ApiRequestPar Object metadata; private PaymentRecordReportPaymentAttemptFailedParams( - List expand, Map extraParams, Long failedAt, Object metadata) { + List expand, + Map extraParams, + Long failedAt, + FailureCode failureCode, + Object metadata) { this.expand = expand; this.extraParams = extraParams; this.failedAt = failedAt; + this.failureCode = failureCode; this.metadata = metadata; } @@ -62,12 +71,14 @@ public static class Builder { private Long failedAt; + private FailureCode failureCode; + private Object metadata; /** Finalize and obtain parameter instance from this builder. */ public PaymentRecordReportPaymentAttemptFailedParams build() { return new PaymentRecordReportPaymentAttemptFailedParams( - this.expand, this.extraParams, this.failedAt, this.metadata); + this.expand, this.extraParams, this.failedAt, this.failureCode, this.metadata); } /** @@ -123,15 +134,22 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Required. When the reported payment failed. Measured in seconds since the - * Unix epoch. - */ + /** When the reported payment failed. Measured in seconds since the Unix epoch. */ public Builder setFailedAt(Long failedAt) { this.failedAt = failedAt; return this; } + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + public Builder setFailureCode( + PaymentRecordReportPaymentAttemptFailedParams.FailureCode failureCode) { + this.failureCode = failureCode; + 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 @@ -183,4 +201,19 @@ public Builder setMetadata(Map metadata) { return this; } } + + public enum FailureCode implements ApiRequestParams.EnumParam { + @SerializedName("payment_method_customer_decline") + PAYMENT_METHOD_CUSTOMER_DECLINE("payment_method_customer_decline"), + + @SerializedName("payment_method_provider_unknown_outcome") + PAYMENT_METHOD_PROVIDER_UNKNOWN_OUTCOME("payment_method_provider_unknown_outcome"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + FailureCode(String value) { + this.value = value; + } + } } diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java index ad95ccaf5bc..19149b01b96 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java @@ -27,10 +27,7 @@ public class PaymentRecordReportPaymentAttemptGuaranteedParams extends ApiReques @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Required. When the reported payment was guaranteed. Measured in seconds since - * the Unix epoch. - */ + /** When the reported payment was guaranteed. Measured in seconds since the Unix epoch. */ @SerializedName("guaranteed_at") Long guaranteedAt; @@ -123,10 +120,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Required. When the reported payment was guaranteed. Measured in seconds - * since the Unix epoch. - */ + /** When the reported payment was guaranteed. Measured in seconds since the Unix epoch. */ public Builder setGuaranteedAt(Long guaranteedAt) { this.guaranteedAt = guaranteedAt; return this; diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java index 8d960fabddc..cebd6f25e51 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java @@ -299,9 +299,17 @@ public static class Failed { @SerializedName("failed_at") Long failedAt; - private Failed(Map extraParams, Long failedAt) { + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + @SerializedName("failure_code") + FailureCode failureCode; + + private Failed(Map extraParams, Long failedAt, FailureCode failureCode) { this.extraParams = extraParams; this.failedAt = failedAt; + this.failureCode = failureCode; } public static Builder builder() { @@ -313,9 +321,12 @@ public static class Builder { private Long failedAt; + private FailureCode failureCode; + /** Finalize and obtain parameter instance from this builder. */ public PaymentRecordReportPaymentAttemptParams.Failed build() { - return new PaymentRecordReportPaymentAttemptParams.Failed(this.extraParams, this.failedAt); + return new PaymentRecordReportPaymentAttemptParams.Failed( + this.extraParams, this.failedAt, this.failureCode); } /** @@ -353,6 +364,31 @@ public Builder setFailedAt(Long failedAt) { this.failedAt = failedAt; return this; } + + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + public Builder setFailureCode( + PaymentRecordReportPaymentAttemptParams.Failed.FailureCode failureCode) { + this.failureCode = failureCode; + return this; + } + } + + public enum FailureCode implements ApiRequestParams.EnumParam { + @SerializedName("payment_method_customer_decline") + PAYMENT_METHOD_CUSTOMER_DECLINE("payment_method_customer_decline"), + + @SerializedName("payment_method_provider_unknown_outcome") + PAYMENT_METHOD_PROVIDER_UNKNOWN_OUTCOME("payment_method_provider_unknown_outcome"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + FailureCode(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java index 2194f0f91db..a48a472b62a 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java @@ -574,9 +574,17 @@ public static class Failed { @SerializedName("failed_at") Long failedAt; - private Failed(Map extraParams, Long failedAt) { + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + @SerializedName("failure_code") + FailureCode failureCode; + + private Failed(Map extraParams, Long failedAt, FailureCode failureCode) { this.extraParams = extraParams; this.failedAt = failedAt; + this.failureCode = failureCode; } public static Builder builder() { @@ -588,9 +596,12 @@ public static class Builder { private Long failedAt; + private FailureCode failureCode; + /** Finalize and obtain parameter instance from this builder. */ public PaymentRecordReportPaymentParams.Failed build() { - return new PaymentRecordReportPaymentParams.Failed(this.extraParams, this.failedAt); + return new PaymentRecordReportPaymentParams.Failed( + this.extraParams, this.failedAt, this.failureCode); } /** @@ -628,6 +639,31 @@ public Builder setFailedAt(Long failedAt) { this.failedAt = failedAt; return this; } + + /** + * The failure code for this payment attempt. Must be one of {@code + * payment_method_customer_decline} or {@code payment_method_provider_unknown_outcome}. + */ + public Builder setFailureCode( + PaymentRecordReportPaymentParams.Failed.FailureCode failureCode) { + this.failureCode = failureCode; + return this; + } + } + + public enum FailureCode implements ApiRequestParams.EnumParam { + @SerializedName("payment_method_customer_decline") + PAYMENT_METHOD_CUSTOMER_DECLINE("payment_method_customer_decline"), + + @SerializedName("payment_method_provider_unknown_outcome") + PAYMENT_METHOD_PROVIDER_UNKNOWN_OUTCOME("payment_method_provider_unknown_outcome"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + FailureCode(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java b/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java index 3d4f5354b69..1bc65013b6c 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java @@ -56,7 +56,7 @@ public class PaymentRecordReportRefundParams extends ApiRequestParams { @SerializedName("processor_details") ProcessorDetails processorDetails; - /** Required. Information about the payment attempt refund. */ + /** Information about the payment attempt refund. */ @SerializedName("refunded") Refunded refunded; @@ -244,7 +244,7 @@ public Builder setProcessorDetails( return this; } - /** Required. Information about the payment attempt refund. */ + /** Information about the payment attempt refund. */ public Builder setRefunded(PaymentRecordReportRefundParams.Refunded refunded) { this.refunded = refunded; return this; diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index 776baffb886..e7b0b75233b 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -9941,9 +9941,6 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("line_starts_at") LINE_STARTS_AT("line_starts_at"), - @SerializedName("now") - NOW("now"), - @SerializedName("pause_collection_start") PAUSE_COLLECTION_START("pause_collection_start"), @@ -12079,9 +12076,6 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("line_starts_at") LINE_STARTS_AT("line_starts_at"), - @SerializedName("now") - NOW("now"), - @SerializedName("pause_collection_start") PAUSE_COLLECTION_START("pause_collection_start"), diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index 7b38b277630..1a5d31097b8 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -9943,9 +9943,6 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("line_starts_at") LINE_STARTS_AT("line_starts_at"), - @SerializedName("now") - NOW("now"), - @SerializedName("pause_collection_start") PAUSE_COLLECTION_START("pause_collection_start"), @@ -12142,9 +12139,6 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("line_starts_at") LINE_STARTS_AT("line_starts_at"), - @SerializedName("now") - NOW("now"), - @SerializedName("pause_collection_start") PAUSE_COLLECTION_START("pause_collection_start"), diff --git a/src/main/java/com/stripe/param/checkout/SessionApproveParams.java b/src/main/java/com/stripe/param/checkout/SessionApproveParams.java new file mode 100644 index 00000000000..e6ceedeeee7 --- /dev/null +++ b/src/main/java/com/stripe/param/checkout/SessionApproveParams.java @@ -0,0 +1,354 @@ +// File generated from our OpenAPI spec +package com.stripe.param.checkout; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; +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 SessionApproveParams extends ApiRequestParams { + /** Required. The ID of the customer's attempt to pay to approve. */ + @SerializedName("attempt") + String attempt; + + /** 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; + + /** + * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code + * payment} mode. + */ + @SerializedName("payment_intent_data") + PaymentIntentData paymentIntentData; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on + * the payment method's app or site. This parameter is allowed and required if and only if you did + * not set the return URL during Checkout Session creation or in {@code checkout.confirm()} in + * Stripe.js. + */ + @SerializedName("return_url") + String returnUrl; + + /** + * A subset of parameters to be passed to subscription creation for Checkout Sessions in {@code + * subscription} mode. + */ + @SerializedName("subscription_data") + SubscriptionData subscriptionData; + + private SessionApproveParams( + String attempt, + List expand, + Map extraParams, + PaymentIntentData paymentIntentData, + String returnUrl, + SubscriptionData subscriptionData) { + this.attempt = attempt; + this.expand = expand; + this.extraParams = extraParams; + this.paymentIntentData = paymentIntentData; + this.returnUrl = returnUrl; + this.subscriptionData = subscriptionData; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String attempt; + + private List expand; + + private Map extraParams; + + private PaymentIntentData paymentIntentData; + + private String returnUrl; + + private SubscriptionData subscriptionData; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionApproveParams build() { + return new SessionApproveParams( + this.attempt, + this.expand, + this.extraParams, + this.paymentIntentData, + this.returnUrl, + this.subscriptionData); + } + + /** Required. The ID of the customer's attempt to pay to approve. */ + public Builder setAttempt(String attempt) { + this.attempt = attempt; + 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 + * SessionApproveParams#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 + * SessionApproveParams#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 + * SessionApproveParams#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 SessionApproveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code + * payment} mode. + */ + public Builder setPaymentIntentData(SessionApproveParams.PaymentIntentData paymentIntentData) { + this.paymentIntentData = paymentIntentData; + return this; + } + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on + * the payment method's app or site. This parameter is allowed and required if and only if you + * did not set the return URL during Checkout Session creation or in {@code checkout.confirm()} + * in Stripe.js. + */ + public Builder setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * A subset of parameters to be passed to subscription creation for Checkout Sessions in {@code + * subscription} mode. + */ + public Builder setSubscriptionData(SessionApproveParams.SubscriptionData subscriptionData) { + this.subscriptionData = subscriptionData; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentIntentData { + /** + * The amount of the application fee (if any) that will be requested to be applied to the + * payment and transferred to the application owner's Stripe account. The amount of the + * application fee collected will be capped at the total amount captured. For more information, + * see the PaymentIntents use case + * for connected accounts. + */ + @SerializedName("application_fee_amount") + Long applicationFeeAmount; + + /** + * 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 PaymentIntentData(Long applicationFeeAmount, Map extraParams) { + this.applicationFeeAmount = applicationFeeAmount; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long applicationFeeAmount; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionApproveParams.PaymentIntentData build() { + return new SessionApproveParams.PaymentIntentData( + this.applicationFeeAmount, this.extraParams); + } + + /** + * The amount of the application fee (if any) that will be requested to be applied to the + * payment and transferred to the application owner's Stripe account. The amount of the + * application fee collected will be capped at the total amount captured. For more + * information, see the PaymentIntents use case for connected + * accounts. + */ + public Builder setApplicationFeeAmount(Long applicationFeeAmount) { + this.applicationFeeAmount = applicationFeeAmount; + 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 + * SessionApproveParams.PaymentIntentData#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 SessionApproveParams.PaymentIntentData#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 SubscriptionData { + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents + * the percentage of the subscription invoice total that will be transferred to the application + * owner's Stripe account. To use an application fee percent, the request must be made on behalf + * of another account, using the {@code Stripe-Account} header or an OAuth key. For more + * information, see the application fees documentation. + */ + @SerializedName("application_fee_percent") + BigDecimal applicationFeePercent; + + /** + * 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 SubscriptionData(BigDecimal applicationFeePercent, Map extraParams) { + this.applicationFeePercent = applicationFeePercent; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BigDecimal applicationFeePercent; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionApproveParams.SubscriptionData build() { + return new SessionApproveParams.SubscriptionData( + this.applicationFeePercent, this.extraParams); + } + + /** + * A non-negative decimal between 0 and 100, with at most two decimal places. This represents + * the percentage of the subscription invoice total that will be transferred to the + * application owner's Stripe account. To use an application fee percent, the request must be + * made on behalf of another account, using the {@code Stripe-Account} header or an OAuth key. + * For more information, see the application fees documentation. + */ + public Builder setApplicationFeePercent(BigDecimal applicationFeePercent) { + this.applicationFeePercent = applicationFeePercent; + 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 + * SessionApproveParams.SubscriptionData#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 SessionApproveParams.SubscriptionData#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/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 1b36c42cf63..f226a5e86fe 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -33,6 +33,18 @@ public class SessionCreateParams extends ApiRequestParams { @SerializedName("allow_promotion_codes") Boolean allowPromotionCodes; + /** + * Determines whether the customer's attempt to pay must be manually approved. + * + *

Default is {@code auto}, when the customer's attempt to pay is approved automatically with + * no action required on your server. + * + *

When set to {@code manual}, you must approve the customer's attempt to pay by calling approve from your server. + */ + @SerializedName("approval_method") + ApprovalMethod approvalMethod; + /** * Settings for automatic tax lookup for this session and resulting payments, invoices, and * subscriptions. @@ -449,6 +461,7 @@ private SessionCreateParams( AdaptivePricing adaptivePricing, AfterExpiration afterExpiration, Boolean allowPromotionCodes, + ApprovalMethod approvalMethod, AutomaticTax automaticTax, BillingAddressCollection billingAddressCollection, BrandingSettings brandingSettings, @@ -501,6 +514,7 @@ private SessionCreateParams( this.adaptivePricing = adaptivePricing; this.afterExpiration = afterExpiration; this.allowPromotionCodes = allowPromotionCodes; + this.approvalMethod = approvalMethod; this.automaticTax = automaticTax; this.billingAddressCollection = billingAddressCollection; this.brandingSettings = brandingSettings; @@ -563,6 +577,8 @@ public static class Builder { private Boolean allowPromotionCodes; + private ApprovalMethod approvalMethod; + private AutomaticTax automaticTax; private BillingAddressCollection billingAddressCollection; @@ -667,6 +683,7 @@ public SessionCreateParams build() { this.adaptivePricing, this.afterExpiration, this.allowPromotionCodes, + this.approvalMethod, this.automaticTax, this.billingAddressCollection, this.brandingSettings, @@ -742,6 +759,20 @@ public Builder setAllowPromotionCodes(Boolean allowPromotionCodes) { return this; } + /** + * Determines whether the customer's attempt to pay must be manually approved. + * + *

Default is {@code auto}, when the customer's attempt to pay is approved automatically with + * no action required on your server. + * + *

When set to {@code manual}, you must approve the customer's attempt to pay by calling approve from your server. + */ + public Builder setApprovalMethod(SessionCreateParams.ApprovalMethod approvalMethod) { + this.approvalMethod = approvalMethod; + return this; + } + /** * Settings for automatic tax lookup for this session and resulting payments, invoices, and * subscriptions. @@ -21812,6 +21843,21 @@ public enum Display implements ApiRequestParams.EnumParam { } } + public enum ApprovalMethod implements ApiRequestParams.EnumParam { + @SerializedName("auto") + AUTO("auto"), + + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ApprovalMethod(String value) { + this.value = value; + } + } + public enum BillingAddressCollection implements ApiRequestParams.EnumParam { @SerializedName("auto") AUTO("auto"), diff --git a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java index 9d5bd3cbe46..5210cf9fe65 100644 --- a/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java +++ b/src/main/java/com/stripe/param/delegatedcheckout/RequestedSessionUpdateParams.java @@ -328,19 +328,27 @@ public static class FulfillmentDetails { @SerializedName("selected_fulfillment_option") SelectedFulfillmentOption selectedFulfillmentOption; + /** The fulfillment option overrides for specific line items. */ + @SerializedName("selected_fulfillment_option_overrides") + List + selectedFulfillmentOptionOverrides; + private FulfillmentDetails( Address address, Object email, Map extraParams, Object name, Object phone, - SelectedFulfillmentOption selectedFulfillmentOption) { + SelectedFulfillmentOption selectedFulfillmentOption, + List + selectedFulfillmentOptionOverrides) { this.address = address; this.email = email; this.extraParams = extraParams; this.name = name; this.phone = phone; this.selectedFulfillmentOption = selectedFulfillmentOption; + this.selectedFulfillmentOptionOverrides = selectedFulfillmentOptionOverrides; } public static Builder builder() { @@ -360,6 +368,10 @@ public static class Builder { private SelectedFulfillmentOption selectedFulfillmentOption; + private List< + RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride> + selectedFulfillmentOptionOverrides; + /** Finalize and obtain parameter instance from this builder. */ public RequestedSessionUpdateParams.FulfillmentDetails build() { return new RequestedSessionUpdateParams.FulfillmentDetails( @@ -368,7 +380,8 @@ public RequestedSessionUpdateParams.FulfillmentDetails build() { this.extraParams, this.name, this.phone, - this.selectedFulfillmentOption); + this.selectedFulfillmentOption, + this.selectedFulfillmentOptionOverrides); } /** The customer's address. */ @@ -447,6 +460,40 @@ public Builder setSelectedFulfillmentOption( this.selectedFulfillmentOption = selectedFulfillmentOption; return this; } + + /** + * Add an element to `selectedFulfillmentOptionOverrides` list. A list is initialized for the + * first `add/addAll` call, and subsequent calls adds additional elements to the original + * list. See {@link + * RequestedSessionUpdateParams.FulfillmentDetails#selectedFulfillmentOptionOverrides} for the + * field documentation. + */ + public Builder addSelectedFulfillmentOptionOverride( + RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride + element) { + if (this.selectedFulfillmentOptionOverrides == null) { + this.selectedFulfillmentOptionOverrides = new ArrayList<>(); + } + this.selectedFulfillmentOptionOverrides.add(element); + return this; + } + + /** + * Add all elements to `selectedFulfillmentOptionOverrides` list. A list is initialized for + * the first `add/addAll` call, and subsequent calls adds additional elements to the original + * list. See {@link + * RequestedSessionUpdateParams.FulfillmentDetails#selectedFulfillmentOptionOverrides} for the + * field documentation. + */ + public Builder addAllSelectedFulfillmentOptionOverride( + List + elements) { + if (this.selectedFulfillmentOptionOverrides == null) { + this.selectedFulfillmentOptionOverrides = new ArrayList<>(); + } + this.selectedFulfillmentOptionOverrides.addAll(elements); + return this; + } } @Getter @@ -858,7 +905,7 @@ public static class Shipping { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. The shipping option identifer. */ + /** Required. The shipping option identifier. */ @SerializedName("shipping_option") Object shippingOption; @@ -913,13 +960,336 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. The shipping option identifer. */ + /** Required. The shipping option identifier. */ + public Builder setShippingOption(String shippingOption) { + this.shippingOption = shippingOption; + return this; + } + + /** Required. The shipping option identifier. */ + public Builder setShippingOption(EmptyParam shippingOption) { + this.shippingOption = shippingOption; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SelectedFulfillmentOptionOverride { + /** The digital fulfillment option. */ + @SerializedName("digital") + Digital digital; + + /** + * 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 line item keys that this fulfillment option override applies + * to. + */ + @SerializedName("line_item_keys") + List lineItemKeys; + + /** The shipping fulfillment option. */ + @SerializedName("shipping") + Shipping shipping; + + /** Required. The type of fulfillment option. */ + @SerializedName("type") + Object type; + + private SelectedFulfillmentOptionOverride( + Digital digital, + Map extraParams, + List lineItemKeys, + Shipping shipping, + Object type) { + this.digital = digital; + this.extraParams = extraParams; + this.lineItemKeys = lineItemKeys; + this.shipping = shipping; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Digital digital; + + private Map extraParams; + + private List lineItemKeys; + + private Shipping shipping; + + private Object type; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride + build() { + return new RequestedSessionUpdateParams.FulfillmentDetails + .SelectedFulfillmentOptionOverride( + this.digital, this.extraParams, this.lineItemKeys, this.shipping, this.type); + } + + /** The digital fulfillment option. */ + public Builder setDigital( + RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride + .Digital + digital) { + this.digital = digital; + 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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride#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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `lineItemKeys` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride#lineItemKeys} + * for the field documentation. + */ + public Builder addLineItemKey(String element) { + if (this.lineItemKeys == null) { + this.lineItemKeys = new ArrayList<>(); + } + this.lineItemKeys.add(element); + return this; + } + + /** + * Add all elements to `lineItemKeys` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride#lineItemKeys} + * for the field documentation. + */ + public Builder addAllLineItemKey(List elements) { + if (this.lineItemKeys == null) { + this.lineItemKeys = new ArrayList<>(); + } + this.lineItemKeys.addAll(elements); + return this; + } + + /** The shipping fulfillment option. */ + public Builder setShipping( + RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride + .Shipping + shipping) { + this.shipping = shipping; + return this; + } + + /** Required. The type of fulfillment option. */ + public Builder setType(String type) { + this.type = type; + return this; + } + + /** Required. The type of fulfillment option. */ + public Builder setType(EmptyParam type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Digital { + /** Required. The digital option identifier. */ + @SerializedName("digital_option") + Object digitalOption; + + /** + * 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 Digital(Object digitalOption, Map extraParams) { + this.digitalOption = digitalOption; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object digitalOption; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride + .Digital + build() { + return new RequestedSessionUpdateParams.FulfillmentDetails + .SelectedFulfillmentOptionOverride.Digital(this.digitalOption, this.extraParams); + } + + /** Required. The digital option identifier. */ + public Builder setDigitalOption(String digitalOption) { + this.digitalOption = digitalOption; + return this; + } + + /** Required. The digital option identifier. */ + public Builder setDigitalOption(EmptyParam digitalOption) { + this.digitalOption = digitalOption; + 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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride.Digital#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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride.Digital#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 Shipping { + /** + * 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 shipping option identifier. */ + @SerializedName("shipping_option") + Object shippingOption; + + private Shipping(Map extraParams, Object shippingOption) { + this.extraParams = extraParams; + this.shippingOption = shippingOption; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object shippingOption; + + /** Finalize and obtain parameter instance from this builder. */ + public RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride + .Shipping + build() { + return new RequestedSessionUpdateParams.FulfillmentDetails + .SelectedFulfillmentOptionOverride.Shipping(this.extraParams, this.shippingOption); + } + + /** + * 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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride.Shipping#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 + * RequestedSessionUpdateParams.FulfillmentDetails.SelectedFulfillmentOptionOverride.Shipping#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 shipping option identifier. */ public Builder setShippingOption(String shippingOption) { this.shippingOption = shippingOption; return this; } - /** Required. The shipping option identifer. */ + /** Required. The shipping option identifier. */ public Builder setShippingOption(EmptyParam shippingOption) { this.shippingOption = shippingOption; return this; diff --git a/src/main/java/com/stripe/param/orchestration/PaymentAttemptRetrieveParams.java b/src/main/java/com/stripe/param/orchestration/PaymentAttemptRetrieveParams.java new file mode 100644 index 00000000000..36a9f762258 --- /dev/null +++ b/src/main/java/com/stripe/param/orchestration/PaymentAttemptRetrieveParams.java @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +package com.stripe.param.orchestration; + +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 PaymentAttemptRetrieveParams 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 PaymentAttemptRetrieveParams(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 PaymentAttemptRetrieveParams build() { + return new PaymentAttemptRetrieveParams(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 + * PaymentAttemptRetrieveParams#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 + * PaymentAttemptRetrieveParams#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 + * PaymentAttemptRetrieveParams#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 PaymentAttemptRetrieveParams#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/radar/CustomerEvaluationCreateParams.java b/src/main/java/com/stripe/param/radar/CustomerEvaluationCreateParams.java new file mode 100644 index 00000000000..a1cec0742c5 --- /dev/null +++ b/src/main/java/com/stripe/param/radar/CustomerEvaluationCreateParams.java @@ -0,0 +1,558 @@ +// File generated from our OpenAPI spec +package com.stripe.param.radar; + +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 CustomerEvaluationCreateParams extends ApiRequestParams { + /** Required. Array of context entries for the evaluation. */ + @SerializedName("evaluation_context") + List evaluationContext; + + /** Required. The type of evaluation event. */ + @SerializedName("event_type") + EventType eventType; + + /** 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 CustomerEvaluationCreateParams( + List evaluationContext, + EventType eventType, + List expand, + Map extraParams) { + this.evaluationContext = evaluationContext; + this.eventType = eventType; + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List evaluationContext; + + private EventType eventType; + + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationCreateParams build() { + return new CustomerEvaluationCreateParams( + this.evaluationContext, this.eventType, this.expand, this.extraParams); + } + + /** + * Add an element to `evaluationContext` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * CustomerEvaluationCreateParams#evaluationContext} for the field documentation. + */ + public Builder addEvaluationContext(CustomerEvaluationCreateParams.EvaluationContext element) { + if (this.evaluationContext == null) { + this.evaluationContext = new ArrayList<>(); + } + this.evaluationContext.add(element); + return this; + } + + /** + * Add all elements to `evaluationContext` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link CustomerEvaluationCreateParams#evaluationContext} for the field documentation. + */ + public Builder addAllEvaluationContext( + List elements) { + if (this.evaluationContext == null) { + this.evaluationContext = new ArrayList<>(); + } + this.evaluationContext.addAll(elements); + return this; + } + + /** Required. The type of evaluation event. */ + public Builder setEventType(CustomerEvaluationCreateParams.EventType eventType) { + this.eventType = eventType; + 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 + * CustomerEvaluationCreateParams#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 + * CustomerEvaluationCreateParams#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 + * CustomerEvaluationCreateParams#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 CustomerEvaluationCreateParams#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 EvaluationContext { + /** Client details context. */ + @SerializedName("client_details") + ClientDetails clientDetails; + + /** Customer details context. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** + * 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 type of context entry. */ + @SerializedName("type") + Type type; + + private EvaluationContext( + ClientDetails clientDetails, + CustomerDetails customerDetails, + Map extraParams, + Type type) { + this.clientDetails = clientDetails; + this.customerDetails = customerDetails; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ClientDetails clientDetails; + + private CustomerDetails customerDetails; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationCreateParams.EvaluationContext build() { + return new CustomerEvaluationCreateParams.EvaluationContext( + this.clientDetails, this.customerDetails, this.extraParams, this.type); + } + + /** Client details context. */ + public Builder setClientDetails( + CustomerEvaluationCreateParams.EvaluationContext.ClientDetails clientDetails) { + this.clientDetails = clientDetails; + return this; + } + + /** Customer details context. */ + public Builder setCustomerDetails( + CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + 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 + * CustomerEvaluationCreateParams.EvaluationContext#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 CustomerEvaluationCreateParams.EvaluationContext#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 type of context entry. */ + public Builder setType(CustomerEvaluationCreateParams.EvaluationContext.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ClientDetails { + /** + * 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. ID for the Radar Session associated with the customer + * evaluation. + */ + @SerializedName("radar_session") + String radarSession; + + private ClientDetails(Map extraParams, String radarSession) { + this.extraParams = extraParams; + this.radarSession = radarSession; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String radarSession; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationCreateParams.EvaluationContext.ClientDetails build() { + return new CustomerEvaluationCreateParams.EvaluationContext.ClientDetails( + this.extraParams, this.radarSession); + } + + /** + * 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 + * CustomerEvaluationCreateParams.EvaluationContext.ClientDetails#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 + * CustomerEvaluationCreateParams.EvaluationContext.ClientDetails#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. ID for the Radar Session associated with the customer + * evaluation. + */ + public Builder setRadarSession(String radarSession) { + this.radarSession = radarSession; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails { + /** Stripe customer ID. */ + @SerializedName("customer") + String customer; + + /** Customer data. */ + @SerializedName("customer_data") + CustomerData customerData; + + /** + * 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 CustomerDetails( + String customer, CustomerData customerData, Map extraParams) { + this.customer = customer; + this.customerData = customerData; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private CustomerData customerData; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails build() { + return new CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails( + this.customer, this.customerData, this.extraParams); + } + + /** Stripe customer ID. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** Customer data. */ + public Builder setCustomerData( + CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails.CustomerData + customerData) { + this.customerData = customerData; + 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 + * CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails#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 + * CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails#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 CustomerData { + /** Customer email. */ + @SerializedName("email") + String email; + + /** + * 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; + + /** Customer name. */ + @SerializedName("name") + String name; + + /** Customer phone. */ + @SerializedName("phone") + String phone; + + private CustomerData( + String email, Map extraParams, String name, String phone) { + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails.CustomerData + build() { + return new CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails + .CustomerData(this.email, this.extraParams, this.name, this.phone); + } + + /** Customer email. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails.CustomerData#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 + * CustomerEvaluationCreateParams.EvaluationContext.CustomerDetails.CustomerData#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Customer name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Customer phone. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("client_details") + CLIENT_DETAILS("client_details"), + + @SerializedName("customer_details") + CUSTOMER_DETAILS("customer_details"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + public enum EventType implements ApiRequestParams.EnumParam { + @SerializedName("login") + LOGIN("login"), + + @SerializedName("registration") + REGISTRATION("registration"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + EventType(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/radar/CustomerEvaluationUpdateParams.java b/src/main/java/com/stripe/param/radar/CustomerEvaluationUpdateParams.java new file mode 100644 index 00000000000..ed05bcc6ccf --- /dev/null +++ b/src/main/java/com/stripe/param/radar/CustomerEvaluationUpdateParams.java @@ -0,0 +1,436 @@ +// File generated from our OpenAPI spec +package com.stripe.param.radar; + +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 CustomerEvaluationUpdateParams 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; + + /** Event payload for login_failed. */ + @SerializedName("login_failed") + LoginFailed loginFailed; + + /** Event payload for registration_failed. */ + @SerializedName("registration_failed") + RegistrationFailed registrationFailed; + + /** Event payload for registration_success. */ + @SerializedName("registration_success") + RegistrationSuccess registrationSuccess; + + /** Required. The type of event to report. */ + @SerializedName("type") + Type type; + + private CustomerEvaluationUpdateParams( + List expand, + Map extraParams, + LoginFailed loginFailed, + RegistrationFailed registrationFailed, + RegistrationSuccess registrationSuccess, + Type type) { + this.expand = expand; + this.extraParams = extraParams; + this.loginFailed = loginFailed; + this.registrationFailed = registrationFailed; + this.registrationSuccess = registrationSuccess; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private LoginFailed loginFailed; + + private RegistrationFailed registrationFailed; + + private RegistrationSuccess registrationSuccess; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationUpdateParams build() { + return new CustomerEvaluationUpdateParams( + this.expand, + this.extraParams, + this.loginFailed, + this.registrationFailed, + this.registrationSuccess, + this.type); + } + + /** + * 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 + * CustomerEvaluationUpdateParams#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 + * CustomerEvaluationUpdateParams#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 + * CustomerEvaluationUpdateParams#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 CustomerEvaluationUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Event payload for login_failed. */ + public Builder setLoginFailed(CustomerEvaluationUpdateParams.LoginFailed loginFailed) { + this.loginFailed = loginFailed; + return this; + } + + /** Event payload for registration_failed. */ + public Builder setRegistrationFailed( + CustomerEvaluationUpdateParams.RegistrationFailed registrationFailed) { + this.registrationFailed = registrationFailed; + return this; + } + + /** Event payload for registration_success. */ + public Builder setRegistrationSuccess( + CustomerEvaluationUpdateParams.RegistrationSuccess registrationSuccess) { + this.registrationSuccess = registrationSuccess; + return this; + } + + /** Required. The type of event to report. */ + public Builder setType(CustomerEvaluationUpdateParams.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LoginFailed { + /** + * 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 reason why this login failed. */ + @SerializedName("reason") + Reason reason; + + private LoginFailed(Map extraParams, Reason reason) { + this.extraParams = extraParams; + this.reason = reason; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Reason reason; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationUpdateParams.LoginFailed build() { + return new CustomerEvaluationUpdateParams.LoginFailed(this.extraParams, this.reason); + } + + /** + * 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 + * CustomerEvaluationUpdateParams.LoginFailed#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 CustomerEvaluationUpdateParams.LoginFailed#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 reason why this login failed. */ + public Builder setReason(CustomerEvaluationUpdateParams.LoginFailed.Reason reason) { + this.reason = reason; + return this; + } + } + + public enum Reason implements ApiRequestParams.EnumParam { + @SerializedName("other") + OTHER("other"), + + @SerializedName("suspected_account_sharing") + SUSPECTED_ACCOUNT_SHARING("suspected_account_sharing"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Reason(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RegistrationFailed { + /** + * 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 reason why this registration failed. */ + @SerializedName("reason") + Reason reason; + + private RegistrationFailed(Map extraParams, Reason reason) { + this.extraParams = extraParams; + this.reason = reason; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Reason reason; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationUpdateParams.RegistrationFailed build() { + return new CustomerEvaluationUpdateParams.RegistrationFailed(this.extraParams, this.reason); + } + + /** + * 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 + * CustomerEvaluationUpdateParams.RegistrationFailed#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 CustomerEvaluationUpdateParams.RegistrationFailed#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 reason why this registration failed. */ + public Builder setReason(CustomerEvaluationUpdateParams.RegistrationFailed.Reason reason) { + this.reason = reason; + return this; + } + } + + public enum Reason implements ApiRequestParams.EnumParam { + @SerializedName("other") + OTHER("other"), + + @SerializedName("suspected_multi_accounting") + SUSPECTED_MULTI_ACCOUNTING("suspected_multi_accounting"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Reason(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RegistrationSuccess { + /** Stripe customer ID to attach to an entity-less registration evaluation. */ + @SerializedName("customer") + Object customer; + + /** + * 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 RegistrationSuccess(Object customer, Map extraParams) { + this.customer = customer; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object customer; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerEvaluationUpdateParams.RegistrationSuccess build() { + return new CustomerEvaluationUpdateParams.RegistrationSuccess( + this.customer, this.extraParams); + } + + /** Stripe customer ID to attach to an entity-less registration evaluation. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** Stripe customer ID to attach to an entity-less registration evaluation. */ + public Builder setCustomer(EmptyParam customer) { + this.customer = customer; + 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 + * CustomerEvaluationUpdateParams.RegistrationSuccess#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 CustomerEvaluationUpdateParams.RegistrationSuccess#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("login_failed") + LOGIN_FAILED("login_failed"), + + @SerializedName("login_success") + LOGIN_SUCCESS("login_success"), + + @SerializedName("registration_failed") + REGISTRATION_FAILED("registration_failed"), + + @SerializedName("registration_success") + REGISTRATION_SUCCESS("registration_success"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/radar/IssuingAuthorizationEvaluationCreateParams.java b/src/main/java/com/stripe/param/radar/IssuingAuthorizationEvaluationCreateParams.java index 9865f2d923e..efdf595f901 100644 --- a/src/main/java/com/stripe/param/radar/IssuingAuthorizationEvaluationCreateParams.java +++ b/src/main/java/com/stripe/param/radar/IssuingAuthorizationEvaluationCreateParams.java @@ -38,7 +38,10 @@ public class IssuingAuthorizationEvaluationCreateParams extends ApiRequestParams @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Details about the merchant where the authorization occurred. */ + /** + * Required. Details about the seller (grocery store, e-commerce website, etc.) + * where the card authorization happened. + */ @SerializedName("merchant_details") MerchantDetails merchantDetails; @@ -51,15 +54,15 @@ public class IssuingAuthorizationEvaluationCreateParams extends ApiRequestParams @SerializedName("metadata") Map metadata; - /** Details about the card network processing. */ + /** Details about the authorization, such as identifiers, set by the card network. */ @SerializedName("network_details") NetworkDetails networkDetails; - /** Details about the token, if a tokenized payment method was used. */ + /** Details about the token, if a tokenized payment method was used for the authorization. */ @SerializedName("token_details") TokenDetails tokenDetails; - /** Details about verification checks performed. */ + /** Details about verification data for the authorization. */ @SerializedName("verification_details") VerificationDetails verificationDetails; @@ -200,7 +203,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. Details about the merchant where the authorization occurred. */ + /** + * Required. Details about the seller (grocery store, e-commerce website, etc.) + * where the card authorization happened. + */ public Builder setMerchantDetails( IssuingAuthorizationEvaluationCreateParams.MerchantDetails merchantDetails) { this.merchantDetails = merchantDetails; @@ -233,21 +239,21 @@ public Builder putAllMetadata(Map map) { return this; } - /** Details about the card network processing. */ + /** Details about the authorization, such as identifiers, set by the card network. */ public Builder setNetworkDetails( IssuingAuthorizationEvaluationCreateParams.NetworkDetails networkDetails) { this.networkDetails = networkDetails; return this; } - /** Details about the token, if a tokenized payment method was used. */ + /** Details about the token, if a tokenized payment method was used for the authorization. */ public Builder setTokenDetails( IssuingAuthorizationEvaluationCreateParams.TokenDetails tokenDetails) { this.tokenDetails = tokenDetails; return this; } - /** Details about verification checks performed. */ + /** Details about verification data for the authorization. */ public Builder setVerificationDetails( IssuingAuthorizationEvaluationCreateParams.VerificationDetails verificationDetails) { this.verificationDetails = verificationDetails; @@ -258,23 +264,30 @@ public Builder setVerificationDetails( @Getter @EqualsAndHashCode(callSuper = false) public static class AuthorizationDetails { - /** Required. The authorization amount in the smallest currency unit. */ + /** + * Required. The total amount of the authorization in the smallest currency unit. + */ @SerializedName("amount") Long amount; - /** The method used for authorization. */ + /** How the card details were provided. */ @SerializedName("authorization_method") AuthorizationMethod authorizationMethod; - /** Required. Three-letter ISO currency code in lowercase. */ + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ @SerializedName("currency") String currency; - /** The card entry mode. */ + /** Defines how the card's information was entered for the authorization. */ @SerializedName("entry_mode") EntryMode entryMode; - /** The raw code for the card entry mode. */ + /** Raw code indicating the entry mode from the network message. */ @SerializedName("entry_mode_raw_code") String entryModeRawCode; @@ -287,21 +300,22 @@ public static class AuthorizationDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * Required. The time when the authorization was initiated (Unix timestamp). - */ + /** Required. The timestamp of the authorization initiated in seconds. */ @SerializedName("initiated_at") Long initiatedAt; - /** The point of sale condition. */ + /** Defines how the card was read at the point of sale. */ @SerializedName("point_of_sale_condition") PointOfSaleCondition pointOfSaleCondition; - /** The raw code for the point of sale condition. */ + /** Raw code indicating the point of sale condition from the network message. */ @SerializedName("point_of_sale_condition_raw_code") String pointOfSaleConditionRawCode; - /** Required. External reference for the authorization. */ + /** + * Required. User's specified unique ID for this authorization attempt (e.g., + * RRN or internal reference). + */ @SerializedName("reference") String reference; @@ -368,13 +382,16 @@ public IssuingAuthorizationEvaluationCreateParams.AuthorizationDetails build() { this.reference); } - /** Required. The authorization amount in the smallest currency unit. */ + /** + * Required. The total amount of the authorization in the smallest currency unit. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; } - /** The method used for authorization. */ + /** How the card details were provided. */ public Builder setAuthorizationMethod( IssuingAuthorizationEvaluationCreateParams.AuthorizationDetails.AuthorizationMethod authorizationMethod) { @@ -382,20 +399,24 @@ public Builder setAuthorizationMethod( return this; } - /** Required. Three-letter ISO currency code in lowercase. */ + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ public Builder setCurrency(String currency) { this.currency = currency; return this; } - /** The card entry mode. */ + /** Defines how the card's information was entered for the authorization. */ public Builder setEntryMode( IssuingAuthorizationEvaluationCreateParams.AuthorizationDetails.EntryMode entryMode) { this.entryMode = entryMode; return this; } - /** The raw code for the card entry mode. */ + /** Raw code indicating the entry mode from the network message. */ public Builder setEntryModeRawCode(String entryModeRawCode) { this.entryModeRawCode = entryModeRawCode; return this; @@ -429,15 +450,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * Required. The time when the authorization was initiated (Unix timestamp). - */ + /** Required. The timestamp of the authorization initiated in seconds. */ public Builder setInitiatedAt(Long initiatedAt) { this.initiatedAt = initiatedAt; return this; } - /** The point of sale condition. */ + /** Defines how the card was read at the point of sale. */ public Builder setPointOfSaleCondition( IssuingAuthorizationEvaluationCreateParams.AuthorizationDetails.PointOfSaleCondition pointOfSaleCondition) { @@ -445,13 +464,16 @@ public Builder setPointOfSaleCondition( return this; } - /** The raw code for the point of sale condition. */ + /** Raw code indicating the point of sale condition from the network message. */ public Builder setPointOfSaleConditionRawCode(String pointOfSaleConditionRawCode) { this.pointOfSaleConditionRawCode = pointOfSaleConditionRawCode; return this; } - /** Required. External reference for the authorization. */ + /** + * Required. User's specified unique ID for this authorization attempt (e.g., + * RRN or internal reference). + */ public Builder setReference(String reference) { this.reference = reference; return this; @@ -561,19 +583,19 @@ public enum PointOfSaleCondition implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class CardDetails { - /** Required. Bank Identification Number (BIN) of the card. */ + /** Required. The Bank Identification Number (BIN) of the card. */ @SerializedName("bin") String bin; - /** Two-letter ISO country code of the card's issuing bank. */ + /** Required. The two-letter country code of the BIN issuer. */ @SerializedName("bin_country") String binCountry; - /** Required. The type of card (physical or virtual). */ + /** Required. The type of the card. */ @SerializedName("card_type") CardType cardType; - /** Required. The time when the card was created (Unix timestamp). */ + /** Required. The timestamp when the card was created. */ @SerializedName("created_at") Long createdAt; @@ -586,11 +608,14 @@ public static class CardDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Last 4 digits of the card number. */ + /** The last 4 digits of the card number. */ @SerializedName("last4") String last4; - /** Required. External reference for the card. */ + /** + * Required. User's specified unique ID of the card for this authorization + * attempt (e.g., RRN or internal reference). + */ @SerializedName("reference") String reference; @@ -642,26 +667,26 @@ public IssuingAuthorizationEvaluationCreateParams.CardDetails build() { this.reference); } - /** Required. Bank Identification Number (BIN) of the card. */ + /** Required. The Bank Identification Number (BIN) of the card. */ public Builder setBin(String bin) { this.bin = bin; return this; } - /** Two-letter ISO country code of the card's issuing bank. */ + /** Required. The two-letter country code of the BIN issuer. */ public Builder setBinCountry(String binCountry) { this.binCountry = binCountry; return this; } - /** Required. The type of card (physical or virtual). */ + /** Required. The type of the card. */ public Builder setCardType( IssuingAuthorizationEvaluationCreateParams.CardDetails.CardType cardType) { this.cardType = cardType; return this; } - /** Required. The time when the card was created (Unix timestamp). */ + /** Required. The timestamp when the card was created. */ public Builder setCreatedAt(Long createdAt) { this.createdAt = createdAt; return this; @@ -695,13 +720,16 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Last 4 digits of the card number. */ + /** The last 4 digits of the card number. */ public Builder setLast4(String last4) { this.last4 = last4; return this; } - /** Required. External reference for the card. */ + /** + * Required. User's specified unique ID of the card for this authorization + * attempt (e.g., RRN or internal reference). + */ public Builder setReference(String reference) { this.reference = reference; return this; @@ -727,7 +755,7 @@ public enum CardType implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class CardholderDetails { - /** The time when the cardholder was created (Unix timestamp). */ + /** The timestamp when the cardholder was created. */ @SerializedName("created_at") Long createdAt; @@ -740,7 +768,10 @@ public static class CardholderDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** External reference for the cardholder. */ + /** + * User's specified unique ID of the cardholder for this authorization attempt (e.g., RRN or + * internal reference). + */ @SerializedName("reference") String reference; @@ -767,7 +798,7 @@ public IssuingAuthorizationEvaluationCreateParams.CardholderDetails build() { this.createdAt, this.extraParams, this.reference); } - /** The time when the cardholder was created (Unix timestamp). */ + /** The timestamp when the cardholder was created. */ public Builder setCreatedAt(Long createdAt) { this.createdAt = createdAt; return this; @@ -801,7 +832,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** External reference for the cardholder. */ + /** + * User's specified unique ID of the cardholder for this authorization attempt (e.g., RRN or + * internal reference). + */ public Builder setReference(String reference) { this.reference = reference; return this; @@ -812,11 +846,11 @@ public Builder setReference(String reference) { @Getter @EqualsAndHashCode(callSuper = false) public static class MerchantDetails { - /** Required. Merchant Category Code (MCC). */ + /** Required. The merchant category code for the seller's business. */ @SerializedName("category_code") String categoryCode; - /** Two-letter ISO country code of the merchant. */ + /** Country where the seller is located. */ @SerializedName("country") String country; @@ -829,15 +863,18 @@ public static class MerchantDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Name of the merchant. */ + /** Required. Name of the seller. */ @SerializedName("name") String name; - /** Required. Network merchant identifier. */ + /** + * Required. Identifier assigned to the seller by the card network. Different + * card networks may assign different network_id fields to the same merchant. + */ @SerializedName("network_id") String networkId; - /** Terminal identifier. */ + /** An ID assigned by the seller to the location of the sale. */ @SerializedName("terminal_id") String terminalId; @@ -884,13 +921,13 @@ public IssuingAuthorizationEvaluationCreateParams.MerchantDetails build() { this.terminalId); } - /** Required. Merchant Category Code (MCC). */ + /** Required. The merchant category code for the seller's business. */ public Builder setCategoryCode(String categoryCode) { this.categoryCode = categoryCode; return this; } - /** Two-letter ISO country code of the merchant. */ + /** Country where the seller is located. */ public Builder setCountry(String country) { this.country = country; return this; @@ -924,19 +961,22 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. Name of the merchant. */ + /** Required. Name of the seller. */ public Builder setName(String name) { this.name = name; return this; } - /** Required. Network merchant identifier. */ + /** + * Required. Identifier assigned to the seller by the card network. Different + * card networks may assign different network_id fields to the same merchant. + */ public Builder setNetworkId(String networkId) { this.networkId = networkId; return this; } - /** Terminal identifier. */ + /** An ID assigned by the seller to the location of the sale. */ public Builder setTerminalId(String terminalId) { this.terminalId = terminalId; return this; @@ -947,7 +987,10 @@ public Builder setTerminalId(String terminalId) { @Getter @EqualsAndHashCode(callSuper = false) public static class NetworkDetails { - /** The acquiring institution identifier. */ + /** + * Identifier assigned to the acquirer by the card network. Sometimes this value is not provided + * by the network; in this case, the value will be null. + */ @SerializedName("acquiring_institution_id") String acquiringInstitutionId; @@ -960,7 +1003,7 @@ public static class NetworkDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The card network that routed the authorization. */ + /** The card network over which Stripe received the authorization. */ @SerializedName("routed_network") RoutedNetwork routedNetwork; @@ -990,7 +1033,10 @@ public IssuingAuthorizationEvaluationCreateParams.NetworkDetails build() { this.acquiringInstitutionId, this.extraParams, this.routedNetwork); } - /** The acquiring institution identifier. */ + /** + * Identifier assigned to the acquirer by the card network. Sometimes this value is not + * provided by the network; in this case, the value will be null. + */ public Builder setAcquiringInstitutionId(String acquiringInstitutionId) { this.acquiringInstitutionId = acquiringInstitutionId; return this; @@ -1024,7 +1070,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The card network that routed the authorization. */ + /** The card network over which Stripe received the authorization. */ public Builder setRoutedNetwork( IssuingAuthorizationEvaluationCreateParams.NetworkDetails.RoutedNetwork routedNetwork) { this.routedNetwork = routedNetwork; @@ -1066,7 +1112,7 @@ public enum RoutedNetwork implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class TokenDetails { - /** The time when the token was created (Unix timestamp). */ + /** The timestamp when the network token was created. */ @SerializedName("created_at") Long createdAt; @@ -1079,11 +1125,17 @@ public static class TokenDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** External reference for the token. */ + /** + * User's specified unique ID of the card token for this authorization attempt (e.g., RRN or + * internal reference). + */ @SerializedName("reference") String reference; - /** The wallet provider for the tokenized payment method. */ + /** + * The digital wallet used for this transaction. One of {@code apple_pay}, {@code google_pay}, + * or {@code samsung_pay}. + */ @SerializedName("wallet") Wallet wallet; @@ -1114,7 +1166,7 @@ public IssuingAuthorizationEvaluationCreateParams.TokenDetails build() { this.createdAt, this.extraParams, this.reference, this.wallet); } - /** The time when the token was created (Unix timestamp). */ + /** The timestamp when the network token was created. */ public Builder setCreatedAt(Long createdAt) { this.createdAt = createdAt; return this; @@ -1148,13 +1200,19 @@ public Builder putAllExtraParam(Map map) { return this; } - /** External reference for the token. */ + /** + * User's specified unique ID of the card token for this authorization attempt (e.g., RRN or + * internal reference). + */ public Builder setReference(String reference) { this.reference = reference; return this; } - /** The wallet provider for the tokenized payment method. */ + /** + * The digital wallet used for this transaction. One of {@code apple_pay}, {@code google_pay}, + * or {@code samsung_pay}. + */ public Builder setWallet( IssuingAuthorizationEvaluationCreateParams.TokenDetails.Wallet wallet) { this.wallet = wallet; @@ -1193,7 +1251,7 @@ public static class VerificationDetails { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The result of 3D Secure verification. */ + /** The outcome of the 3D Secure authentication request. */ @SerializedName("three_d_secure_result") ThreeDSecureResult threeDSecureResult; @@ -1246,7 +1304,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The result of 3D Secure verification. */ + /** The outcome of the 3D Secure authentication request. */ public Builder setThreeDSecureResult( IssuingAuthorizationEvaluationCreateParams.VerificationDetails.ThreeDSecureResult threeDSecureResult) { diff --git a/src/main/java/com/stripe/param/sharedpayment/GrantedTokenCreateParams.java b/src/main/java/com/stripe/param/sharedpayment/GrantedTokenCreateParams.java index 18398d3e454..c98e98a5997 100644 --- a/src/main/java/com/stripe/param/sharedpayment/GrantedTokenCreateParams.java +++ b/src/main/java/com/stripe/param/sharedpayment/GrantedTokenCreateParams.java @@ -230,8 +230,8 @@ public static class UsageLimits { String currency; /** - * Required. Time at which this SharedPaymentToken expires and can no longer be - * used to confirm a PaymentIntent. + * Time at which this SharedPaymentToken expires and can no longer be used to confirm a + * PaymentIntent. */ @SerializedName("expires_at") Long expiresAt; @@ -249,12 +249,23 @@ public static class UsageLimits { @SerializedName("max_amount") Long maxAmount; + /** + * The recurring interval at which the shared payment token's amount usage restrictions reset. + */ + @SerializedName("recurring_interval") + RecurringInterval recurringInterval; + private UsageLimits( - String currency, Long expiresAt, Map extraParams, Long maxAmount) { + String currency, + Long expiresAt, + Map extraParams, + Long maxAmount, + RecurringInterval recurringInterval) { this.currency = currency; this.expiresAt = expiresAt; this.extraParams = extraParams; this.maxAmount = maxAmount; + this.recurringInterval = recurringInterval; } public static Builder builder() { @@ -270,10 +281,16 @@ public static class Builder { private Long maxAmount; + private RecurringInterval recurringInterval; + /** Finalize and obtain parameter instance from this builder. */ public GrantedTokenCreateParams.UsageLimits build() { return new GrantedTokenCreateParams.UsageLimits( - this.currency, this.expiresAt, this.extraParams, this.maxAmount); + this.currency, + this.expiresAt, + this.extraParams, + this.maxAmount, + this.recurringInterval); } /** @@ -287,8 +304,8 @@ public Builder setCurrency(String currency) { } /** - * Required. Time at which this SharedPaymentToken expires and can no longer - * be used to confirm a PaymentIntent. + * Time at which this SharedPaymentToken expires and can no longer be used to confirm a + * PaymentIntent. */ public Builder setExpiresAt(Long expiresAt) { this.expiresAt = expiresAt; @@ -328,6 +345,33 @@ public Builder setMaxAmount(Long maxAmount) { this.maxAmount = maxAmount; return this; } + + /** + * The recurring interval at which the shared payment token's amount usage restrictions reset. + */ + public Builder setRecurringInterval( + GrantedTokenCreateParams.UsageLimits.RecurringInterval recurringInterval) { + this.recurringInterval = recurringInterval; + return this; + } + } + + public enum RecurringInterval implements ApiRequestParams.EnumParam { + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RecurringInterval(String value) { + this.value = value; + } } } } diff --git a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index 6a8c1dce2e6..29f51e1331e 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -15735,6 +15735,10 @@ public static class Us { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Options for the home rule tax registration. */ + @SerializedName("home_rule_tax") + HomeRuleTax homeRuleTax; + /** Options for the local amusement tax registration. */ @SerializedName("local_amusement_tax") LocalAmusementTax localAmusementTax; @@ -15760,12 +15764,14 @@ public static class Us { private Us( Map extraParams, + HomeRuleTax homeRuleTax, LocalAmusementTax localAmusementTax, LocalLeaseTax localLeaseTax, String state, StateSalesTax stateSalesTax, Type type) { this.extraParams = extraParams; + this.homeRuleTax = homeRuleTax; this.localAmusementTax = localAmusementTax; this.localLeaseTax = localLeaseTax; this.state = state; @@ -15780,6 +15786,8 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private HomeRuleTax homeRuleTax; + private LocalAmusementTax localAmusementTax; private LocalLeaseTax localLeaseTax; @@ -15794,6 +15802,7 @@ public static class Builder { public RegistrationCreateParams.CountryOptions.Us build() { return new RegistrationCreateParams.CountryOptions.Us( this.extraParams, + this.homeRuleTax, this.localAmusementTax, this.localLeaseTax, this.state, @@ -15829,6 +15838,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Options for the home rule tax registration. */ + public Builder setHomeRuleTax( + RegistrationCreateParams.CountryOptions.Us.HomeRuleTax homeRuleTax) { + this.homeRuleTax = homeRuleTax; + return this; + } + /** Options for the local amusement tax registration. */ public Builder setLocalAmusementTax( RegistrationCreateParams.CountryOptions.Us.LocalAmusementTax localAmusementTax) { @@ -15866,6 +15882,87 @@ public Builder setType(RegistrationCreateParams.CountryOptions.Us.Type type) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class HomeRuleTax { + /** + * 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. A jurisdiction code representing the local + * jurisdiction. + */ + @SerializedName("jurisdiction") + String jurisdiction; + + private HomeRuleTax(Map extraParams, String jurisdiction) { + this.extraParams = extraParams; + this.jurisdiction = jurisdiction; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String jurisdiction; + + /** Finalize and obtain parameter instance from this builder. */ + public RegistrationCreateParams.CountryOptions.Us.HomeRuleTax build() { + return new RegistrationCreateParams.CountryOptions.Us.HomeRuleTax( + this.extraParams, this.jurisdiction); + } + + /** + * 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 RegistrationCreateParams.CountryOptions.Us.HomeRuleTax#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 RegistrationCreateParams.CountryOptions.Us.HomeRuleTax#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. A jurisdiction code representing the local + * jurisdiction. + */ + public Builder setJurisdiction(String jurisdiction) { + this.jurisdiction = jurisdiction; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class LocalAmusementTax { @@ -16273,6 +16370,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("gross_receipts_tax") GROSS_RECEIPTS_TAX("gross_receipts_tax"), + @SerializedName("home_rule_tax") + HOME_RULE_TAX("home_rule_tax"), + @SerializedName("hospitality_tax") HOSPITALITY_TAX("hospitality_tax"), diff --git a/src/main/java/com/stripe/service/OrchestrationService.java b/src/main/java/com/stripe/service/OrchestrationService.java new file mode 100644 index 00000000000..b89912d9aae --- /dev/null +++ b/src/main/java/com/stripe/service/OrchestrationService.java @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.stripe.net.ApiService; +import com.stripe.net.StripeResponseGetter; + +public final class OrchestrationService extends ApiService { + public OrchestrationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + public com.stripe.service.orchestration.PaymentAttemptService paymentAttempts() { + return new com.stripe.service.orchestration.PaymentAttemptService(this.getResponseGetter()); + } +} diff --git a/src/main/java/com/stripe/service/PaymentAttemptRecordService.java b/src/main/java/com/stripe/service/PaymentAttemptRecordService.java index e27811829a2..76832f66a9d 100644 --- a/src/main/java/com/stripe/service/PaymentAttemptRecordService.java +++ b/src/main/java/com/stripe/service/PaymentAttemptRecordService.java @@ -13,6 +13,12 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.PaymentAttemptRecordListParams; +import com.stripe.param.PaymentAttemptRecordReportAuthenticatedParams; +import com.stripe.param.PaymentAttemptRecordReportCanceledParams; +import com.stripe.param.PaymentAttemptRecordReportFailedParams; +import com.stripe.param.PaymentAttemptRecordReportGuaranteedParams; +import com.stripe.param.PaymentAttemptRecordReportInformationalParams; +import com.stripe.param.PaymentAttemptRecordReportRefundParams; import com.stripe.param.PaymentAttemptRecordRetrieveParams; public final class PaymentAttemptRecordService extends ApiService { @@ -66,4 +72,219 @@ public PaymentAttemptRecord retrieve( options); return this.request(request, PaymentAttemptRecord.class); } + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated( + String paymentAttemptRecord, PaymentAttemptRecordReportAuthenticatedParams params) + throws StripeException { + return reportAuthenticated(paymentAttemptRecord, params, (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated( + String paymentAttemptRecord, RequestOptions options) throws StripeException { + return reportAuthenticated( + paymentAttemptRecord, (PaymentAttemptRecordReportAuthenticatedParams) null, options); + } + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated(String paymentAttemptRecord) + throws StripeException { + return reportAuthenticated( + paymentAttemptRecord, + (PaymentAttemptRecordReportAuthenticatedParams) null, + (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record was authenticated. */ + public PaymentAttemptRecord reportAuthenticated( + String paymentAttemptRecord, + PaymentAttemptRecordReportAuthenticatedParams params, + RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_authenticated", + ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttemptRecord.class); + } + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled( + String paymentAttemptRecord, PaymentAttemptRecordReportCanceledParams params) + throws StripeException { + return reportCanceled(paymentAttemptRecord, params, (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled(String paymentAttemptRecord, RequestOptions options) + throws StripeException { + return reportCanceled( + paymentAttemptRecord, (PaymentAttemptRecordReportCanceledParams) null, options); + } + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled(String paymentAttemptRecord) throws StripeException { + return reportCanceled( + paymentAttemptRecord, + (PaymentAttemptRecordReportCanceledParams) null, + (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record was canceled. */ + public PaymentAttemptRecord reportCanceled( + String paymentAttemptRecord, + PaymentAttemptRecordReportCanceledParams params, + RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_canceled", + ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttemptRecord.class); + } + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed( + String paymentAttemptRecord, PaymentAttemptRecordReportFailedParams params) + throws StripeException { + return reportFailed(paymentAttemptRecord, params, (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed(String paymentAttemptRecord, RequestOptions options) + throws StripeException { + return reportFailed( + paymentAttemptRecord, (PaymentAttemptRecordReportFailedParams) null, options); + } + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed(String paymentAttemptRecord) throws StripeException { + return reportFailed( + paymentAttemptRecord, (PaymentAttemptRecordReportFailedParams) null, (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record failed. */ + public PaymentAttemptRecord reportFailed( + String paymentAttemptRecord, + PaymentAttemptRecordReportFailedParams params, + RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_failed", + ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttemptRecord.class); + } + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed( + String paymentAttemptRecord, PaymentAttemptRecordReportGuaranteedParams params) + throws StripeException { + return reportGuaranteed(paymentAttemptRecord, params, (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed(String paymentAttemptRecord, RequestOptions options) + throws StripeException { + return reportGuaranteed( + paymentAttemptRecord, (PaymentAttemptRecordReportGuaranteedParams) null, options); + } + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed(String paymentAttemptRecord) throws StripeException { + return reportGuaranteed( + paymentAttemptRecord, + (PaymentAttemptRecordReportGuaranteedParams) null, + (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record was guaranteed. */ + public PaymentAttemptRecord reportGuaranteed( + String paymentAttemptRecord, + PaymentAttemptRecordReportGuaranteedParams params, + RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_guaranteed", + ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttemptRecord.class); + } + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational( + String paymentAttemptRecord, PaymentAttemptRecordReportInformationalParams params) + throws StripeException { + return reportInformational(paymentAttemptRecord, params, (RequestOptions) null); + } + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational( + String paymentAttemptRecord, RequestOptions options) throws StripeException { + return reportInformational( + paymentAttemptRecord, (PaymentAttemptRecordReportInformationalParams) null, options); + } + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational(String paymentAttemptRecord) + throws StripeException { + return reportInformational( + paymentAttemptRecord, + (PaymentAttemptRecordReportInformationalParams) null, + (RequestOptions) null); + } + /** Report informational updates on the specified Payment Attempt Record. */ + public PaymentAttemptRecord reportInformational( + String paymentAttemptRecord, + PaymentAttemptRecordReportInformationalParams params, + RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_informational", + ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttemptRecord.class); + } + /** Report that the specified Payment Attempt Record was refunded. */ + public PaymentAttemptRecord reportRefund( + String paymentAttemptRecord, PaymentAttemptRecordReportRefundParams params) + throws StripeException { + return reportRefund(paymentAttemptRecord, params, (RequestOptions) null); + } + /** Report that the specified Payment Attempt Record was refunded. */ + public PaymentAttemptRecord reportRefund( + String paymentAttemptRecord, + PaymentAttemptRecordReportRefundParams params, + RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_attempt_records/%s/report_refund", + ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttemptRecord.class); + } } diff --git a/src/main/java/com/stripe/service/PaymentRecordService.java b/src/main/java/com/stripe/service/PaymentRecordService.java index 8ab61a4ef4d..75d101ff387 100644 --- a/src/main/java/com/stripe/service/PaymentRecordService.java +++ b/src/main/java/com/stripe/service/PaymentRecordService.java @@ -83,6 +83,17 @@ public PaymentRecord reportPaymentAttemptCanceled( return reportPaymentAttemptCanceled(id, params, (RequestOptions) null); } /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled(String id, RequestOptions options) + throws StripeException { + return reportPaymentAttemptCanceled( + id, (PaymentRecordReportPaymentAttemptCanceledParams) null, options); + } + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled(String id) throws StripeException { + return reportPaymentAttemptCanceled( + id, (PaymentRecordReportPaymentAttemptCanceledParams) null, (RequestOptions) null); + } + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ public PaymentRecord reportPaymentAttemptCanceled( String id, PaymentRecordReportPaymentAttemptCanceledParams params, RequestOptions options) throws StripeException { @@ -105,6 +116,21 @@ public PaymentRecord reportPaymentAttemptFailed( String id, PaymentRecordReportPaymentAttemptFailedParams params) throws StripeException { return reportPaymentAttemptFailed(id, params, (RequestOptions) null); } + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed(String id, RequestOptions options) + throws StripeException { + return reportPaymentAttemptFailed( + id, (PaymentRecordReportPaymentAttemptFailedParams) null, options); + } + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed(String id) throws StripeException { + return reportPaymentAttemptFailed( + id, (PaymentRecordReportPaymentAttemptFailedParams) null, (RequestOptions) null); + } /** * Report that the most recent payment attempt on the specified Payment Record failed or errored. */ @@ -129,6 +155,17 @@ public PaymentRecord reportPaymentAttemptGuaranteed( return reportPaymentAttemptGuaranteed(id, params, (RequestOptions) null); } /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed(String id, RequestOptions options) + throws StripeException { + return reportPaymentAttemptGuaranteed( + id, (PaymentRecordReportPaymentAttemptGuaranteedParams) null, options); + } + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed(String id) throws StripeException { + return reportPaymentAttemptGuaranteed( + id, (PaymentRecordReportPaymentAttemptGuaranteedParams) null, (RequestOptions) null); + } + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ public PaymentRecord reportPaymentAttemptGuaranteed( String id, PaymentRecordReportPaymentAttemptGuaranteedParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/RadarService.java b/src/main/java/com/stripe/service/RadarService.java index f206c140487..539e9155b6d 100644 --- a/src/main/java/com/stripe/service/RadarService.java +++ b/src/main/java/com/stripe/service/RadarService.java @@ -13,6 +13,10 @@ public com.stripe.service.radar.AccountEvaluationService accountEvaluations() { return new com.stripe.service.radar.AccountEvaluationService(this.getResponseGetter()); } + public com.stripe.service.radar.CustomerEvaluationService customerEvaluations() { + return new com.stripe.service.radar.CustomerEvaluationService(this.getResponseGetter()); + } + public com.stripe.service.radar.EarlyFraudWarningService earlyFraudWarnings() { return new com.stripe.service.radar.EarlyFraudWarningService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/V1Services.java b/src/main/java/com/stripe/service/V1Services.java index 063fd4a1c12..a710222f790 100644 --- a/src/main/java/com/stripe/service/V1Services.java +++ b/src/main/java/com/stripe/service/V1Services.java @@ -185,6 +185,10 @@ public com.stripe.service.MarginService margins() { return new com.stripe.service.MarginService(this.getResponseGetter()); } + public com.stripe.service.OrchestrationService orchestration() { + return new com.stripe.service.OrchestrationService(this.getResponseGetter()); + } + public com.stripe.service.OrderService orders() { return new com.stripe.service.OrderService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/checkout/SessionService.java b/src/main/java/com/stripe/service/checkout/SessionService.java index b5a1799a1f1..c4a9b17b5a9 100644 --- a/src/main/java/com/stripe/service/checkout/SessionService.java +++ b/src/main/java/com/stripe/service/checkout/SessionService.java @@ -12,6 +12,7 @@ import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; +import com.stripe.param.checkout.SessionApproveParams; import com.stripe.param.checkout.SessionCreateParams; import com.stripe.param.checkout.SessionExpireParams; import com.stripe.param.checkout.SessionListParams; @@ -142,6 +143,30 @@ public Session update(String session, SessionUpdateParams params, RequestOptions options); return this.request(request, Session.class); } + /** + * Approves a customer’s attempt to pay for a Checkout Session with {@code approval_method} set to + * {@code manual}. + */ + public Session approve(String session, SessionApproveParams params) throws StripeException { + return approve(session, params, (RequestOptions) null); + } + /** + * Approves a customer’s attempt to pay for a Checkout Session with {@code approval_method} set to + * {@code manual}. + */ + public Session approve(String session, SessionApproveParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/checkout/sessions/%s/approve", ApiResource.urlEncodeId(session)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Session.class); + } /** * A Checkout Session can be expired when it is in one of these statuses: {@code open} * diff --git a/src/main/java/com/stripe/service/orchestration/PaymentAttemptService.java b/src/main/java/com/stripe/service/orchestration/PaymentAttemptService.java new file mode 100644 index 00000000000..3a621141b48 --- /dev/null +++ b/src/main/java/com/stripe/service/orchestration/PaymentAttemptService.java @@ -0,0 +1,51 @@ +// File generated from our OpenAPI spec +package com.stripe.service.orchestration; + +import com.stripe.exception.StripeException; +import com.stripe.model.orchestration.PaymentAttempt; +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.orchestration.PaymentAttemptRetrieveParams; + +public final class PaymentAttemptService extends ApiService { + public PaymentAttemptService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public PaymentAttempt retrieve(String paymentAttemptRecord, PaymentAttemptRetrieveParams params) + throws StripeException { + return retrieve(paymentAttemptRecord, params, (RequestOptions) null); + } + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public PaymentAttempt retrieve(String paymentAttemptRecord, RequestOptions options) + throws StripeException { + return retrieve(paymentAttemptRecord, (PaymentAttemptRetrieveParams) null, options); + } + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public PaymentAttempt retrieve(String paymentAttemptRecord) throws StripeException { + return retrieve( + paymentAttemptRecord, (PaymentAttemptRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves orchestration information for the given payment attempt record (e.g. return url). */ + public PaymentAttempt retrieve( + String paymentAttemptRecord, PaymentAttemptRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/orchestration/payment_attempts/%s", ApiResource.urlEncodeId(paymentAttemptRecord)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttempt.class); + } +} diff --git a/src/main/java/com/stripe/service/radar/CustomerEvaluationService.java b/src/main/java/com/stripe/service/radar/CustomerEvaluationService.java new file mode 100644 index 00000000000..531534ce330 --- /dev/null +++ b/src/main/java/com/stripe/service/radar/CustomerEvaluationService.java @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec +package com.stripe.service.radar; + +import com.stripe.exception.StripeException; +import com.stripe.model.radar.CustomerEvaluation; +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.radar.CustomerEvaluationCreateParams; +import com.stripe.param.radar.CustomerEvaluationUpdateParams; + +public final class CustomerEvaluationService extends ApiService { + public CustomerEvaluationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Creates a new {@code CustomerEvaluation} object. */ + public CustomerEvaluation create(CustomerEvaluationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Creates a new {@code CustomerEvaluation} object. */ + public CustomerEvaluation create(CustomerEvaluationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v1/radar/customer_evaluations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, CustomerEvaluation.class); + } + /** Reports an event on a {@code CustomerEvaluation} object. */ + public CustomerEvaluation update(String customerEvaluation, CustomerEvaluationUpdateParams params) + throws StripeException { + return update(customerEvaluation, params, (RequestOptions) null); + } + /** Reports an event on a {@code CustomerEvaluation} object. */ + public CustomerEvaluation update( + String customerEvaluation, CustomerEvaluationUpdateParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/radar/customer_evaluations/%s/report", + ApiResource.urlEncodeId(customerEvaluation)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, CustomerEvaluation.class); + } +}