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

Update generated code for beta #1701

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
703ce89
Update generated code (#1694)
stripe-openapi[bot] Nov 30, 2023
e38ac79
Bump version to 24.6.0
anniel-stripe Nov 30, 2023
4be0689
Compatibility
richardm-stripe Nov 30, 2023
f8ffe17
wip
richardm-stripe Nov 30, 2023
514e9b8
wip
richardm-stripe Nov 30, 2023
fe04f58
wip
richardm-stripe Nov 30, 2023
c4421fe
WIP
richardm-stripe Nov 30, 2023
605b804
WIP
richardm-stripe Dec 1, 2023
20789f9
WIP
richardm-stripe Dec 1, 2023
fdb2ca4
WIP
richardm-stripe Dec 1, 2023
c43c989
WIP
richardm-stripe Dec 1, 2023
f9bc5ea
wip
richardm-stripe Dec 1, 2023
c8fd46a
WIP
richardm-stripe Dec 1, 2023
3ffa1bb
Merge upstream and update generated code for v692
stripe-openapi[bot] Dec 1, 2023
d98e1a5
wip
richardm-stripe Dec 1, 2023
937e9aa
Add it!
richardm-stripe Dec 1, 2023
12296ea
Add various changes
richardm-stripe Dec 1, 2023
783b677
Swallow status code
richardm-stripe Dec 1, 2023
e6baf37
Fix
richardm-stripe Dec 1, 2023
b18b100
Revert "Add various changes"
richardm-stripe Dec 1, 2023
ceea10b
Update .github/workflows/ci.yml
richardm-stripe Dec 1, 2023
e5a77be
Merge pull request #1699 from stripe/richardm-compat
richardm-stripe Dec 1, 2023
346e901
Merge upstream and update generated code for v693
stripe-openapi[bot] Dec 1, 2023
261764a
Update generated code for v694
stripe-openapi[bot] Dec 4, 2023
4df3a05
Update generated code for v695
stripe-openapi[bot] Dec 4, 2023
255b70e
Update generated code for v696
stripe-openapi[bot] Dec 5, 2023
74912c4
Update generated code for v697
stripe-openapi[bot] Dec 6, 2023
f91ab48
Update generated code for v698
stripe-openapi[bot] Dec 6, 2023
f9c884a
Update generated code for v700
stripe-openapi[bot] Dec 6, 2023
fde7b25
Update generated code for v701
stripe-openapi[bot] Dec 6, 2023
95a5a3d
Update generated code for v702
stripe-openapi[bot] Dec 7, 2023
e66f04b
Update generated code for v703
stripe-openapi[bot] Dec 7, 2023
b95af02
Update generated code for v704
stripe-openapi[bot] Dec 7, 2023
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
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,63 @@ jobs:
env:
GRGIT_USER: ${{ github.actor }}
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}

compat:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Java
id: setup-jre
uses: actions/setup-java@v1
with:
java-version: "17" # always use 17 TLS for building
architecture: x64

- name: Set Test Java Runtime Environment variable
run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV

- name: Clone japi-compliance-checker
run: |
git clone https://github.com/lvc/japi-compliance-checker ../japi-compliance-checker

- name: Build HEAD JAR file
run: ./gradlew jar

- name: Copy JAR to japi-compliance-checker
run: |
mv build/libs/*.jar ../japi-compliance-checker/new.jar

- name: Checkout base branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}

- name: Build Base JAR file
run: ./gradlew jar

- name: Copy JAR to japi-compliance-checker
run: |
mv build/libs/*.jar ../japi-compliance-checker/old.jar

- name: Run JAPI Compliance Checker
run: |
cd ../japi-compliance-checker
perl japi-compliance-checker.pl -old old.jar -new new.jar --lib=stripe-java || echo "failed" > compliance_failure
cd ../stripe-java
mv ../japi-compliance-checker/compat_reports/stripe-java/*/compat_report.html report.html

- name: Upload report as artifact
uses: actions/upload-artifact@v3
with:
name: JAPI Compliance Report
path: report.html

