Skip to content

Commit c1bd25a

Browse files
Merge pull request #1963 from stripe/latest-codegen-beta
Update generated code for beta
2 parents 760771d + af26308 commit c1bd25a

22 files changed

+405
-77
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ jobs:
2222
lint:
2323
name: Lint
2424

25-
runs-on: ubuntu-latest
25+
runs-on: "ubuntu-24.04"
2626

2727
steps:
28+
- uses: extractions/setup-just@v2
2829
- uses: actions/checkout@master
2930

3031
- name: Setup go
@@ -34,50 +35,41 @@ jobs:
3435

3536
- name: lint
3637
run: |
37-
go install honnef.co/go/tools/cmd/[email protected] &&
38-
go install golang.org/x/tools/cmd/[email protected] &&
39-
$HOME/go/bin/staticcheck &&
40-
make vet &&
41-
make check-gofmt
38+
just lint format-check
4239
4340
test:
44-
runs-on: ubuntu-latest
45-
strategy:
46-
matrix:
47-
go:
48-
- "1.23"
49-
- "1.22"
50-
- "1.21"
51-
- "1.20"
52-
- "1.19"
53-
- "1.18"
54-
- "1.17"
55-
- "1.16"
56-
- "1.15"
57-
name: "Test: go v${{ matrix.go }}"
58-
steps:
59-
- uses: actions/checkout@v2
60-
- name: Setup go
61-
uses: actions/setup-go@v1
62-
with:
63-
go-version: ${{ matrix.go }}
64-
- uses: stripe/openapi/actions/stripe-mock@master
65-
- name: Test
66-
run: make ci-test
67-
- name: Coveralls
68-
run: make coverage && make coveralls
69-
if: matrix.go == '1.16'
70-
env:
71-
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
COVERALLS_FLAG_NAME: Go-${{ matrix.go }}
41+
runs-on: "ubuntu-24.04"
42+
strategy:
43+
matrix:
44+
go:
45+
- "1.23"
46+
- "1.22"
47+
- "1.21"
48+
- "1.20"
49+
- "1.19"
50+
- "1.18"
51+
- "1.17"
52+
- "1.16"
53+
- "1.15"
54+
name: "Test: go v${{ matrix.go }}"
55+
steps:
56+
- uses: extractions/setup-just@v2
57+
- uses: actions/checkout@v2
58+
- name: Setup go
59+
uses: actions/setup-go@v1
60+
with:
61+
go-version: ${{ matrix.go }}
62+
- uses: stripe/openapi/actions/stripe-mock@master
63+
- name: Test
64+
run: just ci-test
7365

7466
publish:
7567
name: Publish
7668
if: >-
7769
(github.event_name == 'workflow_dispatch' || github.event_name == 'push') &&
7870
startsWith(github.ref, 'refs/tags/v') &&
7971
endsWith(github.actor, '-stripe')
80-
runs-on: ubuntu-latest
72+
runs-on: "ubuntu-24.04"
8173
steps:
8274
- uses: actions/checkout@v2
8375
- uses: stripe/openapi/actions/notify-release@master

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-go/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: 3 additions & 1 deletion
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
all: test bench vet lint check-api-clients check-gofmt ci-test
24

35
bench:
@@ -43,7 +45,7 @@ codegen-format: normalize-imports
4345
go install golang.org/x/tools/cmd/[email protected] && goimports -w example/generated_examples_test.go
4446

4547
CURRENT_MAJOR_VERSION := $(shell cat VERSION | sed 's/\..*//')
46-
normalize-imports:
48+
normalize-imports:
4749
@perl -pi -e 's|github.com/stripe/stripe-go/v\d+|github.com/stripe/stripe-go/v$(CURRENT_MAJOR_VERSION)|' go.mod
4850
@find . -name '*.go' -exec perl -pi -e 's|github.com/stripe/stripe-go/(v\d+\|\[MAJOR_VERSION\])|github.com/stripe/stripe-go/v$(CURRENT_MAJOR_VERSION)|' {} +
4951

