Skip to content

Commit

Permalink
Merge pull request #1498 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Dec 22, 2022
2 parents 26a7cd2 + b1e9690 commit a530445
Show file tree
Hide file tree
Showing 35 changed files with 305 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:

- name: Publish package
run: |
./gradlew publish closeAndRelease -Dorg.gradle.project.NEXUS_USERNAME=$NEXUS_USERNAME -Dorg.gradle.project.NEXUS_PASSWORD=$NEXUS_PASSWORD -Dorg.gradle.project.signing.gnupg.keyName=$GPG_SIGNING_KEYID -Dorg.gradle.project.signing.gnupg.passphrase=$GPG_SIGNING_PASSPHRASE
./gradlew publishToSonatype closeSonatypeStagingRepository -Dorg.gradle.project.NEXUS_USERNAME=$NEXUS_USERNAME -Dorg.gradle.project.NEXUS_PASSWORD=$NEXUS_PASSWORD -Dorg.gradle.project.signing.gnupg.keyName=$GPG_SIGNING_KEYID -Dorg.gradle.project.signing.gnupg.passphrase=$GPG_SIGNING_PASSPHRASE
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 22.4.0 - 2022-12-22
* [#1497](https://github.com/stripe/stripe-java/pull/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](https://github.com/stripe/stripe-java/pull/1496) Replace ReflectionCheckingTypeAdapterFactory with a ReflectionAccessFilter
* [#1491](https://github.com/stripe/stripe-java/pull/1491) Don't delombok sources

## 22.4.0-beta.1 - 2022-12-15
* [#1493](https://github.com/stripe/stripe-java/pull/1493) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v215
v216
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ buildscript {
//Add only for SNAPSHOT versions
//maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
}
}

plugins {
id "java"
id "maven-publish"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id "signing"
id "jacoco"
id "io.freefair.lombok" version "6.3.0"
Expand Down Expand Up @@ -82,7 +80,7 @@ repositories {
dependencies {
errorprone group: "com.google.errorprone", name: "error_prone_core", version: "2.10.0"
errorproneJavac group: "com.google.errorprone", name: "javac", version:"9+181-r4173-1"
implementation group: "com.google.code.gson", name: "gson", version:"2.9.0"
implementation group: "com.google.code.gson", name: "gson", version:"2.9.1"
testImplementation group: "com.google.guava", name: "guava", version:"31.0.1-jre"
testImplementation group: "com.squareup.okhttp3", name: "mockwebserver", version: "4.9.1"
testImplementation group: "org.mockito", name: "mockito-core", version:"4.1.0"
Expand Down
26 changes: 17 additions & 9 deletions deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "io.codearte.nexus-staging"

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
Expand All @@ -32,6 +31,23 @@ def getRepositoryPassword() {
return hasProperty("NEXUS_PASSWORD") ? NEXUS_PASSWORD : ""
}


nexusPublishing {
packageGroup = GROUP

repositories {
sonatype {
username = getRepositoryUsername()
password = getRepositoryPassword()
}
}

transitionCheckOptions {
maxRetries.set(40)
delayBetween.set(java.time.Duration.ofMillis(4000))
}
}

afterEvaluate { project ->
tasks.withType(Sign) {
onlyIf { isReleaseBuild() && project.hasProperty("signing.gnupg.keyName") }
Expand All @@ -53,14 +69,6 @@ afterEvaluate { project ->
sign publishing.publications
}

nexusStaging {
packageGroup = GROUP
numberOfRetries = 40
delayBetweenRetriesInMillis = 4000
username = getRepositoryUsername()
password = getRepositoryPassword()
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/stripe/model/CashBalance.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,12 @@ public static class Settings extends StripeObject {
*/
@SerializedName("reconciliation_mode")
String reconciliationMode;

/**
* A flag to indicate if reconciliation mode returned is the user's default or is specific to
* this customer cash balance.
*/
@SerializedName("using_merchant_default")
Boolean usingMerchantDefault;
}
}
5 changes: 3 additions & 2 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ final class EventDataClassLookup {
classLookup.put("subscription", Subscription.class);
classLookup.put("subscription_item", SubscriptionItem.class);
classLookup.put("subscription_schedule", SubscriptionSchedule.class);
classLookup.put("tax.calculation", TaxCalculation.class);
classLookup.put("tax.transaction", TaxTransaction.class);
classLookup.put("tax_code", TaxCode.class);
classLookup.put("tax_deducted_at_source", TaxDeductedAtSource.class);
classLookup.put("tax_id", TaxId.class);
Expand Down Expand Up @@ -135,6 +133,9 @@ final class EventDataClassLookup {

classLookup.put("scheduled_query_run", com.stripe.model.sigma.ScheduledQueryRun.class);

classLookup.put("tax.calculation", com.stripe.model.tax.Calculation.class);
classLookup.put("tax.transaction", com.stripe.model.tax.Transaction.class);

classLookup.put("terminal.configuration", com.stripe.model.terminal.Configuration.class);
classLookup.put("terminal.connection_token", com.stripe.model.terminal.ConnectionToken.class);
classLookup.put("terminal.location", com.stripe.model.terminal.Location.class);
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/stripe/model/Quote.java
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ public static class StatusTransitions extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SubscriptionData extends StripeObject {
/** TODO. */
/** Describes what period to bill for upon accepting the quote. */
@SerializedName("bill_on_acceptance")
BillOnAcceptance billOnAcceptance;

Expand Down Expand Up @@ -1611,8 +1611,7 @@ public static class SubscriptionData extends StripeObject {
Long effectiveDate;

/**
* Behavior of the subscription schedule and underlying subscription when it ends. Possible
* values are {@code release} and {@code cancel}.
* Behavior of the subscription schedule and underlying subscription when it ends.
*
* <p>One of {@code cancel}, or {@code release}.
*/
Expand Down Expand Up @@ -1851,8 +1850,7 @@ public static class SubscriptionDataOverride extends StripeObject {
String description;

/**
* Behavior of the subscription schedule and underlying subscription when it ends. Possible
* values are {@code release} and {@code cancel}.
* Behavior of the subscription schedule and underlying subscription when it ends.
*
* <p>One of {@code cancel}, or {@code release}.
*/
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/stripe/model/SubscriptionSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ public class SubscriptionSchedule extends ApiResource

/**
* Behavior of the subscription schedule and underlying subscription when it ends. Possible values
* are {@code release} and {@code cancel}.
* are {@code release} or {@code cancel} with the default being {@code release}. {@code release}
* will end the subscription schedule and keep the underlying subscription running.{@code cancel}
* will end the subscription schedule and cancel the underlying subscription.
*
* <p>One of {@code cancel}, {@code none}, {@code release}, or {@code renew}.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/stripe/model/checkout/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public class Session extends ApiResource implements HasId {
String billingAddressCollection;

/**
* The URL the customer will be directed to if they decide to cancel payment and return to your
* website.
* If set, Checkout displays a back button and customers will be directed to this URL if they
* decide to cancel payment and return to your website.
*/
@SerializedName("cancel_url")
String cancelUrl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// File generated from our OpenAPI spec
package com.stripe.model;
package com.stripe.model.tax;

import com.google.gson.annotations.SerializedName;
import com.stripe.Stripe;
import com.stripe.exception.StripeException;
import com.stripe.model.HasId;
import com.stripe.model.LineItemCollection;
import com.stripe.model.StripeObject;
import com.stripe.net.ApiResource;
import com.stripe.net.RequestOptions;
import com.stripe.param.TaxCalculationCreateParams;
import com.stripe.param.TaxCalculationListLineItemsParams;
import com.stripe.param.tax.CalculationCreateParams;
import com.stripe.param.tax.CalculationListLineItemsParams;
import java.util.List;
import java.util.Map;
import lombok.EqualsAndHashCode;
Expand All @@ -18,7 +21,7 @@
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class TaxCalculation extends ApiResource implements HasId {
public class Calculation extends ApiResource implements HasId {
/** Total after taxes. */
@SerializedName("amount_total")
Long amountTotal;
Expand Down Expand Up @@ -85,36 +88,36 @@ public class TaxCalculation extends ApiResource implements HasId {

/** Breakdown of individual tax amounts that add up to the total. */
@SerializedName("tax_breakdown")
List<TaxCalculation.TaxBreakdown> taxBreakdown;
List<Calculation.TaxBreakdown> taxBreakdown;

/** Timestamp of date at which the tax rules and rates in effect applies for the calculation. */
@SerializedName("tax_date")
Long taxDate;

/** Calculates tax based on input and returns a Tax <code>Calculation</code> object. */
public static TaxCalculation create(Map<String, Object> params) throws StripeException {
public static Calculation create(Map<String, Object> params) throws StripeException {
return create(params, (RequestOptions) null);
}

/** Calculates tax based on input and returns a Tax <code>Calculation</code> object. */
public static TaxCalculation create(Map<String, Object> params, RequestOptions options)
public static Calculation create(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax/calculations");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, TaxCalculation.class, options);
ApiResource.RequestMethod.POST, url, params, Calculation.class, options);
}

/** Calculates tax based on input and returns a Tax <code>Calculation</code> object. */
public static TaxCalculation create(TaxCalculationCreateParams params) throws StripeException {
public static Calculation create(CalculationCreateParams params) throws StripeException {
return create(params, (RequestOptions) null);
}

/** Calculates tax based on input and returns a Tax <code>Calculation</code> object. */
public static TaxCalculation create(TaxCalculationCreateParams params, RequestOptions options)
public static Calculation create(CalculationCreateParams params, RequestOptions options)
throws StripeException {
String url = String.format("%s%s", Stripe.getApiBase(), "/v1/tax/calculations");
return ApiResource.request(
ApiResource.RequestMethod.POST, url, params, TaxCalculation.class, options);
ApiResource.RequestMethod.POST, url, params, Calculation.class, options);
}

/** Retrieves the line items of a persisted tax calculation as a collection. */
Expand All @@ -140,14 +143,14 @@ public LineItemCollection listLineItems(Map<String, Object> params, RequestOptio
}

/** Retrieves the line items of a persisted tax calculation as a collection. */
public LineItemCollection listLineItems(TaxCalculationListLineItemsParams params)
public LineItemCollection listLineItems(CalculationListLineItemsParams params)
throws StripeException {
return listLineItems(params, (RequestOptions) null);
}

/** Retrieves the line items of a persisted tax calculation as a collection. */
public LineItemCollection listLineItems(
TaxCalculationListLineItemsParams params, RequestOptions options) throws StripeException {
CalculationListLineItemsParams params, RequestOptions options) throws StripeException {
String url =
String.format(
"%s%s",
Expand Down Expand Up @@ -179,7 +182,7 @@ public static class CustomerDetails extends StripeObject {

/** The customer's tax IDs (e.g., EU VAT numbers). */
@SerializedName("tax_ids")
List<TaxCalculation.CustomerDetails.TaxId> taxIds;
List<Calculation.CustomerDetails.TaxId> taxIds;

@Getter
@Setter
Expand Down

0 comments on commit a530445

Please sign in to comment.