Java library for the Stripe API.

Related tags

Financial java stripe
Overview

Stripe Java client library

Maven Central JavaDoc Build Status

The official Stripe Java client library.

Installation

Requirements

  • Java 1.8 or later

Gradle users

Add this dependency to your project's build file:

implementation "com.stripe:stripe-java:20.41.0"

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.stripe</groupId>
  <artifactId>stripe-java</artifactId>
  <version>20.41.0</version>
</dependency>

Others

You'll need to manually install the following JARs:

ProGuard

If you're planning on using ProGuard, make sure that you exclude the Stripe client library. You can do this by adding the following to your proguard.cfg file:

-keep class com.stripe.** { *; }

Documentation

Please see the Java API docs for the most up-to-date documentation.

See video demonstrations covering how to use the library.

You can also refer to the online Javadoc.

Usage

StripeExample.java

import java.util.HashMap;
import java.util.Map;

import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.Customer;
import com.stripe.net.RequestOptions;

public class StripeExample {

    public static void main(String[] args) {
        Stripe.apiKey = "sk_test_...";

        Map<String, Object> customerMap = new HashMap<String, Object>();
        customerMap.put("description", "Example description");
        customerMap.put("email", "[email protected]");
        customerMap.put("payment_method", "pm_card_visa"); // obtained via Stripe.js

        try {
            Customer customer = Customer.create(customerMap);
            System.out.println(customer);
        } catch (StripeException e) {
            e.printStackTrace();
        }
    }
}

See the project's functional tests for more examples.

Per-request Configuration

All of the request methods accept an optional RequestOptions object. This is used if you want to set an idempotency key, if you are using Stripe Connect, or if you want to pass the secret API key on each method.

RequestOptions requestOptions = new RequestOptionsBuilder()
    .setApiKey("sk_test_...")
    .setIdempotencyKey("a1b2c3...")
    .setStripeAccount("acct_...")
    .build();

Customer.list(null, requestOptions);

Customer.retrieve("cus_123456789", requestOptions);

Configuring automatic retries

The library can be configured to automatically retry requests that fail due to an intermittent network problem or other knowingly non-deterministic errors. This can be enabled globally:

Stripe.setMaxNetworkRetries(2);

Or on a finer grain level using RequestOptions:

RequestOptions options = RequestOptions.builder()
    .setMaxNetworkRetries(2)
    .build();
Customer.create(params, options);

Idempotency keys are added to requests to guarantee that retries are safe.

Configuring Timeouts

Connect and read timeouts can be configured globally:

Stripe.setConnectTimeout(30 * 1000); // in milliseconds
Stripe.setReadTimeout(80 * 1000);

Or on a finer grain level using RequestOptions:

RequestOptions options = RequestOptions.builder()
    .setConnectTimeout(30 * 1000) // in milliseconds
    .setReadTimeout(80 * 1000)
    .build();
Customer.create(params, options);

Please take care to set conservative read timeouts. Some API requests can take some time, and a short timeout increases the likelihood of a problem within our servers.

Configuring DNS Cache TTL

We cannot guarantee that the IP address of the Stripe API will be static. Commonly, default JVM configurations can have their DNS cache TTL set to forever. If Stripe's IP address changes, your application's requests to Stripe will all fail until the JVM restarts. Therefore we recommend that you modify the JVM's networkaddress.cache.ttl property to 60 seconds.

Writing a plugin

If you're writing a plugin that uses the library, we'd appreciate it if you identified using Stripe.setAppInfo():

Stripe.setAppInfo("MyAwesomePlugin", "1.2.34", "https://myawesomeplugin.info");

This information is passed along when the library makes calls to the Stripe API.

Request latency telemetry

By default, the library sends request latency telemetry to Stripe. These numbers help Stripe improve the overall latency of its API for all users.

You can disable this behavior if you prefer:

Stripe.enableTelemetry = false;

Development