OPENAPI_VERSION

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

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![Go Reference](https://pkg.go.dev/badge/github.com/stripe/stripe-go)](https://pkg.go.dev/github.com/stripe/stripe-go/v81)
44
[![Build Status](https://github.com/stripe/stripe-go/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-go/actions/workflows/ci.yml?query=branch%3Amaster)
5-
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-go/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-go?branch=master)
65

76
The official [Stripe][stripe] Go client library.
87

@@ -628,6 +627,7 @@ func make_raw_request() error {
628627
}
629628

630629
```
630+
631631
See more examples in the [/example/v2 folder](example/v2).
632632

633633
## Support
@@ -641,19 +641,15 @@ the following guidelines in mind:
641641

642642
1. Code must be `go fmt` compliant.
643643
2. All types, structs and funcs should be documented.
644-
3. Ensure that `make test` succeeds.
645-
646-
## Test
644+
3. Ensure that `just test` succeeds.
647645

648-
The test suite needs testify's `require` package to run:
646+
[Other contribution guidelines for this project](CONTRIBUTING.md)
649647

650-
github.com/stretchr/testify/require
651-
652-
Before running the tests, make sure to grab all of the package's dependencies:
648+
## Test
653649

654-
go get -t -v
650+
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`.
655651

656-
It also depends on [stripe-mock][stripe-mock], so make sure to fetch and run it from a
652+
This package depends on [stripe-mock][stripe-mock], so make sure to fetch and run it from a
657653
background terminal ([stripe-mock's README][stripe-mock-usage] also contains
658654
instructions for installing via Homebrew and other methods):
659655

@@ -662,15 +658,24 @@ instructions for installing via Homebrew and other methods):
662658

663659
Run all tests:
664660

665-
make test
661+
```sh
662+
just test
663+
# or: go test ./...
664+
```
666665

667666
Run tests for one package:
668667

669-
go test ./invoice
668+
```sh
669+
just test ./invoice
670+
# or: go test ./invoice
671+
```
670672

671673
Run a single test:
672674

673-
go test ./invoice -run TestInvoiceGet
675+
```sh
676+
just test ./invoice -run TestInvoiceGet
677+
# or: go test ./invoice -run TestInvoiceGet
678+
```
674679

675680
For any requests, bug or comments, please [open an issue][issues] or [submit a
676681
pull request][pulls].

account.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,12 @@ type AccountCapabilitiesP24PaymentsParams struct {
595595
Requested *bool `form:"requested"`
596596
}
597597

598+
// The pay_by_bank_payments capability.
599+
type AccountCapabilitiesPayByBankPaymentsParams struct {
600+
// Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
601+
Requested *bool `form:"requested"`
602+
}
603+
598604
// The payco_payments capability.
599605
type AccountCapabilitiesPaycoPaymentsParams struct {
600606
// Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
@@ -836,6 +842,8 @@ type AccountCapabilitiesParams struct {
836842
OXXOPayments *AccountCapabilitiesOXXOPaymentsParams `form:"oxxo_payments"`
837843
// The p24_payments capability.
838844
P24Payments *AccountCapabilitiesP24PaymentsParams `form:"p24_payments"`
845+
// The pay_by_bank_payments capability.
846+
PayByBankPayments *AccountCapabilitiesPayByBankPaymentsParams `form:"pay_by_bank_payments"`
839847
// The payco_payments capability.
840848
PaycoPayments *AccountCapabilitiesPaycoPaymentsParams `form:"payco_payments"`
841849
// The paynow_payments capability.
@@ -924,6 +932,16 @@ type AccountCompanyAddressKanjiParams struct {
924932
Town *string `form:"town"`
925933
}
926934

935+
// This hash is used to attest that the directors information provided to Stripe is both current and correct.
936+
type AccountCompanyDirectorshipDeclarationParams struct {
937+
// The Unix timestamp marking when the directorship declaration attestation was made.
938+
Date *int64 `form:"date"`
939+
// The IP address from which the directorship declaration attestation was made.
940+
IP *string `form:"ip"`
941+
// The user agent of the browser from which the directorship declaration attestation was made.
942+
UserAgent *string `form:"user_agent"`
943+
}
944+
927945
// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct.
928946
type AccountCompanyOwnershipDeclarationParams struct {
929947
// The Unix timestamp marking when the beneficial owner attestation was made.
@@ -956,6 +974,8 @@ type AccountCompanyParams struct {
956974
AddressKana *AccountCompanyAddressKanaParams `form:"address_kana"`
957975
// The Kanji variation of the company's primary address (Japan only).
958976
AddressKanji *AccountCompanyAddressKanjiParams `form:"address_kanji"`
977+
// This hash is used to attest that the directors information provided to Stripe is both current and correct.
978+
DirectorshipDeclaration *AccountCompanyDirectorshipDeclarationParams `form:"directorship_declaration"`
959979
// Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.
960980
DirectorsProvided *bool `form:"directors_provided"`
961981
// Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement.
@@ -1035,6 +1055,12 @@ type AccountDocumentsProofOfRegistrationParams struct {
10351055
Files []*string `form:"files"`
10361056
}
10371057

1058+
// One or more documents that demonstrate proof of ultimate beneficial ownership.
1059+
type AccountDocumentsProofOfUltimateBeneficialOwnershipParams struct {
1060+
// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
1061+
Files []*string `form:"files"`
1062+
}
1063+
10381064
// Documents that may be submitted to satisfy various informational requests.
10391065
type AccountDocumentsParams struct {
10401066
// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a check.
@@ -1051,6 +1077,8 @@ type AccountDocumentsParams struct {
10511077
CompanyTaxIDVerification *AccountDocumentsCompanyTaxIDVerificationParams `form:"company_tax_id_verification"`
10521078
// One or more documents showing the company's proof of registration with the national business registry.
10531079
ProofOfRegistration *AccountDocumentsProofOfRegistrationParams `form:"proof_of_registration"`
1080+
// One or more documents that demonstrate proof of ultimate beneficial ownership.
1081+
ProofOfUltimateBeneficialOwnership *AccountDocumentsProofOfUltimateBeneficialOwnershipParams `form:"proof_of_ultimate_beneficial_ownership"`
10541082
}
10551083

10561084
// AccountExternalAccountParams are the parameters allowed to reference an
@@ -1496,6 +1524,8 @@ type AccountCapabilities struct {
14961524
OXXOPayments AccountCapabilityStatus `json:"oxxo_payments"`
14971525
// The status of the P24 payments capability of the account, or whether the account can directly process P24 charges.
14981526
P24Payments AccountCapabilityStatus `json:"p24_payments"`
1527+
// The status of the pay_by_bank payments capability of the account, or whether the account can directly process pay_by_bank charges.
1528+
PayByBankPayments AccountCapabilityStatus `json:"pay_by_bank_payments"`
14991529
// The status of the Payco capability of the account, or whether the account can directly process Payco payments.
15001530
PaycoPayments AccountCapabilityStatus `json:"payco_payments"`
15011531
// The status of the paynow payments capability of the account, or whether the account can directly process paynow charges.

0 commit comments

Comments
 (0)