- name: Fail if compatibility problems exist
run: |
if [ -f "../japi-compliance-checker/compliance_failure" ]; then
echo "There were compatibility problems. See the generated report at https://github.com/stripe/stripe-java/actions/runs/${{ github.run_id }}?check_suite_focus=true#artifacts"
exit 1
fi
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
## 24.7.0-beta.1 - 2023-11-30
* [#1695](https://github.com/stripe/stripe-java/pull/1695) Update generated code for beta

## 24.6.0 - 2023-11-30
* [#1694](https://github.com/stripe/stripe-java/pull/1694) Update generated code
* Add support for new resources `Climate.Order`, `Climate.Product`, and `Climate.Supplier`
* Add support for `cancel`, `create`, `list`, `retrieve`, and `update` methods on resource `Order`
* Add support for `list` and `retrieve` methods on resources `Product` and `Supplier`
* Add support for `created` on `checkout.SessionListParams`
* Add support for `validate_location` on `CustomerCreateParams.tax` and `CustomerUpdateParams.tax`
* Add support for new values `climate_order_purchase` and `climate_order_refund` on enum `reporting.ReportRunCreateParams.parameters.reporting_category`
* Add support for new values `climate.order.canceled`, `climate.order.created`, `climate.order.delayed`, `climate.order.delivered`, `climate.order.product_substituted`, `climate.product.created`, and `climate.product.pricing_updated` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

## 24.6.0-beta.1 - 2023-11-21
* [#1691](https://github.com/stripe/stripe-java/pull/1691) Update generated code for beta
* Rename `receipient` to `recipient` beneath `PaymentDetails` on `Charge` and `PaymentIntent` APIs.
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v691
v704
8 changes: 8 additions & 0 deletions src/main/java/com/stripe/model/AccountSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ public static class AccountOnboarding extends StripeObject {
/** Whether the embedded component is enabled. */
@SerializedName("enabled")
Boolean enabled;

@SerializedName("features")
Features features;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Features extends StripeObject {}
}

@Getter
Expand Down
24 changes: 13 additions & 11 deletions src/main/java/com/stripe/model/BalanceTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ public class BalanceTransaction extends ApiResource implements HasId {
* issuing_authorization_release}, {@code issuing_dispute}, {@code issuing_transaction}, {@code
* obligation_inbound}, {@code obligation_outbound}, {@code obligation_reversal_inbound}, {@code
* obligation_reversal_outbound}, {@code obligation_payout}, {@code obligation_payout_failure},
* {@code payment}, {@code payment_failure_refund}, {@code payment_refund}, {@code
* payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code
* payout_failure}, {@code refund}, {@code refund_failure}, {@code reserve_transaction}, {@code
* reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup},
* {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or
* {@code transfer_refund}. Learn more about <a
* {@code payment}, {@code payment_failure_refund}, {@code payment_network_reserve_hold}, {@code
* payment_network_reserve_release}, {@code payment_refund}, {@code payment_reversal}, {@code
* payment_unreconciled}, {@code payout}, {@code payout_cancel}, {@code payout_failure}, {@code
* refund}, {@code refund_failure}, {@code reserve_transaction}, {@code reserved_funds}, {@code
* stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code topup}, {@code topup_reversal},
* {@code transfer}, {@code transfer_cancel}, {@code transfer_failure}, or {@code
* transfer_refund}. Learn more about <a
* href="https://stripe.com/docs/reports/balance-transaction-types">balance transaction types and
* what they represent</a>. To classify transactions for accounting purposes, consider {@code
* reporting_category} instead.
Expand All @@ -144,11 +145,12 @@ public class BalanceTransaction extends ApiResource implements HasId {
* obligation_inbound}, {@code obligation_outbound}, {@code obligation_payout}, {@code
* obligation_payout_failure}, {@code obligation_reversal_inbound}, {@code
* obligation_reversal_outbound}, {@code payment}, {@code payment_failure_refund}, {@code
* payment_refund}, {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code
* payout_cancel}, {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code
* reserve_transaction}, {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code
* tax_fee}, {@code topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel},
* {@code transfer_failure}, or {@code transfer_refund}.
* payment_network_reserve_hold}, {@code payment_network_reserve_release}, {@code payment_refund},
* {@code payment_reversal}, {@code payment_unreconciled}, {@code payout}, {@code payout_cancel},
* {@code payout_failure}, {@code refund}, {@code refund_failure}, {@code reserve_transaction},
* {@code reserved_funds}, {@code stripe_fee}, {@code stripe_fx_fee}, {@code tax_fee}, {@code
* topup}, {@code topup_reversal}, {@code transfer}, {@code transfer_cancel}, {@code
* transfer_failure}, or {@code transfer_refund}.
*/
@SerializedName("type")
String type;
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/com/stripe/model/CustomerSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static class PaymentElement extends StripeObject {
@SerializedName("enabled")
Boolean enabled;

/** This hash contains the features the Payment Element supports. */
/** This hash defines whether the payment element supports certain features. */
@SerializedName("features")
Features features;

Expand All @@ -170,23 +170,31 @@ public static class PaymentElement extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class Features extends StripeObject {
/**
* Whether the payment element supports detaching payment methods.
* Controls whether the Payment Element allows the removal of a saved payment method.
*
* <p>One of {@code auto}, or {@code never}.
*/
@SerializedName("payment_method_remove")
String paymentMethodRemove;

/**
* Controls whether the Payment Element offers to save a new payment method.
*
* <p>One of {@code auto}, or {@code never}.
*/
@SerializedName("payment_method_detach")
String paymentMethodDetach;
@SerializedName("payment_method_save")
String paymentMethodSave;

/**
* Whether the payment element supports setting payment methods as the customer's default.
* Controls whether the Payment Element offers to set a payment method as the default.
*
* <p>One of {@code auto}, or {@code never}.
*/
@SerializedName("payment_method_set_as_customer_default")
String paymentMethodSetAsCustomerDefault;
@SerializedName("payment_method_set_as_default")
String paymentMethodSetAsDefault;

/**
* Whether the payment element supports updating payment methods.
* Controls whether the Payment Element allows the updating of a saved payment method.
*
* <p>One of {@code auto}, or {@code never}.
*/
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -3060,13 +3060,12 @@ public static class Card extends StripeObject {
* customers for authentication based on risk level and <a
* href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
* However, if you wish to request 3D Secure based on logic from your own fraud engine,
* provide this option. Permitted values include: {@code automatic} or {@code any}. If not
* provided, defaults to {@code automatic}. Read our guide on <a
* href="https://stripe.com/docs/payments/3d-secure#manual-three-ds">manually requesting 3D
* Secure</a> for more information on how this configuration interacts with Radar and our SCA
* Engine.
* provide this option. If not provided, this value defaults to {@code automatic}. Read our
* guide on <a href="https://stripe.com/docs/payments/3d-secure#manual-three-ds">manually
* requesting 3D Secure</a> for more information on how this configuration interacts with
* Radar and our SCA Engine.
*
* <p>One of {@code any}, {@code automatic}, {@code challenge}, or {@code challenge_only}.
* <p>One of {@code any}, or {@code automatic}.
*/
@SerializedName("request_three_d_secure")
String requestThreeDSecure;
Expand Down
73 changes: 73 additions & 0 deletions src/main/java/com/stripe/model/PaymentLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStore<Pay
@SerializedName("id")
String id;

/** The custom message to be displayed to a customer when a payment link is no longer active. */
@SerializedName("inactive_message")
String inactiveMessage;

/** Configuration for creating invoice for payment mode payment links. */
@SerializedName("invoice_creation")
InvoiceCreation invoiceCreation;
Expand Down Expand Up @@ -182,6 +186,10 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStore<Pay
@SerializedName("phone_number_collection")
PhoneNumberCollection phoneNumberCollection;

/** Settings that restrict the usage of a payment link. */
@SerializedName("restrictions")
Restrictions restrictions;

/** Configuration for collecting the customer's shipping address. */
@SerializedName("shipping_address_collection")
ShippingAddressCollection shippingAddressCollection;
Expand Down Expand Up @@ -969,6 +977,14 @@ public static class PaymentIntentData extends StripeObject {
*/
@SerializedName("statement_descriptor_suffix")
String statementDescriptorSuffix;

/**
* A string that identifies the resulting payment as part of a group. See the PaymentIntents <a
* href="https://stripe.com/docs/connect/separate-charges-and-transfers">use case for connected
* accounts</a> for details.
*/
@SerializedName("transfer_group")
String transferGroup;
}

@Getter
Expand All @@ -980,6 +996,33 @@ public static class PhoneNumberCollection extends StripeObject {
Boolean enabled;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Restrictions extends StripeObject {
@SerializedName("completed_sessions")
CompletedSessions completedSessions;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class CompletedSessions extends StripeObject {
/**
* The current number of checkout sessions that have been completed on the payment link which
* count towards the {@code completed_sessions} restriction to be met.
*/
@SerializedName("count")
Long count;

/**
* The maximum number of checkout sessions that can be completed for the {@code
* completed_sessions} restriction to be met.
*/
@SerializedName("limit")
Long limit;
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -1058,6 +1101,10 @@ public static class SubscriptionData extends StripeObject {
@SerializedName("trial_period_days")
Long trialPeriodDays;

/** Settings related to subscription trials. */
@SerializedName("trial_settings")
TrialSettings trialSettings;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -1106,6 +1153,31 @@ public void setAccountObject(Account expandableObject) {
}
}
}

/** Configures how this subscription behaves during the trial period. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class TrialSettings extends StripeObject {
/** Defines how a subscription behaves when a free trial ends. */
@SerializedName("end_behavior")
EndBehavior endBehavior;

/** Defines how a subscription behaves when a free trial ends. */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class EndBehavior extends StripeObject {
/**
* Indicates how the subscription should change when the trial ends if the user did not
* provide a payment method.
*
* <p>One of {@code cancel}, {@code create_invoice}, or {@code pause}.
*/
@SerializedName("missing_payment_method")
String missingPaymentMethod;
}
}
}

@Getter
Expand Down Expand Up @@ -1166,6 +1238,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) {
trySetResponseGetter(onBehalfOf, responseGetter);
trySetResponseGetter(paymentIntentData, responseGetter);
trySetResponseGetter(phoneNumberCollection, responseGetter);
trySetResponseGetter(restrictions, responseGetter);
trySetResponseGetter(shippingAddressCollection, responseGetter);
trySetResponseGetter(subscriptionData, responseGetter);
trySetResponseGetter(taxIdCollection, responseGetter);
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/com/stripe/model/Price.java
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,8 @@ public static class MigrateTo extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class Recurring extends StripeObject {
/**
* Specifies a usage aggregation strategy for prices of {@code usage_type=metered}. Allowed
* values are {@code sum} for summing up all usage during a period, {@code last_during_period}
* for using the last usage record reported within a period, {@code last_ever} for using the
* last usage record ever (across period bounds) or {@code max} which uses the usage record with
* the maximum reported usage during a period. Defaults to {@code sum}.
* Specifies a usage aggregation strategy for prices of {@code usage_type=metered}. Defaults to
* {@code sum}.
*
* <p>One of {@code last_during_period}, {@code last_ever}, {@code max}, or {@code sum}.
*/
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/com/stripe/model/SetupIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1096,11 +1096,10 @@ public static class Card extends StripeObject {
* customers for authentication based on risk level and <a
* href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
* However, if you wish to request 3D Secure based on logic from your own fraud engine,
* provide this option. Permitted values include: {@code automatic} or {@code any}. If not
* provided, defaults to {@code automatic}. Read our guide on <a
* href="https://stripe.com/docs/payments/3d-secure#manual-three-ds">manually requesting 3D
* Secure</a> for more information on how this configuration interacts with Radar and our SCA
* Engine.
* provide this option. If not provided, this value defaults to {@code automatic}. Read our
* guide on <a href="https://stripe.com/docs/payments/3d-secure#manual-three-ds">manually
* requesting 3D Secure</a> for more information on how this configuration interacts with
* Radar and our SCA Engine.
*
* <p>One of {@code any}, {@code automatic}, {@code challenge}, or {@code challenge_only}.
*/
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/stripe/model/StripeError.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public class StripeError extends StripeObject {
* charge_expired_for_capture}, {@code charge_invalid_parameter}, {@code charge_not_refundable},
* {@code clearing_code_unsupported}, {@code country_code_invalid}, {@code country_unsupported},
* {@code coupon_expired}, {@code customer_max_payment_methods}, {@code
* customer_max_subscriptions}, {@code debit_not_authorized}, {@code email_invalid}, {@code
* expired_card}, {@code financial_connections_account_inactive}, {@code
* customer_max_subscriptions}, {@code customer_tax_location_invalid}, {@code
* debit_not_authorized}, {@code email_invalid}, {@code expired_card}, {@code
* financial_connections_account_inactive}, {@code
* financial_connections_no_successful_transaction_refresh}, {@code
* gift_card_balance_insufficient}, {@code gift_card_code_exists}, {@code gift_card_inactive},
* {@code idempotency_key_in_use}, {@code incorrect_address}, {@code incorrect_cvc}, {@code
* incorrect_number}, {@code incorrect_zip}, {@code instant_payouts_config_disabled}, {@code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class Transaction extends StripeObject implements HasId {
@SerializedName("transacted_at")
Long transactedAt;

/** The transaction_refresh object that last updated or created this transaction. */
/** The token of the transaction refresh that last updated or created this transaction. */
@SerializedName("transaction_refresh")
String transactionRefresh;

Expand Down
Loading
Loading