Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring sdk-release/next-major up to date #1470

Merged
merged 9 commits into from
Nov 7, 2022
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:

- name: Send code coverage report to coveralls.io
run: ./gradlew jacocoTestReport coveralls
if: matrix.java-version == '17'
if: env.COVERALLS_REPO_TOKEN && matrix.java-version == '17'
env:
CI_NAME: github-actions
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 21.14.0 - 2022-11-03
* [#1466](https://github.com/stripe/stripe-java/pull/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[]`

## 21.13.0 - 2022-10-20
* [#1461](https://github.com/stripe/stripe-java/pull/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`

## 21.12.0 - 2022-10-14
* [#1457](https://github.com/stripe/stripe-java/pull/1457) Bugfix: Don't require global API Key when API Key is propagated from list request
* [#1458](https://github.com/stripe/stripe-java/pull/1458) API Updates
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v202
v204
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stripe Java client library

[![Maven Central](https://img.shields.io/badge/maven--central-v21.12.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java)
[![Maven Central](https://img.shields.io/badge/maven--central-v21.14.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java)
[![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java)
[![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)
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master)
Expand All @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library.
Add this dependency to your project's build file:

```groovy
implementation "com.stripe:stripe-java:21.12.0"
implementation "com.stripe:stripe-java:21.14.0"
```

### Maven users
Expand All @@ -29,15 +29,15 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>21.12.0</version>
<version>21.14.0</version>
</dependency>
```

### Others

You'll need to manually install the following JARs:

- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.12.0/stripe-java-21.12.0.jar)
- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/21.14.0/stripe-java-21.14.0.jar)
- [Google Gson][gson] from <https://repo1.maven.org/maven2/com/google/code/gson/gson/2.9.0/gson-2.9.0.jar>.

### [ProGuard][proguard]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21.12.0
21.14.0
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.stripe
VERSION_NAME=21.12.0
VERSION_NAME=21.14.0

POM_URL=https://github.com/stripe/stripe-java
POM_SCM_URL=git@github.com:stripe/stripe-java.git
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/Stripe.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public abstract class Stripe {
public static final String CONNECT_API_BASE = "https://connect.stripe.com";
public static final String LIVE_API_BASE = "https://api.stripe.com";
public static final String UPLOAD_API_BASE = "https://files.stripe.com";
public static final String VERSION = "21.12.0";
public static final String VERSION = "21.14.0";

public static volatile String apiKey;
public static volatile String clientId;
Expand Down
45 changes: 23 additions & 22 deletions src/main/java/com/stripe/model/Capability.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,29 +355,30 @@ public static class Errors extends StripeObject {
* The code for the type of error.
*
* <p>One of {@code invalid_address_city_state_postal_code}, {@code invalid_dob_age_under_18},
* {@code invalid_street_address}, {@code invalid_tos_acceptance}, {@code
* invalid_value_other}, {@code verification_document_address_mismatch}, {@code
* verification_document_address_missing}, {@code verification_document_corrupt}, {@code
* verification_document_country_not_supported}, {@code verification_document_dob_mismatch},
* {@code verification_document_duplicate_type}, {@code verification_document_expired}, {@code
* verification_document_failed_copy}, {@code verification_document_failed_greyscale}, {@code
* verification_document_failed_other}, {@code verification_document_failed_test_mode}, {@code
* verification_document_fraudulent}, {@code verification_document_id_number_mismatch}, {@code
* verification_document_id_number_missing}, {@code verification_document_incomplete}, {@code
* verification_document_invalid}, {@code verification_document_issue_or_expiry_date_missing},
* {@code verification_document_manipulated}, {@code verification_document_missing_back},
* {@code verification_document_missing_front}, {@code verification_document_name_mismatch},
* {@code verification_document_name_missing}, {@code
* verification_document_nationality_mismatch}, {@code verification_document_not_readable},
* {@code verification_document_not_signed}, {@code verification_document_not_uploaded},
* {@code verification_document_photo_mismatch}, {@code verification_document_too_large},
* {@code verification_document_type_not_supported}, {@code
* verification_failed_address_match}, {@code verification_failed_business_iec_number}, {@code
* verification_failed_document_match}, {@code verification_failed_id_number_match}, {@code
* verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code
* {@code invalid_representative_country}, {@code invalid_street_address}, {@code
* invalid_tos_acceptance}, {@code invalid_value_other}, {@code
* verification_document_address_mismatch}, {@code verification_document_address_missing},
* {@code verification_document_corrupt}, {@code verification_document_country_not_supported},
* {@code verification_document_dob_mismatch}, {@code verification_document_duplicate_type},
* {@code verification_document_expired}, {@code verification_document_failed_copy}, {@code
* verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code
* verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code
* verification_document_id_number_mismatch}, {@code verification_document_id_number_missing},
* {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code
* verification_document_issue_or_expiry_date_missing}, {@code
* verification_document_manipulated}, {@code verification_document_missing_back}, {@code
* verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code
* verification_document_name_missing}, {@code verification_document_nationality_mismatch},
* {@code verification_document_not_readable}, {@code verification_document_not_signed},
* {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch},
* {@code verification_document_too_large}, {@code verification_document_type_not_supported},
* {@code verification_failed_address_match}, {@code verification_failed_business_iec_number},
* {@code verification_failed_document_match}, {@code verification_failed_id_number_match},
* {@code verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code
* verification_failed_name_match}, {@code verification_failed_other}, {@code
* verification_failed_tax_id_match}, {@code verification_failed_tax_id_not_issued}, {@code
* verification_missing_executives}, {@code verification_missing_owners}, or {@code
* verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code
* verification_failed_tax_id_not_issued}, {@code verification_missing_executives}, {@code
* verification_missing_owners}, or {@code
* verification_requires_additional_memorandum_of_associations}.
*/
@SerializedName("code")
Expand Down
150 changes: 70 additions & 80 deletions src/main/java/com/stripe/model/EphemeralKey.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// File generated from our OpenAPI spec
package com.stripe.model;

import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.net.RequestOptions.RequestOptionsBuilder;
import com.stripe.param.EphemeralKeyCreateParams;
import java.util.HashMap;
import java.util.List;
import com.stripe.param.EphemeralKeyDeleteParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down Expand Up @@ -37,73 +37,77 @@ public class EphemeralKey extends ApiResource implements HasId {
@SerializedName("livemode")
Boolean livemode;

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

/** The key's secret. You can use this value to make authorized requests to the Stripe API. */
@SerializedName("secret")
String secret;

List<AssociatedObject> associatedObjects;

transient String rawJson;

/**
* Creates an ephemeral API key for a given resource.
*
* @param params request parameters. Must include "api-version" equal to the stripe version of
* your mobile client.
* @return the new ephemeral key
*/
/** Creates a short-lived API key for a given resource. */
public static EphemeralKey create(Map<String, Object> params) throws StripeException {
return create(params, null);
return create(params, (RequestOptions) null);
}

/**
* Creates an ephemeral API key for a given resource.
*
* @param params request parameters. Use call {@link
* EphemeralKeyCreateParams.Builder#setStripeVersion(String)} with the stripe version of your
* mobile client.
* @return the new ephemeral key
*/
/** Creates a short-lived API key for a given resource. */
public static EphemeralKey create(EphemeralKeyCreateParams params) throws StripeException {
return create(params, null);
return create(params, (RequestOptions) null);
}

/**
* Creates an ephemeral API key for a given resource.
*
* @param params request parameters
* @param options request options. {@code stripeVersion} is required when creating ephemeral keys.
* it must have non-null {@link RequestOptions#getStripeVersionOverride()}.
* @return the new ephemeral key
*/
public static EphemeralKey create(EphemeralKeyCreateParams params, RequestOptions options)
/** Invalidates a short-lived API key for a given resource. */
public EphemeralKey delete() throws StripeException {
return delete((Map<String, Object>) null, (RequestOptions) null);
}

/** Invalidates a short-lived API key for a given resource. */
public EphemeralKey delete(RequestOptions options) throws StripeException {
return delete((Map<String, Object>) null, options);
}

/** Invalidates a short-lived API key for a given resource. */
public EphemeralKey delete(Map<String, Object> params) throws StripeException {
return delete(params, (RequestOptions) null);
}

/** Invalidates a short-lived API key for a given resource. */
public EphemeralKey delete(Map<String, Object> params, RequestOptions options)
throws StripeException {
checkNullTypedParams(classUrl(EphemeralKey.class), params);
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/ephemeral_keys/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(
ApiResource.RequestMethod.DELETE, url, params, EphemeralKey.class, options);
}

Map<String, Object> paramMap = params.toMap();
if (!paramMap.containsKey("stripe-version")) {
throw new IllegalArgumentException(
"You must .setStripeVersion on EphemeralKeyCreateParams.builder() with"
+ " the stripe version of your mobile client.");
}
return create(params.toMap(), options);
/** Invalidates a short-lived API key for a given resource. */
public EphemeralKey delete(EphemeralKeyDeleteParams params) throws StripeException {
return delete(params, (RequestOptions) null);
}

/**
* Creates an ephemeral API key for a given resource.
*
* @param params request parameters
* @param options request options. {@code stripeVersion} is required when creating ephemeral keys.
* it must have non-null {@link RequestOptions#getStripeVersionOverride()}.
* @return the new ephemeral key
*/
public static EphemeralKey create(Map<String, Object> params, RequestOptions options)
/** Invalidates a short-lived API key for a given resource. */
public EphemeralKey delete(EphemeralKeyDeleteParams params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/ephemeral_keys/%s", ApiResource.urlEncodeId(this.getId())));
return ApiResource.request(
ApiResource.RequestMethod.DELETE, url, params, EphemeralKey.class, options);
}

/** Creates a short-lived API key for a given resource. */
public static EphemeralKey create(Map<String, Object> params, RequestOptions options)
throws StripeException {
final String versionOverride;
if (!params.containsKey("stripe-version")) {
throw new IllegalArgumentException(
Expand All @@ -116,53 +120,39 @@ public static EphemeralKey create(Map<String, Object> params, RequestOptions opt
throw new IllegalArgumentException(
"`stripe-version` must be explicitly specified in " + "`params` as a string");
}

if (options == null) {
options = RequestOptions.getDefault();
}

// Take "stripe-version" from params and plug it into RequestOptions
// so it will be sent in the Stripe-Version header
final RequestOptions overriddenOptions =
RequestOptionsBuilder.unsafeSetStripeVersionOverride(
com.stripe.net.RequestOptions.RequestOptionsBuilder.unsafeSetStripeVersionOverride(
options.toBuilderFullCopy(), versionOverride)
.build();

// Remove "stripe-version" from params so that it is not sent in the
// request body.
final Map<String, Object> overriddenParams = new HashMap<String, Object>(params);
final Map<String, Object> overriddenParams = new java.util.HashMap<String, Object>(params);
overriddenParams.remove("stripe-version");

return request(
RequestMethod.POST,
classUrl(EphemeralKey.class),
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/ephemeral_keys");
return ApiResource.request(
ApiResource.RequestMethod.POST,
url,
overriddenParams,
EphemeralKey.class,
overriddenOptions);
}

/** Invalidates an ephemeral API key for a given resource. */
public EphemeralKey delete() throws StripeException {
return delete(null);
}

/** Invalidates an ephemeral API key for a given resource. */
public EphemeralKey delete(RequestOptions options) throws StripeException {
return request(
RequestMethod.DELETE,
instanceUrl(EphemeralKey.class, this.id),
(Map<String, Object>) null,
EphemeralKey.class,
options);
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AssociatedObject extends StripeObject implements HasId {
@Getter(onMethod_ = {@Override})
String id;

String type;
/** Creates a short-lived API key for a given resource. */
public static EphemeralKey create(EphemeralKeyCreateParams params, RequestOptions options)
throws StripeException {
checkNullTypedParams("/v1/ephemeral_keys", params);
Map<String, Object> paramMap = params.toMap();
if (!paramMap.containsKey("stripe-version")) {
throw new IllegalArgumentException(
"You must .setStripeVersion on EphemeralKeyCreateParams.builder() with"
+ " the stripe version of your mobile client.");
}
return create(paramMap, options);
}
}
17 changes: 11 additions & 6 deletions src/main/java/com/stripe/model/Invoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,11 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("hosted_invoice_url")
String hostedInvoiceUrl;

/** Unique identifier for the object. */
/**
* Unique identifier for the object. This property is always present unless the invoice is an
* upcoming invoice. See <a href="https://stripe.com/docs/api/invoices/upcoming">Retrieve an
* upcoming invoice</a> for more details.
*/
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;
Expand Down Expand Up @@ -1712,11 +1716,12 @@ public static class CustomerTaxId extends StripeObject {
* eu_oss_vat}, {@code gb_vat}, {@code nz_gst}, {@code au_abn}, {@code au_arn}, {@code in_gst},
* {@code no_vat}, {@code za_vat}, {@code ch_vat}, {@code mx_rfc}, {@code sg_uen}, {@code
* ru_inn}, {@code ru_kpp}, {@code ca_bn}, {@code hk_br}, {@code es_cif}, {@code tw_vat}, {@code
* th_vat}, {@code jp_cn}, {@code jp_rn}, {@code li_uid}, {@code my_itn}, {@code us_ein}, {@code
* kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code ca_pst_mb}, {@code
* ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code cl_tin}, {@code sa_vat},
* {@code id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat}, {@code ua_vat}, {@code
* is_vat}, {@code bg_uic}, {@code hu_tin}, {@code si_tin}, or {@code unknown}.
* th_vat}, {@code jp_cn}, {@code jp_rn}, {@code jp_trn}, {@code li_uid}, {@code my_itn}, {@code
* us_ein}, {@code kr_brn}, {@code ca_qst}, {@code ca_gst_hst}, {@code ca_pst_bc}, {@code
* ca_pst_mb}, {@code ca_pst_sk}, {@code my_sst}, {@code sg_gst}, {@code ae_trn}, {@code
* cl_tin}, {@code sa_vat}, {@code id_npwp}, {@code my_frp}, {@code il_vat}, {@code ge_vat},
* {@code ua_vat}, {@code is_vat}, {@code bg_uic}, {@code hu_tin}, {@code si_tin}, {@code
* ke_pin}, {@code tr_tin}, {@code eg_tin}, {@code ph_tin}, or {@code unknown}.
*/
@SerializedName("type")
String type;
Expand Down
Loading