Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ indent_size = 2
[*.json]
indent_style = space
indent_size = 2

[CHANGELOG.md]
trim_trailing_whitespace = false
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ List out the key changes made in this PR, e.g.

### See Also
<!-- Include any links or additional information that help explain this change. -->

## Changelog
<!-- Heads up! This section should include entries for any user-facing changes.
Either fill it out or remove it if there are no entries to report.

List changes that affect end users, e.g.
- Fixes crash when calling `foo.bar()` with null argument
- Adds support for new `baz` parameter on `PaymentIntent` creation

List breaking changes first with a ⚠️ prefix, e.g.
- ⚠️ Removes deprecated `legacy_method` function
-->
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 33.0.0 - 2026-06-05

This release **doesn't** change the pinned API version; it still uses `2026-05-27.dahlia`.

We're doing an out-of-band-major to update a field type that changed. If you're not using `tax_details`, this is a no-op release when compared with the last one. If you _are_ using `tax_details` its type has changed slightly and you'll have to update your code when upgrading.

* [#2234](https://github.com/stripe/stripe-java/pull/2234) ⚠️ Make `tax_rate.tax_details` expandable
* [#2230](https://github.com/stripe/stripe-java/pull/2230) Add "source" field to user-agent header

## 32.3.0-beta.1 - 2026-05-27
This release changes the pinned API version to 2026-05-27.private.

Expand All @@ -15,6 +24,53 @@ This release changes the pinned API version to 2026-05-27.private.
* ⚠️ Change type of `v2.moneymanagement.ReceivedCredit.bank_transfer.gb_bank_account.network` from `literal('fps')` to `enum('chaps'|'fps')`
* Add support for new value `chaps` on enum `v2.FinancialAddressCreditSimulationCreditParams.network`

## 32.2.0 - 2026-05-27
This release changes the pinned API version to 2026-05-27.dahlia.

* [#2220](https://github.com/stripe/stripe-java/pull/2220) Update generated code
* Add support for new resource `v2.commerce.ProductCatalogImport`
* Add support for `create` and `retrieve` methods on resource `v2.commerce.ProductCatalogImport`
* Add support for `bizumPayments` and `scalapayPayments` on `Account.capabilities`, `AccountCreateParams.capabilities`, and `AccountUpdateParams.capabilities`
* Add support for `automaticTransferRulesByCurrency` on `BalanceSettings.payments.payouts` and `BalanceSettingsUpdateParams.payments.payouts`
* Add support for `startOfDay` on `BalanceSettings.payments.settlement_timing` and `BalanceSettingsUpdateParams.payments.settlement_timing`
* Add support for `description` on `ChargeCreateParams.transfer_data`, `PaymentIntent.transfer_data`, `PaymentIntentCreateParams.transfer_data`, and `PaymentIntentUpdateParams.transfer_data`
* Add support for `bizum` on `Charge.payment_method_details`, `ConfirmationToken.payment_method_preview`, `ConfirmationTokenCreateParams.payment_method_data`, `PaymentAttemptRecord.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethod`, `PaymentRecord.payment_method_details`, `SetupIntent.payment_method_options`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentConfirmParams.payment_method_options`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentCreateParams.payment_method_options`, `SetupIntentUpdateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_options`
* Add support for `scalapay` on `Charge.payment_method_details`, `ConfirmationToken.payment_method_preview`, `ConfirmationTokenCreateParams.payment_method_data`, `PaymentAttemptRecord.payment_method_details`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethod`, `PaymentRecord.payment_method_details`, `Refund.destination_details`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, `SetupIntentUpdateParams.payment_method_data`, `checkout.Session.payment_method_options`, and `checkout.SessionCreateParams.payment_method_options`
* Add support for `mandate` on `Charge.payment_method_details.twint`, `PaymentAttemptRecord.payment_method_details.twint`, and `PaymentRecord.payment_method_details.twint`
* Add support for new values `bizum` and `scalapay` on enums `PaymentIntentConfirmParams.excludedPaymentMethodTypes`, `PaymentIntentCreateParams.excludedPaymentMethodTypes`, `PaymentIntentUpdateParams.excludedPaymentMethodTypes`, `SetupIntentCreateParams.excludedPaymentMethodTypes`, `SetupIntentUpdateParams.excludedPaymentMethodTypes`, and `checkout.SessionCreateParams.excludedPaymentMethodTypes`
* Change type of `PaymentIntentConfirmParams.payment_method_options.twint.setupFutureUsage`, `PaymentIntentCreateParams.payment_method_options.twint.setupFutureUsage`, `PaymentIntentUpdateParams.payment_method_options.twint.setupFutureUsage`, and `checkout.SessionCreateParams.payment_method_options.twint.setupFutureUsage` from `literal('none')` to `enum('none'|'off_session')`
* Add support for new values `bizum` and `scalapay` on enum `checkout.SessionCreateParams.paymentMethodTypes`
* ⚠️ Change type of `PaymentIntent.payment_method_options.twint.setupFutureUsage` and `checkout.Session.payment_method_options.twint.setupFutureUsage` from `literal('none')` to `enum('none'|'off_session')`
* Add support for new values `bizum` and `scalapay` on enums `ConfirmationTokenCreateParams.payment_method_data.type`, `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for new values `bizum` and `scalapay` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type`
* Add support for `creditedItems` on `InvoiceItem.proration_details`
* Add support for new value `twint` on enums `InvoiceCreateParams.payment_settings.paymentMethodTypes`, `InvoiceUpdateParams.payment_settings.paymentMethodTypes`, `SubscriptionCreateParams.payment_settings.paymentMethodTypes`, and `SubscriptionUpdateParams.payment_settings.paymentMethodTypes`
* Add support for `discountable` on `InvoiceCreatePreviewParams.schedule_details.phases[].add_invoice_items[]`, `SubscriptionCreateParams.add_invoice_items[]`, `SubscriptionSchedule.phases[].add_invoice_items[]`, `SubscriptionScheduleCreateParams.phases[].add_invoice_items[]`, `SubscriptionScheduleUpdateParams.phases[].add_invoice_items[]`, and `SubscriptionUpdateParams.add_invoice_items[]`
* Add support for `billingSchedules` on `InvoiceCreatePreviewParams.subscription_details`, `SubscriptionCreateParams`, `SubscriptionUpdateParams`, and `Subscription`
* Add support for new value `max_billed_until` on enums `InvoiceCreatePreviewParams.subscription_details.cancelAt`, `SubscriptionCreateParams.cancelAt`, and `SubscriptionUpdateParams.cancelAt`
* Add support for `amountPaidOffStripe` on `Invoice`
* Add support for `twint` on `Mandate.payment_method_details` and `SetupAttempt.payment_method_details`
* Add support for `metadata` on `PaymentIntent.transfer_data`, `PaymentIntentCreateParams.transfer_data`, `PaymentIntentUpdateParams.transfer_data`, and `Subscription.pending_update`
* Add support for `paymentData` on `PaymentIntent.transfer_data`, `PaymentIntentCreateParams.transfer_data`, and `PaymentIntentUpdateParams.transfer_data`
* Add support for `blikAuthorize` on `PaymentIntent.next_action` and `SetupIntent.next_action`
* Add support for `paymentMethodOptions` on `PaymentLinkCreateParams`, `PaymentLinkUpdateParams`, and `PaymentLink`
* Add support for new value `bizum` on enums `PaymentLinkCreateParams.paymentMethodTypes` and `PaymentLinkUpdateParams.paymentMethodTypes`
* Add support for `active` on `PaymentMethodConfigurationListParams`
* Add support for `billedUntil` on `SubscriptionItem`
* Add support for `discount` and `discounts` on `Subscription.pending_update`
* Add support for `verifoneM425`, `verifoneP630`, `verifoneUx700`, and `verifoneV660p` on `terminal.ConfigurationCreateParams`, `terminal.ConfigurationUpdateParams`, and `terminal.Configuration`
* Add support for new values `simulated_verifone_m425`, `simulated_verifone_p630`, `simulated_verifone_ux700`, `simulated_verifone_v660p`, `verifone_m425`, `verifone_p630`, `verifone_ux700`, and `verifone_v660p` on enum `terminal.ReaderListParams.deviceType`
* Add support for `apiError` and `printContent` on `terminal.Reader.action`
* Add support for `customer` on `testhelpers.TestClockCreateParams`
* Add support for new value `2026-05-27.dahlia` on enum `WebhookEndpointCreateParams.apiVersion`
* Add support for `signer` on `v2.core.Account.identity.business_details.documents.proof_of_registration`, `v2.core.Account.identity.business_details.documents.proof_of_ultimate_beneficial_ownership`, `v2.core.AccountCreateParams.identity.business_details.documents.proof_of_registration`, `v2.core.AccountCreateParams.identity.business_details.documents.proof_of_ultimate_beneficial_ownership`, `v2.core.AccountTokenCreateParams.identity.business_details.documents.proof_of_registration`, `v2.core.AccountTokenCreateParams.identity.business_details.documents.proof_of_ultimate_beneficial_ownership`, `v2.core.AccountUpdateParams.identity.business_details.documents.proof_of_registration`, and `v2.core.AccountUpdateParams.identity.business_details.documents.proof_of_ultimate_beneficial_ownership`
* Add support for `azureEventGrid` on `v2.core.EventDestinationCreateParams` and `v2.core.EventDestination`
* Add support for new value `azure_event_grid` on enum `v2.core.EventDestinationCreateParams.type`
* Add support for new value `meter_event_value_too_many_digits` on enums `EventsV1BillingMeterErrorReportTriggeredEvent.reason.error_types[].code` and `EventsV1BillingMeterNoMeterFoundEvent.reason.error_types[].code`
* Add support for event notifications `V2CommerceProductCatalogImportsFailedEvent`, `V2CommerceProductCatalogImportsProcessingEvent`, `V2CommerceProductCatalogImportsSucceededEvent`, and `V2CommerceProductCatalogImportsSucceededWithErrorsEvent` with related object `v2.commerce.ProductCatalogImport`
* [#2219](https://github.com/stripe/stripe-java/pull/2219) Emit warning when `stripe-notify` header is present in response
* [#2218](https://github.com/stripe/stripe-java/pull/2218) Add better example for accessing non-documented properties in a list response

## 32.2.0-beta.2 - 2026-04-24
* [#2210](https://github.com/stripe/stripe-java/pull/2210) Update generated code for beta
* Add support for new resources `v2.commerce.ProductCatalogImport`, `v2.data.reporting.QueryRun`, `v2.extend.WorkflowRun`, `v2.extend.Workflow`, `v2.iam.ActivityLog`, `v2.network.BusinessProfile`, and `v2.orchestratedcommerce.Agreement`
Expand Down
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1af5aa444ea8141a2d2b8d86e76c73f788f65e09
d4c29f2350721870596931042bd8edf49187fe0c
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2277
v2314
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Stripe.addBetaVersion("feature_beta", "v3");

### Private Preview SDKs

Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `25.2.0-alpha.2`. These are invite-only features. Once invited, you can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-java?tab=readme-ov-file#public-preview-sdks) above and replacing the term `beta` with `alpha`.
Stripe has features in the [private preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-alpha.X` suffix like `25.2.0-alpha.2`. You can install the private preview SDKs by following the same instructions as for the [public preview SDKs](https://github.com/stripe/stripe-java?tab=readme-ov-file#public-preview-sdks) above and replacing the term `beta` with `alpha`. Note that access to specific private preview API features may require separate approval.

### Custom requests

Expand Down Expand Up @@ -335,6 +335,9 @@ New features and bug fixes are released on the latest major version of the Strip

## Development

> [!WARNING]
> External contributions to this repo from first-time contributors are currently on hiatus. If you'd like to see a change made to the package, please open an issue.

[Contribution guidelines for this project](CONTRIBUTING.md)

JDK 17 is required to build the Stripe Java library. By default, tests use the same Java runtime as the build.
Expand Down
52 changes: 52 additions & 0 deletions src/main/java/com/stripe/net/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.InputStream;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.security.MessageDigest;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
Expand All @@ -26,6 +27,53 @@ public abstract class HttpClient {
/** A value indicating whether the client should sleep between automatic request retries. */
boolean networkRetriesSleep = true;

static String UNAME_HASH = computeUnameHash();

private static String computeUnameHash() {
String uname = "";
try {
uname =
(System.getProperty("os.name", "")
+ " "
+ System.getProperty("os.version", "")
+ " "
+ System.getProperty("os.arch", "")
+ " "
+ System.getProperty("java.version", "")
+ " "
+ System.getProperty("java.vendor", "")
+ " "
+ System.getProperty("java.vm.name", "")
+ " "
+ getHostname())
.trim();
} catch (Exception e) {
// fall through with empty string
}
if (uname.isEmpty()) {
return "";
}
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] hashBytes = md.digest(uname.getBytes(java.nio.charset.StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder();
for (byte b : hashBytes) {
sb.append(String.format("%02x", b));
}
return sb.toString();
} catch (Exception e) {
return "";
}
}

private static String getHostname() {
try {
return java.net.InetAddress.getLocalHost().getHostName();
} catch (Exception e) {
return "";
}
}

/** Initializes a new instance of the {@link HttpClient} class. */
protected HttpClient() {}

Expand Down Expand Up @@ -228,6 +276,10 @@ static String buildXStripeClientUserAgentString(String aiAgent) {
propertyMap.put("ai_agent", aiAgent);
}

if (!UNAME_HASH.isEmpty()) {
propertyMap.put("source", UNAME_HASH);
}

return ApiResource.INTERNAL_GSON.toJson(propertyMap);
}

Expand Down
27 changes: 0 additions & 27 deletions src/test/java/com/stripe/functional/AccountLinkTest.java

This file was deleted.

67 changes: 0 additions & 67 deletions src/test/java/com/stripe/functional/ApplePayDomainTest.java

This file was deleted.

35 changes: 0 additions & 35 deletions src/test/java/com/stripe/functional/ApplicationFeeTest.java

This file was deleted.

Loading
Loading