Skip to content

Commit

Permalink
Merge pull request #1935 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored Jan 18, 2025
2 parents fc96887 + 5b353e3 commit 468aece
Show file tree
Hide file tree
Showing 46 changed files with 3,333 additions and 75 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
build:
name: Build

runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"

steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@master

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

- name: Spotless
run: ./gradlew spotlessCheck
run: just format-check

- name: Build artifacts
run: ./gradlew assemble javadoc

test:
name: Test

runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"

strategy:
fail-fast: false
Expand All @@ -59,6 +60,7 @@ jobs:
- "20"

steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@master

- name: Setup Test Java Runtime
Expand Down Expand Up @@ -88,22 +90,15 @@ jobs:
- uses: stripe/openapi/actions/stripe-mock@master
- name: Run test suite
run: make ci-test

- name: Send code coverage report to coveralls.io
run: ./gradlew jacocoTestReport coveralls
if: env.COVERALLS_REPO_TOKEN && matrix.java-version == '17'
env:
CI_NAME: github-actions
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: just test

publish:
if: >-
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
startsWith(github.ref, 'refs/tags/v') &&
endsWith(github.actor, '-stripe')
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
startsWith(github.ref, 'refs/tags/v') &&
endsWith(github.actor, '-stripe')
needs: [build, test]
runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"
steps:
- uses: actions/checkout@master
- name: Setup Java
Expand Down Expand Up @@ -143,7 +138,7 @@ jobs:
!contains(github.ref, 'beta') &&
endsWith(github.actor, '-stripe')
needs: [build, test]
runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"
steps:
- uses: actions/checkout@master
- name: Setup Java
Expand All @@ -163,7 +158,7 @@ jobs:
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}

compat:
runs-on: ubuntu-latest
runs-on: "ubuntu-24.04"

steps:
- name: Checkout repository
Expand Down
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# Contributing

We welcome bug reports, feature requests, and code contributions in a pull request.

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).

## Contributor License Agreement

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.

## Generated code

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.

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`.

## Compatibility with supported language and runtime versions

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.

## Set up your dev environment

Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands.

.PHONY: update-version codegen-format
update-version:
@echo "$(VERSION)" > VERSION
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1436
v1454
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Maven Central](https://img.shields.io/badge/maven--central-v28.3.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)

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

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

## Development

[Contribution guidelines for this project](CONTRIBUTING.md)

JDK 17 is required to build the Stripe Java library. By default, tests use the same Java runtime as the build.
To use a custom version of Java runtime for tests set the `JAVA_TEST_HOME` environment variable to runtime's
home directory.
Expand All @@ -308,6 +309,8 @@ go get -u github.com/stripe/stripe-mock
stripe-mock
```

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`.

To run all checks (tests and code formatting):

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

```sh
./gradlew test
just test
# or: ./gradlew test
```

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

```sh
./gradlew test --tests com.stripe.model.AccountTest
./gradlew test --tests com.stripe.functional.CustomerTest
./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate
just test-one com.stripe.model.AccountTest
just test-one com.stripe.functional.CustomerTest
just test-one com.stripe.functional.CustomerTest.testCustomerCreate
# or: ./gradlew test --tests com.stripe.model.AccountTest
# or: ./gradlew test --tests com.stripe.functional.CustomerTest
# or: ./gradlew test --tests com.stripe.functional.CustomerTest.testCustomerCreate
```

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

```sh
./gradlew spotlessApply
just format
# or: ./gradlew spotlessApply
```

The library uses [Project Lombok][lombok]. While it is not a requirement, you
Expand Down
12 changes: 0 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ plugins {
id "io.freefair.lombok" version "6.3.0"
id "com.diffplug.spotless" version "6.4.0"
id "net.ltgt.errorprone" version "2.0.2"
id "com.github.kt3k.coveralls" version "2.12.0"
id "biz.aQute.bnd.builder" version "6.1.0"
id "org.ajoberstar.git-publish" version "3.0.1"
}
Expand Down Expand Up @@ -137,17 +136,6 @@ spotless {
}
}

jacocoTestReport {
reports {
xml.required = true // coveralls plugin depends on xml format report
html.required = true
}
}

coveralls {
jacocoReportPath "build/reports/jacoco/test/jacocoTestReport.xml"
}

gitPublish {
repoUri = 'https://github.com/stripe/stripe-java.git'
branch = 'gh-pages'
Expand Down
35 changes: 35 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
set quiet

import? '../sdk-codegen/utils.just'

_default:
just --list --unsorted

# ⭐ run the whole test suite
[no-exit-message]
test *args:
./gradlew test {{ args }}

# run a single test
test-one modelPath: (test "--tests" modelPath)

# ⭐ format all files
[no-exit-message]
format:
./gradlew spotlessApply

# check, but don't change, the formatting
[no-exit-message]
format-check:
./gradlew spotlessCheck

# called by tooling
[private]
update-version 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
perl -pi -e 's|VERSION_NAME=[.\d\-\w]+|VERSION_NAME={{ version }}|' gradle.properties
perl -pi -e 's|public static final String VERSION = "[.\d\-\w]+";|public static final String VERSION = "{{ version }}";|' src/main/java/com/stripe/Stripe.java
2 changes: 1 addition & 1 deletion src/main/java/com/stripe/ApiVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package com.stripe;

final class ApiVersion {
public static final String CURRENT = "2024-12-18.acacia";
public static final String CURRENT = "2025-01-27.acacia";
}
9 changes: 9 additions & 0 deletions src/main/java/com/stripe/model/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,15 @@ public static class Capabilities extends StripeObject {
@SerializedName("p24_payments")
String p24Payments;

/**
* The status of the pay_by_bank payments capability of the account, or whether the account can
* directly process pay_by_bank charges.
*
* <p>One of {@code active}, {@code inactive}, or {@code pending}.
*/
@SerializedName("pay_by_bank_payments")
String payByBankPayments;

/**
* The status of the Payco capability of the account, or whether the account can directly
* process Payco payments.
Expand Down
Loading

0 comments on commit 468aece

Please sign in to comment.