Skip to content

Commit

Permalink
Merge pull request #1447 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
* Add beta readme.md section (#1425)

* Codegen for openapi v184 (#1422)

* Bump version to 21.3.0

* Update README.md to clarify that API version can only be change in beta (#1427)

* Update README.md

* Update README.md

* Show test coverage in README

* Codegen for openapi v186 (#1430)

* Bump version to 21.4.0

* Update coveralls to only run for one java version

* Update badge to static format, add command in Makefile to update version in shields.io link accordingly

* Update docuemntation test

* Codegen for openapi v188 (#1433)

* Bump version to 21.5.0

* Codegen for openapi v189 (#1434)

* Bump version to 21.6.0

* Codegen for openapi v190 (#1435)

* Bump version to 21.7.0

* Codegen for openapi v192 (#1444)

* Bump version to 21.8.0

* React to EventDataClassLookup generation changes (#1446)

* Codegen for openapi v196 (#1445)

* Bump version to 21.9.0

* Set version to 21.9.0 to simplify merge

* Reset version to 21.4.0-beta.1

* Codegen for openapi v196

Co-authored-by: Kamil Pajdzik <99290280+kamil-stripe@users.noreply.github.com>
Co-authored-by: Dominic Charley-Roy <dcr@stripe.com>
Co-authored-by: Annie Li <anniel@stripe.com>
Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com>
Co-authored-by: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com>
Co-authored-by: yejia-stripe <90646909+yejia-stripe@users.noreply.github.com>
Co-authored-by: Yejia Chen <yejia@stripe.com>
Co-authored-by: Kamil Pajdzik <kamil@stripe.com>
  • Loading branch information
9 people committed Sep 26, 2022
2 parents 430a5b1 + 4669460 commit 3cebc81
Show file tree
Hide file tree
Showing 209 changed files with 18,118 additions and 6,080 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Expand Up @@ -99,6 +99,7 @@ jobs:

- name: Send code coverage report to coveralls.io
run: ./gradlew jacocoTestReport coveralls
if: matrix.java-version == '18'
env:
CI_NAME: github-actions
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,51 @@
# Changelog

## 21.9.0 - 2022-09-22
* [#1445](https://github.com/stripe/stripe-java/pull/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.

## 21.8.0 - 2022-09-15
* [#1444](https://github.com/stripe/stripe-java/pull/1444) API Updates
* Add support for `pix` on `Charge.payment_method_details`, `Checkout.Session.payment_method_options`, `CheckoutSessionCreateParams.payment_method_options`, `PaymentIntent.payment_method_options`, `PaymentIntentConfirmParams.payment_method_data`, `PaymentIntentConfirmParams.payment_method_options`, `PaymentIntentCreateParams.payment_method_data`, `PaymentIntentCreateParams.payment_method_options`, `PaymentIntentUpdateParams.payment_method_data`, `PaymentIntentUpdateParams.payment_method_options`, `PaymentMethodCreateParams`, `PaymentMethod`, `SetupIntentConfirmParams.payment_method_data`, `SetupIntentCreateParams.payment_method_data`, and `SetupIntentUpdateParams.payment_method_data`
* Add support for new value `pix` on enum `CheckoutSessionCreateParams.payment_method_types[]`
* Add support for new value `pix` on enums `CustomerListPaymentMethodsParams.type` and `PaymentMethodListParams.type`
* Add support for `from_invoice` on `InvoiceCreateParams` and `Invoice`
* Add support for `latest_revision` on `Invoice`
* Add support for new value `pix` on enums `PaymentIntentConfirmParams.payment_method_data.type`, `PaymentIntentCreateParams.payment_method_data.type`, `PaymentIntentUpdateParams.payment_method_data.type`, `SetupIntentConfirmParams.payment_method_data.type`, `SetupIntentCreateParams.payment_method_data.type`, and `SetupIntentUpdateParams.payment_method_data.type`
* Add support for `pix_display_qr_code` on `PaymentIntent.next_action`
* Add support for new value `pix` on enums `PaymentLinkCreateParams.payment_method_types[]` and `PaymentLinkUpdateParams.payment_method_types[]`
* Add support for new value `pix` on enum `PaymentMethodCreateParams.type`
* Add support for `created` on `Treasury.CreditReversal` and `Treasury.DebitReversal`

## 21.7.0 - 2022-09-09
* [#1435](https://github.com/stripe/stripe-java/pull/1435) API Updates
* Add support for `require_signature` on `Issuing.Card.shipping` and `IssuingCardCreateParams.shipping`

## 21.6.0 - 2022-09-06
* [#1434](https://github.com/stripe/stripe-java/pull/1434) API Updates
* Add support for new value `terminal_reader_splashscreen` on enum `FileListParams.purpose`
* Fix `LineItem.Discount.discount` to reference the correct `Discount` class (`com.stripe.model.Discount`)

## 21.5.0 - 2022-08-31
* [#1433](https://github.com/stripe/stripe-java/pull/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](https://github.com/stripe/stripe-java/pull/1432) Update README badge
* [#1431](https://github.com/stripe/stripe-java/pull/1431) Update coveralls to only run for one java version

## 21.4.0 - 2022-08-26
* [#1430](https://github.com/stripe/stripe-java/pull/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](https://github.com/stripe/stripe-java/pull/1428) Show test coverage in README
* [#1427](https://github.com/stripe/stripe-java/pull/1427) Update README.md to clarify that API version can only be change in beta

## 21.4.0-beta.1 - 2022-08-26
* [#1429](https://github.com/stripe/stripe-java/pull/1429) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
1 change: 1 addition & 0 deletions Makefile
@@ -1,6 +1,7 @@
.PHONY: update-version codegen-format
update-version:
@echo "$(VERSION)" > VERSION
@perl -pi -e 's|badge/maven--central-v[.\d\-\w]+-blue|badge/maven--central-v$(VERSION)-blue|' README.md
@perl -pi -e 's|https:\/\/search\.maven\.org\/remotecontent\?filepath=com\/stripe\/stripe-java\/[.\d\-\w]+\/stripe-java-[.\d\-\w]+.jar|https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/$(VERSION)/stripe-java-$(VERSION).jar|' README.md
@perl -pi -e 's|implementation "com\.stripe:stripe-java:[.\d\-\w]+"|implementation "com.stripe:stripe-java:$(VERSION)"|' README.md
@perl -pi -e 's|<version>[.\d\-\w]+<\/version>|<version>$(VERSION)</version>|' README.md
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v185
v196
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# Stripe Java client library

[![Maven Central](https://img.shields.io/maven-central/v/com.stripe/stripe-java)](https://mvnrepository.com/artifact/com.stripe/stripe-java)
[![Maven Central](https://img.shields.io/badge/maven--central-v21.4.0-beta.1-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 Down
8 changes: 4 additions & 4 deletions src/main/java/com/stripe/model/AccountSession.java
Expand Up @@ -14,14 +14,14 @@

/**
* An AccountSession allows a Connect platform to grant access to a connected account in Connect
* Elements.
* Embedded UIs.
*
* <p>We recommend that you create an AccountSession each time you need to display an embedded UI to
* your user. Do not save AccountSessions to your database as they expire relatively quickly, and
* cannot be used more than once.
*
* <p>Related guide: <a href="https://stripe.com/docs/connect/get-started-connect-elements">Connect
* Elements</a>.
* Embedded UIs</a>.
*/
@Getter
@Setter
Expand All @@ -40,8 +40,8 @@ public class AccountSession extends ApiResource {
* that you have TLS enabled on any page that includes the client secret.
*
* <p>Refer to our docs to <a
* href="https://stripe.com/docs/connect/get-started-connect-elements">setup Connect Elements</a>
* and learn about how {@code client_secret} should be handled.
* href="https://stripe.com/docs/connect/get-started-connect-elements">setup Connect Embedded
* UIs</a> and learn about how {@code client_secret} should be handled.
*/
@SerializedName("client_secret")
String clientSecret;
Expand Down
30 changes: 22 additions & 8 deletions src/main/java/com/stripe/model/Charge.java
Expand Up @@ -1168,6 +1168,9 @@ public static class PaymentMethodDetails extends StripeObject {
@SerializedName("paynow")
Paynow paynow;

@SerializedName("pix")
Pix pix;

@SerializedName("promptpay")
Promptpay promptpay;

Expand Down Expand Up @@ -1998,13 +2001,14 @@ public static class Eps extends StripeObject {
* austrian_anadi_bank_ag}, {@code bank_austria}, {@code bankhaus_carl_spangler}, {@code
* bankhaus_schelhammer_und_schattera_ag}, {@code bawag_psk_ag}, {@code bks_bank_ag}, {@code
* brull_kallmus_bank_ag}, {@code btv_vier_lander_bank}, {@code capital_bank_grawe_gruppe_ag},
* {@code dolomitenbank}, {@code easybank_ag}, {@code erste_bank_und_sparkassen}, {@code
* hypo_alpeadriabank_international_ag}, {@code hypo_noe_lb_fur_niederosterreich_u_wien},
* {@code hypo_oberosterreich_salzburg_steiermark}, {@code hypo_tirol_bank_ag}, {@code
* hypo_vorarlberg_bank_ag}, {@code hypo_bank_burgenland_aktiengesellschaft}, {@code
* marchfelder_bank}, {@code oberbank_ag}, {@code raiffeisen_bankengruppe_osterreich}, {@code
* schoellerbank_ag}, {@code sparda_bank_wien}, {@code volksbank_gruppe}, {@code
* volkskreditbank_ag}, or {@code vr_bank_braunau}.
* {@code deutsche_bank_ag}, {@code dolomitenbank}, {@code easybank_ag}, {@code
* erste_bank_und_sparkassen}, {@code hypo_alpeadriabank_international_ag}, {@code
* hypo_noe_lb_fur_niederosterreich_u_wien}, {@code hypo_oberosterreich_salzburg_steiermark},
* {@code hypo_tirol_bank_ag}, {@code hypo_vorarlberg_bank_ag}, {@code
* hypo_bank_burgenland_aktiengesellschaft}, {@code marchfelder_bank}, {@code oberbank_ag},
* {@code raiffeisen_bankengruppe_osterreich}, {@code schoellerbank_ag}, {@code
* sparda_bank_wien}, {@code volksbank_gruppe}, {@code volkskreditbank_ag}, or {@code
* vr_bank_braunau}.
*/
@SerializedName("bank")
String bank;
Expand Down Expand Up @@ -2350,7 +2354,8 @@ public static class Klarna extends StripeObject {
* fi-FI}, {@code sv-FI}, {@code en-FI}, {@code en-GB}, {@code en-IE}, {@code it-IT}, {@code
* en-IT}, {@code nl-NL}, {@code en-NL}, {@code nb-NO}, {@code en-NO}, {@code sv-SE}, {@code
* en-SE}, {@code en-US}, {@code es-US}, {@code fr-FR}, {@code en-FR}, {@code en-AU}, {@code
* en-NZ}, {@code en-CA}, or {@code fr-CA}
* en-NZ}, {@code en-CA}, {@code fr-CA}, {@code pl-PL}, {@code en-PL}, {@code pt-PT}, {@code
* en-PT}, {@code de-CH}, {@code fr-CH}, {@code it-CH}, or {@code en-CH}
*/
@SerializedName("preferred_locale")
String preferredLocale;
Expand Down Expand Up @@ -2433,6 +2438,15 @@ public static class Paynow extends StripeObject {
String reference;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pix extends StripeObject {
/** Unique transaction id generated by BCB. */
@SerializedName("bank_transaction_id")
String bankTransactionId;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/com/stripe/model/EventDataClassLookup.java
Expand Up @@ -9,7 +9,7 @@
* string of the model.
*/
final class EventDataClassLookup {
private static final Map<String, Class<? extends StripeObject>> classLookup = new HashMap<>();
public static final Map<String, Class<? extends StripeObject>> classLookup = new HashMap<>();

static {
classLookup.put("account", Account.class);
Expand Down Expand Up @@ -91,6 +91,11 @@ final class EventDataClassLookup {
"billing_portal.configuration", com.stripe.model.billingportal.Configuration.class);
classLookup.put("billing_portal.session", com.stripe.model.billingportal.Session.class);

classLookup.put("capital.financing_offer", com.stripe.model.capital.FinancingOffer.class);
classLookup.put("capital.financing_summary", com.stripe.model.capital.FinancingSummary.class);
classLookup.put(
"capital.financing_transaction", com.stripe.model.capital.FinancingTransaction.class);

classLookup.put("checkout.session", com.stripe.model.checkout.Session.class);

classLookup.put(
Expand Down Expand Up @@ -148,8 +153,4 @@ final class EventDataClassLookup {
classLookup.put("treasury.transaction", com.stripe.model.treasury.Transaction.class);
classLookup.put("treasury.transaction_entry", com.stripe.model.treasury.TransactionEntry.class);
}

public static Class<? extends StripeObject> findClass(String objectType) {
return classLookup.get(objectType);
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/model/EventDataDeserializer.java
Expand Up @@ -53,7 +53,7 @@ public EventData deserialize(JsonElement json, Type typeOfT, JsonDeserialization
*/
static StripeObject deserializeStripeObject(JsonObject eventDataObjectJson) {
String type = eventDataObjectJson.getAsJsonObject().get("object").getAsString();
Class<? extends StripeObject> cl = EventDataClassLookup.findClass(type);
Class<? extends StripeObject> cl = EventDataClassLookup.classLookup.get(type);
return ApiResource.GSON.fromJson(
eventDataObjectJson, cl != null ? cl : StripeRawJsonObject.class);
}
Expand Down

0 comments on commit 3cebc81

Please sign in to comment.