The test suite depends on stripe-mock, so make sure to fetch and run it from a background terminal (stripe-mock's README also contains instructions for installing via Homebrew and other methods):

go get -u github.com/stripe/stripe-mock
stripe-mock

To run all checks (tests and code formatting):

./gradlew check

To run the tests:

./gradlew test

You can run particular tests by passing --tests Class#method. Make sure you use the fully qualified class name. For example:

./gradlew test --tests com.stripe.model.AccountTest
./gradlew test --tests com.stripe.functional.CustomerTest
./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate

The library uses Spotless along with google-java-format for code formatting. Code must be formatted before PRs are submitted, otherwise CI will fail. Run the formatter with:

./gradlew spotlessApply

The library uses Project Lombok. While it is not a requirement, you might want to install a plugin for your favorite IDE to facilitate development.

Comments
  • compile-time safety for api call parameters and types

    compile-time safety for api call parameters and types

    The current java api provides no compile-time safety for api call parameters. Neither the names of the parameters nor the types being passed as values are checked at compile time. It would be beneficial to users of the API to have a fluent style api for Stripe api calls. For example:

        final Refund refund = 
            stripe.refund()
            .create(chargeId)
            .reverseTransfer(true)
            .metadata("reason", "refund due to cancellation")
            .idempotencyKey(stripeRefundNonce)
            .get();
    

    This might seem like a lot of work, however the official Stripe API reference is structured so well that such an API can be generated directly from the HTML. In fact, I know it can be done because that's what I'm doing in my project. A little bit of Javascript, jQuery, and Mustache is all that's needed to create a fluent style api directly from the official reference documentation. Every time the API changes, the corresponding java code can be regenerated automatically. Additionally, because it comes directly from the documentation, we can also incorporate Javadoc:

        /**
         * A cursor for use in pagination. <code>ending_before</code> is an
         * object ID that defines your place in the list. For instance, if
         * you make a list request and receive 100 objects, starting with
         * <code>obj_bar</code>, your subsequent call can include
         * <code>ending_before=obj_bar</code> in order to fetch the previous
         * page of the list.
         */
        public final AllMethod endingBefore(final String endingBefore) {
            return set("ending_before", endingBefore);
        }
    

    If this is something that should be in the official Stripe API then I can create a pull request for it, otherwise I can create a separate project that builds on top of stripe-java.

    future 
    opened by hardtoe 23
  • Use Project Lombok

    Use Project Lombok

    cc @stripe/api-libraries

    This is a proposal to make use of Project Lombok and particularly its @Getter / @Setter and @EqualsAndHashCode annotations to reduce the amount of boilerplate code.

    This PR removes about 6,000 lines of code, while adding some functionality as some of the classes currently lacks some setters or equals() / hashCode() methods.

    This is obviously a non-trivial change, and I don't suggest it be merged as is, but I think it's an interesting improvement worth exploring.

    approved 
    opened by olivierbellone 18
  • Provide a type-safe API method interface

    Provide a type-safe API method interface

    The current interface for creating and updating records requires manual construction of HashMaps.

    Map<String, Object> planParams = new HashMap<String, Object>();
    planParams.put("amount", 5000);
    planParams.put("interval", "month");
    planParams.put("name", "Gold large");
    planParams.put("currency", "usd");
    planParams.put("id", "gold-large");
    Plan.create(planParams);
    

    This pull requests uses Google AutoValue to generate a typed interface for API requests. Creating a plan can now be down in a type-safe manner.

    CreatePlan params = CreatePlan.builder()
        .amount(5000)
        .interval("month")
        .name("Gold large")
        .currency("usd")
        .id("gold-large")
        .build()
    Plan.create(params);
    

    Breaking changes

    If you were calling a method with null before, you'll need to cast or pass an empty value object now.

    -Account account = Account.create(null);
    +Account account = Account.create(new HashMap<String, Object>());
    

    TODO

    • [x] Support nullable arguments
    • [x] Update all methods to include a signature with the correct ValueObject

    Future work

    • Support nested input parameters
    • Use annotations to instead of toMap
    • Type safe interface for retrieval methods (all, retrieve, etc.)
    opened by kjc-stripe 16
  • InvoiceLineItemCollection provided by getLines doesn't get same auth request options with autoPagingIterable

    InvoiceLineItemCollection provided by getLines doesn't get same auth request options with autoPagingIterable

    I'm using this library in a multithreaded environment against various keys granted via oauth by Stripe users for my app, so I provide the appropriate key in request options for each call I make. However, it seems like some of the models' methods don't copy these credentials on additional requests that are made.

    e.g., I call Invoice.list passing my request options, and then on each invoice I call getLines and use the autoPagingIterable to access all invoice line items. However, for any invoice with enough line items such that an additional request is needed I get an exception like this:

    java.lang.RuntimeException: Unable to lazy-load stripe objects
    Caused by: com.stripe.exception.AuthenticationException: No API key provided. (HINT: set your API key using 'Stripe.apiKey = <API-KEY>'. You can generate API keys from the Stripe web interface. See https://stripe.com/api for details or email [email protected] if you have questions.
    

    e: I'm using 1.41.0

    opened by keithblaha 15
  • The source code for 20.128.0 is not what is compiled into classes

    The source code for 20.128.0 is not what is compiled into classes

    Describe the bug

    When trying to debug EventDataObjectDeserializer public Optional getObject() I hit comment lines.

    To Reproduce

    1. Using Maven add dependency 20.128.0
    2. Create a Java snippet: Event event = Webhook.constructEvent(json, header, endpointSecret); Optional optional = event.getDataObjectDeserializer().getObject();
    3. Using Stripe CLI hit a webhook endpoint.
    4. Step into getDataObjectDeserializer.

    Expected behavior

    I expect to step through getObject method code.

    Code snippets

    @RequestMapping(value = "/stripeCheckoutSessionCompleted", method = POST, consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
        @ResponseBody
        public String stripeWebhookEndpoint(HttpServletRequest request) {
            String header = request.getHeader("Stripe-Signature");
            try {
                String json = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8);
                Event event = Webhook.constructEvent(json, header, endpointSecret);
                Optional<StripeObject> optional = event.getDataObjectDeserializer().getObject();
    ...
    

    OS

    Windows 10

    Java version

    11

    stripe-java version

    20.128.0

    API version

    2020-08-27

    Additional context

    No response

    bug 
    opened by geniot 14
  • allow to set connection and read timeout per request.

    allow to set connection and read timeout per request.

    It's important to be able to set a reasonable timeout for http connections. If production server has a network problem or Stripe serve is down, a reasonable timeout could prevent the calling thread from being blocked for huge amount of time.

    Timeout values were previously hard coded in LiveStripeResponseGetter, and the values were frankly quite high (30 seconds for connection and 80 for reads).

    Example:

    RequestOptions options = RequestOptions.builder()
        .setConnectionTimeout(2000)
        .setReadTimeout(5000)
        .build()
    
    Customer.create(params, options);
    
    
    opened by agori 14
  • Balance transaction deserialization with support for expandable source objects

    Balance transaction deserialization with support for expandable source objects

    The Task

    Implement balance transactions view with metadata (e.g. customer name, payment summary) rendered for records of type "charge". To make it clear, Charge objects we create are populated with metadata we need to store. This task is only about extracting that metadata from balance transaction records corresponding to charges.

    Note: I'm aware balance transactions do not support metadata, but according to API docs, "source" object on balance transaction is expandable and is capable of returning full nested structure of corresponding charge, transfer, etc.

    The Problem

    If "data.source" expansion is requested, returned JSON data structure looks correct - it does contain nested objects.

    However, stripe-java unfortunately does not support this currently.

    Consider the following API call:

    Map<String, Object> params = new HashMap<String, Object>(); params.put("expand", Arrays.asList(new String[]{ "data.source.metadata" })); BalanceTransactionCollection transactions = BalanceTransaction.list(params);

    It worked perfectly without "expand" param set (but obviously didn't contain the nested objects we needed to get), but as long as param is set, it fails with the following exception:

    com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 15 column 18 path $.data[0].source

    This happens when execution flow reaches the following line within LiveStripeResponseGetter._request method:

    T resource = APIResource.GSON.fromJson(rBody, clazz);

    Obviously Gson fails to properly deserialize balance transaction JSON structure that has nested source object, b/c BalanceTransaction.source is defined as String.

    To make it clear, I'm aware that stripe-java has support for expandable fields, but the challenge there is that just changing "source" type on BalanceTransaction from String to ExpandableField<...> wouldn't work b/c nested "source" objects within returned JSON might have different types (i.e. some are charges, others are transfers, adjustments, etc), while ExpandableField requires single generic type (<? extends HasId>).

    The Solution

    Note: I tried to solve this in a different way initially - see pull request https://github.com/stripe/stripe-java/pull/361 - , which worked just fine with JSON structures returned by end-point requests, but was incompatible with incoming JSON structures for webhooks (was throwing exception on APIResource.GSON.fromJson(jsonBody, Event.class) call); this new solution supports both and looks a bit more elegant too.

    Here's a list of changes I made to solve the problem:

    • added a bunch of transient properties for various possible nested "source" object types (e.g. “sourceCharge", “sourceTransfer", etc.) to BalanceTransaction class (I only added a few, might need to support more in the future) which would be populated based on the type of corresponding "source" object (others would remain null); so, for example, if nested "source" object was of type "charge", you'd be able to call balanceTransaction.getSourceCharge() to get populated Charge instance
    • implemented new BalanceTransactionDeserializer class that supports nested "source" objects deserialization for balance transactions and registered it within APIResource.GSON (i.e. mapped it to BalanceTransaction class via GsonBuilder)

    I only needed support for nested "charge" objects, but also added support for "transfer" and "refund" ones - for the sake of having an example of how to extend that logic to support more nested object types, if needed.

    NOTE: I did these changes on separate branch - balance-transaction-deserializer - which is based on v3.11.0 of code-base b/c that's the version we use in production currently (i.e. version our code-base is currently integrated with); changes are pretty straightforward though and shouldn't be hard to merge into master branch (GitHub indicates there are no conflicts).

    IMPORTANT: as far as I can tell, these are non-breaking changes that should be safe to merge in - they should not break any existing code that uses stripe-java, i.e. if someone calls balanceTransaction.getSource() in their code, they would still be getting String ID, while those who need full nested source object would rather call one of the new methods for the appropriate "source" object type, e.g. balanceTransaction.getSourceCharge() to get nested Charge object; BalanceTransactionDeserializer only handles nested "source" object for balance transaction if one is present and only handles types it knows how to handle - in all other cases it does nothing besides of setting "source" object ID (which it always does, of course), so it won't throw exceptions in case no/new/unknown "source" objects are present in JSON data returned by API end-points; and, finally, just FYI: BalanceTransactionTest still passes without issues (I did not do any changes to it).

    opened by kion 14
  • Exception when casting Invoice object on webhook in case of

    Exception when casting Invoice object on webhook in case of "invoice.payment_succeeded"

    My code :

     Invoice invoice = (Invoice) event.getDataObjectDeserializer().getObject();
     Customer customer = invoice.getCustomerObject();
    

    NullPointerException at the first line & in the second line the customer object is null!

    The same code was working fine 2 months ago, Stripe maven version : 8.0.2 API version: 2019-03-14.

    Could you advise?

    Thanks.

    opened by makahleh 13
  • Make Source.ThreeDSecure extend Source.Card

    Make Source.ThreeDSecure extend Source.Card

    Hi there,

    I juste tried to upgrade from Stripe 7 to Stripe 8 and found that HasSourceTypeData interface is removed. This mean that we cannot use getTypeData anymore. While it's a huge improvement, I am struggling with a side effect.

    My sources are always either a card or a 3DSecured card. Since they both have the fields three_d_secure, brand, .... I was not performing any check on the type because it was simply useless.

    By reviewing both Card and ThreeDSecureclasses, I found that they are the same with the only difference that ThreeDSecure class has three additional fields: authenticated, card, customer.

    Would it be possible to extends ThreeDSecure from Card instead of StripeObject?

    Thanks,

    opened by Flo354 13
  • Changed accountBalance's type to Long

    Changed accountBalance's type to Long

    Fixes #308.

    Changed accountBalance's attribute in the Customer class from Integer to Long to avoid overflow issues.

    r? @brandur cc @stripe/api-libraries

    opened by olivierbellone 13
  • Pagination

    Pagination

    Adds support for iteration over Stripe collections with lazy pagination that's activated as necessary.

    Based on previous work by @hardtoe in #208. (Thanks for that!)

    This pull is still a WIP. I'm going to take one more look at the interface and implement a basic test suite so that we have some better guarantees that everything works as we might expect.

    opened by brandur 13
  • Provide Reachability Metadata

    Provide Reachability Metadata

    Is your feature request related to a problem? Please describe.

    Without the runtime hints, it's not possible to use the SDK in native images.

    Describe the solution you'd like

    To be able to use the SDK in native images without providing runtime hints (but the user).

    Describe alternatives you've considered

    The alternative in Spring is to generate the runtime hints during AoT. However the end user (of the SDK) is not the best person to write such hints. (For example, since I didn't know what to add, I added hints for full reflection of all classes in model and param packages. The JSON file is 1.1MB big and has more than 4K entries.)

    Additional context

    No response

    future feature-request 
    opened by akefirad 1
  • Support mocking of stripe outbound RPCs for unit tests

    Support mocking of stripe outbound RPCs for unit tests

    Is your feature request related to a problem? Please describe.

    When writing unit tests, there is a need to avoid outbound RPCs to another server. Today the Stripe API uses static methods and global (or request) config parameters, but there does not seem to be a way to mock the request/verify the request without running StripeMock, which is perhaps too large for a java unit test.

    Describe the solution you'd like

    If there was a constructor/factory based approach to constructing the stripe api, then we would be able to mock this away in our DI layer.

    Today

    Customer.create(customerCreateParamsObj);
    

    Desirable alternatives

    stripeFactoryObj.customerService().create(customerCreateParamsObj);
    

    In my code I would likely provide CustomerService via DI, and then call like such:

    customerService.create(customerCreateParamsObj);
    

    This way I would be able to provide a Mockito implementation for CustomerService and setup mocks/verifications.

    Describe alternatives you've considered

    My solution until this is supported will be to wrap every Stripe API in a class/method and indirectly call the stripe API.

    Alternatively it seems clients could use Mockito to mock static methods, though this approach is less desirable.

    Additional context

    No response

    future feature-request 
    opened by Kurru 6
  • Allow public access to `ApiRequestParams` subclass constructors/fields

    Allow public access to `ApiRequestParams` subclass constructors/fields

    Is your feature request related to a problem? Please describe.

    I am using Kotlin and the use of the builders provided on these classes is overly verbose.

    Describe the solution you'd like

    Make the constructors public, so I can build the objects myself, using Kotlin's Type Safe Builders.

    Also, I believe the fields will need to be accessible.

    Or even create a Kotlin extensions library with the type-safe builders included.

    Describe alternatives you've considered

    I've tried creating a wrapper around the builders themselves, but it turned out to be extremely cumbersome.

    Additional context

    For example, instead of:

    val lineItem = SessionCreateParams.LineItem.builder()
                .setPrice(priceID)
                .setQuantity(1)
                .build()
    
    SessionCreateParams.builder().apply {
                setMode(SUBSCRIPTION)
                addPaymentMethodType(SessionCreateParams.PaymentMethodType.CARD)
                addLineItem(lineItem)
                setSuccessUrl("$domainURL/stripe/checkout?sessionID={CHECKOUT_SESSION_ID}&success=true")
                setCancelUrl("$domainURL/stripe/checkout?success=false")
                setAllowPromotionCodes(true)
                setSubscriptionData(subscriptionData)
    

    I could simply do

    createSessionParams {
      mode = SUBSCRIPTION
      paymentMethodTypes += CARD
      lineItems = listOf(
        lineItem {
          price = priceID
          quantity = 1
        }
      )
      successUrl = "$domainURL/stripe/checkout?sessionID={CHECKOUT_SESSION_ID}&success=true"
      cancelUrl = "$domainURL/stripe/checkout?success=false"
      allowPromitionCodes = true
      subscriptionData = 
    }
    

    But I cannot instantiate the classes myself, as the constructors are private.

    future 
    opened by shaun-wild 3
  • invalid_request_error mapped to CardException not InvalidRequestException

    invalid_request_error mapped to CardException not InvalidRequestException

    Describe the bug

    handleApiError maps all 402 status code responses to CardException. We have received responses that in the Stripe dashboard are "type": "invalid_request_error", but result in a CardException. (The CardException has a null code which causes us problems.) An example of the Response body is shown further below.

    I have been in touch with Stripe support who say "our error documentation doesn't map status codes to specific error types, so the invalid_request_error may not always go hand in hand with the 404 status code.". So I think handleApiError needs to allow for invalid_request_error type in the case 402: branch.

    Example of Response body for invalid_request_error type which results in CardException:

    Response body
    {
      "error": {
        "message": "The payment is blocked because the used IBAN has been suspended. You can learn more about this at https://support.stripe.com/questions/sepa-debit-chargebacks-faq and if you need assistance processing a payment please contact us via https://support.stripe.com/contact/ for further information.",
        "type": "invalid_request_error"
      }
    }
    

    To Reproduce

    Using the Charges API create a Charge with an underlying payment source where the associated IBAN has been disputed 3 times in row. Such that Stripe block the Charge and return an invalid_request_error response. See https://support.stripe.com/questions/sepa-debit-chargebacks-faq

    Expected behavior

    Expected the Stripe Java SDK to translate the invalid_request_error with HTTP status code 402 into an InvalidRequestException. Actual behavior: CardException where only the message property is populated, notably not the code.

    Code snippets

    No response

    OS

    macOS

    Java version

    Java 11

    stripe-java version

    20.121.0

    API version

    2020-08-27

    Additional context

    At https://support.stripe.com/questions/sepa-debit-chargebacks-faq Stripe note this is new behavior since 2022-03-07. This is exactly consistent with when we started seeing this issue.

    future breaking-api-change bug 
    opened by jstafford406 3
  • Feature Request: Support pluggable JSON library

    Feature Request: Support pluggable JSON library

    Tracking issue for supporting other libraries for JSON (de)serialization.

    We've had a number of requests over the years to do this, so will be using this as the main feature request to a) track support for this and b) track work in this space.

    future feature-request 
    opened by dcr-stripe 3
  • Implicit Gson library dependency should be removed

    Implicit Gson library dependency should be removed

    Is your feature request related to a problem? Please describe.

    The EventData class which is defined in the Event object has a member object of type JsonObject which is a type defined by the com.google.gson library.

    When I try to deserialize stored json into an Event object using a com.fasterxml.jackson ObjectMapper, errors are thrown because the object jsonString contains fields not explicitly defined by the JsonObject.

    https://github.com/stripe/stripe-java/blob/master/src/main/java/com/stripe/model/EventData.java#L28

    Describe the solution you'd like

    The object field of the EventData class should be of type Map<String, Object> or something similar... and anywhere else in the models where JsonObject is used, it should be replaced with the same solution

    Describe alternatives you've considered

    No response

    Additional context

    No response

    future feature-request 
    opened by solatarius 2
Releases(v22.5.0-beta.1)
  • v22.5.0-beta.1(Dec 22, 2022)

  • v22.4.0(Dec 22, 2022)

    • #1497 API Updates
      • Add support for new value merchant_default on enums CashBalanceUpdateParams.settings.reconciliation_mode, CustomerCreateParams.cash_balance.settings.reconciliation_mode, and CustomerUpdateParams.cash_balance.settings.reconciliation_mode
      • Add support for using_merchant_default on CashBalance.settings
    • #1496 Replace ReflectionCheckingTypeAdapterFactory with a ReflectionAccessFilter
    • #1491 Don't delombok sources

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v22.4.0-beta.1(Dec 16, 2022)

    • #1493 API Updates for beta branch
      • Updated stable APIs to the latest version
      • Add support for new resources QuoteLine, TaxCalculation, and TaxTransaction
      • Add support for create and list_line_items methods on resource TaxCalculation
      • Add support for create_reversal, create, and retrieve methods on resource TaxTransaction

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v22.3.0(Dec 8, 2022)

  • v22.3.0-beta.1(Dec 8, 2022)

  • v22.2.0(Dec 6, 2022)

    • #1484 API Updates
      • Add support for flow_data on BillingPortalSessionCreateParams
      • Add support for flow on BillingPortal.Session
    • #1483 API Updates
      • Add support for india_international_payments on Account.capabilities, AccountCreateParams.capabilities, and AccountUpdateParams.capabilities
      • Add support for invoice_creation on Checkout.Session and CheckoutSessionCreateParams
      • Add support for invoice on Checkout.Session
      • Add support for metadata on SubscriptionSchedule.phases[].items[], SubscriptionScheduleCreateParams.phases[].items[], and SubscriptionScheduleUpdateParams.phases[].items[]

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v22.1.0(Nov 17, 2022)

    • #1480 API Updates
      • Add support for hosted_instructions_url on PaymentIntent.next_action.wechat_pay_display_qr_code
    • #1479 API Updates
      • Add support for custom_text on Checkout.Session, CheckoutSessionCreateParams, PaymentLinkCreateParams, PaymentLinkUpdateParams, and PaymentLink
      • Add support for hosted_instructions_url on PaymentIntent.next_action.paynow_display_qr_code

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v22.0.0(Nov 16, 2022)

    • #1471 Next major release changes

    Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15.

    "⚠️" symbol highlights breaking changes.

    • ⚠️ Inline several "shared" classes for consistency (#1455)
    • ⚠️ Removed LineItem.Product property that was released by mistake. (#1456)
    • ⚠️ Removed Charges property on PaymentIntent and replace it with LatestCharge (#1473)
    • ⚠️ Removed deprecated Amount, Currency, Description, Images, Name properties from SessionCreateParams.LineItem (#1473)
    • ⚠️ Remove support for tos_shown_and_accepted on CheckoutSessionCreateParams.payment_method_options.paynow (#1473)
    • ⚠️ Removed deprecated Sku resource (#1459)
    • ⚠️ Removed RequestOptions.getStripeVersionOverride, RequestOptions.setStripeVersionOverride, and RequestOptions.clearStripeVersionOverride (#1464)

    Use of setStripeVersionOverride is discouraged and can lead to unexpected errors during service calls because Java SDK class shapes are not guaranteed to match API responses on arbitrary versions.

    If you were using these methods in conjunction with EphemeralKey resource prefer the EphemeralKeyCreateParamsBuilder.setStripeVersion.

    EphemeralKeyCreateParams params = EphemeralKeyCreateParams.builder()
      .setStripeVersion("XXXX-YY-ZZ")
      .build();
    

    If you have a use case that requires per-request version overrides, please file an issue on stripe-java repository to ensure we are aware and can add first-class support for it. In the meantime you can use unsafeSetStripeVersionOverride method as a workaround.

    RequestOptions.RequestOptionsBuilder builder = RequestOptions.builder();
    builder.setApiKey(...)
                .setClientId(...);
    
    RequestOptionsBuilder.unsafeSetStripeVersionOverride(builder, "2022-11-15");
    
    • #1474 API Updates
      • ⚠️ Remove support for tos_shown_and_accepted on CheckoutSessionCreateParams.payment_method_options.paynow. The property was mistakenly released and never worked.
    Source code(tar.gz)
    Source code(zip)
  • v21.16.0-beta.1(Nov 10, 2022)

  • v21.15.0(Nov 8, 2022)

    • #1472 API Updates
      • Add support for new values eg_tin, ph_tin, and tr_tin on enums CustomerCreateParams.tax_id_data[].type, InvoiceUpcomingLinesParams.customer_details.tax_ids[].type, InvoiceUpcomingParams.customer_details.tax_ids[].type, OrderCreateParams.tax_details.tax_ids[].type, OrderUpdateParams.tax_details.tax_ids[].type, and TaxIdCreateParams.type
      • Add support for reason_message on Issuing.Authorization.request_history[]

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.14.0(Nov 3, 2022)

    • #1466 API Updates
      • Add support for on_behalf_of on CheckoutSessionCreateParams.subscription_data, SubscriptionCreateParams, SubscriptionSchedule.default_settings, SubscriptionSchedule.phases[], SubscriptionScheduleCreateParams.default_settings, SubscriptionScheduleCreateParams.phases[], SubscriptionScheduleUpdateParams.default_settings, SubscriptionScheduleUpdateParams.phases[], SubscriptionUpdateParams, and Subscription
      • Add support for tax_behavior and tax_code on InvoiceItemCreateParams, InvoiceItemUpdateParams, InvoiceUpcomingLinesParams.invoice_items[], and InvoiceUpcomingParams.invoice_items[]

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.14.0-beta.2(Nov 2, 2022)

    • #1467 API Updates for beta branch
      • Updated beta APIs to the latest stable version
      • Add support for cashappPayments and zipPayments on Account, AccountCreateParams, AccountUpdateParams.
      • Add support for cashapp and zip on Charge, PaymentMethod, PaymentMethodCreateParams, PaymentMethodUpdateParams.
      • Add support for trialSettings on SubscriptionSchedule.

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.14.0-beta.1(Oct 22, 2022)

    • #1462 API Updates for beta branch
      • Updated stable APIs to the latest version
      • Add support for new value revoked on enum CapitalFinancingOfferListParams.status
      • Add support for paypal on Charge.payment_method_details and Source
      • Add support for network_data on Issuing.Transaction
      • Add support for billing_cycle_anchor on SubscriptionScheduleAmendParams.amendments[]
      • Add support for tipping on Terminal.Reader.action.process_payment_intent.process_config and TerminalReaderProcessPaymentIntentParams.process_config

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.13.0(Oct 20, 2022)

    • #1461 API Updates
      • Add support for new values jp_trn and ke_pin on enums CustomerCreateParams.tax_id_data[].type, InvoiceUpcomingLinesParams.customer_details.tax_ids[].type, InvoiceUpcomingParams.customer_details.tax_ids[].type, OrderCreateParams.tax_details.tax_ids[].type, OrderUpdateParams.tax_details.tax_ids[].type, and TaxIdCreateParams.type
      • Add support for tipping on Terminal.Reader.action.process_payment_intent.process_config and TerminalReaderProcessPaymentIntentParams.process_config

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.13.0-beta.1(Oct 14, 2022)

    • Add support for schedule_settings on SubscriptionScheduleAmendParams
    • Add support for new value upcoming_invoice on enum SubscriptionScheduleAmendParams.amendments[].amendment_end.type
    • Add support for new values schedule_end and upcoming_invoice on enum SubscriptionScheduleAmendParams.amendments[].amendment_start.type

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.12.0(Oct 14, 2022)

  • v21.12.0-beta.1(Oct 7, 2022)

  • v21.11.0(Oct 6, 2022)

    • #1451 API Updates
      • Add support for new value bank_of_china on enums PaymentIntentConfirmParams.payment_method_data.fpx.bank, PaymentIntentCreateParams.payment_method_data.fpx.bank, PaymentIntentUpdateParams.payment_method_data.fpx.bank, PaymentMethodCreateParams.fpx.bank, SetupIntentConfirmParams.payment_method_data.fpx.bank, SetupIntentCreateParams.payment_method_data.fpx.bank, and SetupIntentUpdateParams.payment_method_data.fpx.bank
      • Add support for new values America/Nuuk, Europe/Kyiv, and Pacific/Kanton on enum ReportingReportRunCreateParams.parameters.timezone
      • Add support for klarna on SetupAttempt.payment_method_details
    • #1450 Set JDK to 17 LTS

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.10.0(Sep 29, 2022)

    • #1448 API Updates
      • Add support for created on Checkout.Session
      • Add support for setup_future_usage on PaymentIntent.payment_method_options.pix, PaymentIntentConfirmParams.payment_method_options.pix, PaymentIntentCreateParams.payment_method_options.pix, and PaymentIntentUpdateParams.payment_method_options.pix
      • Deprecate SessionCreateParams.subscription_data.items (use the line_items param instead). This will be removed in the next major version.

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.10.0-beta.1(Sep 26, 2022)

  • v21.9.0(Sep 22, 2022)

    • #1445 API Updates
      • Add support for terms_of_service on Checkout.Session.consent_collection, Checkout.Session.consent, CheckoutSessionCreateParams.consent_collection, PaymentLink.consent_collection, and PaymentLinkCreateParams.consent_collection
      • ⚠️ Remove support for plan on CheckoutSessionCreateParams.payment_method_options.card.installments. The property was mistakenly released and never worked.
      • Add support for amount on IssuingDisputeCreateParams and IssuingDisputeUpdateParams
      • Add support for statement_descriptor on PaymentIntentIncrementAuthorizationParams
      • Add upcomingLines method to Invoice resource.

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.8.0(Sep 15, 2022)

  • v21.7.0(Sep 9, 2022)

  • v21.6.0(Sep 6, 2022)

  • v21.5.0(Aug 31, 2022)

    • #1433 API Updates
      • Add support for new values de-CH, en-CH, en-PL, en-PT, fr-CH, it-CH, pl-PL, and pt-PT on enums OrderCreateParams.payment.settings.payment_method_options.klarna.preferred_locale, OrderUpdateParams.payment.settings.payment_method_options.klarna.preferred_locale, PaymentIntentConfirmParams.payment_method_options.klarna.preferred_locale, PaymentIntentCreateParams.payment_method_options.klarna.preferred_locale, and PaymentIntentUpdateParams.payment_method_options.klarna.preferred_locale
      • Add support for description on PaymentLink.subscription_data and PaymentLinkCreateParams.subscription_data
    • #1432 Update README badge
    • #1431 Update coveralls to only run for one java version

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.4.0(Aug 26, 2022)

    • #1430 API Updates
      • Add support for login_page on BillingPortal.Configuration, BillingPortalConfigurationCreateParams, and BillingPortalConfigurationUpdateParams
      • Add support for customs and phone_number on Issuing.Card.shipping and IssuingCardCreateParams.shipping
      • Add support for new value deutsche_bank_ag on enums PaymentIntentConfirmParams.payment_method_data.eps.bank, PaymentIntentCreateParams.payment_method_data.eps.bank, PaymentIntentUpdateParams.payment_method_data.eps.bank, PaymentMethodCreateParams.eps.bank, SetupIntentConfirmParams.payment_method_data.eps.bank, SetupIntentCreateParams.payment_method_data.eps.bank, and SetupIntentUpdateParams.payment_method_data.eps.bank
      • Add support for description on Quote.subscription_data, QuoteCreateParams.subscription_data, QuoteUpdateParams.subscription_data, SubscriptionSchedule.default_settings, SubscriptionSchedule.phases[], SubscriptionScheduleCreateParams.default_settings, SubscriptionScheduleCreateParams.phases[], SubscriptionScheduleUpdateParams.default_settings, and SubscriptionScheduleUpdateParams.phases[]
    • #1428 Show test coverage in README
    • #1427 Update README.md to clarify that API version can only be change in beta

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.4.0-beta.1(Aug 26, 2022)

  • v21.3.0(Aug 23, 2022)

    • #1422 API Updates
      • Add support for new resource CustomerCashBalanceTransaction
      • Remove support for value paypal from enums OrderCreateParams.payment.settings.payment_method_types[] and OrderUpdateParams.payment.settings.payment_method_types[]
      • Add support for currency on PaymentLink
      • Add support for network on SetupIntentConfirmParams.payment_method_options.card, SetupIntentCreateParams.payment_method_options.card, SetupIntentUpdateParams.payment_method_options.card, Subscription.payment_settings.payment_method_options.card, SubscriptionCreateParams.payment_settings.payment_method_options.card, and SubscriptionUpdateParams.payment_settings.payment_method_options.card
      • Change TreasuryOutboundTransferCreateParams.destination_payment_method to be optional
      • Add support for new value customer_cash_balance_transaction.created on enums WebhookEndpointCreateParams.enabled_events[] and WebhookEndpointUpdateParams.enabled_events[]
      • Change the return type of Customer.fundCashBalance test helper from CustomerBalanceTransaction to CustomerCashBalanceTransaction.
        • This would generally be considered a breaking change, but we've worked with all existing users to migrate and are comfortable releasing this as a minor as it is solely a test helper method. This was essentially broken prior to this change.
    • #1425 Add beta readme.md section
    • #1423 chore: Remove unused variable from SearchPagingIteratorTest.
    • #1421 Add a support section to the readme
    • #1420 Fix outdated test comment
    • #1418 Fix latest JAR hyperlink and related tests
    • #1419 Fix makefile indentation and improve regex

    See the changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • v21.3.0-beta.2(Aug 23, 2022)

  • v21.3.0-beta.1(Aug 11, 2022)

A Java library for technical analysis.

ta4j Technical Analysis For Java Ta4j is an open source Java library for technical analysis. It provides the basic components for creation, evaluation

null 1.7k Jan 3, 2023
Telegram API Client and Telegram BOT API Library and Framework in Pure java.

Javagram Telegram API Client and Telegram Bot API library and framework in pure Java. Hello Telegram You can use Javagram for both Telegram API Client

Java For Everything 3 Oct 17, 2021
Jakarta money is a helpful library for a better developer experience when combining Money-API with Jakarta and MicroProfile API.

jakarta-money Jakarta money is a helpful library for a better developer experience when combining Money-API with Jakarta and MicroProfile API. The dep

Money and Currency API | JavaMoney 19 Aug 12, 2022
A Java API wrapper for the pastemyst api

Pastemyst.java What is pastemyst.java? pastemyst.java is a pastemyst API Wrapper, written in Java. The library is in early development, and all contri

YeffyCodeGit 8 Sep 28, 2022
An API wrapper for BotiCord API written in Java

An API wrapper for BotiCord API written in Java

BotiCord 3 Nov 8, 2022
Duck Library is a library for developers who don't want to spend their time to write same library consistently.

Duck Library is a library for developers who don't want to spend their time to write same library consistently. It has almost every useful feature to

null 5 Jul 28, 2022
Inria 1.4k Dec 29, 2022
JPassport works like Java Native Access (JNA) but uses the Foreign Linker API instead of JNI. Similar to JNA, you declare a Java interface that is bound to the external C library using method names.

JPassport works like Java Native Access (JNA) but uses the Foreign Linker API instead of JNI. Similar to JNA, you declare a Java interface t

null 28 Dec 30, 2022
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API

Swagger Core NOTE: If you're looking for Swagger Core 1.5.X and OpenAPI 2.0, please refer to 1.5 branch. NOTE: Since version 2.1.7 Swagger Core suppor

Swagger 7.1k Jan 5, 2023
Dio-api-1 - Repositório com os artefatos da mentoria de API

dio-api-1 Repositório com os artefatos da mentoria de API Reference Documentation For further reference, please consider the following sections: Offic

Ricardo Lucas Chagas 5 Feb 25, 2022
Produtos-api-client - Biblioteca de consumo de uma API Rest básica de produtos disponibilizada em outro repositório.

produtos-api-client Biblioteca de consumo de uma API Rest básica de produtos disponibilizada no repositório: clique aqui para acessar Com essa bibliot

null 1 Jan 4, 2022
COMMA Config API is an API allowing you to easily create complex and stylish config menu screens for Minecraft Fabric mods

COMMA Config API is an API allowing you to easily create complex and stylish config menu screens for Minecraft Fabric mods. COMMA stands for Configurable Options Menu Modding API

Dr. Rubisco 1 Jan 13, 2022
API Gestor é uma API que permite a comunicação com um Banco de Dados educacionais sobre a educação brasileira.

API Gestor O projeto API Gestor é uma API que permite a comunicação de outras aplicações com os dados educacionais armazenados em um banco de dados, c

null 2 Apr 13, 2022
There are two challenges one is to create a backend api the other is to create a frontend application to consume the public data api devall.

Sobre | Desafio | Resolução | Tecnologias | Execução | Itexto desafio tecnico Sobre os Desafios existem dois desafios um é criar uma api backend o out

fabricio S Miranda 1 Oct 18, 2021
Deploy this 🔥🔥🔥 BLAZING FAST 🔥🔥🔥 API to get instant access to ✨✨✨ INNOVATIVE ✨✨✨ API to quickly define whether the numbers are odd or even.

Is Odd API This ?? is ?? ?? a ?? simple API that ?? returns ?? whether ?? ?? a ?? number ?? ?? is ?? ?? odd ?? or ?? not. ♂ With ?? ?? this ?? ?? API

rferee 5 Sep 23, 2022
cglib - Byte Code Generation Library is high level API to generate and transform Java byte code. It is used by AOP, testing, data access frameworks to generate dynamic proxy objects and intercept field access.

cglib Byte Code Generation Library is high level API to generate and transform JAVA byte code. It is used by AOP, testing, data access frameworks to g

Code Generation Library 4.5k Jan 8, 2023
Java library to provide an API for beans and properties.

Joda-Beans Joda-Beans provides a small framework that adds properties to Java, greatly enhancing JavaBeans. An API is provided that defines a bean and

Joda.org 137 Nov 25, 2022
Java client library for the Square Connect v2 API

Square Connect Java SDK - RETIRED NOTICE: Square Connect Java SDK retired The Square Connect Java SDK is retired (EOL) as of 2019-12-17 and will no lo

Square 38 Jan 26, 2022