diff --git a/CHANGELOG.md b/CHANGELOG.md index f28140be9bf..78b994463a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,17 @@ * [#1909](https://github.com/stripe/stripe-java/pull/1909) Do not allow setting Stripe.stripeVersion * `Stripe.stripeVersion` is no longer settable. If you were using this to set the beta headers, use the helper method `Stripe.addBetaVersion()` instead. +## 28.0.1 - 2024-11-06 +* [#1919](https://github.com/stripe/stripe-java/pull/1919) Catch `JsonSyntaxException` when processing all errors +* [#1916](https://github.com/stripe/stripe-java/pull/1916) Restore `testReportsRawRequestUsageTelemetry` test +* [#1915](https://github.com/stripe/stripe-java/pull/1915) add major version blurb to changelog + ## 28.0.0 - 2024-10-29 + +Historically, when upgrading webhooks to a new API version, you also had to upgrade your SDK version. Your webhook's API version needed to match the API version pinned by the SDK you were using to ensure successful deserialization of events. With the `2024-09-30.acacia` release, Stripe follows a [new API release process](https://stripe.com/blog/introducing-stripes-new-api-release-process). As a result, you can safely upgrade your webhook endpoints to any API version within a biannual release (like `acacia`) without upgrading the SDK. + +However, [a bug](https://github.com/stripe/stripe-java/pull/1906) in the `27.x.y` SDK releases meant that webhook version upgrades from the SDK's pinned `2024-09-30.acacia` version to the new `2024-10-28.acacia` version would fail. Therefore, we are shipping SDK support for `2024-10-28.acacia` as a major version to enforce the idea that an SDK upgrade is also required. Future API versions in the `acacia` line will be released as minor versions. + * [#1896](https://github.com/stripe/stripe-java/pull/1896) This release changes the pinned API version to `2024-10-28.acacia`. * Add support for new resource `V2.EventDestinations` * Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations` diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c626f7dd819..b9cb5323fbe 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1319 \ No newline at end of file +v1333 \ No newline at end of file diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index e0245c7c44b..a90e6d113b2 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -273,6 +273,10 @@ public com.stripe.service.OrderService orders() { return new com.stripe.service.OrderService(this.getResponseGetter()); } + public com.stripe.service.PaymentAttemptRecordService paymentAttemptRecords() { + return new com.stripe.service.PaymentAttemptRecordService(this.getResponseGetter()); + } + public com.stripe.service.PaymentIntentService paymentIntents() { return new com.stripe.service.PaymentIntentService(this.getResponseGetter()); } @@ -293,6 +297,10 @@ public com.stripe.service.PaymentMethodService paymentMethods() { return new com.stripe.service.PaymentMethodService(this.getResponseGetter()); } + public com.stripe.service.PaymentRecordService paymentRecords() { + return new com.stripe.service.PaymentRecordService(this.getResponseGetter()); + } + public com.stripe.service.PayoutService payouts() { return new com.stripe.service.PayoutService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index 55816228d91..135082a144e 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -1936,7 +1936,16 @@ public static class FutureRequirements extends StripeObject { @SerializedName("currently_due") List currentlyDue; - /** This is typed as a string for consistency with {@code requirements.disabled_reason}. */ + /** + * This is typed as an enum for consistency with {@code requirements.disabled_reason}. + * + *

One of {@code action_required.requested_capabilities}, {@code listed}, {@code other}, + * {@code platform_paused}, {@code rejected.fraud}, {@code rejected.incomplete_verification}, + * {@code rejected.listed}, {@code rejected.other}, {@code rejected.platform_fraud}, {@code + * rejected.platform_other}, {@code rejected.platform_terms_of_service}, {@code + * rejected.terms_of_service}, {@code requirements.past_due}, {@code + * requirements.pending_verification}, or {@code under_review}. + */ @SerializedName("disabled_reason") String disabledReason; @@ -2128,13 +2137,16 @@ public static class Requirements extends StripeObject { List currentlyDue; /** - * If the account is disabled, this string describes why. Learn more about handling - * verification issues. Can be {@code action_required.requested_capabilities}, {@code - * requirements.past_due}, {@code requirements.pending_verification}, {@code listed}, {@code - * platform_paused}, {@code rejected.fraud}, {@code rejected.incomplete_verification}, {@code - * rejected.listed}, {@code rejected.other}, {@code rejected.terms_of_service}, {@code - * under_review}, or {@code other}. + * verification issues. + * + *

One of {@code action_required.requested_capabilities}, {@code listed}, {@code other}, + * {@code platform_paused}, {@code rejected.fraud}, {@code rejected.incomplete_verification}, + * {@code rejected.listed}, {@code rejected.other}, {@code rejected.platform_fraud}, {@code + * rejected.platform_other}, {@code rejected.platform_terms_of_service}, {@code + * rejected.terms_of_service}, {@code requirements.past_due}, {@code + * requirements.pending_verification}, or {@code under_review}. */ @SerializedName("disabled_reason") String disabledReason; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 3b04c751c3d..95f47a4bd4e 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1696,7 +1696,8 @@ public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -1803,7 +1804,8 @@ public static class Card extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; @@ -2259,7 +2261,8 @@ public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -2371,7 +2374,8 @@ public static class CardPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; @@ -2878,7 +2882,8 @@ public static class InteracPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index 1480b899a9d..0abf7f14cf1 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -632,7 +632,8 @@ public static class Boleto extends StripeObject { public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -829,7 +830,8 @@ public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or + * {@code unknown}. */ @SerializedName("brand") String brand; @@ -942,8 +944,8 @@ public static class CardPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * interac}, {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code - * unknown}. + * interac}, {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code + * visa}, or {@code unknown}. */ @SerializedName("network") String network; @@ -1299,7 +1301,8 @@ public static class VisaCheckout extends StripeObject { public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index 790d5a5a542..e8c6c92ebd8 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -1113,7 +1113,8 @@ public static class AmazonPay extends StripeObject { public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index 1c3db39375f..fb5d67e8963 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -163,19 +163,20 @@ public class Event extends ApiResource implements HasId { * {@code invoice.created}, {@code invoice.deleted}, {@code invoice.finalization_failed}, {@code * invoice.finalized}, {@code invoice.marked_uncollectible}, {@code invoice.overdue}, {@code * invoice.paid}, {@code invoice.payment.overpaid}, {@code invoice.payment_action_required}, - * {@code invoice.payment_failed}, {@code invoice.payment_succeeded}, {@code invoice.sent}, {@code - * invoice.upcoming}, {@code invoice.updated}, {@code invoice.voided}, {@code - * invoice.will_be_due}, {@code invoiceitem.created}, {@code invoiceitem.deleted}, {@code - * issuing_authorization.created}, {@code issuing_authorization.request}, {@code - * issuing_authorization.updated}, {@code issuing_card.created}, {@code issuing_card.updated}, - * {@code issuing_cardholder.created}, {@code issuing_cardholder.updated}, {@code - * issuing_dispute.closed}, {@code issuing_dispute.created}, {@code - * issuing_dispute.funds_reinstated}, {@code issuing_dispute.funds_rescinded}, {@code + * {@code invoice.payment_attempt_required}, {@code invoice.payment_failed}, {@code + * invoice.payment_succeeded}, {@code invoice.sent}, {@code invoice.upcoming}, {@code + * invoice.updated}, {@code invoice.voided}, {@code invoice.will_be_due}, {@code + * invoiceitem.created}, {@code invoiceitem.deleted}, {@code issuing_authorization.created}, + * {@code issuing_authorization.request}, {@code issuing_authorization.updated}, {@code + * issuing_card.created}, {@code issuing_card.updated}, {@code issuing_cardholder.created}, {@code + * issuing_cardholder.updated}, {@code issuing_dispute.closed}, {@code issuing_dispute.created}, + * {@code issuing_dispute.funds_reinstated}, {@code issuing_dispute.funds_rescinded}, {@code * issuing_dispute.submitted}, {@code issuing_dispute.updated}, {@code * issuing_dispute_settlement_detail.created}, {@code issuing_dispute_settlement_detail.updated}, - * {@code issuing_personalization_design.activated}, {@code - * issuing_personalization_design.deactivated}, {@code issuing_personalization_design.rejected}, - * {@code issuing_personalization_design.updated}, {@code issuing_settlement.created}, {@code + * {@code issuing_fraud_liability_debit.created}, {@code + * issuing_personalization_design.activated}, {@code issuing_personalization_design.deactivated}, + * {@code issuing_personalization_design.rejected}, {@code + * issuing_personalization_design.updated}, {@code issuing_settlement.created}, {@code * issuing_settlement.updated}, {@code issuing_token.created}, {@code issuing_token.updated}, * {@code issuing_transaction.created}, {@code * issuing_transaction.purchase_details_receipt_updated}, {@code issuing_transaction.updated}, diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 8408b7f7258..b273c4ab8a1 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -57,11 +57,13 @@ public final class EventDataClassLookup { classLookup.put("mandate", Mandate.class); classLookup.put("margin", Margin.class); classLookup.put("order", Order.class); + classLookup.put("payment_attempt_record", PaymentAttemptRecord.class); classLookup.put("payment_intent", PaymentIntent.class); classLookup.put("payment_link", PaymentLink.class); classLookup.put("payment_method", PaymentMethod.class); classLookup.put("payment_method_configuration", PaymentMethodConfiguration.class); classLookup.put("payment_method_domain", PaymentMethodDomain.class); + classLookup.put("payment_record", PaymentRecord.class); classLookup.put("payout", Payout.class); classLookup.put("person", Person.class); classLookup.put("plan", Plan.class); @@ -177,6 +179,8 @@ public final class EventDataClassLookup { classLookup.put( "issuing.dispute_settlement_detail", com.stripe.model.issuing.DisputeSettlementDetail.class); + classLookup.put( + "issuing.fraud_liability_debit", com.stripe.model.issuing.FraudLiabilityDebit.class); classLookup.put( "issuing.personalization_design", com.stripe.model.issuing.PersonalizationDesign.class); classLookup.put("issuing.physical_bundle", com.stripe.model.issuing.PhysicalBundle.class); diff --git a/src/main/java/com/stripe/model/FundingInstructions.java b/src/main/java/com/stripe/model/FundingInstructions.java index 67ab75417e5..17db7de5395 100644 --- a/src/main/java/com/stripe/model/FundingInstructions.java +++ b/src/main/java/com/stripe/model/FundingInstructions.java @@ -124,10 +124,24 @@ public static class FinancialAddress extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Aba extends StripeObject { + @SerializedName("account_holder_address") + Address accountHolderAddress; + + /** The account holder name. */ + @SerializedName("account_holder_name") + String accountHolderName; + /** The ABA account number. */ @SerializedName("account_number") String accountNumber; + /** The account type. */ + @SerializedName("account_type") + String accountType; + + @SerializedName("bank_address") + Address bankAddress; + /** The bank name. */ @SerializedName("bank_name") String bankName; @@ -203,10 +217,24 @@ public static class Spei extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Swift extends StripeObject { + @SerializedName("account_holder_address") + Address accountHolderAddress; + + /** The account holder name. */ + @SerializedName("account_holder_name") + String accountHolderName; + /** The account number. */ @SerializedName("account_number") String accountNumber; + /** The account type. */ + @SerializedName("account_type") + String accountType; + + @SerializedName("bank_address") + Address bankAddress; + /** The bank name. */ @SerializedName("bank_name") String bankName; diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 59f2cddd01f..df33d46c724 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -102,6 +102,13 @@ public class Invoice extends ApiResource implements HasId, MetadataStore charge; - @SerializedName("out_of_band_payment") - OutOfBandPayment outOfBandPayment; - /** * ID of the PaymentIntent associated with this payment when {@code type} is {@code * payment_intent}. Note: This property is only populated for invoices finalized on or after @@ -135,10 +131,20 @@ public static class Payment extends StripeObject { @Setter(lombok.AccessLevel.NONE) ExpandableField paymentIntent; + /** + * ID of the PaymentRecord associated with this payment when {@code type} is {@code + * payment_record}. + */ + @SerializedName("payment_record") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentRecord; + /** * Type of payment object associated with this invoice payment. * - *

One of {@code charge}, {@code out_of_band_payment}, or {@code payment_intent}. + *

One of {@code charge}, {@code out_of_band_payment}, {@code payment_intent}, or {@code + * payment_record}. */ @SerializedName("type") String type; @@ -180,45 +186,23 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } - /** - * For more details about OutOfBandPayment, please refer to the API Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class OutOfBandPayment extends StripeObject { - /** Amount paid on this out of band payment, in cents (or local equivalent). */ - @SerializedName("amount") - Long amount; - - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * 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. - */ - @SerializedName("metadata") - Map metadata; - - /** The type of money movement for this out of band payment record. */ - @SerializedName("money_movement_type") - String moneyMovementType; - - /** The timestamp when this out of band payment was paid. */ - @SerializedName("paid_at") - Long paidAt; - - /** The reference for this out of band payment record. */ - @SerializedName("payment_reference") - String paymentReference; + /** Get ID of expandable {@code paymentRecord} object. */ + public String getPaymentRecord() { + return (this.paymentRecord != null) ? this.paymentRecord.getId() : null; + } + + public void setPaymentRecord(String id) { + this.paymentRecord = ApiResource.setExpandableFieldId(id, this.paymentRecord); + } + + /** Get expanded {@code paymentRecord}. */ + public PaymentRecord getPaymentRecordObject() { + return (this.paymentRecord != null) ? this.paymentRecord.getExpanded() : null; + } + + public void setPaymentRecordObject(PaymentRecord expandableObject) { + this.paymentRecord = + new ExpandableField(expandableObject.getId(), expandableObject); } } diff --git a/src/main/java/com/stripe/model/Order.java b/src/main/java/com/stripe/model/Order.java index 15651e4ef8a..593b0dfcc43 100644 --- a/src/main/java/com/stripe/model/Order.java +++ b/src/main/java/com/stripe/model/Order.java @@ -1923,14 +1923,14 @@ public static class TaxId extends StripeObject { * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, - * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code - * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or - * {@code unknown}. + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, + * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code + * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, + * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code + * ph_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, + * {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code + * ma_vat}, {@code by_tin}, or {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java new file mode 100644 index 00000000000..391fac0ce7d --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -0,0 +1,457 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.PaymentAttemptRecordListParams; +import com.stripe.param.PaymentAttemptRecordRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * A Payment Attempt Record represents an individual attempt at making a payment, on or off Stripe. + * Each payment attempt tries to collect a fixed amount of money from a fixed customer and payment + * method. Payment Attempt Records are attached to Payment Records. Only one attempt per Payment + * Record can have guaranteed funds. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentAttemptRecord extends ApiResource implements HasId { + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_canceled") + AmountCanceled amountCanceled; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_failed") + AmountFailed amountFailed; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_guaranteed") + AmountGuaranteed amountGuaranteed; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_requested") + AmountRequested amountRequested; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** Customer information for this payment. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** + * Indicates whether the customer was present in your checkout flow during this payment. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("customer_presence") + String customerPresence; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String description; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * 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. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code payment_attempt_record}. + */ + @SerializedName("object") + String object; + + /** Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** ID of the Payment Record this Payment Attempt Record belongs to. */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * An opaque string for manual reconciliation of this payment, for example a check number or a + * payment processor ID. + */ + @SerializedName("payment_reference") + String paymentReference; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list( + Map params, RequestOptions options) throws StripeException { + String path = "/v1/payment_attempt_records"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecordCollection.class); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list(PaymentAttemptRecordListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list( + PaymentAttemptRecordListParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_attempt_records"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecordCollection.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); + } + + /** Retrieves a Payment Attempt Record with the given ID. */ + public static PaymentAttemptRecord retrieve(String id, RequestOptions options) + throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieves a Payment Attempt Record with the given ID. */ + public static PaymentAttemptRecord retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Retrieves a Payment Attempt Record with the given ID. */ + public static PaymentAttemptRecord retrieve( + String id, PaymentAttemptRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountCanceled extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountFailed extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountGuaranteed extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountRequested extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** Information about the customer for this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails extends StripeObject { + /** ID of the Stripe Customer associated with this payment. */ + @SerializedName("customer") + String customer; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** The customer's name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + } + + /** Details about the Payment Method used in this payment attempt. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails extends StripeObject { + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** Information about the custom (user-defined) payment method used to make this payment. */ + @SerializedName("custom") + Custom custom; + + /** ID of the Stripe PaymentMethod used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + /** + * The type of Payment Method used for this payment attempt. + * + *

Equal to {@code custom}. + */ + @SerializedName("type") + String type; + + /** Billing details used by the customer for this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails extends StripeObject { + /** A representation of a physical address. */ + @SerializedName("address") + Address address; + + /** The billing email associated with the method of payment. */ + @SerializedName("email") + String email; + + /** The billing name associated with the method of payment. */ + @SerializedName("name") + String name; + + /** The billing phone number associated with the method of payment. */ + @SerializedName("phone") + String phone; + + /** A representation of a physical address. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + } + } + + /** + * Custom Payment Methods represent Payment Method types not modeled directly in the Stripe API. + * This resource consists of details about the custom payment method used for this payment + * attempt. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** + * Display name for the custom (user-defined) payment method type used to make this payment. + */ + @SerializedName("display_name") + String displayName; + + /** The custom payment method type associated with this payment. */ + @SerializedName("type") + String type; + } + } + + /** The customer's shipping information associated with this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails extends StripeObject { + /** A representation of a physical address. */ + @SerializedName("address") + Address address; + + /** The shipping recipient's name. */ + @SerializedName("name") + String name; + + /** The shipping recipient's phone number. */ + @SerializedName("phone") + String phone; + + /** A representation of a physical address. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(amountCanceled, responseGetter); + trySetResponseGetter(amountFailed, responseGetter); + trySetResponseGetter(amountGuaranteed, responseGetter); + trySetResponseGetter(amountRequested, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(paymentMethodDetails, responseGetter); + trySetResponseGetter(shippingDetails, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecordCollection.java b/src/main/java/com/stripe/model/PaymentAttemptRecordCollection.java new file mode 100644 index 00000000000..4ed311a29ca --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentAttemptRecordCollection.java @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +public class PaymentAttemptRecordCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 2d228b0a2cd..315753b3797 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -259,7 +259,11 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore

paymentMethod; - /** Information about the payment method configuration used for this PaymentIntent. */ + /** + * Information about the payment method + * configuration used for this PaymentIntent. + */ @SerializedName("payment_method_configuration_details") PaymentMethodConfigurationDetails paymentMethodConfigurationDetails; @@ -2031,10 +2035,24 @@ public static class FinancialAddress extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Aba extends StripeObject { + @SerializedName("account_holder_address") + com.stripe.model.Address accountHolderAddress; + + /** The account holder name. */ + @SerializedName("account_holder_name") + String accountHolderName; + /** The ABA account number. */ @SerializedName("account_number") String accountNumber; + /** The account type. */ + @SerializedName("account_type") + String accountType; + + @SerializedName("bank_address") + com.stripe.model.Address bankAddress; + /** The bank name. */ @SerializedName("bank_name") String bankName; @@ -2110,10 +2128,24 @@ public static class Spei extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Swift extends StripeObject { + @SerializedName("account_holder_address") + com.stripe.model.Address accountHolderAddress; + + /** The account holder name. */ + @SerializedName("account_holder_name") + String accountHolderName; + /** The account number. */ @SerializedName("account_number") String accountNumber; + /** The account type. */ + @SerializedName("account_type") + String accountType; + + @SerializedName("bank_address") + com.stripe.model.Address bankAddress; + /** The bank name. */ @SerializedName("bank_name") String bankName; diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 4782c3741da..90a963225f8 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -866,7 +866,7 @@ public static class Boleto extends StripeObject { public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. */ @SerializedName("brand") String brand; @@ -1062,7 +1062,8 @@ public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or + * {@code unknown}. */ @SerializedName("brand") String brand; @@ -1174,8 +1175,8 @@ public static class CardPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * interac}, {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code - * unknown}. + * interac}, {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code + * visa}, or {@code unknown}. */ @SerializedName("network") String network; @@ -1526,7 +1527,7 @@ public static class VisaCheckout extends StripeObject { public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. */ @SerializedName("brand") String brand; diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java new file mode 100644 index 00000000000..da2ac2f2011 --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -0,0 +1,692 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.PaymentRecordReportPaymentAttemptCanceledParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptFailedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptGuaranteedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptParams; +import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * A Payment Record is a resource that allows you to represent payments that occur on- or + * off-Stripe. For example, you can create a Payment Record to model a payment made on a different + * payment processor, in order to mark an Invoice as paid and a Subscription as active. Payment + * Records consist of one or more Payment Attempt Records, which represent individual attempts made + * on a payment network. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentRecord extends ApiResource implements HasId { + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_canceled") + AmountCanceled amountCanceled; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_failed") + AmountFailed amountFailed; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_guaranteed") + AmountGuaranteed amountGuaranteed; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_refunded") + AmountRefunded amountRefunded; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_requested") + AmountRequested amountRequested; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** Customer information for this payment. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** + * Indicates whether the customer was present in your checkout flow during this payment. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("customer_presence") + String customerPresence; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String description; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** ID of the latest Payment Attempt Record attached to this Payment Record. */ + @SerializedName("latest_payment_attempt_record") + String latestPaymentAttemptRecord; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * 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. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code payment_record}. + */ + @SerializedName("object") + String object; + + /** Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** + * An opaque string for manual reconciliation of this payment, for example a check number or a + * payment processor ID. + */ + @SerializedName("payment_reference") + String paymentReference; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment(Map params) throws StripeException { + return reportPayment(params, (RequestOptions) null); + } + + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/payment_records/report_payment"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment(PaymentRecordReportPaymentParams params) + throws StripeException { + return reportPayment(params, (RequestOptions) null); + } + + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment( + PaymentRecordReportPaymentParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_records/report_payment"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt(Map params) throws StripeException { + return reportPaymentAttempt(params, (RequestOptions) null); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt(PaymentRecordReportPaymentAttemptParams params) + throws StripeException { + return reportPaymentAttempt(params, (RequestOptions) null); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt( + PaymentRecordReportPaymentAttemptParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt", 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, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled(Map params) + throws StripeException { + return reportPaymentAttemptCanceled(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_canceled", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + PaymentRecordReportPaymentAttemptCanceledParams params) throws StripeException { + return reportPaymentAttemptCanceled(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + PaymentRecordReportPaymentAttemptCanceledParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_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, PaymentRecord.class); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed(Map params) + throws StripeException { + return reportPaymentAttemptFailed(params, (RequestOptions) null); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_failed", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + PaymentRecordReportPaymentAttemptFailedParams params) throws StripeException { + return reportPaymentAttemptFailed(params, (RequestOptions) null); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + PaymentRecordReportPaymentAttemptFailedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_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, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed(Map params) + throws StripeException { + return reportPaymentAttemptGuaranteed(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_guaranteed", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + PaymentRecordReportPaymentAttemptGuaranteedParams params) throws StripeException { + return reportPaymentAttemptGuaranteed(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + PaymentRecordReportPaymentAttemptGuaranteedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_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, PaymentRecord.class); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/payment_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve( + String id, PaymentRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_records/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountCanceled extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountFailed extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountGuaranteed extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountRefunded extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountRequested extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** Information about the customer for this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails extends StripeObject { + /** ID of the Stripe Customer associated with this payment. */ + @SerializedName("customer") + String customer; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** The customer's name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + } + + /** Details about the Payment Method used in this payment attempt. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails extends StripeObject { + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** Information about the custom (user-defined) payment method used to make this payment. */ + @SerializedName("custom") + Custom custom; + + /** ID of the Stripe PaymentMethod used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + /** + * The type of Payment Method used for this payment attempt. + * + *

Equal to {@code custom}. + */ + @SerializedName("type") + String type; + + /** Billing details used by the customer for this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails extends StripeObject { + /** A representation of a physical address. */ + @SerializedName("address") + Address address; + + /** The billing email associated with the method of payment. */ + @SerializedName("email") + String email; + + /** The billing name associated with the method of payment. */ + @SerializedName("name") + String name; + + /** The billing phone number associated with the method of payment. */ + @SerializedName("phone") + String phone; + + /** A representation of a physical address. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + } + } + + /** + * Custom Payment Methods represent Payment Method types not modeled directly in the Stripe API. + * This resource consists of details about the custom payment method used for this payment + * attempt. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** + * Display name for the custom (user-defined) payment method type used to make this payment. + */ + @SerializedName("display_name") + String displayName; + + /** The custom payment method type associated with this payment. */ + @SerializedName("type") + String type; + } + } + + /** The customer's shipping information associated with this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails extends StripeObject { + /** A representation of a physical address. */ + @SerializedName("address") + Address address; + + /** The shipping recipient's name. */ + @SerializedName("name") + String name; + + /** The shipping recipient's phone number. */ + @SerializedName("phone") + String phone; + + /** A representation of a physical address. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(amountCanceled, responseGetter); + trySetResponseGetter(amountFailed, responseGetter); + trySetResponseGetter(amountGuaranteed, responseGetter); + trySetResponseGetter(amountRefunded, responseGetter); + trySetResponseGetter(amountRequested, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(paymentMethodDetails, responseGetter); + trySetResponseGetter(shippingDetails, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/QuotePreviewInvoice.java b/src/main/java/com/stripe/model/QuotePreviewInvoice.java index 910deee65c5..069e25fd64e 100644 --- a/src/main/java/com/stripe/model/QuotePreviewInvoice.java +++ b/src/main/java/com/stripe/model/QuotePreviewInvoice.java @@ -85,6 +85,13 @@ public class QuotePreviewInvoice extends ApiResource implements HasId { @SerializedName("amount_due") Long amountDue; + /** + * Amount that was overpaid on the invoice. Overpayments are debited to the customer's credit + * balance. + */ + @SerializedName("amount_overpaid") + Long amountOverpaid; + /** The amount, in cents (or local equivalent), that was paid. */ @SerializedName("amount_paid") Long amountPaid; @@ -1125,14 +1132,15 @@ public static class CustomerTaxId extends StripeObject { * {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst}, {@code * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code tw_vat}, - * {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code my_itn}, - * {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code - * ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code - * cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, - * {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code - * ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, {@code kz_bin}, - * {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code tz_vat}, {@code - * uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or {@code unknown}. + * {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code li_vat}, + * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code + * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code + * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, + * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code + * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, + * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code + * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or + * {@code unknown}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index 253acfb9e02..b311cc8ee8f 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -491,7 +491,8 @@ public static class Boleto extends StripeObject {} public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -562,7 +563,8 @@ public static class Card extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index 93e790078b1..c64243283f1 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -193,7 +193,11 @@ public class SetupIntent extends ApiResource implements HasId, MetadataStore paymentMethod; - /** Information about the payment method configuration used for this Setup Intent. */ + /** + * Information about the payment method + * configuration used for this Setup Intent. + */ @SerializedName("payment_method_configuration_details") PaymentMethodConfigurationDetails paymentMethodConfigurationDetails; diff --git a/src/main/java/com/stripe/model/TaxId.java b/src/main/java/com/stripe/model/TaxId.java index 8ae108c649a..d53166ff8c7 100644 --- a/src/main/java/com/stripe/model/TaxId.java +++ b/src/main/java/com/stripe/model/TaxId.java @@ -81,13 +81,13 @@ public class TaxId extends ApiResource implements HasId { * {@code eg_tin}, {@code es_cif}, {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code * ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code * in_gst}, {@code is_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code - * kr_brn}, {@code kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code - * my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, - * {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, - * {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, - * {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, - * or {@code za_vat}. Note that some legacy tax IDs have type {@code unknown} + * kr_brn}, {@code kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code + * mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, + * {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, + * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, + * {@code vn_tin}, or {@code za_vat}. Note that some legacy tax IDs have type {@code unknown} */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/TaxRate.java b/src/main/java/com/stripe/model/TaxRate.java index 2e2f6797c35..84195dd5852 100644 --- a/src/main/java/com/stripe/model/TaxRate.java +++ b/src/main/java/com/stripe/model/TaxRate.java @@ -160,7 +160,7 @@ public class TaxRate extends ApiResource implements HasId, MetadataStoreOne of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, {@code * igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code retail_delivery_fee}, - * {@code rst}, {@code sales_tax}, or {@code vat}. + * {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/billing/CreditGrant.java b/src/main/java/com/stripe/model/billing/CreditGrant.java index 64563a07182..091662a63a4 100644 --- a/src/main/java/com/stripe/model/billing/CreditGrant.java +++ b/src/main/java/com/stripe/model/billing/CreditGrant.java @@ -32,7 +32,7 @@ * *

Related guide: Billing - * credits end + * credits */ @Getter @Setter @@ -45,8 +45,8 @@ public class CreditGrant extends ApiResource implements HasId, MetadataStoreOne of {@code paid}, or {@code promotional}. */ @@ -57,20 +57,17 @@ public class CreditGrant extends ApiResource implements HasId, MetadataStore customer; - /** The time when the billing credits become effective i.e when they are eligible to be used. */ + /** The time when the billing credits become effective—when they're eligible for use. */ @SerializedName("effective_at") Long effectiveAt; - /** - * The time when the billing credits will expire. If not present, the billing credits will never - * expire. - */ + /** The time when the billing credits expire. If not present, the billing credits don't expire. */ @SerializedName("expires_at") Long expiresAt; @@ -454,7 +451,7 @@ public static class ApplicabilityConfig extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Scope extends StripeObject { /** - * The price type to which credit grants can apply to. We currently only support {@code + * The price type for which credit grants can apply. We currently only support the {@code * metered} price type. This refers to prices that have a Billing Meter attached to them. * diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 8ad2831402f..ef7e8148ef3 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -58,6 +58,13 @@ @Setter @EqualsAndHashCode(callSuper = false) public class Session extends ApiResource implements HasId, MetadataStore { + /** + * Settings for price localization with Adaptive Pricing. + */ + @SerializedName("adaptive_pricing") + AdaptivePricing adaptivePricing; + /** When set, provides configuration for actions to take if this Checkout Session expires. */ @SerializedName("after_expiration") AfterExpiration afterExpiration; @@ -814,6 +821,19 @@ public Session update(SessionUpdateParams params, RequestOptions options) throws return getResponseGetter().request(request, Session.class); } + /** + * For more details about AdaptivePricing, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AdaptivePricing extends StripeObject { + /** Whether Adaptive Pricing is enabled. */ + @SerializedName("enabled") + Boolean enabled; + } + /** * For more details about AfterExpiration, please refer to the API Reference. @@ -977,14 +997,14 @@ public static class TaxId extends StripeObject { * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, - * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code - * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or - * {@code unknown}. + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, + * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code + * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, + * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code + * ph_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, + * {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code + * ma_vat}, {@code by_tin}, or {@code unknown}. */ @SerializedName("type") String type; @@ -1402,14 +1422,14 @@ public static class TaxId extends StripeObject { * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, - * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code - * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or - * {@code unknown}. + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, + * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code + * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, + * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code + * ph_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, + * {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code + * ma_vat}, {@code by_tin}, or {@code unknown}. */ @SerializedName("type") String type; @@ -2005,6 +2025,9 @@ public static class AuBecsDebit extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class BacsDebit extends StripeObject { + @SerializedName("mandate_options") + MandateOptions mandateOptions; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -2028,6 +2051,15 @@ public static class BacsDebit extends StripeObject { */ @SerializedName("setup_future_usage") String setupFutureUsage; + + /** + * For more details about MandateOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject {} } /** @@ -2115,6 +2147,52 @@ public static class Card extends StripeObject { @SerializedName("installments") Installments installments; + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_decremental_authorization") + String requestDecrementalAuthorization; + + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_extended_authorization") + String requestExtendedAuthorization; + + /** + * Request ability to increment the + * authorization for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_incremental_authorization") + String requestIncrementalAuthorization; + + /** + * Request ability to make multiple + * captures for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_multicapture") + String requestMulticapture; + + /** + * Request ability to overcapture for + * this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_overcapture") + String requestOvercapture; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MandateOptions extends StripeObject {} } /** @@ -3669,6 +3759,7 @@ public static class Tax extends StripeObject { @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); + trySetResponseGetter(adaptivePricing, responseGetter); trySetResponseGetter(afterExpiration, responseGetter); trySetResponseGetter(automaticTax, responseGetter); trySetResponseGetter(collectedInformation, responseGetter); diff --git a/src/main/java/com/stripe/model/identity/VerificationReport.java b/src/main/java/com/stripe/model/identity/VerificationReport.java index ebc14e94857..ee0fef5d21a 100644 --- a/src/main/java/com/stripe/model/identity/VerificationReport.java +++ b/src/main/java/com/stripe/model/identity/VerificationReport.java @@ -102,7 +102,7 @@ public class VerificationReport extends ApiResource implements HasId { @SerializedName("type") String type; - /** The configuration token of a Verification Flow from the dashboard. */ + /** The configuration token of a verification flow from the dashboard. */ @SerializedName("verification_flow") String verificationFlow; diff --git a/src/main/java/com/stripe/model/identity/VerificationSession.java b/src/main/java/com/stripe/model/identity/VerificationSession.java index 54c1da3c2d7..cd26557bff8 100644 --- a/src/main/java/com/stripe/model/identity/VerificationSession.java +++ b/src/main/java/com/stripe/model/identity/VerificationSession.java @@ -162,7 +162,7 @@ public class VerificationSession extends ApiResource @SerializedName("url") String url; - /** The configuration token of a Verification Flow from the dashboard. */ + /** The configuration token of a verification flow from the dashboard. */ @SerializedName("verification_flow") String verificationFlow; diff --git a/src/main/java/com/stripe/model/issuing/Authorization.java b/src/main/java/com/stripe/model/issuing/Authorization.java index 8c9da51055c..5a707bd60b1 100644 --- a/src/main/java/com/stripe/model/issuing/Authorization.java +++ b/src/main/java/com/stripe/model/issuing/Authorization.java @@ -80,8 +80,8 @@ public class Authorization extends ApiResource List balanceTransactions; /** - * You can create physical or virtual cards - * that are issued to cardholders. + * You can create physical or virtual cards that are + * issued to cardholders. */ @SerializedName("card") Card card; diff --git a/src/main/java/com/stripe/model/issuing/Card.java b/src/main/java/com/stripe/model/issuing/Card.java index 1a0a8afac24..aa88a7c6149 100644 --- a/src/main/java/com/stripe/model/issuing/Card.java +++ b/src/main/java/com/stripe/model/issuing/Card.java @@ -30,8 +30,8 @@ import lombok.Setter; /** - * You can create physical or virtual cards that - * are issued to cardholders. + * You can create physical or virtual cards that are + * issued to cardholders. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/issuing/FraudLiabilityDebit.java b/src/main/java/com/stripe/model/issuing/FraudLiabilityDebit.java new file mode 100644 index 00000000000..c2c7b7faa3d --- /dev/null +++ b/src/main/java/com/stripe/model/issuing/FraudLiabilityDebit.java @@ -0,0 +1,195 @@ +// File generated from our OpenAPI spec +package com.stripe.model.issuing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.BalanceTransaction; +import com.stripe.model.ExpandableField; +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.net.StripeResponseGetter; +import com.stripe.param.issuing.FraudLiabilityDebitListParams; +import com.stripe.param.issuing.FraudLiabilityDebitRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * A fraud liability debit occurs when Stripe debits a platform's account for fraud losses on + * Issuing transactions. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class FraudLiabilityDebit extends ApiResource implements HasId { + /** + * Debited amount. This is equal to the disputed amount and is given in the card’s currency and in + * the smallest currency unit. + */ + @SerializedName("amount") + Long amount; + + /** + * ID of the balance transaction + * associated with this debit. + */ + @SerializedName("balance_transaction") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField balanceTransaction; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** + * The currency of the debit. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** The ID of the linked dispute. */ + @SerializedName("dispute") + String dispute; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code issuing.fraud_liability_debit}. + */ + @SerializedName("object") + String object; + + /** Get ID of expandable {@code balanceTransaction} object. */ + public String getBalanceTransaction() { + return (this.balanceTransaction != null) ? this.balanceTransaction.getId() : null; + } + + public void setBalanceTransaction(String id) { + this.balanceTransaction = ApiResource.setExpandableFieldId(id, this.balanceTransaction); + } + + /** Get expanded {@code balanceTransaction}. */ + public BalanceTransaction getBalanceTransactionObject() { + return (this.balanceTransaction != null) ? this.balanceTransaction.getExpanded() : null; + } + + public void setBalanceTransactionObject(BalanceTransaction expandableObject) { + this.balanceTransaction = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static FraudLiabilityDebitCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static FraudLiabilityDebitCollection list( + Map params, RequestOptions options) throws StripeException { + String path = "/v1/issuing/fraud_liability_debits"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, FraudLiabilityDebitCollection.class); + } + + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static FraudLiabilityDebitCollection list(FraudLiabilityDebitListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public static FraudLiabilityDebitCollection list( + FraudLiabilityDebitListParams params, RequestOptions options) throws StripeException { + String path = "/v1/issuing/fraud_liability_debits"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, FraudLiabilityDebitCollection.class); + } + + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public static FraudLiabilityDebit retrieve(String fraudLiabilityDebit) throws StripeException { + return retrieve(fraudLiabilityDebit, (Map) null, (RequestOptions) null); + } + + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public static FraudLiabilityDebit retrieve(String fraudLiabilityDebit, RequestOptions options) + throws StripeException { + return retrieve(fraudLiabilityDebit, (Map) null, options); + } + + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public static FraudLiabilityDebit retrieve( + String fraudLiabilityDebit, Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/issuing/fraud_liability_debits/%s", ApiResource.urlEncodeId(fraudLiabilityDebit)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, FraudLiabilityDebit.class); + } + + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public static FraudLiabilityDebit retrieve( + String fraudLiabilityDebit, FraudLiabilityDebitRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/issuing/fraud_liability_debits/%s", ApiResource.urlEncodeId(fraudLiabilityDebit)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, FraudLiabilityDebit.class); + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(balanceTransaction, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/issuing/FraudLiabilityDebitCollection.java b/src/main/java/com/stripe/model/issuing/FraudLiabilityDebitCollection.java new file mode 100644 index 00000000000..fda067f9496 --- /dev/null +++ b/src/main/java/com/stripe/model/issuing/FraudLiabilityDebitCollection.java @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec +package com.stripe.model.issuing; + +import com.stripe.model.StripeCollection; + +public class FraudLiabilityDebitCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/tax/Calculation.java b/src/main/java/com/stripe/model/tax/Calculation.java index 5fadc7b6d33..916eaf99ba6 100644 --- a/src/main/java/com/stripe/model/tax/Calculation.java +++ b/src/main/java/com/stripe/model/tax/Calculation.java @@ -327,14 +327,14 @@ public static class TaxId extends StripeObject { * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, - * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code - * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or - * {@code unknown}. + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, + * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code + * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, + * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code + * ph_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, + * {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code + * ma_vat}, {@code by_tin}, or {@code unknown}. */ @SerializedName("type") String type; @@ -562,7 +562,8 @@ public static class TaxRateDetails extends StripeObject { * *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code + * vat}. */ @SerializedName("tax_type") String taxType; @@ -658,7 +659,7 @@ public static class TaxRateDetails extends StripeObject { * *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/CalculationLineItem.java b/src/main/java/com/stripe/model/tax/CalculationLineItem.java index 0d231fcacab..041f16d431a 100644 --- a/src/main/java/com/stripe/model/tax/CalculationLineItem.java +++ b/src/main/java/com/stripe/model/tax/CalculationLineItem.java @@ -199,7 +199,7 @@ public static class TaxRateDetails extends StripeObject { * *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index 3cf65286ee9..cbb0832d0c2 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -372,14 +372,14 @@ public static class TaxId extends StripeObject { * no_vat}, {@code no_voec}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, * {@code ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code * tw_vat}, {@code th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, - * {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code - * ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code - * ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, - * {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code - * si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, {@code bh_vat}, - * {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, {@code ch_uid}, {@code - * tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code ma_vat}, {@code by_tin}, or - * {@code unknown}. + * {@code li_vat}, {@code my_itn}, {@code us_ein}, {@code kr_brn}, {@code ca_qst}, {@code + * ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, + * {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code + * my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code is_vat}, {@code bg_uic}, + * {@code hu_tin}, {@code si_tin}, {@code ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code + * ph_tin}, {@code bh_vat}, {@code kz_bin}, {@code ng_tin}, {@code om_vat}, {@code de_stn}, + * {@code ch_uid}, {@code tz_vat}, {@code uz_vat}, {@code uz_tin}, {@code md_vat}, {@code + * ma_vat}, {@code by_tin}, or {@code unknown}. */ @SerializedName("type") String type; @@ -623,7 +623,8 @@ public static class TaxRateDetails extends StripeObject { * *

One of {@code amusement_tax}, {@code communications_tax}, {@code gst}, {@code hst}, * {@code igst}, {@code jct}, {@code lease_tax}, {@code pst}, {@code qst}, {@code - * retail_delivery_fee}, {@code rst}, {@code sales_tax}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code + * vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/net/LiveStripeResponseGetter.java b/src/main/java/com/stripe/net/LiveStripeResponseGetter.java index 91d9d8f4860..76b88830be3 100644 --- a/src/main/java/com/stripe/net/LiveStripeResponseGetter.java +++ b/src/main/java/com/stripe/net/LiveStripeResponseGetter.java @@ -6,7 +6,6 @@ import com.google.gson.JsonSyntaxException; import com.stripe.Stripe; import com.stripe.exception.*; -import com.stripe.exception.ApiKeyMissingException; import com.stripe.exception.oauth.InvalidClientException; import com.stripe.exception.oauth.InvalidGrantException; import com.stripe.exception.oauth.InvalidScopeException; @@ -288,22 +287,25 @@ private StripeError parseStripeError( } private void handleError(StripeResponse response, ApiMode apiMode) throws StripeException { - JsonObject responseBody = ApiResource.GSON.fromJson(response.body(), JsonObject.class); - - /* - OAuth errors are JSON objects where `error` is a string. In - contrast, in API errors, `error` is a hash with sub-keys. We use - this property to distinguish between OAuth and API errors. - */ - if (responseBody.has("error") && responseBody.get("error").isJsonPrimitive()) { - JsonPrimitive error = responseBody.getAsJsonPrimitive("error"); - if (error.isString()) { - handleOAuthError(response); + try { + /* + OAuth errors are JSON objects where `error` is a string. In + contrast, in API errors, `error` is a hash with sub-keys. We use + this property to distinguish between OAuth and API errors. + */ + JsonObject responseBody = ApiResource.GSON.fromJson(response.body(), JsonObject.class); + if (responseBody.has("error") && responseBody.get("error").isJsonPrimitive()) { + JsonPrimitive error = responseBody.getAsJsonPrimitive("error"); + if (error.isString()) { + handleOAuthError(response); + } + } else if (apiMode == ApiMode.V2) { + handleV2ApiError(response); + } else { + handleV1ApiError(response); } - } else if (apiMode == ApiMode.V2) { - handleV2ApiError(response); - } else { - handleV1ApiError(response); + } catch (JsonSyntaxException e) { + throw makeMalformedJsonError(response.body(), response.code(), response.requestId(), e); } } diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index c9a44d41c4d..55880118c46 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -2467,10 +2467,6 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether to allow money movement features. */ - @SerializedName("money_movement") - Boolean moneyMovement; - /** Whether to allow sending money. */ @SerializedName("send_money") Boolean sendMoney; @@ -2483,13 +2479,11 @@ private Features( Boolean disableStripeUserAuthentication, Boolean externalAccountCollection, Map extraParams, - Boolean moneyMovement, Boolean sendMoney, Boolean transferBalance) { this.disableStripeUserAuthentication = disableStripeUserAuthentication; this.externalAccountCollection = externalAccountCollection; this.extraParams = extraParams; - this.moneyMovement = moneyMovement; this.sendMoney = sendMoney; this.transferBalance = transferBalance; } @@ -2505,8 +2499,6 @@ public static class Builder { private Map extraParams; - private Boolean moneyMovement; - private Boolean sendMoney; private Boolean transferBalance; @@ -2517,7 +2509,6 @@ public AccountSessionCreateParams.Components.FinancialAccount.Features build() { this.disableStripeUserAuthentication, this.externalAccountCollection, this.extraParams, - this.moneyMovement, this.sendMoney, this.transferBalance); } @@ -2571,12 +2562,6 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether to allow money movement features. */ - public Builder setMoneyMovement(Boolean moneyMovement) { - this.moneyMovement = moneyMovement; - return this; - } - /** Whether to allow sending money. */ public Builder setSendMoney(Boolean sendMoney) { this.sendMoney = sendMoney; @@ -2607,6 +2592,7 @@ public static class FinancialAccountTransactions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** The list of features enabled in the embedded component. */ @SerializedName("features") Features features; @@ -2670,6 +2656,7 @@ public Builder putAllExtraParam(Map map) { return this; } + /** The list of features enabled in the embedded component. */ public Builder setFeatures( AccountSessionCreateParams.Components.FinancialAccountTransactions.Features features) { this.features = features; @@ -2839,6 +2826,18 @@ public Builder setFeatures( @Getter public static class Features { + /** Whether to allow card management features. */ + @SerializedName("card_management") + Boolean cardManagement; + + /** Whether to allow card spend dispute management features. */ + @SerializedName("card_spend_dispute_management") + Boolean cardSpendDisputeManagement; + + /** Whether to allow cardholder management features. */ + @SerializedName("cardholder_management") + Boolean cardholderManagement; + /** * 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. @@ -2849,8 +2848,21 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Features(Map extraParams) { + /** Whether to allow spend control management features. */ + @SerializedName("spend_control_management") + Boolean spendControlManagement; + + private Features( + Boolean cardManagement, + Boolean cardSpendDisputeManagement, + Boolean cardholderManagement, + Map extraParams, + Boolean spendControlManagement) { + this.cardManagement = cardManagement; + this.cardSpendDisputeManagement = cardSpendDisputeManagement; + this.cardholderManagement = cardholderManagement; this.extraParams = extraParams; + this.spendControlManagement = spendControlManagement; } public static Builder builder() { @@ -2858,11 +2870,42 @@ public static Builder builder() { } public static class Builder { + private Boolean cardManagement; + + private Boolean cardSpendDisputeManagement; + + private Boolean cardholderManagement; + private Map extraParams; + private Boolean spendControlManagement; + /** Finalize and obtain parameter instance from this builder. */ public AccountSessionCreateParams.Components.IssuingCard.Features build() { - return new AccountSessionCreateParams.Components.IssuingCard.Features(this.extraParams); + return new AccountSessionCreateParams.Components.IssuingCard.Features( + this.cardManagement, + this.cardSpendDisputeManagement, + this.cardholderManagement, + this.extraParams, + this.spendControlManagement); + } + + /** Whether to allow card management features. */ + public Builder setCardManagement(Boolean cardManagement) { + this.cardManagement = cardManagement; + return this; + } + + /** Whether to allow card spend dispute management features. */ + public Builder setCardSpendDisputeManagement(Boolean cardSpendDisputeManagement) { + this.cardSpendDisputeManagement = cardSpendDisputeManagement; + return this; + } + + /** Whether to allow cardholder management features. */ + public Builder setCardholderManagement(Boolean cardholderManagement) { + this.cardholderManagement = cardholderManagement; + return this; } /** @@ -2892,6 +2935,12 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** Whether to allow spend control management features. */ + public Builder setSpendControlManagement(Boolean spendControlManagement) { + this.spendControlManagement = spendControlManagement; + return this; + } } } } @@ -2995,6 +3044,14 @@ public static class Features { @SerializedName("cardholder_management") Boolean cardholderManagement; + /** + * Disables Stripe user authentication for this embedded component. This feature can only be + * false for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like custom accounts. + */ + @SerializedName("disable_stripe_user_authentication") + Boolean disableStripeUserAuthentication; + /** * 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. @@ -3013,11 +3070,13 @@ private Features( Boolean cardManagement, Boolean cardSpendDisputeManagement, Boolean cardholderManagement, + Boolean disableStripeUserAuthentication, Map extraParams, Boolean spendControlManagement) { this.cardManagement = cardManagement; this.cardSpendDisputeManagement = cardSpendDisputeManagement; this.cardholderManagement = cardholderManagement; + this.disableStripeUserAuthentication = disableStripeUserAuthentication; this.extraParams = extraParams; this.spendControlManagement = spendControlManagement; } @@ -3033,6 +3092,8 @@ public static class Builder { private Boolean cardholderManagement; + private Boolean disableStripeUserAuthentication; + private Map extraParams; private Boolean spendControlManagement; @@ -3043,6 +3104,7 @@ public AccountSessionCreateParams.Components.IssuingCardsList.Features build() { this.cardManagement, this.cardSpendDisputeManagement, this.cardholderManagement, + this.disableStripeUserAuthentication, this.extraParams, this.spendControlManagement); } @@ -3065,6 +3127,17 @@ public Builder setCardholderManagement(Boolean cardholderManagement) { return this; } + /** + * Disables Stripe user authentication for this embedded component. This feature can only + * be false for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like custom accounts. + */ + public Builder setDisableStripeUserAuthentication( + Boolean disableStripeUserAuthentication) { + this.disableStripeUserAuthentication = disableStripeUserAuthentication; + 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 diff --git a/src/main/java/com/stripe/param/CustomerCreateParams.java b/src/main/java/com/stripe/param/CustomerCreateParams.java index 7c6f21300d5..7f09c119bc9 100644 --- a/src/main/java/com/stripe/param/CustomerCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerCreateParams.java @@ -1689,13 +1689,13 @@ public static class TaxIdData { * eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, * {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, {@code jp_cn}, {@code * jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, - * {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code - * my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, {@code om_vat}, - * {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code - * ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sv_nit}, - * {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, or - * {@code za_vat} + * {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code + * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, + * {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code + * ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, + * {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, + * {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -1762,13 +1762,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(CustomerCreateParams.TaxIdData.Type type) { this.type = type; @@ -1921,6 +1921,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java b/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java index c96f11f9110..dbc72bfabe0 100644 --- a/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerTaxIdCreateParams.java @@ -33,13 +33,13 @@ public class CustomerTaxIdCreateParams extends ApiRequestParams { * do_rcn}, {@code ec_ruc}, {@code eg_tin}, {@code es_cif}, {@code eu_oss_vat}, {@code eu_vat}, * {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, {@code id_npwp}, * {@code il_vat}, {@code in_gst}, {@code is_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, - * {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, - * {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, - * {@code no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code - * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code - * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code - * tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, + * {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, + * {@code no_vat}, {@code no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code + * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code + * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code + * tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -136,13 +136,13 @@ public Builder putAllExtraParam(Map map) { * eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, * {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, {@code jp_cn}, {@code * jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, - * {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code - * my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, {@code om_vat}, - * {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code - * ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sv_nit}, - * {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, or - * {@code za_vat} + * {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code + * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, + * {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code + * ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, + * {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, + * {@code vn_tin}, or {@code za_vat} */ public Builder setType(CustomerTaxIdCreateParams.Type type) { this.type = type; @@ -295,6 +295,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java index a0b44f4bdab..df2056cb9eb 100644 --- a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java @@ -1982,6 +1982,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java b/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java index 88b0c71a46b..cf3b3ac4ca8 100644 --- a/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java +++ b/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java @@ -32,25 +32,31 @@ public class InvoiceAttachPaymentParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The out of band payment to attach to the invoice. */ - @SerializedName("out_of_band_payment") - OutOfBandPayment outOfBandPayment; - /** The ID of the PaymentIntent to attach to the invoice. */ @SerializedName("payment_intent") String paymentIntent; + /** The ID of the PaymentRecord to detach from the invoice. */ + @SerializedName("payment_record") + String paymentRecord; + + /** The PaymentRecord data for attaching an out of band payment to the invoice. */ + @SerializedName("payment_record_data") + PaymentRecordData paymentRecordData; + private InvoiceAttachPaymentParams( Long amountRequested, List expand, Map extraParams, - OutOfBandPayment outOfBandPayment, - String paymentIntent) { + String paymentIntent, + String paymentRecord, + PaymentRecordData paymentRecordData) { this.amountRequested = amountRequested; this.expand = expand; this.extraParams = extraParams; - this.outOfBandPayment = outOfBandPayment; this.paymentIntent = paymentIntent; + this.paymentRecord = paymentRecord; + this.paymentRecordData = paymentRecordData; } public static Builder builder() { @@ -64,18 +70,21 @@ public static class Builder { private Map extraParams; - private OutOfBandPayment outOfBandPayment; - private String paymentIntent; + private String paymentRecord; + + private PaymentRecordData paymentRecordData; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceAttachPaymentParams build() { return new InvoiceAttachPaymentParams( this.amountRequested, this.expand, this.extraParams, - this.outOfBandPayment, - this.paymentIntent); + this.paymentIntent, + this.paymentRecord, + this.paymentRecordData); } /** @@ -139,22 +148,28 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The out of band payment to attach to the invoice. */ - public Builder setOutOfBandPayment( - InvoiceAttachPaymentParams.OutOfBandPayment outOfBandPayment) { - this.outOfBandPayment = outOfBandPayment; - return this; - } - /** The ID of the PaymentIntent to attach to the invoice. */ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; } + + /** The ID of the PaymentRecord to detach from the invoice. */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** The PaymentRecord data for attaching an out of band payment to the invoice. */ + public Builder setPaymentRecordData( + InvoiceAttachPaymentParams.PaymentRecordData paymentRecordData) { + this.paymentRecordData = paymentRecordData; + return this; + } } @Getter - public static class OutOfBandPayment { + public static class PaymentRecordData { /** Required. The amount that was paid out of band. */ @SerializedName("amount") Long amount; @@ -195,7 +210,7 @@ public static class OutOfBandPayment { @SerializedName("payment_reference") String paymentReference; - private OutOfBandPayment( + private PaymentRecordData( Long amount, String currency, Map extraParams, @@ -232,8 +247,8 @@ public static class Builder { private String paymentReference; /** Finalize and obtain parameter instance from this builder. */ - public InvoiceAttachPaymentParams.OutOfBandPayment build() { - return new InvoiceAttachPaymentParams.OutOfBandPayment( + public InvoiceAttachPaymentParams.PaymentRecordData build() { + return new InvoiceAttachPaymentParams.PaymentRecordData( this.amount, this.currency, this.extraParams, @@ -258,7 +273,7 @@ public Builder setCurrency(String currency) { /** * 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 - * InvoiceAttachPaymentParams.OutOfBandPayment#extraParams} for the field documentation. + * InvoiceAttachPaymentParams.PaymentRecordData#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -271,7 +286,7 @@ public Builder putExtraParam(String key, Object value) { /** * 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 InvoiceAttachPaymentParams.OutOfBandPayment#extraParams} for the field + * See {@link InvoiceAttachPaymentParams.PaymentRecordData#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -285,7 +300,7 @@ public Builder putAllExtraParam(Map map) { /** * 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 - * InvoiceAttachPaymentParams.OutOfBandPayment#metadata} for the field documentation. + * InvoiceAttachPaymentParams.PaymentRecordData#metadata} for the field documentation. */ @SuppressWarnings("unchecked") public Builder putMetadata(String key, String value) { @@ -299,7 +314,7 @@ public Builder putMetadata(String key, String value) { /** * 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 InvoiceAttachPaymentParams.OutOfBandPayment#metadata} for the field + * See {@link InvoiceAttachPaymentParams.PaymentRecordData#metadata} for the field * documentation. */ @SuppressWarnings("unchecked") diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index 328cc7ff037..47f2ef78817 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -4159,6 +4159,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 90f88603620..dd5ecfb7151 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -1364,13 +1364,13 @@ public static class TaxId { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -1440,13 +1440,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(InvoiceCreatePreviewParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -1599,6 +1599,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java index 9dab5179833..96433b10712 100644 --- a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java @@ -1927,6 +1927,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingLinesListParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingLinesListParams.java index ca929767349..f06241927a4 100644 --- a/src/main/java/com/stripe/param/InvoiceUpcomingLinesListParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpcomingLinesListParams.java @@ -1878,13 +1878,13 @@ public static class TaxId { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -1954,13 +1954,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(InvoiceUpcomingLinesListParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -2113,6 +2113,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java index 1f0470c0d69..417d08b74b8 100644 --- a/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpcomingLinesParams.java @@ -1870,13 +1870,13 @@ public static class TaxId { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -1946,13 +1946,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(InvoiceUpcomingLinesParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -2105,6 +2105,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java index bc406e80a75..fc1a35e0679 100644 --- a/src/main/java/com/stripe/param/InvoiceUpcomingParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpcomingParams.java @@ -1792,13 +1792,13 @@ public static class TaxId { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -1868,13 +1868,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(InvoiceUpcomingParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -2027,6 +2027,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java index 7a02eb9a5e7..09624419acf 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java @@ -2009,6 +2009,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index 206ddcaef79..2528dcf0a99 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -4204,6 +4204,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/OrderCreateParams.java b/src/main/java/com/stripe/param/OrderCreateParams.java index aa3b354a701..c0500c14036 100644 --- a/src/main/java/com/stripe/param/OrderCreateParams.java +++ b/src/main/java/com/stripe/param/OrderCreateParams.java @@ -8449,13 +8449,13 @@ public static class TaxId { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -8524,13 +8524,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(OrderCreateParams.TaxDetails.TaxId.Type type) { this.type = type; @@ -8683,6 +8683,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/OrderUpdateParams.java b/src/main/java/com/stripe/param/OrderUpdateParams.java index 1d56c297758..1faa055f741 100644 --- a/src/main/java/com/stripe/param/OrderUpdateParams.java +++ b/src/main/java/com/stripe/param/OrderUpdateParams.java @@ -9082,13 +9082,13 @@ public static class TaxId { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -9157,13 +9157,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(OrderUpdateParams.TaxDetails.TaxId.Type type) { this.type = type; @@ -9322,6 +9322,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java new file mode 100644 index 00000000000..771fcdd9330 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java @@ -0,0 +1,112 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentAttemptRecordListParams 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; + + /** Required. The ID of the Payment Record. */ + @SerializedName("payment_record") + String paymentRecord; + + private PaymentAttemptRecordListParams( + List expand, Map extraParams, String paymentRecord) { + this.expand = expand; + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private String paymentRecord; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordListParams build() { + return new PaymentAttemptRecordListParams(this.expand, this.extraParams, this.paymentRecord); + } + + /** + * 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 + * PaymentAttemptRecordListParams#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 + * PaymentAttemptRecordListParams#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 + * PaymentAttemptRecordListParams#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 PaymentAttemptRecordListParams#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 ID of the Payment Record. */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java new file mode 100644 index 00000000000..b33fda4ba39 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentAttemptRecordRetrieveParams 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 PaymentAttemptRecordRetrieveParams(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 PaymentAttemptRecordRetrieveParams build() { + return new PaymentAttemptRecordRetrieveParams(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 + * PaymentAttemptRecordRetrieveParams#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 + * PaymentAttemptRecordRetrieveParams#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 + * PaymentAttemptRecordRetrieveParams#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 PaymentAttemptRecordRetrieveParams#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/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index f42753c7d4e..474664d9fae 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -16978,6 +16978,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index a1b5decf810..83bd8be78f6 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -190,7 +190,10 @@ public class PaymentIntentCreateParams extends ApiRequestParams { @SerializedName("payment_method") String paymentMethod; - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ @SerializedName("payment_method_configuration") String paymentMethodConfiguration; @@ -209,9 +212,8 @@ public class PaymentIntentCreateParams extends ApiRequestParams { /** * The list of payment method types (for example, a card) that this PaymentIntent can use. If you - * don't provide this, it defaults to ["card"]. Use {@code automatic_payment_methods} to - * manage payment methods from the Stripe Dashboard. + * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -811,7 +813,10 @@ public Builder setPaymentMethod(String paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -17447,6 +17452,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index d8e37fb2d12..4e6e3a20398 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -103,7 +103,10 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { @SerializedName("payment_method") Object paymentMethod; - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ @SerializedName("payment_method_configuration") Object paymentMethodConfiguration; @@ -587,13 +590,19 @@ public Builder setPaymentMethod(EmptyParam paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; } - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -17790,6 +17799,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 16611a2b192..56077d4fab8 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -4015,8 +4015,7 @@ public Builder setLimit(Long limit) { public static class ShippingAddressCollection { /** * Required. An array of two-letter ISO country codes representing which - * countries Checkout should provide as options for shipping locations. Unsupported country - * codes: {@code AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}. + * countries Checkout should provide as options for shipping locations. */ @SerializedName("allowed_countries") List allowedCountries; diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 6d02bebea81..5eb99ffd00e 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -131,6 +131,15 @@ public class PaymentLinkUpdateParams extends ApiRequestParams { @SerializedName("shipping_address_collection") Object shippingAddressCollection; + /** + * Describes the type of transaction being performed in order to customize relevant text on the + * page, such as the submit button. Changing this value will also affect the hostname in the url property + * (example: {@code donate.stripe.com}). + */ + @SerializedName("submit_type") + SubmitType submitType; + /** * When creating a subscription, the specified configuration data will be used. There must be at * least one line item with a recurring price to use {@code subscription_data}. @@ -162,6 +171,7 @@ private PaymentLinkUpdateParams( Object paymentMethodTypes, Object restrictions, Object shippingAddressCollection, + SubmitType submitType, SubscriptionData subscriptionData, TaxIdCollection taxIdCollection) { this.active = active; @@ -183,6 +193,7 @@ private PaymentLinkUpdateParams( this.paymentMethodTypes = paymentMethodTypes; this.restrictions = restrictions; this.shippingAddressCollection = shippingAddressCollection; + this.submitType = submitType; this.subscriptionData = subscriptionData; this.taxIdCollection = taxIdCollection; } @@ -230,6 +241,8 @@ public static class Builder { private Object shippingAddressCollection; + private SubmitType submitType; + private SubscriptionData subscriptionData; private TaxIdCollection taxIdCollection; @@ -256,6 +269,7 @@ public PaymentLinkUpdateParams build() { this.paymentMethodTypes, this.restrictions, this.shippingAddressCollection, + this.submitType, this.subscriptionData, this.taxIdCollection); } @@ -580,6 +594,17 @@ public Builder setShippingAddressCollection(EmptyParam shippingAddressCollection return this; } + /** + * Describes the type of transaction being performed in order to customize relevant text on the + * page, such as the submit button. Changing this value will also affect the hostname in the url property + * (example: {@code donate.stripe.com}). + */ + public Builder setSubmitType(PaymentLinkUpdateParams.SubmitType submitType) { + this.submitType = submitType; + return this; + } + /** * When creating a subscription, the specified configuration data will be used. There must be at * least one line item with a recurring price to use {@code subscription_data}. @@ -3633,8 +3658,7 @@ public Builder setLimit(Long limit) { public static class ShippingAddressCollection { /** * Required. An array of two-letter ISO country codes representing which - * countries Checkout should provide as options for shipping locations. Unsupported country - * codes: {@code AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}. + * countries Checkout should provide as options for shipping locations. */ @SerializedName("allowed_countries") List allowedCountries; @@ -5254,4 +5278,25 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { this.value = value; } } + + public enum SubmitType implements ApiRequestParams.EnumParam { + @SerializedName("auto") + AUTO("auto"), + + @SerializedName("book") + BOOK("book"), + + @SerializedName("donate") + DONATE("donate"), + + @SerializedName("pay") + PAY("pay"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SubmitType(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 new file mode 100644 index 00000000000..5bc2dbf116b --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptCanceledParams extends ApiRequestParams { + /** + * Required. 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; + + @SerializedName("metadata") + Map metadata; + + private PaymentRecordReportPaymentAttemptCanceledParams( + Long canceledAt, + List expand, + Map extraParams, + Map 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 Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptCanceledParams build() { + return new PaymentRecordReportPaymentAttemptCanceledParams( + this.canceledAt, this.expand, this.extraParams, this.metadata); + } + + /** + * Required. 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 + * PaymentRecordReportPaymentAttemptCanceledParams#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 + * PaymentRecordReportPaymentAttemptCanceledParams#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 + * PaymentRecordReportPaymentAttemptCanceledParams#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 PaymentRecordReportPaymentAttemptCanceledParams#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 + * PaymentRecordReportPaymentAttemptCanceledParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + 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 PaymentRecordReportPaymentAttemptCanceledParams#metadata} for the field + * documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java new file mode 100644 index 00000000000..e35a090ac43 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptFailedParams 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; + + /** + * Required. When the reported payment failed. Measured in seconds since the Unix + * epoch. + */ + @SerializedName("failed_at") + Long failedAt; + + @SerializedName("metadata") + Map metadata; + + private PaymentRecordReportPaymentAttemptFailedParams( + List expand, + Map extraParams, + Long failedAt, + Map metadata) { + this.expand = expand; + this.extraParams = extraParams; + this.failedAt = failedAt; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Long failedAt; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptFailedParams build() { + return new PaymentRecordReportPaymentAttemptFailedParams( + this.expand, this.extraParams, this.failedAt, 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 + * PaymentRecordReportPaymentAttemptFailedParams#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 + * PaymentRecordReportPaymentAttemptFailedParams#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 + * PaymentRecordReportPaymentAttemptFailedParams#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 PaymentRecordReportPaymentAttemptFailedParams#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 payment failed. Measured in seconds since the + * Unix epoch. + */ + public Builder setFailedAt(Long failedAt) { + this.failedAt = failedAt; + 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 + * PaymentRecordReportPaymentAttemptFailedParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + 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 PaymentRecordReportPaymentAttemptFailedParams#metadata} for the field + * documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java new file mode 100644 index 00000000000..d5c0d9b3f9b --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptGuaranteedParams 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; + + /** + * Required. When the reported payment was guaranteed. Measured in seconds since + * the Unix epoch. + */ + @SerializedName("guaranteed_at") + Long guaranteedAt; + + @SerializedName("metadata") + Map metadata; + + private PaymentRecordReportPaymentAttemptGuaranteedParams( + List expand, + Map extraParams, + Long guaranteedAt, + Map 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 Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptGuaranteedParams build() { + return new PaymentRecordReportPaymentAttemptGuaranteedParams( + 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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#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 PaymentRecordReportPaymentAttemptGuaranteedParams#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 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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + 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 PaymentRecordReportPaymentAttemptGuaranteedParams#metadata} for the field + * documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java new file mode 100644 index 00000000000..3bb9dfb8f64 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java @@ -0,0 +1,1186 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptParams extends ApiRequestParams { + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String 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; + + /** Information about the payment attempt failure. */ + @SerializedName("failed") + Failed failed; + + /** Information about the payment attempt guarantee. */ + @SerializedName("guaranteed") + Guaranteed guaranteed; + + /** + * Required. When the reported payment 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") + Map metadata; + + /** The outcome of the reported payment. */ + @SerializedName("outcome") + Outcome outcome; + + /** Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + private PaymentRecordReportPaymentAttemptParams( + String description, + List expand, + Map extraParams, + Failed failed, + Guaranteed guaranteed, + Long initiatedAt, + Map metadata, + Outcome outcome, + PaymentMethodDetails paymentMethodDetails, + ShippingDetails shippingDetails) { + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.failed = failed; + this.guaranteed = guaranteed; + this.initiatedAt = initiatedAt; + this.metadata = metadata; + this.outcome = outcome; + this.paymentMethodDetails = paymentMethodDetails; + this.shippingDetails = shippingDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String description; + + private List expand; + + private Map extraParams; + + private Failed failed; + + private Guaranteed guaranteed; + + private Long initiatedAt; + + private Map metadata; + + private Outcome outcome; + + private PaymentMethodDetails paymentMethodDetails; + + private ShippingDetails shippingDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams build() { + return new PaymentRecordReportPaymentAttemptParams( + this.description, + this.expand, + this.extraParams, + this.failed, + this.guaranteed, + this.initiatedAt, + this.metadata, + this.outcome, + this.paymentMethodDetails, + this.shippingDetails); + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + public Builder setDescription(String 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 + * PaymentRecordReportPaymentAttemptParams#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 + * PaymentRecordReportPaymentAttemptParams#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 + * PaymentRecordReportPaymentAttemptParams#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 PaymentRecordReportPaymentAttemptParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Information about the payment attempt failure. */ + public Builder setFailed(PaymentRecordReportPaymentAttemptParams.Failed failed) { + this.failed = failed; + return this; + } + + /** Information about the payment attempt guarantee. */ + public Builder setGuaranteed(PaymentRecordReportPaymentAttemptParams.Guaranteed guaranteed) { + this.guaranteed = guaranteed; + return this; + } + + /** + * Required. When the reported payment 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 + * PaymentRecordReportPaymentAttemptParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + 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 PaymentRecordReportPaymentAttemptParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** The outcome of the reported payment. */ + public Builder setOutcome(PaymentRecordReportPaymentAttemptParams.Outcome outcome) { + this.outcome = outcome; + return this; + } + + /** Information about the Payment Method debited for this payment. */ + public Builder setPaymentMethodDetails( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails paymentMethodDetails) { + this.paymentMethodDetails = paymentMethodDetails; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails( + PaymentRecordReportPaymentAttemptParams.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + } + + @Getter + public static class Failed { + /** + * 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 payment failed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("failed_at") + Long failedAt; + + private Failed(Map extraParams, Long failedAt) { + this.extraParams = extraParams; + this.failedAt = failedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long failedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.Failed build() { + return new PaymentRecordReportPaymentAttemptParams.Failed(this.extraParams, this.failedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptParams.Failed#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 PaymentRecordReportPaymentAttemptParams.Failed#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 payment failed. Measured in seconds since the + * Unix epoch. + */ + public Builder setFailedAt(Long failedAt) { + this.failedAt = failedAt; + return this; + } + } + } + + @Getter + public static class Guaranteed { + /** + * 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 payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + @SerializedName("guaranteed_at") + Long guaranteedAt; + + private Guaranteed(Map extraParams, Long guaranteedAt) { + this.extraParams = extraParams; + this.guaranteedAt = guaranteedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long guaranteedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.Guaranteed build() { + return new PaymentRecordReportPaymentAttemptParams.Guaranteed( + this.extraParams, this.guaranteedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptParams.Guaranteed#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 PaymentRecordReportPaymentAttemptParams.Guaranteed#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 payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + public Builder setGuaranteedAt(Long guaranteedAt) { + this.guaranteedAt = guaranteedAt; + return this; + } + } + } + + @Getter + public static class PaymentMethodDetails { + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** Information about the custom (user-defined) payment method used to make this payment. */ + @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; + + /** ID of the Stripe Payment Method used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + @SerializedName("type") + Type type; + + private PaymentMethodDetails( + BillingDetails billingDetails, + Custom custom, + Map extraParams, + String paymentMethod, + Type type) { + this.billingDetails = billingDetails; + this.custom = custom; + this.extraParams = extraParams; + this.paymentMethod = paymentMethod; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Custom custom; + + private Map extraParams; + + private String paymentMethod; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails( + this.billingDetails, this.custom, this.extraParams, this.paymentMethod, this.type); + } + + /** The billing details associated with the method of payment. */ + public Builder setBillingDetails( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails + billingDetails) { + this.billingDetails = billingDetails; + return this; + } + + /** Information about the custom (user-defined) payment method used to make this payment. */ + public Builder setCustom( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails#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 PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** ID of the Stripe Payment Method used to make this payment. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + public Builder setType( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + public static class BillingDetails { + /** The billing address associated with the method of payment. */ + @SerializedName("address") + Address address; + + /** The billing email associated with the method of payment. */ + @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 billing name associated with the method of payment. */ + @SerializedName("name") + String name; + + /** The billing phone number associated with the method of payment. */ + @SerializedName("phone") + String phone; + + private BillingDetails( + Address address, + String email, + Map extraParams, + String name, + String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** The billing address associated with the method of payment. */ + public Builder setAddress( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.Address + address) { + this.address = address; + return this; + } + + /** The billing email associated with the method of payment. */ + 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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails#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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails#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 billing name associated with the method of payment. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The billing phone number associated with the method of payment. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @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 PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.Address + build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails + .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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.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 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., 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. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + @Getter + public static class Custom { + /** + * Display name for the custom (user-defined) payment method type used to make this payment. + */ + @SerializedName("display_name") + String displayName; + + /** + * 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 custom payment method type associated with this payment. */ + @SerializedName("type") + String type; + + private Custom(String displayName, Map extraParams, String type) { + this.displayName = displayName; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + private Map extraParams; + + private String type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom( + this.displayName, this.extraParams, this.type); + } + + /** + * Display name for the custom (user-defined) payment method type used to make this payment. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + 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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.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; + } + + /** The custom payment method type associated with this payment. */ + public Builder setType(String type) { + this.type = type; + 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 + 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 PaymentRecordReportPaymentAttemptParams.ShippingDetails build() { + return new PaymentRecordReportPaymentAttemptParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** The physical shipping address. */ + public Builder setAddress( + PaymentRecordReportPaymentAttemptParams.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 + * PaymentRecordReportPaymentAttemptParams.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 PaymentRecordReportPaymentAttemptParams.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 + 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @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 PaymentRecordReportPaymentAttemptParams.ShippingDetails.Address build() { + return new PaymentRecordReportPaymentAttemptParams.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 + * PaymentRecordReportPaymentAttemptParams.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 + * PaymentRecordReportPaymentAttemptParams.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 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., 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. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + public enum Outcome implements ApiRequestParams.EnumParam { + @SerializedName("failed") + FAILED("failed"), + + @SerializedName("guaranteed") + GUARANTEED("guaranteed"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Outcome(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 new file mode 100644 index 00000000000..2798d2bc67c --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java @@ -0,0 +1,1467 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentParams extends ApiRequestParams { + /** Required. The amount you intend to collect for this payment. */ + @SerializedName("amount_requested") + AmountRequested amountRequested; + + /** Customer information for this payment. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** Indicates whether the customer was present in your checkout flow during this payment. */ + @SerializedName("customer_presence") + CustomerPresence customerPresence; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String 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; + + /** Information about the payment attempt failure. */ + @SerializedName("failed") + Failed failed; + + /** Information about the payment attempt guarantee. */ + @SerializedName("guaranteed") + Guaranteed guaranteed; + + /** + * Required. When the reported payment 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") + Map metadata; + + /** The outcome of the reported payment. */ + @SerializedName("outcome") + Outcome outcome; + + /** Required. Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** + * Required. An opaque string for manual reconciliation of this payment, for + * example a check number or a payment processor ID. + */ + @SerializedName("payment_reference") + String paymentReference; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + private PaymentRecordReportPaymentParams( + AmountRequested amountRequested, + CustomerDetails customerDetails, + CustomerPresence customerPresence, + String description, + List expand, + Map extraParams, + Failed failed, + Guaranteed guaranteed, + Long initiatedAt, + Map metadata, + Outcome outcome, + PaymentMethodDetails paymentMethodDetails, + String paymentReference, + ShippingDetails shippingDetails) { + this.amountRequested = amountRequested; + this.customerDetails = customerDetails; + this.customerPresence = customerPresence; + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.failed = failed; + this.guaranteed = guaranteed; + this.initiatedAt = initiatedAt; + this.metadata = metadata; + this.outcome = outcome; + this.paymentMethodDetails = paymentMethodDetails; + this.paymentReference = paymentReference; + this.shippingDetails = shippingDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AmountRequested amountRequested; + + private CustomerDetails customerDetails; + + private CustomerPresence customerPresence; + + private String description; + + private List expand; + + private Map extraParams; + + private Failed failed; + + private Guaranteed guaranteed; + + private Long initiatedAt; + + private Map metadata; + + private Outcome outcome; + + private PaymentMethodDetails paymentMethodDetails; + + private String paymentReference; + + private ShippingDetails shippingDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams build() { + return new PaymentRecordReportPaymentParams( + this.amountRequested, + this.customerDetails, + this.customerPresence, + this.description, + this.expand, + this.extraParams, + this.failed, + this.guaranteed, + this.initiatedAt, + this.metadata, + this.outcome, + this.paymentMethodDetails, + this.paymentReference, + this.shippingDetails); + } + + /** Required. The amount you intend to collect for this payment. */ + public Builder setAmountRequested( + PaymentRecordReportPaymentParams.AmountRequested amountRequested) { + this.amountRequested = amountRequested; + return this; + } + + /** Customer information for this payment. */ + public Builder setCustomerDetails( + PaymentRecordReportPaymentParams.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + return this; + } + + /** Indicates whether the customer was present in your checkout flow during this payment. */ + public Builder setCustomerPresence( + PaymentRecordReportPaymentParams.CustomerPresence customerPresence) { + this.customerPresence = customerPresence; + 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; + } + + /** + * 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 + * PaymentRecordReportPaymentParams#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 + * PaymentRecordReportPaymentParams#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 + * PaymentRecordReportPaymentParams#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 PaymentRecordReportPaymentParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Information about the payment attempt failure. */ + public Builder setFailed(PaymentRecordReportPaymentParams.Failed failed) { + this.failed = failed; + return this; + } + + /** Information about the payment attempt guarantee. */ + public Builder setGuaranteed(PaymentRecordReportPaymentParams.Guaranteed guaranteed) { + this.guaranteed = guaranteed; + return this; + } + + /** + * Required. When the reported payment 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 + * PaymentRecordReportPaymentParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + 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 PaymentRecordReportPaymentParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** The outcome of the reported payment. */ + public Builder setOutcome(PaymentRecordReportPaymentParams.Outcome outcome) { + this.outcome = outcome; + return this; + } + + /** Required. Information about the Payment Method debited for this payment. */ + public Builder setPaymentMethodDetails( + PaymentRecordReportPaymentParams.PaymentMethodDetails paymentMethodDetails) { + this.paymentMethodDetails = paymentMethodDetails; + return this; + } + + /** + * Required. An opaque string for manual reconciliation of this payment, for + * example a check number or a payment processor ID. + */ + public Builder setPaymentReference(String paymentReference) { + this.paymentReference = paymentReference; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails( + PaymentRecordReportPaymentParams.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + } + + @Getter + public static class AmountRequested { + /** + * 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 smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + + private AmountRequested(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 PaymentRecordReportPaymentParams.AmountRequested build() { + return new PaymentRecordReportPaymentParams.AmountRequested( + 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 + * PaymentRecordReportPaymentParams.AmountRequested#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 PaymentRecordReportPaymentParams.AmountRequested#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 smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + public Builder setValue(Long value) { + this.value = value; + return this; + } + } + } + + @Getter + 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 PaymentRecordReportPaymentParams.CustomerDetails build() { + return new PaymentRecordReportPaymentParams.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 + * PaymentRecordReportPaymentParams.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 PaymentRecordReportPaymentParams.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 + public static class Failed { + /** + * 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 payment failed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("failed_at") + Long failedAt; + + private Failed(Map extraParams, Long failedAt) { + this.extraParams = extraParams; + this.failedAt = failedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long failedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.Failed build() { + return new PaymentRecordReportPaymentParams.Failed(this.extraParams, this.failedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentParams.Failed#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 PaymentRecordReportPaymentParams.Failed#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 payment failed. Measured in seconds since the + * Unix epoch. + */ + public Builder setFailedAt(Long failedAt) { + this.failedAt = failedAt; + return this; + } + } + } + + @Getter + public static class Guaranteed { + /** + * 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 payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + @SerializedName("guaranteed_at") + Long guaranteedAt; + + private Guaranteed(Map extraParams, Long guaranteedAt) { + this.extraParams = extraParams; + this.guaranteedAt = guaranteedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long guaranteedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.Guaranteed build() { + return new PaymentRecordReportPaymentParams.Guaranteed(this.extraParams, this.guaranteedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentParams.Guaranteed#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 PaymentRecordReportPaymentParams.Guaranteed#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 payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + public Builder setGuaranteedAt(Long guaranteedAt) { + this.guaranteedAt = guaranteedAt; + return this; + } + } + } + + @Getter + public static class PaymentMethodDetails { + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** Information about the custom (user-defined) payment method used to make this payment. */ + @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; + + /** ID of the Stripe Payment Method used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + @SerializedName("type") + Type type; + + private PaymentMethodDetails( + BillingDetails billingDetails, + Custom custom, + Map extraParams, + String paymentMethod, + Type type) { + this.billingDetails = billingDetails; + this.custom = custom; + this.extraParams = extraParams; + this.paymentMethod = paymentMethod; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Custom custom; + + private Map extraParams; + + private String paymentMethod; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.PaymentMethodDetails build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails( + this.billingDetails, this.custom, this.extraParams, this.paymentMethod, this.type); + } + + /** The billing details associated with the method of payment. */ + public Builder setBillingDetails( + PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails billingDetails) { + this.billingDetails = billingDetails; + return this; + } + + /** Information about the custom (user-defined) payment method used to make this payment. */ + public Builder setCustom( + PaymentRecordReportPaymentParams.PaymentMethodDetails.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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails#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 PaymentRecordReportPaymentParams.PaymentMethodDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** ID of the Stripe Payment Method used to make this payment. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + public Builder setType(PaymentRecordReportPaymentParams.PaymentMethodDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + public static class BillingDetails { + /** The billing address associated with the method of payment. */ + @SerializedName("address") + Address address; + + /** The billing email associated with the method of payment. */ + @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 billing name associated with the method of payment. */ + @SerializedName("name") + String name; + + /** The billing phone number associated with the method of payment. */ + @SerializedName("phone") + String phone; + + private BillingDetails( + Address address, + String email, + Map extraParams, + String name, + String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** The billing address associated with the method of payment. */ + public Builder setAddress( + PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.Address address) { + this.address = address; + return this; + } + + /** The billing email associated with the method of payment. */ + 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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails#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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails#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 billing name associated with the method of payment. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The billing phone number associated with the method of payment. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @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 PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.Address + build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.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 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., 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. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + @Getter + public static class Custom { + /** + * Display name for the custom (user-defined) payment method type used to make this payment. + */ + @SerializedName("display_name") + String displayName; + + /** + * 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 custom payment method type associated with this payment. */ + @SerializedName("type") + String type; + + private Custom(String displayName, Map extraParams, String type) { + this.displayName = displayName; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + private Map extraParams; + + private String type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom( + this.displayName, this.extraParams, this.type); + } + + /** + * Display name for the custom (user-defined) payment method type used to make this payment. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + 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 PaymentRecordReportPaymentParams.PaymentMethodDetails.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 PaymentRecordReportPaymentParams.PaymentMethodDetails.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; + } + + /** The custom payment method type associated with this payment. */ + public Builder setType(String type) { + this.type = type; + 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 + 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 PaymentRecordReportPaymentParams.ShippingDetails build() { + return new PaymentRecordReportPaymentParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** The physical shipping address. */ + public Builder setAddress(PaymentRecordReportPaymentParams.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 + * PaymentRecordReportPaymentParams.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 PaymentRecordReportPaymentParams.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 + 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @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 PaymentRecordReportPaymentParams.ShippingDetails.Address build() { + return new PaymentRecordReportPaymentParams.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 PaymentRecordReportPaymentParams.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 PaymentRecordReportPaymentParams.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 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., 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. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + public enum CustomerPresence implements ApiRequestParams.EnumParam { + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CustomerPresence(String value) { + this.value = value; + } + } + + public enum Outcome implements ApiRequestParams.EnumParam { + @SerializedName("failed") + FAILED("failed"), + + @SerializedName("guaranteed") + GUARANTEED("guaranteed"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Outcome(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java b/src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java new file mode 100644 index 00000000000..f7445ed145b --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordRetrieveParams 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 PaymentRecordRetrieveParams(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 PaymentRecordRetrieveParams build() { + return new PaymentRecordRetrieveParams(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 + * PaymentRecordRetrieveParams#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 + * PaymentRecordRetrieveParams#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 + * PaymentRecordRetrieveParams#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 PaymentRecordRetrieveParams#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/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index d301f9418aa..21113063c12 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -8222,6 +8222,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 3815f378563..42ee87f9309 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -111,7 +111,10 @@ public class SetupIntentCreateParams extends ApiRequestParams { @SerializedName("payment_method") String paymentMethod; - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ @SerializedName("payment_method_configuration") String paymentMethodConfiguration; @@ -129,7 +132,8 @@ public class SetupIntentCreateParams extends ApiRequestParams { /** * The list of payment method types (for example, card) that this SetupIntent can use. If you - * don't provide this, it defaults to ["card"]. + * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -486,7 +490,10 @@ public Builder setPaymentMethod(String paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -8674,6 +8681,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 477d4402bbc..12fd5a23a67 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -75,7 +75,10 @@ public class SetupIntentUpdateParams extends ApiRequestParams { @SerializedName("payment_method") Object paymentMethod; - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ @SerializedName("payment_method_configuration") Object paymentMethodConfiguration; @@ -93,7 +96,8 @@ public class SetupIntentUpdateParams extends ApiRequestParams { /** * The list of payment method types (for example, card) that this SetupIntent can set up. If you - * don't provide this array, it defaults to ["card"]. + * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -367,13 +371,19 @@ public Builder setPaymentMethod(EmptyParam paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; } - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -8237,6 +8247,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 9ade2e89a4f..7e0162f236b 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -5212,6 +5212,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), @@ -6262,6 +6265,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index b88711ac451..34fb3b199ab 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -5468,6 +5468,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), @@ -6553,6 +6556,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java index 467044f224f..24b2317f61d 100644 --- a/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCollectionCreateParams.java @@ -33,13 +33,13 @@ public class TaxIdCollectionCreateParams extends ApiRequestParams { * do_rcn}, {@code ec_ruc}, {@code eg_tin}, {@code es_cif}, {@code eu_oss_vat}, {@code eu_vat}, * {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, {@code id_npwp}, * {@code il_vat}, {@code in_gst}, {@code is_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, - * {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, - * {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, - * {@code no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code - * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code - * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code - * tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, + * {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, + * {@code no_vat}, {@code no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code + * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code + * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code + * tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -136,13 +136,13 @@ public Builder putAllExtraParam(Map map) { * eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, * {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, {@code jp_cn}, {@code * jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, - * {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code - * my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, {@code om_vat}, - * {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code - * ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sv_nit}, - * {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, or - * {@code za_vat} + * {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code + * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, + * {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code + * ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, + * {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, + * {@code vn_tin}, or {@code za_vat} */ public Builder setType(TaxIdCollectionCreateParams.Type type) { this.type = type; @@ -295,6 +295,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/TaxIdCreateParams.java b/src/main/java/com/stripe/param/TaxIdCreateParams.java index e8c04d77f6a..6a7dea021d0 100644 --- a/src/main/java/com/stripe/param/TaxIdCreateParams.java +++ b/src/main/java/com/stripe/param/TaxIdCreateParams.java @@ -37,13 +37,13 @@ public class TaxIdCreateParams extends ApiRequestParams { * do_rcn}, {@code ec_ruc}, {@code eg_tin}, {@code es_cif}, {@code eu_oss_vat}, {@code eu_vat}, * {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, {@code id_npwp}, * {@code il_vat}, {@code in_gst}, {@code is_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, - * {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, - * {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, - * {@code no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code - * ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code - * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code - * tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, + * {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, + * {@code no_vat}, {@code no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code + * ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code + * sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code + * tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -150,13 +150,13 @@ public Builder setOwner(TaxIdCreateParams.Owner owner) { * eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code hr_oib}, {@code hu_tin}, * {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, {@code jp_cn}, {@code * jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code kz_bin}, {@code li_uid}, - * {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code my_itn}, {@code - * my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, {@code om_vat}, - * {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code ru_inn}, {@code - * ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, {@code sv_nit}, - * {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code ua_vat}, {@code - * us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, {@code vn_tin}, or - * {@code za_vat} + * {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, {@code + * my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code nz_gst}, + * {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, {@code + * ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code si_tin}, + * {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, {@code + * ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code ve_rif}, + * {@code vn_tin}, or {@code za_vat} */ public Builder setType(TaxIdCreateParams.Type type) { this.type = type; @@ -425,6 +425,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/param/TaxRateCreateParams.java b/src/main/java/com/stripe/param/TaxRateCreateParams.java index 6dfde76285c..a3df1a13942 100644 --- a/src/main/java/com/stripe/param/TaxRateCreateParams.java +++ b/src/main/java/com/stripe/param/TaxRateCreateParams.java @@ -347,6 +347,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/TaxRateUpdateParams.java b/src/main/java/com/stripe/param/TaxRateUpdateParams.java index 3ad5c153a02..7e24c42954b 100644 --- a/src/main/java/com/stripe/param/TaxRateUpdateParams.java +++ b/src/main/java/com/stripe/param/TaxRateUpdateParams.java @@ -381,6 +381,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 13062521c7f..7e760095678 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -941,6 +941,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.payment_action_required") INVOICE__PAYMENT_ACTION_REQUIRED("invoice.payment_action_required"), + @SerializedName("invoice.payment_attempt_required") + INVOICE__PAYMENT_ATTEMPT_REQUIRED("invoice.payment_attempt_required"), + @SerializedName("invoice.payment_failed") INVOICE__PAYMENT_FAILED("invoice.payment_failed"), @@ -1013,6 +1016,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("issuing_dispute_settlement_detail.updated") ISSUING_DISPUTE_SETTLEMENT_DETAIL__UPDATED("issuing_dispute_settlement_detail.updated"), + @SerializedName("issuing_fraud_liability_debit.created") + ISSUING_FRAUD_LIABILITY_DEBIT__CREATED("issuing_fraud_liability_debit.created"), + @SerializedName("issuing_personalization_design.activated") ISSUING_PERSONALIZATION_DESIGN__ACTIVATED("issuing_personalization_design.activated"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index e0fe0fc1663..73e8e77d4a3 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -599,6 +599,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.payment_action_required") INVOICE__PAYMENT_ACTION_REQUIRED("invoice.payment_action_required"), + @SerializedName("invoice.payment_attempt_required") + INVOICE__PAYMENT_ATTEMPT_REQUIRED("invoice.payment_attempt_required"), + @SerializedName("invoice.payment_failed") INVOICE__PAYMENT_FAILED("invoice.payment_failed"), @@ -671,6 +674,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("issuing_dispute_settlement_detail.updated") ISSUING_DISPUTE_SETTLEMENT_DETAIL__UPDATED("issuing_dispute_settlement_detail.updated"), + @SerializedName("issuing_fraud_liability_debit.created") + ISSUING_FRAUD_LIABILITY_DEBIT__CREATED("issuing_fraud_liability_debit.created"), + @SerializedName("issuing_personalization_design.activated") ISSUING_PERSONALIZATION_DESIGN__ACTIVATED("issuing_personalization_design.activated"), diff --git a/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java b/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java index a56cf342eb3..90edb084feb 100644 --- a/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java +++ b/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java @@ -236,8 +236,8 @@ public static class ApplicabilityScope { Map extraParams; /** - * Required. The price type to which credit grants can apply to. We currently - * only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ @SerializedName("price_type") PriceType priceType; @@ -291,8 +291,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. The price type to which credit grants can apply to. We - * currently only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ public Builder setPriceType( CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope.PriceType priceType) { diff --git a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java index 2efeb965b30..a00472e10e3 100644 --- a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java +++ b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java @@ -23,15 +23,13 @@ public class CreditGrantCreateParams extends ApiRequestParams { @SerializedName("category") Category category; - /** - * Required. ID of the customer to whom the billing credits should be granted. - */ + /** Required. ID of the customer to receive the billing credits. */ @SerializedName("customer") String customer; /** - * The time when the billing credits become effective i.e when they are eligible to be used. - * Defaults to the current timestamp if not specified. + * The time when the billing credits become effective—when they're eligible for use. Defaults to + * the current timestamp if not specified. */ @SerializedName("effective_at") Long effectiveAt; @@ -41,7 +39,7 @@ public class CreditGrantCreateParams extends ApiRequestParams { List expand; /** - * The time when the billing credits will expire. If not specified, the billing credits will never + * The time when the billing credits will expire. If not specified, the billing credits don't * expire. */ @SerializedName("expires_at") @@ -58,12 +56,12 @@ public class CreditGrantCreateParams extends ApiRequestParams { /** * Set of key-value pairs that you can attach to an object. This can be useful for storing - * additional information about the object (ex: cost basis) in a structured format. + * additional information about the object (for example, cost basis) in a structured format. */ @SerializedName("metadata") Map metadata; - /** A descriptive name shown in dashboard. */ + /** A descriptive name shown in the Dashboard. */ @SerializedName("name") String name; @@ -149,17 +147,15 @@ public Builder setCategory(CreditGrantCreateParams.Category category) { return this; } - /** - * Required. ID of the customer to whom the billing credits should be granted. - */ + /** Required. ID of the customer to receive the billing credits. */ public Builder setCustomer(String customer) { this.customer = customer; return this; } /** - * The time when the billing credits become effective i.e when they are eligible to be used. - * Defaults to the current timestamp if not specified. + * The time when the billing credits become effective—when they're eligible for use. Defaults to + * the current timestamp if not specified. */ public Builder setEffectiveAt(Long effectiveAt) { this.effectiveAt = effectiveAt; @@ -193,8 +189,8 @@ public Builder addAllExpand(List elements) { } /** - * The time when the billing credits will expire. If not specified, the billing credits will - * never expire. + * The time when the billing credits will expire. If not specified, the billing credits don't + * expire. */ public Builder setExpiresAt(Long expiresAt) { this.expiresAt = expiresAt; @@ -253,7 +249,7 @@ public Builder putAllMetadata(Map map) { return this; } - /** A descriptive name shown in dashboard. */ + /** A descriptive name shown in the Dashboard. */ public Builder setName(String name) { this.name = name; return this; @@ -534,8 +530,8 @@ public static class Scope { Map extraParams; /** - * Required. The price type to which credit grants can apply to. We currently - * only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ @SerializedName("price_type") PriceType priceType; @@ -589,8 +585,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. The price type to which credit grants can apply to. We - * currently only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ public Builder setPriceType( CreditGrantCreateParams.ApplicabilityConfig.Scope.PriceType priceType) { diff --git a/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java b/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java index a4a2020e00c..cde992e155d 100644 --- a/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java +++ b/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java @@ -17,8 +17,8 @@ public class CreditGrantUpdateParams extends ApiRequestParams { List expand; /** - * The time when the billing credits created by this credit grant will expire. If set to empty, - * the billing credits will never expire. + * The time when the billing credits created by this credit grant expire. If set to empty, the + * billing credits never expire. */ @SerializedName("expires_at") Object expiresAt; @@ -33,8 +33,8 @@ public class CreditGrantUpdateParams extends ApiRequestParams { 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 (ex: cost basis) in a structured format. + * Set of key-value pairs you can attach to an object. This can be useful for storing additional + * information about the object (for example, cost basis) in a structured format. */ @SerializedName("metadata") Map metadata; @@ -96,8 +96,8 @@ public Builder addAllExpand(List elements) { } /** - * The time when the billing credits created by this credit grant will expire. If set to empty, - * the billing credits will never expire. + * The time when the billing credits created by this credit grant expire. If set to empty, the + * billing credits never expire. */ public Builder setExpiresAt(Long expiresAt) { this.expiresAt = expiresAt; @@ -105,8 +105,8 @@ public Builder setExpiresAt(Long expiresAt) { } /** - * The time when the billing credits created by this credit grant will expire. If set to empty, - * the billing credits will never expire. + * The time when the billing credits created by this credit grant expire. If set to empty, the + * billing credits never expire. */ public Builder setExpiresAt(EmptyParam expiresAt) { this.expiresAt = expiresAt; diff --git a/src/main/java/com/stripe/param/billing/MeterEventCreateParams.java b/src/main/java/com/stripe/param/billing/MeterEventCreateParams.java index 11b7b1a2f92..be342f300fe 100644 --- a/src/main/java/com/stripe/param/billing/MeterEventCreateParams.java +++ b/src/main/java/com/stripe/param/billing/MeterEventCreateParams.java @@ -32,8 +32,11 @@ public class MeterEventCreateParams extends ApiRequestParams { Map extraParams; /** - * A unique identifier for the event. If not provided, one will be generated. We recommend using a - * globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. + * A unique identifier for the event. If not provided, one will be generated. We strongly advise + * using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least 24 + * hours. The enforcement of uniqueness primarily addresses issues arising from accidental retries + * or other problems occurring within extremely brief time intervals. This approach helps prevent + * duplicate entries and ensures data integrity in high-frequency operations. */ @SerializedName("identifier") String identifier; @@ -159,9 +162,11 @@ public Builder putAllExtraParam(Map map) { } /** - * A unique identifier for the event. If not provided, one will be generated. We recommend using - * a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour - * period. + * A unique identifier for the event. If not provided, one will be generated. We strongly advise + * using UUID-like identifiers. We will enforce uniqueness within a rolling period of at least + * 24 hours. The enforcement of uniqueness primarily addresses issues arising from accidental + * retries or other problems occurring within extremely brief time intervals. This approach + * helps prevent duplicate entries and ensures data integrity in high-frequency operations. */ public Builder setIdentifier(String identifier) { this.identifier = identifier; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 2b5b9621ca8..741a10291d6 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -13,6 +13,13 @@ @Getter public class SessionCreateParams extends ApiRequestParams { + /** + * Settings for price localization with Adaptive Pricing. + */ + @SerializedName("adaptive_pricing") + AdaptivePricing adaptivePricing; + /** Configure actions after a Checkout Session has expired. */ @SerializedName("after_expiration") AfterExpiration afterExpiration; @@ -352,6 +359,7 @@ public class SessionCreateParams extends ApiRequestParams { UiMode uiMode; private SessionCreateParams( + AdaptivePricing adaptivePricing, AfterExpiration afterExpiration, Boolean allowPromotionCodes, AutomaticTax automaticTax, @@ -394,6 +402,7 @@ private SessionCreateParams( String successUrl, TaxIdCollection taxIdCollection, UiMode uiMode) { + this.adaptivePricing = adaptivePricing; this.afterExpiration = afterExpiration; this.allowPromotionCodes = allowPromotionCodes; this.automaticTax = automaticTax; @@ -443,6 +452,8 @@ public static Builder builder() { } public static class Builder { + private AdaptivePricing adaptivePricing; + private AfterExpiration afterExpiration; private Boolean allowPromotionCodes; @@ -530,6 +541,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams build() { return new SessionCreateParams( + this.adaptivePricing, this.afterExpiration, this.allowPromotionCodes, this.automaticTax, @@ -574,6 +586,15 @@ public SessionCreateParams build() { this.uiMode); } + /** + * Settings for price localization with Adaptive Pricing. + */ + public Builder setAdaptivePricing(SessionCreateParams.AdaptivePricing adaptivePricing) { + this.adaptivePricing = adaptivePricing; + return this; + } + /** Configure actions after a Checkout Session has expired. */ public Builder setAfterExpiration(SessionCreateParams.AfterExpiration afterExpiration) { this.afterExpiration = afterExpiration; @@ -1124,6 +1145,84 @@ public Builder setUiMode(SessionCreateParams.UiMode uiMode) { } } + @Getter + public static class AdaptivePricing { + /** + * Set to {@code true} to enable Adaptive Pricing. + * Defaults to your dashboard + * setting. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * 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 AdaptivePricing(Boolean enabled, Map extraParams) { + this.enabled = enabled; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.AdaptivePricing build() { + return new SessionCreateParams.AdaptivePricing(this.enabled, this.extraParams); + } + + /** + * Set to {@code true} to enable Adaptive Pricing. + * Defaults to your dashboard + * setting. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + 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 + * SessionCreateParams.AdaptivePricing#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 SessionCreateParams.AdaptivePricing#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 public static class AfterExpiration { /** @@ -5703,7 +5802,7 @@ public static class PaymentMethodOptions { @SerializedName("multibanco") Multibanco multibanco; - /** contains details about the Kakao Pay payment method options. */ + /** contains details about the Naver Pay payment method options. */ @SerializedName("naver_pay") NaverPay naverPay; @@ -6150,7 +6249,7 @@ public Builder setMultibanco(SessionCreateParams.PaymentMethodOptions.Multibanco return this; } - /** contains details about the Kakao Pay payment method options. */ + /** contains details about the Naver Pay payment method options. */ public Builder setNaverPay(SessionCreateParams.PaymentMethodOptions.NaverPay naverPay) { this.naverPay = naverPay; return this; @@ -7331,6 +7430,10 @@ public static class BacsDebit { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -7353,8 +7456,12 @@ public static class BacsDebit { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; - private BacsDebit(Map extraParams, SetupFutureUsage setupFutureUsage) { + private BacsDebit( + Map extraParams, + MandateOptions mandateOptions, + SetupFutureUsage setupFutureUsage) { this.extraParams = extraParams; + this.mandateOptions = mandateOptions; this.setupFutureUsage = setupFutureUsage; } @@ -7365,12 +7472,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private MandateOptions mandateOptions; + private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.BacsDebit build() { return new SessionCreateParams.PaymentMethodOptions.BacsDebit( - this.extraParams, this.setupFutureUsage); + this.extraParams, this.mandateOptions, this.setupFutureUsage); } /** @@ -7401,6 +7510,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Additional fields for Mandate creation. */ + public Builder setMandateOptions( + SessionCreateParams.PaymentMethodOptions.BacsDebit.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -7428,6 +7544,67 @@ public Builder setSetupFutureUsage( } } + @Getter + public static class MandateOptions { + /** + * 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 MandateOptions(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.BacsDebit.MandateOptions build() { + return new SessionCreateParams.PaymentMethodOptions.BacsDebit.MandateOptions( + this.extraParams); + } + + /** + * 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 + * SessionCreateParams.PaymentMethodOptions.BacsDebit.MandateOptions#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 + * SessionCreateParams.PaymentMethodOptions.BacsDebit.MandateOptions#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 SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -7734,6 +7911,42 @@ public static class Card { @SerializedName("installments") Installments installments; + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + @SerializedName("request_decremental_authorization") + RequestDecrementalAuthorization requestDecrementalAuthorization; + + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + @SerializedName("request_extended_authorization") + RequestExtendedAuthorization requestExtendedAuthorization; + + /** + * Request ability to increment the + * authorization for this CheckoutSession. + */ + @SerializedName("request_incremental_authorization") + RequestIncrementalAuthorization requestIncrementalAuthorization; + + /** + * Request ability to make multiple + * captures for this CheckoutSession. + */ + @SerializedName("request_multicapture") + RequestMulticapture requestMulticapture; + + /** + * Request ability to overcapture for + * this CheckoutSession. + */ + @SerializedName("request_overcapture") + RequestOvercapture requestOvercapture; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and extraParams, Installments installments, + RequestDecrementalAuthorization requestDecrementalAuthorization, + RequestExtendedAuthorization requestExtendedAuthorization, + RequestIncrementalAuthorization requestIncrementalAuthorization, + RequestMulticapture requestMulticapture, + RequestOvercapture requestOvercapture, RequestThreeDSecure requestThreeDSecure, SetupFutureUsage setupFutureUsage, String statementDescriptorSuffixKana, String statementDescriptorSuffixKanji) { this.extraParams = extraParams; this.installments = installments; + this.requestDecrementalAuthorization = requestDecrementalAuthorization; + this.requestExtendedAuthorization = requestExtendedAuthorization; + this.requestIncrementalAuthorization = requestIncrementalAuthorization; + this.requestMulticapture = requestMulticapture; + this.requestOvercapture = requestOvercapture; this.requestThreeDSecure = requestThreeDSecure; this.setupFutureUsage = setupFutureUsage; this.statementDescriptorSuffixKana = statementDescriptorSuffixKana; @@ -7814,6 +8037,16 @@ public static class Builder { private Installments installments; + private RequestDecrementalAuthorization requestDecrementalAuthorization; + + private RequestExtendedAuthorization requestExtendedAuthorization; + + private RequestIncrementalAuthorization requestIncrementalAuthorization; + + private RequestMulticapture requestMulticapture; + + private RequestOvercapture requestOvercapture; + private RequestThreeDSecure requestThreeDSecure; private SetupFutureUsage setupFutureUsage; @@ -7827,6 +8060,11 @@ public SessionCreateParams.PaymentMethodOptions.Card build() { return new SessionCreateParams.PaymentMethodOptions.Card( this.extraParams, this.installments, + this.requestDecrementalAuthorization, + this.requestExtendedAuthorization, + this.requestIncrementalAuthorization, + this.requestMulticapture, + this.requestOvercapture, this.requestThreeDSecure, this.setupFutureUsage, this.statementDescriptorSuffixKana, @@ -7868,6 +8106,60 @@ public Builder setInstallments( return this; } + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + public Builder setRequestDecrementalAuthorization( + SessionCreateParams.PaymentMethodOptions.Card.RequestDecrementalAuthorization + requestDecrementalAuthorization) { + this.requestDecrementalAuthorization = requestDecrementalAuthorization; + return this; + } + + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + public Builder setRequestExtendedAuthorization( + SessionCreateParams.PaymentMethodOptions.Card.RequestExtendedAuthorization + requestExtendedAuthorization) { + this.requestExtendedAuthorization = requestExtendedAuthorization; + return this; + } + + /** + * Request ability to increment the + * authorization for this CheckoutSession. + */ + public Builder setRequestIncrementalAuthorization( + SessionCreateParams.PaymentMethodOptions.Card.RequestIncrementalAuthorization + requestIncrementalAuthorization) { + this.requestIncrementalAuthorization = requestIncrementalAuthorization; + return this; + } + + /** + * Request ability to make multiple + * captures for this CheckoutSession. + */ + public Builder setRequestMulticapture( + SessionCreateParams.PaymentMethodOptions.Card.RequestMulticapture requestMulticapture) { + this.requestMulticapture = requestMulticapture; + return this; + } + + /** + * Request ability to overcapture for + * this CheckoutSession. + */ + public Builder setRequestOvercapture( + SessionCreateParams.PaymentMethodOptions.Card.RequestOvercapture requestOvercapture) { + this.requestOvercapture = requestOvercapture; + return this; + } + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and map) { } } + public enum RequestDecrementalAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestDecrementalAuthorization(String value) { + this.value = value; + } + } + + public enum RequestExtendedAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestExtendedAuthorization(String value) { + this.value = value; + } + } + + public enum RequestIncrementalAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestIncrementalAuthorization(String value) { + this.value = value; + } + } + + public enum RequestMulticapture implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestMulticapture(String value) { + this.value = value; + } + } + + public enum RequestOvercapture implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestOvercapture(String value) { + this.value = value; + } + } + public enum RequestThreeDSecure implements ApiRequestParams.EnumParam { @SerializedName("any") ANY("any"), @@ -9257,6 +9624,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter public static class KakaoPay { + /** Controls when the funds will be captured from the customer's account. */ + @SerializedName("capture_method") + CaptureMethod captureMethod; + /** * 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. @@ -9288,7 +9659,11 @@ public static class KakaoPay { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; - private KakaoPay(Map extraParams, SetupFutureUsage setupFutureUsage) { + private KakaoPay( + CaptureMethod captureMethod, + Map extraParams, + SetupFutureUsage setupFutureUsage) { + this.captureMethod = captureMethod; this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -9298,6 +9673,8 @@ public static Builder builder() { } public static class Builder { + private CaptureMethod captureMethod; + private Map extraParams; private SetupFutureUsage setupFutureUsage; @@ -9305,7 +9682,14 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.KakaoPay build() { return new SessionCreateParams.PaymentMethodOptions.KakaoPay( - this.extraParams, this.setupFutureUsage); + this.captureMethod, this.extraParams, this.setupFutureUsage); + } + + /** Controls when the funds will be captured from the customer's account. */ + public Builder setCaptureMethod( + SessionCreateParams.PaymentMethodOptions.KakaoPay.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; } /** @@ -9363,6 +9747,18 @@ public Builder setSetupFutureUsage( } } + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -9649,6 +10045,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter public static class KrCard { + /** Controls when the funds will be captured from the customer's account. */ + @SerializedName("capture_method") + CaptureMethod captureMethod; + /** * 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. @@ -9680,7 +10080,11 @@ public static class KrCard { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; - private KrCard(Map extraParams, SetupFutureUsage setupFutureUsage) { + private KrCard( + CaptureMethod captureMethod, + Map extraParams, + SetupFutureUsage setupFutureUsage) { + this.captureMethod = captureMethod; this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -9690,6 +10094,8 @@ public static Builder builder() { } public static class Builder { + private CaptureMethod captureMethod; + private Map extraParams; private SetupFutureUsage setupFutureUsage; @@ -9697,7 +10103,14 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.KrCard build() { return new SessionCreateParams.PaymentMethodOptions.KrCard( - this.extraParams, this.setupFutureUsage); + this.captureMethod, this.extraParams, this.setupFutureUsage); + } + + /** Controls when the funds will be captured from the customer's account. */ + public Builder setCaptureMethod( + SessionCreateParams.PaymentMethodOptions.KrCard.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; } /** @@ -9755,6 +10168,18 @@ public Builder setSetupFutureUsage( } } + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -10139,6 +10564,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter public static class NaverPay { + /** Controls when the funds will be captured from the customer's account. */ + @SerializedName("capture_method") + CaptureMethod captureMethod; + /** * 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. @@ -10170,7 +10599,11 @@ public static class NaverPay { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; - private NaverPay(Map extraParams, SetupFutureUsage setupFutureUsage) { + private NaverPay( + CaptureMethod captureMethod, + Map extraParams, + SetupFutureUsage setupFutureUsage) { + this.captureMethod = captureMethod; this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; } @@ -10180,6 +10613,8 @@ public static Builder builder() { } public static class Builder { + private CaptureMethod captureMethod; + private Map extraParams; private SetupFutureUsage setupFutureUsage; @@ -10187,7 +10622,14 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.NaverPay build() { return new SessionCreateParams.PaymentMethodOptions.NaverPay( - this.extraParams, this.setupFutureUsage); + this.captureMethod, this.extraParams, this.setupFutureUsage); + } + + /** Controls when the funds will be captured from the customer's account. */ + public Builder setCaptureMethod( + SessionCreateParams.PaymentMethodOptions.NaverPay.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; } /** @@ -10245,6 +10687,18 @@ public Builder setSetupFutureUsage( } } + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -10545,6 +10999,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter public static class Payco { + /** Controls when the funds will be captured from the customer's account. */ + @SerializedName("capture_method") + CaptureMethod captureMethod; + /** * 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. @@ -10554,7 +11012,8 @@ public static class Payco { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Payco(Map extraParams) { + private Payco(CaptureMethod captureMethod, Map extraParams) { + this.captureMethod = captureMethod; this.extraParams = extraParams; } @@ -10563,11 +11022,21 @@ public static Builder builder() { } public static class Builder { + private CaptureMethod captureMethod; + private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.Payco build() { - return new SessionCreateParams.PaymentMethodOptions.Payco(this.extraParams); + return new SessionCreateParams.PaymentMethodOptions.Payco( + this.captureMethod, this.extraParams); + } + + /** Controls when the funds will be captured from the customer's account. */ + public Builder setCaptureMethod( + SessionCreateParams.PaymentMethodOptions.Payco.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; } /** @@ -10598,6 +11067,18 @@ public Builder putAllExtraParam(Map map) { return this; } } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } } @Getter @@ -11753,6 +12234,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter public static class SamsungPay { + /** Controls when the funds will be captured from the customer's account. */ + @SerializedName("capture_method") + CaptureMethod captureMethod; + /** * 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. @@ -11762,7 +12247,8 @@ public static class SamsungPay { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private SamsungPay(Map extraParams) { + private SamsungPay(CaptureMethod captureMethod, Map extraParams) { + this.captureMethod = captureMethod; this.extraParams = extraParams; } @@ -11771,11 +12257,21 @@ public static Builder builder() { } public static class Builder { + private CaptureMethod captureMethod; + private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.SamsungPay build() { - return new SessionCreateParams.PaymentMethodOptions.SamsungPay(this.extraParams); + return new SessionCreateParams.PaymentMethodOptions.SamsungPay( + this.captureMethod, this.extraParams); + } + + /** Controls when the funds will be captured from the customer's account. */ + public Builder setCaptureMethod( + SessionCreateParams.PaymentMethodOptions.SamsungPay.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; } /** @@ -11806,6 +12302,18 @@ public Builder putAllExtraParam(Map map) { return this; } } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } } @Getter @@ -11819,6 +12327,10 @@ public static class SepaDebit { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Additional fields for Mandate creation. */ + @SerializedName("mandate_options") + MandateOptions mandateOptions; + /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -11841,8 +12353,12 @@ public static class SepaDebit { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; - private SepaDebit(Map extraParams, SetupFutureUsage setupFutureUsage) { + private SepaDebit( + Map extraParams, + MandateOptions mandateOptions, + SetupFutureUsage setupFutureUsage) { this.extraParams = extraParams; + this.mandateOptions = mandateOptions; this.setupFutureUsage = setupFutureUsage; } @@ -11853,12 +12369,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private MandateOptions mandateOptions; + private SetupFutureUsage setupFutureUsage; /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.SepaDebit build() { return new SessionCreateParams.PaymentMethodOptions.SepaDebit( - this.extraParams, this.setupFutureUsage); + this.extraParams, this.mandateOptions, this.setupFutureUsage); } /** @@ -11889,6 +12407,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Additional fields for Mandate creation. */ + public Builder setMandateOptions( + SessionCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions mandateOptions) { + this.mandateOptions = mandateOptions; + return this; + } + /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -11916,6 +12441,67 @@ public Builder setSetupFutureUsage( } } + @Getter + public static class MandateOptions { + /** + * 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 MandateOptions(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions build() { + return new SessionCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions( + this.extraParams); + } + + /** + * 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 + * SessionCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions#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 + * SessionCreateParams.PaymentMethodOptions.SepaDebit.MandateOptions#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 SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), @@ -13218,8 +13804,7 @@ public Builder setOnBehalfOf(String onBehalfOf) { public static class ShippingAddressCollection { /** * Required. An array of two-letter ISO country codes representing which - * countries Checkout should provide as options for shipping locations. Unsupported country - * codes: {@code AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI}. + * countries Checkout should provide as options for shipping locations. */ @SerializedName("allowed_countries") List allowedCountries; diff --git a/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java b/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java index 9f47aecddbe..bf58632728a 100644 --- a/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java +++ b/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java @@ -66,7 +66,7 @@ public class VerificationSessionCreateParams extends ApiRequestParams { Type type; /** - * The ID of a Verification Flow from the Dashboard. See + * The ID of a verification flow from the Dashboard. See * https://docs.stripe.com/identity/verification-flows. */ @SerializedName("verification_flow") @@ -258,7 +258,7 @@ public Builder setType(VerificationSessionCreateParams.Type type) { } /** - * The ID of a Verification Flow from the Dashboard. See + * The ID of a verification flow from the Dashboard. See * https://docs.stripe.com/identity/verification-flows. */ public Builder setVerificationFlow(String verificationFlow) { diff --git a/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java b/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java index 703a3c79756..bcddaceb4b2 100644 --- a/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/AuthorizationCreateParams.java @@ -13,8 +13,8 @@ @Getter public class AuthorizationCreateParams extends ApiRequestParams { /** - * Required. The total amount to attempt to authorize. This amount is in the - * provided currency, or defaults to the card's currency, and in the smallest currency unit. */ @SerializedName("amount") @@ -72,6 +72,21 @@ public class AuthorizationCreateParams extends ApiRequestParams { @SerializedName("is_amount_controllable") Boolean isAmountControllable; + /** + * The total amount to attempt to authorize. This amount is in the provided merchant currency, and + * in the smallest currency unit. + */ + @SerializedName("merchant_amount") + Long merchantAmount; + + /** + * The currency of the authorization. If not provided, defaults to the currency of the card. + * Three-letter ISO currency code, + * in lowercase. Must be a supported currency. + */ + @SerializedName("merchant_currency") + String merchantCurrency; + /** * Details about the seller (grocery store, e-commerce website, etc.) where the card authorization * happened. @@ -108,6 +123,8 @@ private AuthorizationCreateParams( Fleet fleet, Fuel fuel, Boolean isAmountControllable, + Long merchantAmount, + String merchantCurrency, MerchantData merchantData, NetworkData networkData, VerificationData verificationData, @@ -122,6 +139,8 @@ private AuthorizationCreateParams( this.fleet = fleet; this.fuel = fuel; this.isAmountControllable = isAmountControllable; + this.merchantAmount = merchantAmount; + this.merchantCurrency = merchantCurrency; this.merchantData = merchantData; this.networkData = networkData; this.verificationData = verificationData; @@ -153,6 +172,10 @@ public static class Builder { private Boolean isAmountControllable; + private Long merchantAmount; + + private String merchantCurrency; + private MerchantData merchantData; private NetworkData networkData; @@ -174,6 +197,8 @@ public AuthorizationCreateParams build() { this.fleet, this.fuel, this.isAmountControllable, + this.merchantAmount, + this.merchantCurrency, this.merchantData, this.networkData, this.verificationData, @@ -181,8 +206,8 @@ public AuthorizationCreateParams build() { } /** - * Required. The total amount to attempt to authorize. This amount is in the - * provided currency, or defaults to the card's currency, and in the smallest currency unit. */ public Builder setAmount(Long amount) { @@ -298,6 +323,27 @@ public Builder setIsAmountControllable(Boolean isAmountControllable) { return this; } + /** + * The total amount to attempt to authorize. This amount is in the provided merchant currency, + * and in the smallest currency + * unit. + */ + public Builder setMerchantAmount(Long merchantAmount) { + this.merchantAmount = merchantAmount; + return this; + } + + /** + * The currency of the authorization. If not provided, defaults to the currency of the card. + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + public Builder setMerchantCurrency(String merchantCurrency) { + this.merchantCurrency = merchantCurrency; + return this; + } + /** * Details about the seller (grocery store, e-commerce website, etc.) where the card * authorization happened. diff --git a/src/main/java/com/stripe/param/issuing/FraudLiabilityDebitListParams.java b/src/main/java/com/stripe/param/issuing/FraudLiabilityDebitListParams.java new file mode 100644 index 00000000000..8d711bc8675 --- /dev/null +++ b/src/main/java/com/stripe/param/issuing/FraudLiabilityDebitListParams.java @@ -0,0 +1,308 @@ +// File generated from our OpenAPI spec +package com.stripe.param.issuing; + +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.Getter; + +@Getter +public class FraudLiabilityDebitListParams extends ApiRequestParams { + /** + * Only return Issuing Fraud Liability Debits that were created during the given date interval. + */ + @SerializedName("created") + Object created; + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** 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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + private FraudLiabilityDebitListParams( + Object created, + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { + this.created = created; + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object created; + + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + /** Finalize and obtain parameter instance from this builder. */ + public FraudLiabilityDebitListParams build() { + return new FraudLiabilityDebitListParams( + this.created, + this.endingBefore, + this.expand, + this.extraParams, + this.limit, + this.startingAfter); + } + + /** + * Only return Issuing Fraud Liability Debits that were created during the given date interval. + */ + public Builder setCreated(FraudLiabilityDebitListParams.Created created) { + this.created = created; + return this; + } + + /** + * Only return Issuing Fraud Liability Debits that were created during the given date interval. + */ + public Builder setCreated(Long created) { + this.created = created; + return this; + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + 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 + * FraudLiabilityDebitListParams#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 + * FraudLiabilityDebitListParams#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 + * FraudLiabilityDebitListParams#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 FraudLiabilityDebitListParams#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 limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + } + + @Getter + public static class Created { + /** + * 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; + + /** Minimum value to filter by (exclusive). */ + @SerializedName("gt") + Long gt; + + /** Minimum value to filter by (inclusive). */ + @SerializedName("gte") + Long gte; + + /** Maximum value to filter by (exclusive). */ + @SerializedName("lt") + Long lt; + + /** Maximum value to filter by (inclusive). */ + @SerializedName("lte") + Long lte; + + private Created(Map extraParams, Long gt, Long gte, Long lt, Long lte) { + this.extraParams = extraParams; + this.gt = gt; + this.gte = gte; + this.lt = lt; + this.lte = lte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long gt; + + private Long gte; + + private Long lt; + + private Long lte; + + /** Finalize and obtain parameter instance from this builder. */ + public FraudLiabilityDebitListParams.Created build() { + return new FraudLiabilityDebitListParams.Created( + this.extraParams, this.gt, this.gte, this.lt, this.lte); + } + + /** + * 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 + * FraudLiabilityDebitListParams.Created#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 FraudLiabilityDebitListParams.Created#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Minimum value to filter by (exclusive). */ + public Builder setGt(Long gt) { + this.gt = gt; + return this; + } + + /** Minimum value to filter by (inclusive). */ + public Builder setGte(Long gte) { + this.gte = gte; + return this; + } + + /** Maximum value to filter by (exclusive). */ + public Builder setLt(Long lt) { + this.lt = lt; + return this; + } + + /** Maximum value to filter by (inclusive). */ + public Builder setLte(Long lte) { + this.lte = lte; + return this; + } + } + } +} diff --git a/src/main/java/com/stripe/param/issuing/FraudLiabilityDebitRetrieveParams.java b/src/main/java/com/stripe/param/issuing/FraudLiabilityDebitRetrieveParams.java new file mode 100644 index 00000000000..6a912c3b660 --- /dev/null +++ b/src/main/java/com/stripe/param/issuing/FraudLiabilityDebitRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.issuing; + +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.Getter; + +@Getter +public class FraudLiabilityDebitRetrieveParams 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 FraudLiabilityDebitRetrieveParams(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 FraudLiabilityDebitRetrieveParams build() { + return new FraudLiabilityDebitRetrieveParams(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 + * FraudLiabilityDebitRetrieveParams#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 + * FraudLiabilityDebitRetrieveParams#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 + * FraudLiabilityDebitRetrieveParams#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 FraudLiabilityDebitRetrieveParams#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/tax/CalculationCreateParams.java b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java index a408d6ae5c3..5948d1f6023 100644 --- a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java @@ -634,13 +634,13 @@ public static class TaxId { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ @SerializedName("type") Type type; @@ -710,13 +710,13 @@ public Builder putAllExtraParam(Map map) { * {@code eu_oss_vat}, {@code eu_vat}, {@code gb_vat}, {@code ge_vat}, {@code hk_br}, {@code * hr_oib}, {@code hu_tin}, {@code id_npwp}, {@code il_vat}, {@code in_gst}, {@code is_vat}, * {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code ke_pin}, {@code kr_brn}, {@code - * kz_bin}, {@code li_uid}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, {@code my_frp}, - * {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code no_voec}, {@code - * nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, {@code rs_pib}, - * {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code sg_uen}, {@code - * si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, {@code tz_vat}, - * {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code uz_vat}, {@code - * ve_rif}, {@code vn_tin}, or {@code za_vat} + * kz_bin}, {@code li_uid}, {@code li_vat}, {@code ma_vat}, {@code md_vat}, {@code mx_rfc}, + * {@code my_frp}, {@code my_itn}, {@code my_sst}, {@code ng_tin}, {@code no_vat}, {@code + * no_voec}, {@code nz_gst}, {@code om_vat}, {@code pe_ruc}, {@code ph_tin}, {@code ro_tin}, + * {@code rs_pib}, {@code ru_inn}, {@code ru_kpp}, {@code sa_vat}, {@code sg_gst}, {@code + * sg_uen}, {@code si_tin}, {@code sv_nit}, {@code th_vat}, {@code tr_tin}, {@code tw_vat}, + * {@code tz_vat}, {@code ua_vat}, {@code us_ein}, {@code uy_ruc}, {@code uz_tin}, {@code + * uz_vat}, {@code ve_rif}, {@code vn_tin}, or {@code za_vat} */ public Builder setType(CalculationCreateParams.CustomerDetails.TaxId.Type type) { this.type = type; @@ -869,6 +869,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("li_uid") LI_UID("li_uid"), + @SerializedName("li_vat") + LI_VAT("li_vat"), + @SerializedName("ma_vat") MA_VAT("ma_vat"), diff --git a/src/main/java/com/stripe/service/IssuingService.java b/src/main/java/com/stripe/service/IssuingService.java index 319756ba0b9..14d9786dccf 100644 --- a/src/main/java/com/stripe/service/IssuingService.java +++ b/src/main/java/com/stripe/service/IssuingService.java @@ -33,6 +33,10 @@ public com.stripe.service.issuing.DisputeService disputes() { return new com.stripe.service.issuing.DisputeService(this.getResponseGetter()); } + public com.stripe.service.issuing.FraudLiabilityDebitService fraudLiabilityDebits() { + return new com.stripe.service.issuing.FraudLiabilityDebitService(this.getResponseGetter()); + } + public com.stripe.service.issuing.PersonalizationDesignService personalizationDesigns() { return new com.stripe.service.issuing.PersonalizationDesignService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/PaymentAttemptRecordService.java b/src/main/java/com/stripe/service/PaymentAttemptRecordService.java new file mode 100644 index 00000000000..e27811829a2 --- /dev/null +++ b/src/main/java/com/stripe/service/PaymentAttemptRecordService.java @@ -0,0 +1,69 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.PaymentAttemptRecord; +import com.stripe.model.StripeCollection; +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.PaymentAttemptRecordListParams; +import com.stripe.param.PaymentAttemptRecordRetrieveParams; + +public final class PaymentAttemptRecordService extends ApiService { + public PaymentAttemptRecordService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public StripeCollection list(PaymentAttemptRecordListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public StripeCollection list( + PaymentAttemptRecordListParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_attempt_records"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, new TypeToken>() {}.getType()); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve(String id, PaymentAttemptRecordRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PaymentAttemptRecordRetrieveParams) null, options); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve(String id) throws StripeException { + return retrieve(id, (PaymentAttemptRecordRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve( + String id, PaymentAttemptRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + 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 new file mode 100644 index 00000000000..7c62b0d39af --- /dev/null +++ b/src/main/java/com/stripe/service/PaymentRecordService.java @@ -0,0 +1,172 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.stripe.exception.StripeException; +import com.stripe.model.PaymentRecord; +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.PaymentRecordReportPaymentAttemptCanceledParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptFailedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptGuaranteedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptParams; +import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordRetrieveParams; + +public final class PaymentRecordService extends ApiService { + public PaymentRecordService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve(String id, PaymentRecordRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PaymentRecordRetrieveParams) null, options); + } + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve(String id) throws StripeException { + return retrieve(id, (PaymentRecordRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve( + String id, PaymentRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt( + String id, PaymentRecordReportPaymentAttemptParams params) throws StripeException { + return reportPaymentAttempt(id, params, (RequestOptions) null); + } + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt( + String id, PaymentRecordReportPaymentAttemptParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/payment_records/%s/report_payment_attempt", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + String id, PaymentRecordReportPaymentAttemptCanceledParams params) throws StripeException { + 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, PaymentRecordReportPaymentAttemptCanceledParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_canceled", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + 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, PaymentRecordReportPaymentAttemptFailedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_failed", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + String id, PaymentRecordReportPaymentAttemptGuaranteedParams params) throws StripeException { + 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, PaymentRecordReportPaymentAttemptGuaranteedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_guaranteed", + ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public PaymentRecord reportPayment(PaymentRecordReportPaymentParams params) + throws StripeException { + return reportPayment(params, (RequestOptions) null); + } + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public PaymentRecord reportPayment( + PaymentRecordReportPaymentParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_records/report_payment"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } +} diff --git a/src/main/java/com/stripe/service/issuing/FraudLiabilityDebitService.java b/src/main/java/com/stripe/service/issuing/FraudLiabilityDebitService.java new file mode 100644 index 00000000000..2449e15851d --- /dev/null +++ b/src/main/java/com/stripe/service/issuing/FraudLiabilityDebitService.java @@ -0,0 +1,93 @@ +// File generated from our OpenAPI spec +package com.stripe.service.issuing; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.StripeCollection; +import com.stripe.model.issuing.FraudLiabilityDebit; +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.issuing.FraudLiabilityDebitListParams; +import com.stripe.param.issuing.FraudLiabilityDebitRetrieveParams; + +public final class FraudLiabilityDebitService extends ApiService { + public FraudLiabilityDebitService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public StripeCollection list(FraudLiabilityDebitListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((FraudLiabilityDebitListParams) null, options); + } + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public StripeCollection list() throws StripeException { + return list((FraudLiabilityDebitListParams) null, (RequestOptions) null); + } + /** + * Returns a list of Issuing {@code FraudLiabilityDebit} objects. The objects are sorted in + * descending order by creation date, with the most recently created object appearing first. + */ + public StripeCollection list( + FraudLiabilityDebitListParams params, RequestOptions options) throws StripeException { + String path = "/v1/issuing/fraud_liability_debits"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, new TypeToken>() {}.getType()); + } + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public FraudLiabilityDebit retrieve( + String fraudLiabilityDebit, FraudLiabilityDebitRetrieveParams params) throws StripeException { + return retrieve(fraudLiabilityDebit, params, (RequestOptions) null); + } + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public FraudLiabilityDebit retrieve(String fraudLiabilityDebit, RequestOptions options) + throws StripeException { + return retrieve(fraudLiabilityDebit, (FraudLiabilityDebitRetrieveParams) null, options); + } + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public FraudLiabilityDebit retrieve(String fraudLiabilityDebit) throws StripeException { + return retrieve( + fraudLiabilityDebit, (FraudLiabilityDebitRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves an Issuing {@code FraudLiabilityDebit} object. */ + public FraudLiabilityDebit retrieve( + String fraudLiabilityDebit, FraudLiabilityDebitRetrieveParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/issuing/fraud_liability_debits/%s", ApiResource.urlEncodeId(fraudLiabilityDebit)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, FraudLiabilityDebit.class); + } +} diff --git a/src/test/java/com/stripe/StripeClientTest.java b/src/test/java/com/stripe/StripeClientTest.java index 01b05adb2f4..fd8b82e0477 100644 --- a/src/test/java/com/stripe/StripeClientTest.java +++ b/src/test/java/com/stripe/StripeClientTest.java @@ -60,8 +60,7 @@ public void testReportsStripeClientUsageTelemetry() throws StripeException { }); } - // TODO: https://go/j/DEVSDK-2178 - // @Test + @Test public void testReportsRawRequestUsageTelemetry() throws StripeException { mockClient.rawRequest( com.stripe.net.ApiResource.RequestMethod.POST, "/v1/customers", "description=foo", null); diff --git a/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java b/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java index afc1f623ff4..8a470940027 100644 --- a/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java +++ b/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java @@ -63,4 +63,19 @@ public void testIdempotencyError() throws StripeException { }); assertThat(exception.getMessage(), CoreMatchers.containsString("idempotency")); } + + @Test + public void testErrorWithJsonSyntaxException() throws Exception { + HttpClient spy = Mockito.spy(new HttpURLConnectionClient()); + StripeResponseGetter srg = new LiveStripeResponseGetter(spy); + ApiResource.setGlobalResponseGetter(srg); + StripeResponse response = + new StripeResponse(400, HttpHeaders.of(Collections.emptyMap()), "I am not JSON :)"); + Mockito.doReturn(response).when(spy).requestWithRetries(Mockito.any()); + assertThrows( + StripeException.class, + () -> { + Subscription.retrieve("sub_123"); + }); + } }