Skip to content

Commit

Permalink
Merge pull request #1508 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
API Updates for beta branch
  • Loading branch information
pakrym-stripe committed Jan 19, 2023
2 parents ed71afc + 5651550 commit 93f6b29
Show file tree
Hide file tree
Showing 23 changed files with 885 additions and 38 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 22.6.0 - 2023-01-19
* [#1507](https://github.com/stripe/stripe-java/pull/1507) API Updates
* Add support for `verification_session` on `EphemeralKeyCreateParams`
* Add support for new values `refund.created` and `refund.updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

## 22.6.0-beta.2 - 2023-01-12
* [#1506](https://github.com/stripe/stripe-java/pull/1506) API Updates for beta branch
* Add support for new resource `Tax.Registration`
Expand All @@ -10,7 +15,7 @@
* Remove support for `index` on `QuoteLine.actions[].add_item.discounts[]`, `QuoteLine.actions[].remove_discount`, `QuoteLine.actions[].set_discounts[]`, `QuoteLine.actions[].set_items[].discounts[]`, `SubscriptionSchedule.phases[].add_invoice_items[].discounts[]`, `SubscriptionSchedule.phases[].discounts[]`, and `SubscriptionSchedule.phases[].items[].discounts[]`
* Add support for new values `quote.accepting`, `quote.reestimated`, and `quote.stale` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

* Updated stable APIs to the latest version
* Updated stable APIs to the latest version

## 22.6.0-beta.1 - 2023-01-05
* [#1504](https://github.com/stripe/stripe-java/pull/1504) API Updates for beta branch
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v218
v219
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ final class EventDataClassLookup {

classLookup.put("tax.calculation", com.stripe.model.tax.Calculation.class);
classLookup.put("tax.registration", com.stripe.model.tax.Registration.class);
classLookup.put("tax.settings", com.stripe.model.tax.Settings.class);
classLookup.put("tax.transaction", com.stripe.model.tax.Transaction.class);

classLookup.put("terminal.configuration", com.stripe.model.terminal.Configuration.class);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/stripe/model/PaymentLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public static class CustomText extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class ShippingAddress extends StripeObject {
/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
@SerializedName("message")
String message;
}
Expand All @@ -496,7 +496,7 @@ public static class ShippingAddress extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Submit extends StripeObject {
/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
@SerializedName("message")
String message;
}
Expand Down
28 changes: 22 additions & 6 deletions src/main/java/com/stripe/model/Quote.java
Original file line number Diff line number Diff line change
Expand Up @@ -1516,8 +1516,8 @@ public static class Canceled extends StripeObject {
/**
* The reason this quote was marked as canceled.
*
* <p>One of {@code quote_accepted}, {@code quote_expired}, {@code quote_superseded}, {@code
* subscription_canceled}, or {@code user_canceled}.
* <p>One of {@code canceled}, {@code quote_accepted}, {@code quote_expired}, {@code
* quote_superseded}, or {@code subscription_canceled}.
*/
@SerializedName("reason")
String reason;
Expand Down Expand Up @@ -1557,19 +1557,35 @@ public static class LastReason extends StripeObject {
@SerializedName("line_invalid")
String lineInvalid;

/** The state of the subscription before the quote was marked as stale. */
/** The ID of the subscription that was canceled. */
@SerializedName("subscription_canceled")
String subscriptionCanceled;

@SerializedName("subscription_changed")
SubscriptionChanged subscriptionChanged;

/** The state of the subscription schedule before the quote was marked as stale. */
/** The ID of the subscription that was expired. */
@SerializedName("subscription_expired")
String subscriptionExpired;

/** The ID of the subscription schedule that was canceled. */
@SerializedName("subscription_schedule_canceled")
String subscriptionScheduleCanceled;

@SerializedName("subscription_schedule_changed")
SubscriptionScheduleChanged subscriptionScheduleChanged;

/** The ID of the subscription schedule that was released. */
@SerializedName("subscription_schedule_released")
String subscriptionScheduleReleased;

/**
* The reason the quote was marked as stale.
*
* <p>One of {@code bill_on_acceptance_invalid}, {@code line_invalid}, {@code
* subscription_changed}, or {@code subscription_schedule_changed}.
* <p>One of {@code bill_on_acceptance_invalid}, {@code line_invalid}, {@code marked_stale},
* {@code subscription_canceled}, {@code subscription_changed}, {@code
* subscription_expired}, {@code subscription_schedule_canceled}, {@code
* subscription_schedule_changed}, or {@code subscription_schedule_released}.
*/
@SerializedName("type")
String type;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/stripe/model/checkout/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ public static class CustomText extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class ShippingAddress extends StripeObject {
/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
@SerializedName("message")
String message;
}
Expand All @@ -791,7 +791,7 @@ public static class ShippingAddress extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Submit extends StripeObject {
/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
@SerializedName("message")
String message;
}
Expand Down
139 changes: 139 additions & 0 deletions src/main/java/com/stripe/model/tax/Settings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
// File generated from our OpenAPI spec
package com.stripe.model.tax;

import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Address;
import com.stripe.model.StripeObject;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.tax.SettingsRetrieveParams;
import com.stripe.param.tax.SettingsUpdateParams;
import java.util.List;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
* You can use Tax {@code Settings} to manage configurations used by Stripe Tax calculations.
*
* <p>Related guide: <a href="https://stripe.com/docs/tax/connect/settings">Account settings</a>.
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class Settings extends ApiResource {
@SerializedName("defaults")
Defaults defaults;

/**
* 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;

/** The places where your business is located. */
@SerializedName("locations")
List<Settings.Location> locations;

/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code tax.settings}.
*/
@SerializedName("object")
String object;

/** Retrieves Tax <code>Settings</code> for a merchant. */
public static Settings retrieve() throws StripeException {
return retrieve((Map<String, Object>) null, (RequestOptions) null);
}

/** Retrieves Tax <code>Settings</code> for a merchant. */
public static Settings retrieve(RequestOptions options) throws StripeException {
return retrieve((Map<String, Object>) null, options);
}

/** Retrieves Tax <code>Settings</code> for a merchant. */
public static Settings retrieve(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Settings.class, options);
}

/** Retrieves Tax <code>Settings</code> for a merchant. */
public static Settings retrieve(SettingsRetrieveParams params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(ApiResource.RequestMethod.GET, url, params, Settings.class, options);
}

/**
* Updates Tax <code>Settings</code> parameters used in tax calculations. All parameters are
* editable but none can be removed once set.
*/
public static Settings update(Map<String, Object> params) throws StripeException {
return update(params, (RequestOptions) null);
}

/**
* Updates Tax <code>Settings</code> parameters used in tax calculations. All parameters are
* editable but none can be removed once set.
*/
public static Settings update(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, Settings.class, options);
}

/**
* Updates Tax <code>Settings</code> parameters used in tax calculations. All parameters are
* editable but none can be removed once set.
*/
public static Settings update(SettingsUpdateParams params) throws StripeException {
return update(params, (RequestOptions) null);
}

/**
* Updates Tax <code>Settings</code> parameters used in tax calculations. All parameters are
* editable but none can be removed once set.
*/
public static Settings update(SettingsUpdateParams params, RequestOptions options)
throws StripeException {
String url = ApiResource.fullUrl(Stripe.getApiBase(), options, "/v1/tax/settings");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, Settings.class, options);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Defaults extends StripeObject {
/**
* Default <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> used to classify
* your products and prices.
*/
@SerializedName("tax_code")
String taxCode;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Location extends StripeObject {
@SerializedName("address")
Address address;

/**
* The role of this location address.
*
* <p>Equal to {@code head_office}.
*/
@SerializedName("role")
String role;
}
}
29 changes: 27 additions & 2 deletions src/main/java/com/stripe/param/EphemeralKeyCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,26 @@ public class EphemeralKeyCreateParams extends ApiRequestParams {
@SerializedName("stripe-version")
String stripeVersion;

/**
* The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral
* key.
*/
@SerializedName("verification_session")
String verificationSession;

private EphemeralKeyCreateParams(
String customer,
List<String> expand,
Map<String, Object> extraParams,
String issuingCard,
String stripeVersion) {
String stripeVersion,
String verificationSession) {
this.customer = customer;
this.expand = expand;
this.extraParams = extraParams;
this.issuingCard = issuingCard;
this.stripeVersion = stripeVersion;
this.verificationSession = verificationSession;
}

public static Builder builder() {
Expand All @@ -67,10 +76,17 @@ public static class Builder {

private String stripeVersion;

private String verificationSession;

/** Finalize and obtain parameter instance from this builder. */
public EphemeralKeyCreateParams build() {
return new EphemeralKeyCreateParams(
this.customer, this.expand, this.extraParams, this.issuingCard, this.stripeVersion);
this.customer,
this.expand,
this.extraParams,
this.issuingCard,
this.stripeVersion,
this.verificationSession);
}

/** The ID of the Customer you'd like to modify using the resulting ephemeral key. */
Expand Down Expand Up @@ -137,6 +153,15 @@ public Builder setIssuingCard(String issuingCard) {
return this;
}

/**
* The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral
* key.
*/
public Builder setVerificationSession(String verificationSession) {
this.verificationSession = verificationSession;
return this;
}

/**
* Determines the value of the Stripe-Version header. Set this to the API Version of your mobile
* client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public class InvoiceUpcomingLinesParams extends ApiRequestParams {
* Determines how to handle <a
* href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a> when the
* billing cycle changes (e.g., when switching plans, resetting {@code billing_cycle_anchor=now},
* or starting a trial), or if an item's {@code quantity} changes.
* or starting a trial), or if an item's {@code quantity} changes. The default value is {@code
* create_prorations}.
*/
@SerializedName("subscription_proration_behavior")
SubscriptionProrationBehavior subscriptionProrationBehavior;
Expand Down Expand Up @@ -704,6 +705,7 @@ public Builder setSubscriptionPrebilling(
* href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a> when the
* billing cycle changes (e.g., when switching plans, resetting {@code
* billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes.
* The default value is {@code create_prorations}.
*/
public Builder setSubscriptionProrationBehavior(
InvoiceUpcomingLinesParams.SubscriptionProrationBehavior subscriptionProrationBehavior) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/stripe/param/InvoiceUpcomingParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public class InvoiceUpcomingParams extends ApiRequestParams {
* Determines how to handle <a
* href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a> when the
* billing cycle changes (e.g., when switching plans, resetting {@code billing_cycle_anchor=now},
* or starting a trial), or if an item's {@code quantity} changes.
* or starting a trial), or if an item's {@code quantity} changes. The default value is {@code
* create_prorations}.
*/
@SerializedName("subscription_proration_behavior")
SubscriptionProrationBehavior subscriptionProrationBehavior;
Expand Down Expand Up @@ -632,6 +633,7 @@ public Builder setSubscriptionPrebilling(
* href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a> when the
* billing cycle changes (e.g., when switching plans, resetting {@code
* billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes.
* The default value is {@code create_prorations}.
*/
public Builder setSubscriptionProrationBehavior(
InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/param/PaymentLinkCreateParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ public static class ShippingAddress {
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map<String, Object> extraParams;

/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
@SerializedName("message")
String message;

Expand Down Expand Up @@ -1277,7 +1277,7 @@ public Builder putAllExtraParam(Map<String, Object> map) {
return this;
}

/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
public Builder setMessage(String message) {
this.message = message;
return this;
Expand All @@ -1296,7 +1296,7 @@ public static class Submit {
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
Map<String, Object> extraParams;

/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
@SerializedName("message")
String message;

Expand Down Expand Up @@ -1347,7 +1347,7 @@ public Builder putAllExtraParam(Map<String, Object> map) {
return this;
}

/** Text may be up to 500 characters in length. */
/** Text may be up to 1000 characters in length. */
public Builder setMessage(String message) {
this.message = message;
return this;
Expand Down

0 comments on commit 93f6b29

Please sign in to comment.