Skip to content

Commit

Permalink
Merge changes from stripe/stripe-java master
Browse files Browse the repository at this point in the history
  • Loading branch information
helenye-stripe committed May 3, 2024
2 parents 74ea5b8 + 6bc17eb commit 2c02b1e
Show file tree
Hide file tree
Showing 20 changed files with 1,005 additions and 59 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
# Changelog

## 25.5.0 - 2024-05-02
* [#1785](https://github.com/stripe/stripe-java/pull/1785) Update generated code
* Add support for `paypal` on `Dispute.payment_method_details`
* Change type of `Dispute.payment_method_details.type` from `literal('card')` to `enum('card'|'paypal')`
* Change type of `entitlements.FeatureUpdateParams.metadata` from `map(string: string)` to `emptyable(map(string: string))`
* Add support for `payment_method_types` on `PaymentIntentConfirmParams`
* Add support for `ship_from_details` on `Tax.Calculation`, `Tax.Transaction`, and `tax.CalculationCreateParams`
* Add support for `bh`, `eg`, `ge`, `ke`, `kz`, `ng`, and `om` on `Tax.Registration.country_options` and `tax.RegistrationCreateParams.country_options`
* [#1787](https://github.com/stripe/stripe-java/pull/1787) Deprecate Java params based on OpenAPI spec
- Mark as deprecated the `persistent_token` property on `ConfirmationToken.Link.persistentToken`, `PaymentIntent.Link.persistentToken`, `PaymentMethod.Link.persistentToken`, `SetupIntent.Link.persistentToken`, `PaymentIntentConfirmParams.Link.persistentToken`, `PaymentIntentCreateParams.Link.persistentToken`, `PaymentIntentUpdateParams.Link.persistentToken`, `SetupIntentConfirmParams.Link.persistentToken`, `SetupIntentCreateParams.Link.persistentToken`, `SetupIntentUpdateParams.Link.persistentToken`. This is a legacy parameter that no longer has any function.

## 25.5.0-beta.1 - 2024-04-25
* [#1783](https://github.com/stripe/stripe-java/pull/1783) Update generated code for beta
* Add support for `payment_method_settings` on `AccountSessionCreateParams.components`
* Add support for `cancel_subscription_schedule` on `QuoteCreateParams.lines[]`, `QuoteLine`, and `QuoteUpdateParams.lines[]`

## 25.4.0 - 2024-04-25
* [#1784](https://github.com/stripe/stripe-java/pull/1784) Update generated code
* Add support for `setup_future_usage` on `Checkout.Session.payment_method_options.amazon_pay`, `Checkout.Session.payment_method_options.revolut_pay`, `PaymentIntent.payment_method_options.amazon_pay`, and `PaymentIntent.payment_method_options.revolut_pay`
* Change type of `Entitlements.ActiveEntitlement.feature` from `string` to `expandable($Entitlements.Feature)`
* Remove support for inadvertently released identity verification features `email` and `phone` on `identity.VerificationSessionCreateParams.options` and `identity.VerificationSessionUpdateParams.options`
* Add support for new values `amazon_pay` and `revolut_pay` on enums `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]`
* Add support for `amazon_pay` and `revolut_pay` on `Mandate.payment_method_details` and `SetupAttempt.payment_method_details`
* Add support for `ending_before`, `limit`, and `starting_after` on `PaymentMethodConfigurationListParams`
* Add support for `mobilepay` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration`

## 25.4.0-beta.1 - 2024-04-18
* [#1781](https://github.com/stripe/stripe-java/pull/1781) Update generated code for beta
* Add support for `capital_overview`, `tax_registrations`, and `tax_settings` on `AccountSessionCreateParams.components`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v992
v992
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ tasks.withType(JavaCompile) {
throw new GradleException("JDK 17 is required to build Stripe")
}

options.fork = true
options.forkOptions.jvmArgs += ['-Xms256M', '-Xmx512M']

options.release = project.targetCompatibility.majorVersion as Integer

options.compilerArgs << "-Xlint:all" << "-Xlint:-options" << "-Xlint:-processing"
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/Charge.java
Original file line number Diff line number Diff line change
Expand Up @@ -2680,6 +2680,7 @@ public static class Link extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Mobilepay extends StripeObject {
/** Internal card details. */
@SerializedName("card")
Card card;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/ConfirmationToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ public static class Link extends StripeObject {

/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;
}

Expand Down
18 changes: 17 additions & 1 deletion src/main/java/com/stripe/model/Dispute.java
Original file line number Diff line number Diff line change
Expand Up @@ -1045,10 +1045,13 @@ public static class PaymentMethodDetails extends StripeObject {
@SerializedName("card")
Card card;

@SerializedName("paypal")
Paypal paypal;

/**
* Payment method type.
*
* <p>Equal to {@code card}.
* <p>One of {@code card}, or {@code paypal}.
*/
@SerializedName("type")
String type;
Expand All @@ -1073,6 +1076,19 @@ public static class Card extends StripeObject {
@SerializedName("network_reason_code")
String networkReasonCode;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Paypal extends StripeObject {
/** The ID of the dispute in PayPal. */
@SerializedName("case_id")
String caseId;

/** The reason for the dispute as defined by PayPal. */
@SerializedName("reason_code")
String reasonCode;
}
}

@Override
Expand Down
31 changes: 30 additions & 1 deletion src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,12 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("period_end")
Long periodEnd;

/** Start of the usage period during which invoice items were added to this invoice. */
/**
* Start of the usage period during which invoice items were added to this invoice. This looks
* back one period for a subscription invoice. Use the <a
* href="https://stripe.com/api/invoices/line_item#invoice_line_item_object-period">line item
* period</a> to get the service period for each price.
*/
@SerializedName("period_start")
Long periodStart;

Expand Down Expand Up @@ -1171,6 +1176,10 @@ public static Invoice create(InvoiceCreateParams params, RequestOptions options)
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview() throws StripeException {
return createPreview((Map<String, Object>) null, (RequestOptions) null);
Expand All @@ -1193,6 +1202,10 @@ public static Invoice createPreview() throws StripeException {
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(RequestOptions options) throws StripeException {
return createPreview((Map<String, Object>) null, options);
Expand All @@ -1215,6 +1228,10 @@ public static Invoice createPreview(RequestOptions options) throws StripeExcepti
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(Map<String, Object> params) throws StripeException {
return createPreview(params, (RequestOptions) null);
Expand All @@ -1237,6 +1254,10 @@ public static Invoice createPreview(Map<String, Object> params) throws StripeExc
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(Map<String, Object> params, RequestOptions options)
throws StripeException {
Expand Down Expand Up @@ -1264,6 +1285,10 @@ public static Invoice createPreview(Map<String, Object> params, RequestOptions o
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(InvoiceCreatePreviewParams params) throws StripeException {
return createPreview(params, (RequestOptions) null);
Expand All @@ -1286,6 +1311,10 @@ public static Invoice createPreview(InvoiceCreatePreviewParams params) throws St
* parameter when doing the actual subscription update. The recommended way to get only the
* prorations being previewed is to consider only proration line items where {@code period[start]}
* is equal to the {@code subscription_details.proration_date} value passed in the request.
*
* <p>Note: Currency conversion calculations use the latest exchange rates. Exchange rates may
* vary between the time of the preview and the time of the actual invoice creation. <a
* href="https://docs.stripe.com/currencies/conversions">Learn more</a>
*/
public static Invoice createPreview(InvoiceCreatePreviewParams params, RequestOptions options)
throws StripeException {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -3870,6 +3870,7 @@ public static class Link extends StripeObject {

/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/PaymentMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ public static class Link extends StripeObject {

/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/stripe/model/SetupIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,7 @@ public static class CardPresent extends StripeObject {}
public static class Link extends StripeObject {
/** [Deprecated] This is a legacy parameter that no longer has any function. */
@SerializedName("persistent_token")
@Deprecated
String persistentToken;
}

Expand Down

0 comments on commit 2c02b1e

Please sign in to comment.