{"id":13485804,"url":"https://github.com/stripe/stripe-java","last_synced_at":"2026-04-29T07:05:11.890Z","repository":{"id":37549656,"uuid":"2176646","full_name":"stripe/stripe-java","owner":"stripe","description":"Java library for the Stripe API.    ","archived":false,"fork":false,"pushed_at":"2026-04-03T00:38:40.000Z","size":1265419,"stargazers_count":967,"open_issues_count":23,"forks_count":394,"subscribers_count":42,"default_branch":"master","last_synced_at":"2026-04-03T01:43:23.341Z","etag":null,"topics":["java","stripe","stripe-sdk"],"latest_commit_sha":null,"homepage":"https://stripe.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stripe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2011-08-09T00:06:31.000Z","updated_at":"2026-04-02T12:33:40.000Z","dependencies_parsed_at":"2026-02-23T21:06:25.276Z","dependency_job_id":null,"html_url":"https://github.com/stripe/stripe-java","commit_stats":{"total_commits":2159,"total_committers":164,"mean_commits":"13.164634146341463","dds":0.8068550254747568,"last_synced_commit":"dab97fe985990811aba446fece79ad5eef30f22c"},"previous_names":[],"tags_count":871,"template":false,"template_full_name":null,"purl":"pkg:github/stripe/stripe-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stripe%2Fstripe-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stripe%2Fstripe-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stripe%2Fstripe-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stripe%2Fstripe-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stripe","download_url":"https://codeload.github.com/stripe/stripe-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stripe%2Fstripe-java/sbom","scorecard":{"id":627263,"data":{"date":"2025-08-11","repo":{"name":"github.com/stripe/stripe-java","commit":"03ae4a9af088c3f0891f6eb57196c66832cb9422"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.7,"checks":[{"name":"Maintained","score":10,"reason":"15 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":9,"reason":"Found 19/21 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/ci.yml:146","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/rules.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":8,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: required approving review count is 1 on branch 'master'","Warn: codeowners review is not required on branch 'master'","Info: status check found to merge onto on branch 'master'","Info: PRs are required in order to make changes on branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/stripe/.github/SECURITY.md:1","Info: Found linked content: github.com/stripe/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/stripe/.github/SECURITY.md:1","Info: Found text in security policy: github.com/stripe/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:94: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:106: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:109: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:132: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:148: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:151: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:170: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:174: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:194: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:213: update your workflow using https://app.stepsecurity.io/secureworkflow/stripe/stripe-java/ci.yml/master?enable=pin","Info:   0 out of  13 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/ci.yml:98"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T06:50:21.537Z","repository_id":37549656,"created_at":"2025-08-21T06:50:21.537Z","updated_at":"2025-08-21T06:50:21.537Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31575755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","stripe","stripe-sdk"],"created_at":"2024-07-31T18:00:31.967Z","updated_at":"2026-04-29T07:05:11.878Z","avatar_url":"https://github.com/stripe.png","language":"Java","funding_links":[],"categories":["Projects","API Clients \u0026 SDKs","项目"],"sub_categories":["Financial","Official SDKs","财务"],"readme":"# Stripe Java client library\n\n[![Maven Central](https://img.shields.io/badge/maven--central-v32.1.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java)\n[![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java)\n[![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster)\n\n\u003e [!TIP]\n\u003e Want to chat live with Stripe engineers? Join us on our [Discord server](https://stripe.com/go/discord/java).\n\nThe official [Stripe][stripe] Java client library.\n\n## Installation\n\n### Requirements\n\nWe support LTS versions of the JDK. Currently, that's Java versions:\n\n- 8 (1.8)\n- 11\n- 17\n- 21\n- 25\n\n### Gradle users\n\nAdd this dependency to your project's build file:\n\n```groovy\nimplementation \"com.stripe:stripe-java:32.1.0\"\n```\n\n### Maven users\n\nAdd this dependency to your project's POM:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.stripe\u003c/groupId\u003e\n  \u003cartifactId\u003estripe-java\u003c/artifactId\u003e\n  \u003cversion\u003e32.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Others\n\nIf you are not using Gradle or Maven, you will need to manually install the following JARs:\n\n1. The Stripe JAR:\n   - Download the latest release version from [Maven Central](https://repo1.maven.org/maven2/com/stripe/stripe-java/32.1.0/stripe-java-32.1.0.jar)\n   - Current release version: 32.1.0\n\n2. Google Gson:\n   - The Stripe JAR builds and tests with Gson version 2.10.1\n   - Download from [Maven Central](https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar)\n   - We recommend using the same version of Gson if possible to guarantee compatibility, but you should be able to use any stable version of Gson that is 2.10.1 or newer\n\nTo use these JARs:\n1. Download the JARs from the links provided above\n2. Add the JARs to your project's classpath\n\n### [ProGuard][proguard]\n\nIf you're planning on using ProGuard, make sure that you exclude the Stripe\nclient library. You can do this by adding the following to your `proguard.cfg`\nfile:\n\n```\n-keep class com.stripe.** { *; }\n```\n\n## Documentation\n\nPlease see the [Java API docs][api-docs] for the most\nup-to-date documentation.\n\nYou can also refer to the [online Javadoc][javadoc].\n\n## Usage\n\nStripeExample.java\n\n```java\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport com.stripe.StripeClient;\nimport com.stripe.exception.StripeException;\nimport com.stripe.model.Customer;\nimport com.stripe.net.RequestOptions;\nimport com.stripe.param.CustomerCreateParams;\n\npublic class StripeExample {\n\n    public static void main(String[] args) {\n        StripeClient client = new StripeClient(\"sk_test_...\");\n        CustomerCreateParams params =\n            CustomerCreateParams\n                .builder()\n                .setDescription(\"Example description\")\n                .setEmail(\"test@example.com\")\n                .setPaymentMethod(\"pm_card_visa\")  // obtained via Stripe.js\n                .build();\n\n        try {\n            Customer customer = client.v1().customers().create(params);\n            System.out.println(customer);\n        } catch (StripeException e) {\n            e.printStackTrace();\n        }\n    }\n}\n```\n\nSee the project's [functional tests][functional-tests] for more examples.\n\n### StripeClient vs legacy pattern\n\nWe introduced the `StripeClient` class in v23 of the Java SDK. The legacy pattern used prior to that version is still available to use but will be marked as deprecated soon. Review the [migration guide to use StripeClient](https://github.com/stripe/stripe-java/wiki/Migration-guide-for-v23#stripeclient) to move from the legacy pattern.\n\nOnce the legacy pattern is deprecated, new API endpoints will only be accessible in the StripeClient. While there are no current plans to remove the legacy pattern for existing API endpoints, this may change in the future.\n\n### Per-request Configuration\n\nAll the request methods accept an optional `RequestOptions` object. This is\nused if you want to set an [idempotency key][idempotency-keys], if you are\nusing [Stripe Connect][connect-auth], or if you want to pass the secret API\nkey on each method.\n\n```java\nRequestOptions requestOptions = RequestOptions.builder()\n    .setApiKey(\"sk_test_...\")\n    .setIdempotencyKey(\"a1b2c3...\")\n    .setStripeAccount(\"acct_...\")\n    .build();\n\nclient.v1().customers().list(requestOptions);\n\nclient.v1().customers().retrieve(\"cus_123456789\", requestOptions);\n```\n\n### Configuring automatic retries\n\nThe library can be configured to automatically retry requests that fail due to\nan intermittent network problem or other knowingly non-deterministic errors.\nThis can be enabled globally:\n\n```java\nStripeClient client = StripeClient.builder()\n        .setMaxNetworkRetries(2)\n        .build();\n```\n\nOr on a finer grain level using `RequestOptions`:\n\n```java\nRequestOptions options = RequestOptions.builder()\n    .setMaxNetworkRetries(2)\n    .build();\nclient.v1().customers().create(params, options);\n```\n\n[Idempotency keys][idempotency-keys] are added to requests to guarantee that\nretries are safe.\n\n### Configuring Timeouts\n\nConnect and read timeouts can be configured globally:\n\n```java\nStripeClient client = StripeClient.builder()\n        .setConnectTimeout(30 * 1000); // in milliseconds\n        .setReadTimeout(80 * 1000);\n        .build();\n```\n\nOr on a finer grain level using `RequestOptions`:\n\n```java\nRequestOptions options = RequestOptions.builder()\n    .setConnectTimeout(30 * 1000) // in milliseconds\n    .setReadTimeout(80 * 1000)\n    .build();\nclient.v1().customers().create(params, options);\n```\n\nPlease take care to set conservative read timeouts. Some API requests can take\nsome time, and a short timeout increases the likelihood of a problem within our\nservers.\n\n### Configuring DNS Cache TTL\n\nWe cannot guarantee that the IP address of the Stripe API will be static.\nCommonly, default JVM configurations can have their DNS cache TTL set to\nforever. If Stripe's IP address changes, your application's requests to\nStripe will all fail until the JVM restarts. Therefore we recommend that\nyou modify the JVM's [networkaddress.cache.ttl\nproperty](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/doc-files/net-properties.html)\nto `60` seconds.\n\n### How to use undocumented parameters and properties\n\nstripe-java is a typed library and it supports all public properties or parameters.\n\nStripe sometimes has beta which introduces new properties or parameters that are not immediately public. The library does not support these properties or parameters until they are public but there is still an approach that allows you to use them.\n\n#### Parameters\n\nTo pass undocumented parameters to Stripe using stripe-java you need to use the `putExtraParam()` method, as shown below:\n\n```java\nCustomerCreateParams params =\n  CustomerCreateParams.builder()\n    .setEmail(\"jenny.rosen@example.com\")\n    .putExtraParam(\"secret_feature_enabled\", \"true\")\n    .putExtraParam(\"secret_parameter[primary]\", \"primary value\")\n    .putExtraParam(\"secret_parameter[secondary]\", \"secondary value\")\n    .build();\n\nclient.v1().customers().create(params);\n```\n\n#### Properties\n\nTo retrieve undocumented properties from Stripe using Java you can use an option in the library to return the raw JSON object and return the property as a native type. An example of this is shown below:\n\n```java\nfinal Customer customer = client.v1().customers().retrieve(\"cus_1234\");\nBoolean featureEnabled =\n  customer.getRawJsonObject()\n    .getAsJsonPrimitive(\"secret_feature_enabled\")\n    .getAsBoolean();\nString primaryValue =\n  customer.getRawJsonObject()\n    .getAsJsonObject(\"secret_parameter\")\n    .getAsJsonPrimitive(\"primary\")\n    .getAsString();\nString secondaryValue =\n  customer.getRawJsonObject()\n    .getAsJsonObject(\"secret_parameter\")\n    .getAsJsonPrimitive(\"secondary\")\n    .getAsString();\n```\n\n### Writing a plugin\n\nIf you're writing a plugin that uses the library, we'd appreciate it if you\nidentified using `Stripe.setAppInfo()`:\n\n```java\nStripe.setAppInfo(\"MyAwesomePlugin\", \"1.2.34\", \"https://myawesomeplugin.info\");\n```\n\nThis information is passed along when the library makes calls to the Stripe\nAPI.\n\n### Request latency telemetry\n\nBy default, the library sends request latency telemetry to Stripe. These\nnumbers help Stripe improve the overall latency of its API for all users.\n\nYou can disable this behavior if you prefer:\n\n```java\nStripe.enableTelemetry = false;\n```\n\n### Public Preview SDKs\n\nStripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `25.2.0-beta.2`.\nWe would love for you to try these as we incrementally release new features and improve them based on your feedback.\n\n To install, pick the latest version with the `beta` suffix by reviewing the [releases page](https://github.com/stripe/stripe-java/releases/) and then use it [installation steps above](#installation).\n\n\u003e **Note**\n\u003e There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest public preview SDK.\n\nSome preview features require a name and version to be set in the `Stripe-Version` header like `feature_beta=v3`. If your preview feature has this requirement, use the `Stripe.addBetaVersion` function (available only in the public preview SDKs):\n\n```java\nStripe.addBetaVersion(\"feature_beta\", \"v3\");\n```\n### Private Preview SDKs\n\nStripe 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`.\n\n### Custom requests\n\n\u003e This feature is only available from version 27 of this SDK.\n\nIf you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `rawRequest` method on `StripeClient`.\n\n```java\n// (Optional) Create a RawRequestOptions object, allowing you to set per-request\n// configuration options like additional headers.\nMap\u003cString, String\u003e stripeVersionHeader = new HashMap\u003c\u003e();\nstripeVersionHeader.put(\"Stripe-Version\", \"2024-09-30.acacia\");\nRawRequestOptions options = RawRequestOptions.builder()\n        .setAdditionalHeaders(stripeVersionHeader)\n        .build();\n\n// Make the request using the StripeClient.rawRequest() method.\nStripeClient client = new StripeClient(\"sk_test_...\");\nfinal StripeResponse response =\n        client.rawRequest(\n                ApiResource.RequestMethod.POST, \"/v1/customers\", \"name=johndoe\u0026email=johndoe@example.com\", options);\n\n// (Optional) response.body() is a string. You can call\n// StripeClient.deserialize() to get a StripeObject\n// Pass ApiMode.V2 if the endpoint you are targeting starts with \"/v2\", else pass ApiMode.V1\nStripeObject object = client.deserialize(response.body(), ApiMode.V1);\n// or cast it if a corresponding response class exists in the SDK\nCustomer customer = (Customer) client.deserialize(response.body(), ApiMode.V1);\n```\n\n## Support\n\nNew features and bug fixes are released on the latest major version of the Stripe Java client library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.\n\n## Development\n\n[Contribution guidelines for this project](CONTRIBUTING.md)\n\nJDK 17 is required to build the Stripe Java library. By default, tests use the same Java runtime as the build.\nTo use a custom version of Java runtime for tests set the `JAVA_TEST_HOME` environment variable to runtime's\nhome directory.\n\nThe test suite depends on [stripe-mock], so make sure to fetch and run it from a\nbackground terminal ([stripe-mock's README][stripe-mock] also contains\ninstructions for installing via Homebrew and other methods):\n\n```sh\ngo get -u github.com/stripe/stripe-mock\nstripe-mock\n```\n\nWe use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`.\n\nTo run all checks (tests and code formatting):\n\n```sh\n./gradlew check\n```\n\nTo run the tests:\n\n```sh\njust test\n# or: ./gradlew test\n```\n\nYou can run particular tests by passing `--tests Class#method`. Make sure you\nuse the fully qualified class name. For example:\n\n```sh\njust test-one com.stripe.model.AccountTest\njust test-one com.stripe.functional.CustomerTest\njust test-one com.stripe.functional.CustomerTest.testCustomerCreate\n# or: ./gradlew test --tests com.stripe.model.AccountTest\n# or: ./gradlew test --tests com.stripe.functional.CustomerTest\n# or: ./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate\n```\n\nThe library uses [Spotless][spotless] along with\n[google-java-format][google-java-format] for code formatting. Code must be\nformatted before PRs are submitted, otherwise CI will fail. Run the formatter\nwith:\n\n```sh\njust format\n# or: ./gradlew spotlessApply\n```\n\nThe library uses [Project Lombok][lombok]. While it is not a requirement, you\nmight want to install a [plugin][lombok-plugins] for your favorite IDE to\nfacilitate development.\n\n[api-docs]: https://stripe.com/docs/api?lang=java\n[connect-auth]: https://stripe.com/docs/connect/authentication#stripe-account-header\n[functional-tests]: https://github.com/stripe/stripe-java/blob/master/src/test/java/com/stripe/functional/\n[google-java-format]: https://github.com/google/google-java-format\n[gson]: https://github.com/google/gson\n[idempotency-keys]: https://stripe.com/docs/api/idempotent_requests?lang=java\n[javadoc]: https://stripe.dev/stripe-java\n[lombok]: https://projectlombok.org\n[lombok-plugins]: https://projectlombok.org/setup/overview\n[proguard]: https://www.guardsquare.com/en/products/proguard\n[spotless]: https://github.com/diffplug/spotless\n[stripe]: https://stripe.com\n[stripe-mock]: https://github.com/stripe/stripe-mock\n\n\u003c!--\n# vim: set tw=79:\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstripe%2Fstripe-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstripe%2Fstripe-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstripe%2Fstripe-java/lists"}