Skip to content

Commit 468aece

Browse files
Merge pull request #1935 from stripe/latest-codegen-beta
Update generated code for beta
2 parents fc96887 + 5b353e3 commit 468aece

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3333
-75
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ jobs:
2121
build:
2222
name: Build
2323

24-
runs-on: ubuntu-latest
24+
runs-on: "ubuntu-24.04"
2525

2626
steps:
27+
- uses: extractions/setup-just@v2
2728
- uses: actions/checkout@master
2829

2930
- name: Setup Java
@@ -37,15 +38,15 @@ jobs:
3738
run: echo "JAVA_TEST_HOME=${{ steps.setup-jre.outputs.path }}" >> $GITHUB_ENV
3839

3940
- name: Spotless
40-
run: ./gradlew spotlessCheck
41+
run: just format-check
4142

4243
- name: Build artifacts
4344
run: ./gradlew assemble javadoc
4445

4546
test:
4647
name: Test
4748

48-
runs-on: ubuntu-latest
49+
runs-on: "ubuntu-24.04"
4950

5051
strategy:
5152
fail-fast: false
@@ -59,6 +60,7 @@ jobs:
5960
- "20"
6061

6162
steps:
63+
- uses: extractions/setup-just@v2
6264
- uses: actions/checkout@master
6365

6466
- name: Setup Test Java Runtime
@@ -88,22 +90,15 @@ jobs:
8890
8991
- uses: stripe/openapi/actions/stripe-mock@master
9092
- name: Run test suite
91-
run: make ci-test
92-
93-
- name: Send code coverage report to coveralls.io
94-
run: ./gradlew jacocoTestReport coveralls
95-
if: env.COVERALLS_REPO_TOKEN && matrix.java-version == '17'
96-
env:
97-
CI_NAME: github-actions
98-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
93+
run: just test
9994

10095
publish:
10196
if: >-
102-
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
103-
startsWith(github.ref, 'refs/tags/v') &&
104-
endsWith(github.actor, '-stripe')
97+
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
98+
startsWith(github.ref, 'refs/tags/v') &&
99+
endsWith(github.actor, '-stripe')
105100
needs: [build, test]
106-
runs-on: ubuntu-latest
101+
runs-on: "ubuntu-24.04"
107102
steps:
108103
- uses: actions/checkout@master
109104
- name: Setup Java
@@ -143,7 +138,7 @@ jobs:
143138
!contains(github.ref, 'beta') &&
144139
endsWith(github.actor, '-stripe')
145140
needs: [build, test]
146-
runs-on: ubuntu-latest
141+
runs-on: "ubuntu-24.04"
147142
steps:
148143
- uses: actions/checkout@master
149144
- name: Setup Java
@@ -163,7 +158,7 @@ jobs:
163158
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
164159

165160
compat:
166-
runs-on: ubuntu-latest
161+
runs-on: "ubuntu-24.04"
167162

168163
steps:
169164
- name: Checkout repository

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# Contributing
3+
4+
We welcome bug reports, feature requests, and code contributions in a pull request.
5+
6+
For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-java/issues/new/choose).
7+
8+
## Contributor License Agreement
9+
10+
All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant.
11+
12+
## Generated code
13+
14+
This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution.
15+
16+
To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`.
17+
18+
## Compatibility with supported language and runtime versions
19+
20+
This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward.
21+
22+
## Set up your dev environment
23+
24+
Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment.
25+

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands.
2+
13
.PHONY: update-version codegen-format
24
update-version:
35
@echo "$(VERSION)" > VERSION

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1436
1+
v1454

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![Maven Central](https://img.shields.io/badge/maven--central-v28.3.0-beta.1-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java)
44
[![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java)
55
[![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)
6-
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master)
76

87
The official [Stripe][stripe] Java client library.
98

@@ -295,6 +294,8 @@ New features and bug fixes are released on the latest major version of the Strip
295294

296295
## Development
297296

297+
[Contribution guidelines for this project](CONTRIBUTING.md)
298+
298299
JDK 17 is required to build the Stripe Java library. By default, tests use the same Java runtime as the build.
299300
To use a custom version of Java runtime for tests set the `JAVA_TEST_HOME` environment variable to runtime's
300301
home directory.
@@ -308,6 +309,8 @@ go get -u github.com/stripe/stripe-mock
308309
stripe-mock
309310
```
310311

