Skip to content

Commit

Permalink
Merge pull request #1681 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Nov 10, 2023
2 parents 17f60db + 2a9e750 commit b387fa3
Show file tree
Hide file tree
Showing 12 changed files with 299 additions and 37 deletions.
18 changes: 11 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@
* Change type of `tax.RegistrationCreateParams.active_from` to `DateTime | 'now'`
* Add support for new value `invoice.payment.overpaid` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

## 24.2.0 - 2023-11-09
* [#1679](https://github.com/stripe/stripe-java/pull/1679) Update generated code
* Add support for `metadata` on `Quote.subscription_data`, `QuoteCreateParams.subscription_data`, and `QuoteUpdateParams.subscription_data`

## 24.1.0 - 2023-11-02
* [#1677](https://github.com/stripe/stripe-java/pull/1677) Update generated code
* Add support for new resource `Tax.Registration`
* Add support for `revolut_pay` throughout the API.
* Add support for `aba` and `swift` on `FundingInstructions.bank_transfer.financial_addresses[]` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[]`
* Add support for `url` on `Issuing.Authorization.merchant_data`, `Issuing.Transaction.merchant_data`, `issuing.AuthorizationCreateParams.merchant_data`, `issuing.TransactionCreateForceCaptureParams.merchant_data`, and `issuing.TransactionCreateUnlinkedRefundParams.merchant_data`
* Add support for `authentication_exemption` and `three_d_secure` on `Issuing.Authorization.verification_data` and `issuing.AuthorizationCreateParams.verification_data`
* Add support for `description` on `PaymentLink.payment_intent_data`, `PaymentLinkCreateParams.payment_intent_data`, and `PaymentLinkUpdateParams.payment_intent_data`
* Add support for new value `unreconciled_customer_funds` on enum `reporting.ReportRunCreateParams.parameters.reporting_category`
* Add support for new resource `Tax.Registration`
* Add support for `revolut_pay` throughout the API.
* Add support for `aba` and `swift` on `FundingInstructions.bank_transfer.financial_addresses[]` and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[]`
* Add support for `url` on `Issuing.Authorization.merchant_data`, `Issuing.Transaction.merchant_data`, `issuing.AuthorizationCreateParams.merchant_data`, `issuing.TransactionCreateForceCaptureParams.merchant_data`, and `issuing.TransactionCreateUnlinkedRefundParams.merchant_data`
* Add support for `authentication_exemption` and `three_d_secure` on `Issuing.Authorization.verification_data` and `issuing.AuthorizationCreateParams.verification_data`
* Add support for `description` on `PaymentLink.payment_intent_data`, `PaymentLinkCreateParams.payment_intent_data`, and `PaymentLinkUpdateParams.payment_intent_data`
* Add support for new value `unreconciled_customer_funds` on enum `reporting.ReportRunCreateParams.parameters.reporting_category`


## 24.1.0-beta.2 - 2023-10-26
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v645
v655
7 changes: 6 additions & 1 deletion src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -2818,7 +2818,12 @@ public static class SepaDebit extends StripeObject {
@SerializedName("last4")
String last4;

/** ID of the mandate used to make this payment. */
/**
* Find the ID of the mandate used for this payment under the <a
* href="https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate">payment_method_details.sepa_debit.mandate</a>
* property on the Charge. Use this mandate ID to <a
* href="https://stripe.com/docs/api/mandates/retrieve">retrieve the Mandate</a>.
*/
@SerializedName("mandate")
String mandate;
}
Expand Down
31 changes: 16 additions & 15 deletions src/main/java/com/stripe/model/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,22 @@ public class Event extends ApiResource implements HasId {
* price.deleted}, {@code price.updated}, {@code product.created}, {@code product.deleted}, {@code
* product.updated}, {@code promotion_code.created}, {@code promotion_code.updated}, {@code
* quote.accept_failed}, {@code quote.accepted}, {@code quote.accepting}, {@code quote.canceled},
* {@code quote.created}, {@code quote.draft}, {@code quote.finalized}, {@code quote.reestimated},
* {@code quote.stale}, {@code radar.early_fraud_warning.created}, {@code
* radar.early_fraud_warning.updated}, {@code refund.created}, {@code refund.updated}, {@code
* reporting.report_run.failed}, {@code reporting.report_run.succeeded}, {@code
* reporting.report_type.updated}, {@code review.closed}, {@code review.opened}, {@code
* setup_intent.canceled}, {@code setup_intent.created}, {@code setup_intent.requires_action},
* {@code setup_intent.setup_failed}, {@code setup_intent.succeeded}, {@code
* sigma.scheduled_query_run.created}, {@code source.canceled}, {@code source.chargeable}, {@code
* source.failed}, {@code source.mandate_notification}, {@code source.refund_attributes_required},
* {@code source.transaction.created}, {@code source.transaction.updated}, {@code
* subscription_schedule.aborted}, {@code subscription_schedule.canceled}, {@code
* subscription_schedule.completed}, {@code subscription_schedule.created}, {@code
* subscription_schedule.expiring}, {@code subscription_schedule.released}, {@code
* subscription_schedule.updated}, {@code tax.form.updated}, {@code tax.settings.updated}, {@code
* tax_rate.created}, {@code tax_rate.updated}, {@code terminal.reader.action_failed}, {@code
* {@code quote.created}, {@code quote.draft}, {@code quote.finalized}, {@code
* quote.reestimate_failed}, {@code quote.reestimated}, {@code quote.stale}, {@code
* radar.early_fraud_warning.created}, {@code radar.early_fraud_warning.updated}, {@code
* refund.created}, {@code refund.updated}, {@code reporting.report_run.failed}, {@code
* reporting.report_run.succeeded}, {@code reporting.report_type.updated}, {@code review.closed},
* {@code review.opened}, {@code setup_intent.canceled}, {@code setup_intent.created}, {@code
* setup_intent.requires_action}, {@code setup_intent.setup_failed}, {@code
* setup_intent.succeeded}, {@code sigma.scheduled_query_run.created}, {@code source.canceled},
* {@code source.chargeable}, {@code source.failed}, {@code source.mandate_notification}, {@code
* source.refund_attributes_required}, {@code source.transaction.created}, {@code
* source.transaction.updated}, {@code subscription_schedule.aborted}, {@code
* subscription_schedule.canceled}, {@code subscription_schedule.completed}, {@code
* subscription_schedule.created}, {@code subscription_schedule.expiring}, {@code
* subscription_schedule.released}, {@code subscription_schedule.updated}, {@code
* tax.form.updated}, {@code tax.settings.updated}, {@code tax_rate.created}, {@code
* tax_rate.updated}, {@code terminal.reader.action_failed}, {@code
* terminal.reader.action_succeeded}, {@code terminal.reader.action_updated}, {@code
* test_helpers.test_clock.advancing}, {@code test_helpers.test_clock.created}, {@code
* test_helpers.test_clock.deleted}, {@code test_helpers.test_clock.internal_failure}, {@code
Expand Down
70 changes: 70 additions & 0 deletions src/main/java/com/stripe/model/Quote.java
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,13 @@ public void setAccountObject(Account expandableObject) {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Computed extends StripeObject {
/**
* Details of the most recent reestimate of the quote's preview schedules and upcoming invoices,
* including the status of Stripe's calculation.
*/
@SerializedName("last_reestimation_details")
LastReestimationDetails lastReestimationDetails;

/**
* The definitive totals and line items the customer will be charged on a recurring basis. Takes
* into account the line items with recurring prices and discounts with {@code duration=forever}
Expand All @@ -1343,6 +1350,57 @@ public static class Computed extends StripeObject {
@SerializedName("upfront")
Upfront upfront;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class LastReestimationDetails extends StripeObject {
/**
* When {@code status} is {@code failed}, provides details about the quote reestimation
* failure.
*/
@SerializedName("failed")
Failed failed;

/**
* Latest status of the reestimation.
*
* <p>One of {@code failed}, {@code in_progress}, or {@code succeeded}.
*/
@SerializedName("status")
String status;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Failed extends StripeObject {
/**
* The failure {@code code} is more granular than the {@code reason} provided and may
* correspond to a Stripe error code. For automation errors, this field is one of: {@code
* reverse_api_failure}, {@code reverse_api_deadline_exceeeded}, or {@code
* reverse_api_response_validation_error}, which are Stripe error codes and map to the error
* {@code message} field.
*/
@SerializedName("failure_code")
String failureCode;

/**
* Information derived from the {@code failure_code} or a freeform message that explains the
* error as a human-readable English string. For example, &quot;margin ID is not a valid
* ID&quot;.
*/
@SerializedName("message")
String message;

/**
* The reason the reestimation failed.
*
* <p>One of {@code automation_failure}, or {@code internal_error}.
*/
@SerializedName("reason")
String reason;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -1878,6 +1936,18 @@ public static class SubscriptionData extends StripeObject {
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Subscription> fromSubscription;

/**
* Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will set
* metadata on the subscription or subscription schedule when the quote is accepted. If a
* recurring price is included in {@code line_items}, this field will be passed to the resulting
* subscription's {@code metadata} field. If {@code subscription_data.effective_date} is used,
* this field will be passed to the resulting subscription schedule's {@code phases.metadata}
* field. Unlike object-level metadata, this field is declarative. Updates will clear prior
* values.
*/
@SerializedName("metadata")
Map<String, String> metadata;

/**
* If specified, the invoicing for the given billing cycle iterations will be processed when the
* quote is accepted. Cannot be used with {@code effective_date}.
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/stripe/model/QuotePhase.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ public class QuotePhase extends ApiResource implements HasId {
@SerializedName("line_items")
LineItemCollection lineItems;

/**
* Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
* declaratively set metadata on the subscription schedule's phases when the quote is accepted.
*/
@SerializedName("metadata")
Map<String, String> metadata;

/**
* String representing the object's type. Objects of the same type share the same value.
*
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/stripe/model/StripeError.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public class StripeError extends StripeObject {
* {@code state_unsupported}, {@code status_transition_invalid}, {@code stripe_tax_inactive},
* {@code tax_id_invalid}, {@code taxes_calculation_failed}, {@code
* terminal_location_country_unsupported}, {@code terminal_reader_busy}, {@code
* terminal_reader_offline}, {@code terminal_reader_timeout}, {@code testmode_charges_only},
* {@code tls_version_unsupported}, {@code token_already_used}, {@code
* token_card_network_invalid}, {@code token_in_use}, {@code
* terminal_reader_hardware_fault}, {@code terminal_reader_offline}, {@code
* terminal_reader_timeout}, {@code testmode_charges_only}, {@code tls_version_unsupported},
* {@code token_already_used}, {@code token_card_network_invalid}, {@code token_in_use}, {@code
* transfer_source_balance_parameters_mismatch}, {@code transfers_not_allowed}, or {@code
* url_invalid}.
*/
Expand Down
81 changes: 81 additions & 0 deletions src/main/java/com/stripe/param/QuoteCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -6208,6 +6208,13 @@ public static class Phase {
@SerializedName("line_items")
List<QuoteCreateParams.Phase.LineItem> lineItems;

/**
* Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will
* declaratively set metadata on the subscription schedule's phases when the quote is accepted.
*/
@SerializedName("metadata")
Map<String, String> metadata;

/**
* If the update changes the current phase, indicates whether the changes should be prorated.
* The default value is {@code create_prorations}.
Expand Down Expand Up @@ -6239,6 +6246,7 @@ private Phase(
InvoiceSettings invoiceSettings,
Long iterations,
List<QuoteCreateParams.Phase.LineItem> lineItems,
Map<String, String> metadata,
ProrationBehavior prorationBehavior,
Boolean trial,
Long trialEnd) {
Expand All @@ -6251,6 +6259,7 @@ private Phase(
this.invoiceSettings = invoiceSettings;
this.iterations = iterations;
this.lineItems = lineItems;
this.metadata = metadata;
this.prorationBehavior = prorationBehavior;
this.trial = trial;
this.trialEnd = trialEnd;
Expand Down Expand Up @@ -6279,6 +6288,8 @@ public static class Builder {

private List<QuoteCreateParams.Phase.LineItem> lineItems;

private Map<String, String> metadata;

private ProrationBehavior prorationBehavior;

private Boolean trial;
Expand All @@ -6297,6 +6308,7 @@ public QuoteCreateParams.Phase build() {
this.invoiceSettings,
this.iterations,
this.lineItems,
this.metadata,
this.prorationBehavior,
this.trial,
this.trialEnd);
Expand Down Expand Up @@ -6504,6 +6516,32 @@ public Builder addAllLineItem(List<QuoteCreateParams.Phase.LineItem> elements) {
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
* QuoteCreateParams.Phase#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 QuoteCreateParams.Phase#metadata} for the field documentation.
*/
public Builder putAllMetadata(Map<String, String> map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}

/**
* If the update changes the current phase, indicates whether the changes should be prorated.
* The default value is {@code create_prorations}.
Expand Down Expand Up @@ -7972,6 +8010,18 @@ public static class SubscriptionData {
@SerializedName("from_subscription")
String fromSubscription;

/**
* Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that will set
* metadata on the subscription or subscription schedule when the quote is accepted. If a
* recurring price is included in {@code line_items}, this field will be passed to the resulting
* subscription's {@code metadata} field. If {@code subscription_data.effective_date} is used,
* this field will be passed to the resulting subscription schedule's {@code phases.metadata}
* field. Unlike object-level metadata, this field is declarative. Updates will clear prior
* values.
*/
@SerializedName("metadata")
Map<String, String> metadata;

/**
* If specified, the invoicing for the given billing cycle iterations will be processed when the
* quote is accepted. Cannot be used with {@code effective_date}.
Expand Down Expand Up @@ -8015,6 +8065,7 @@ private SubscriptionData(
Map<String, Object> extraParams,
String fromSchedule,
String fromSubscription,
Map<String, String> metadata,
Object prebilling,
ProrationBehavior prorationBehavior,
Object trialPeriodDays) {
Expand All @@ -8027,6 +8078,7 @@ private SubscriptionData(
this.extraParams = extraParams;
this.fromSchedule = fromSchedule;
this.fromSubscription = fromSubscription;
this.metadata = metadata;
this.prebilling = prebilling;
this.prorationBehavior = prorationBehavior;
this.trialPeriodDays = trialPeriodDays;
Expand Down Expand Up @@ -8055,6 +8107,8 @@ public static class Builder {

private String fromSubscription;

private Map<String, String> metadata;

private Object prebilling;

private ProrationBehavior prorationBehavior;
Expand All @@ -8073,6 +8127,7 @@ public QuoteCreateParams.SubscriptionData build() {
this.extraParams,
this.fromSchedule,
this.fromSubscription,
this.metadata,
this.prebilling,
this.prorationBehavior,
this.trialPeriodDays);
Expand Down Expand Up @@ -8219,6 +8274,32 @@ public Builder setFromSubscription(String fromSubscription) {
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
* QuoteCreateParams.SubscriptionData#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 QuoteCreateParams.SubscriptionData#metadata} for the field documentation.
*/
public Builder putAllMetadata(Map<String, String> map) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.putAll(map);
return this;
}

/**
* If specified, the invoicing for the given billing cycle iterations will be processed when
* the quote is accepted. Cannot be used with {@code effective_date}.
Expand Down
Loading

0 comments on commit b387fa3

Please sign in to comment.