312+
We use [just](https://github.com/casey/just) for conveniently running development tasks. You can use them directly, or copy the commands out of the `justfile`. To our help docs, run `just`.
313+
311314
To run all checks (tests and code formatting):
312315

313316
```sh
@@ -317,16 +320,20 @@ To run all checks (tests and code formatting):
317320
To run the tests:
318321

319322
```sh
320-
./gradlew test
323+
just test
324+
# or: ./gradlew test
321325
```
322326

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

326330
```sh
327-
./gradlew test --tests com.stripe.model.AccountTest
328-
./gradlew test --tests com.stripe.functional.CustomerTest
329-
./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate
331+
just test-one com.stripe.model.AccountTest
332+
just test-one com.stripe.functional.CustomerTest
333+
just test-one com.stripe.functional.CustomerTest.testCustomerCreate
334+
# or: ./gradlew test --tests com.stripe.model.AccountTest
335+
# or: ./gradlew test --tests com.stripe.functional.CustomerTest
336+
# or: ./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate
330337
```
331338

332339
The library uses [Spotless][spotless] along with
@@ -335,7 +342,8 @@ formatted before PRs are submitted, otherwise CI will fail. Run the formatter
335342
with:
336343

337344
```sh
338-
./gradlew spotlessApply
345+
just format
346+
# or: ./gradlew spotlessApply
339347
```
340348

341349
The library uses [Project Lombok][lombok]. While it is not a requirement, you

build.gradle

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ plugins {
1515
id "io.freefair.lombok" version "6.3.0"
1616
id "com.diffplug.spotless" version "6.4.0"
1717
id "net.ltgt.errorprone" version "2.0.2"
18-
id "com.github.kt3k.coveralls" version "2.12.0"
1918
id "biz.aQute.bnd.builder" version "6.1.0"
2019
id "org.ajoberstar.git-publish" version "3.0.1"
2120
}
@@ -137,17 +136,6 @@ spotless {
137136
}
138137
}
139138

140-
jacocoTestReport {
141-
reports {
142-
xml.required = true // coveralls plugin depends on xml format report
143-
html.required = true
144-
}
145-
}
146-
147-
coveralls {
148-
jacocoReportPath "build/reports/jacoco/test/jacocoTestReport.xml"
149-
}
150-
151139
gitPublish {
152140
repoUri = 'https://github.com/stripe/stripe-java.git'
153141
branch = 'gh-pages'

justfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
set quiet
2+
3+
import? '../sdk-codegen/utils.just'
4+
5+
_default:
6+
just --list --unsorted
7+
8+
# ⭐ run the whole test suite
9+
[no-exit-message]
10+
test *args:
11+
./gradlew test {{ args }}
12+
13+
# run a single test
14+
test-one modelPath: (test "--tests" modelPath)
15+
16+
# ⭐ format all files
17+
[no-exit-message]
18+
format:
19+
./gradlew spotlessApply
20+
21+
# check, but don't change, the formatting
22+
[no-exit-message]
23+
format-check:
24+
./gradlew spotlessCheck
25+
26+
# called by tooling
27+
[private]
28+
update-version version:
29+
echo "{{ version }}" > VERSION
30+
perl -pi -e 's|badge/maven--central-v[.\d\-\w]+-blue|badge/maven--central-v{{ version }}-blue|' README.md
31+
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
32+
perl -pi -e 's|implementation "com\.stripe:stripe-java:[.\d\-\w]+"|implementation "com.stripe:stripe-java:{{ version }}"|' README.md
33+
perl -pi -e 's|<version>[.\d\-\w]+<\/version>|<version>{{ version }}</version>|' README.md
34+
perl -pi -e 's|VERSION_NAME=[.\d\-\w]+|VERSION_NAME={{ version }}|' gradle.properties
35+
perl -pi -e 's|public static final String VERSION = "[.\d\-\w]+";|public static final String VERSION = "{{ version }}";|' src/main/java/com/stripe/Stripe.java

src/main/java/com/stripe/ApiVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
package com.stripe;
33

44
final class ApiVersion {
5-
public static final String CURRENT = "2024-12-18.acacia";
5+
public static final String CURRENT = "2025-01-27.acacia";
66
}

src/main/java/com/stripe/model/Account.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,15 @@ public static class Capabilities extends StripeObject {
12261226
@SerializedName("p24_payments")
12271227
String p24Payments;
12281228

1229+
/**
1230+
* The status of the pay_by_bank payments capability of the account, or whether the account can
1231+
* directly process pay_by_bank charges.
1232+
*
1233+
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
1234+
*/
1235+
@SerializedName("pay_by_bank_payments")
1236+
String payByBankPayments;
1237+
12291238
/**
12301239
* The status of the Payco capability of the account, or whether the account can directly
12311240
* process Payco payments.

0 commit comments

Comments
 (0)