Skip to content

Commit

Permalink
Merge pull request #1615 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
API Updates for beta branch
  • Loading branch information
pakrym-stripe authored Mar 2, 2023
2 parents 69f76a4 + e5a4f98 commit 874fcc6
Show file tree
Hide file tree
Showing 16 changed files with 492 additions and 28 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 74.10.0 - 2023-03-02
* [#1614](https://github.com/stripe/stripe-go/pull/1614) API Updates
* Add support for `ReconciliationStatus` on `Payout`
* Add support for new value `lease_tax` on enum `TaxRateTaxType`

* [#1613](https://github.com/stripe/stripe-go/pull/1613) Update golang.org/x/net
* [#1611](https://github.com/stripe/stripe-go/pull/1611) Run goimports on generated test suite

## 74.10.0-beta.1 - 2023-02-23
* [#1610](https://github.com/stripe/stripe-go/pull/1610) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ update-version:

codegen-format:
go fmt ./...
goimports -w example/generated_examples_test.go

.PHONY: codegen-format update-version
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v232
v237
36 changes: 18 additions & 18 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,24 +601,6 @@ type AccountCompanyParams struct {
Verification *AccountCompanyVerificationParams `form:"verification"`
}

// Properties of the controlling application.
type AccountControllerApplicationParams struct {
// Whether the controller is liable for losses on this account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).
LossLiable *bool `form:"loss_liable"`
// Whether the controller owns onboarding for this account.
OnboardingOwner *bool `form:"onboarding_owner"`
// Whether the controller has pricing controls for this account.
PricingControls *bool `form:"pricing_controls"`
}

// The configuration of the account when using unified accounts.
type AccountControllerParams struct {
// The documentation for the application hash.
Application *AccountControllerApplicationParams `form:"application"`
// Properties of the account's dashboard.
Dashboard *AccountControllerDashboardParams `form:"dashboard"`
}

// 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 voided check.
type AccountDocumentsBankAccountOwnershipVerificationParams struct {
// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
Expand Down Expand Up @@ -822,12 +804,30 @@ type AccountListParams struct {
CreatedRange *RangeQueryParams `form:"created"`
}

// The documentation for the application hash.
type AccountControllerApplicationParams struct {
// Whether the controller is liable for losses on this account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).
LossLiable *bool `form:"loss_liable"`
// Whether the controller owns onboarding for this account.
OnboardingOwner *bool `form:"onboarding_owner"`
// Whether the controller has pricing controls for this account.
PricingControls *bool `form:"pricing_controls"`
}

// Properties of the account's dashboard.
type AccountControllerDashboardParams struct {
// Whether this account should have access to the full Stripe dashboard (`full`) or no dashboard (`none`).
Type *string `form:"type"`
}

// The configuration of the account when `type` is not provided.
type AccountControllerParams struct {
// The documentation for the application hash.
Application *AccountControllerApplicationParams `form:"application"`
// Properties of the account's dashboard.
Dashboard *AccountControllerDashboardParams `form:"dashboard"`
}

// With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
//
// Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
Expand Down
12 changes: 12 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import (
"github.com/stripe/stripe-go/v74/invoiceitem"
issuingauthorization "github.com/stripe/stripe-go/v74/issuing/authorization"
issuingcard "github.com/stripe/stripe-go/v74/issuing/card"
issuingcardbundle "github.com/stripe/stripe-go/v74/issuing/cardbundle"
issuingcarddesign "github.com/stripe/stripe-go/v74/issuing/carddesign"
issuingcardholder "github.com/stripe/stripe-go/v74/issuing/cardholder"
issuingdispute "github.com/stripe/stripe-go/v74/issuing/dispute"
issuingtransaction "github.com/stripe/stripe-go/v74/issuing/transaction"
Expand Down Expand Up @@ -100,6 +102,7 @@ import (
terminalreader "github.com/stripe/stripe-go/v74/terminal/reader"
testhelperscustomer "github.com/stripe/stripe-go/v74/testhelpers/customer"
testhelpersissuingcard "github.com/stripe/stripe-go/v74/testhelpers/issuing/card"
testhelpersissuingcarddesign "github.com/stripe/stripe-go/v74/testhelpers/issuing/carddesign"
testhelpersrefund "github.com/stripe/stripe-go/v74/testhelpers/refund"
testhelpersterminalreader "github.com/stripe/stripe-go/v74/testhelpers/terminal/reader"
testhelperstestclock "github.com/stripe/stripe-go/v74/testhelpers/testclock"
Expand Down Expand Up @@ -213,6 +216,10 @@ type API struct {
Invoices *invoice.Client
// IssuingAuthorizations is the client used to invoke /issuing/authorizations APIs.
IssuingAuthorizations *issuingauthorization.Client
// IssuingCardBundles is the client used to invoke /issuing/card_bundles APIs.
IssuingCardBundles *issuingcardbundle.Client
// IssuingCardDesigns is the client used to invoke /issuing/card_designs APIs.
IssuingCardDesigns *issuingcarddesign.Client
// IssuingCardholders is the client used to invoke /issuing/cardholders APIs.
IssuingCardholders *issuingcardholder.Client
// IssuingCards is the client used to invoke /issuing/cards APIs.
Expand Down Expand Up @@ -309,6 +316,8 @@ type API struct {
TerminalReaders *terminalreader.Client
// TestHelpersCustomers is the client used to invoke /customers APIs.
TestHelpersCustomers *testhelperscustomer.Client
// TestHelpersIssuingCardDesigns is the client used to invoke /issuing/card_designs APIs.
TestHelpersIssuingCardDesigns *testhelpersissuingcarddesign.Client
// TestHelpersIssuingCards is the client used to invoke /issuing/cards APIs.
TestHelpersIssuingCards *testhelpersissuingcard.Client
// TestHelpersRefunds is the client used to invoke /refunds APIs.
Expand Down Expand Up @@ -415,6 +424,8 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key}
a.Invoices = &invoice.Client{B: backends.API, Key: key}
a.IssuingAuthorizations = &issuingauthorization.Client{B: backends.API, Key: key}
a.IssuingCardBundles = &issuingcardbundle.Client{B: backends.API, Key: key}
a.IssuingCardDesigns = &issuingcarddesign.Client{B: backends.API, Key: key}
a.IssuingCardholders = &issuingcardholder.Client{B: backends.API, Key: key}
a.IssuingCards = &issuingcard.Client{B: backends.API, Key: key}
a.IssuingDisputes = &issuingdispute.Client{B: backends.API, Key: key}
Expand Down Expand Up @@ -463,6 +474,7 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.TerminalLocations = &terminallocation.Client{B: backends.API, Key: key}
a.TerminalReaders = &terminalreader.Client{B: backends.API, Key: key}
a.TestHelpersCustomers = &testhelperscustomer.Client{B: backends.API, Key: key}
a.TestHelpersIssuingCardDesigns = &testhelpersissuingcarddesign.Client{B: backends.API, Key: key}
a.TestHelpersIssuingCards = &testhelpersissuingcard.Client{B: backends.API, Key: key}
a.TestHelpersRefunds = &testhelpersrefund.Client{B: backends.API, Key: key}
a.TestHelpersTerminalReaders = &testhelpersterminalreader.Client{B: backends.API, Key: key}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ go 1.13

require (
github.com/stretchr/testify v1.7.0
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
)
15 changes: 8 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE=
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
Expand Down
77 changes: 77 additions & 0 deletions issuing/cardbundle/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package cardbundle provides the /issuing/card_bundles APIs
package cardbundle

import (
"net/http"

stripe "github.com/stripe/stripe-go/v74"
"github.com/stripe/stripe-go/v74/form"
)

// Client is used to invoke /issuing/card_bundles APIs.
type Client struct {
B stripe.Backend
Key string
}

// Get returns the details of an issuing card bundle.
func Get(id string, params *stripe.IssuingCardBundleParams) (*stripe.IssuingCardBundle, error) {
return getC().Get(id, params)
}

// Get returns the details of an issuing card bundle.
func (c Client) Get(id string, params *stripe.IssuingCardBundleParams) (*stripe.IssuingCardBundle, error) {
path := stripe.FormatURLPath("/v1/issuing/card_bundles/%s", id)
cardbundle := &stripe.IssuingCardBundle{}
err := c.B.Call(http.MethodGet, path, c.Key, params, cardbundle)
return cardbundle, err
}

// List returns a list of issuing card bundles.
func List(params *stripe.IssuingCardBundleListParams) *Iter {
return getC().List(params)
}

// List returns a list of issuing card bundles.
func (c Client) List(listParams *stripe.IssuingCardBundleListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.IssuingCardBundleList{}
err := c.B.CallRaw(http.MethodGet, "/v1/issuing/card_bundles", c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

return ret, list, err
}),
}
}

// Iter is an iterator for issuing card bundles.
type Iter struct {
*stripe.Iter
}

// IssuingCardBundle returns the issuing card bundle which the iterator is currently pointing to.
func (i *Iter) IssuingCardBundle() *stripe.IssuingCardBundle {
return i.Current().(*stripe.IssuingCardBundle)
}

// IssuingCardBundleList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *Iter) IssuingCardBundleList() *stripe.IssuingCardBundleList {
return i.List().(*stripe.IssuingCardBundleList)
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
90 changes: 90 additions & 0 deletions issuing/carddesign/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
//
//
// File generated from our OpenAPI spec
//
//

// Package carddesign provides the /issuing/card_designs APIs
package carddesign

import (
"net/http"

stripe "github.com/stripe/stripe-go/v74"
"github.com/stripe/stripe-go/v74/form"
)

// Client is used to invoke /issuing/card_designs APIs.
type Client struct {
B stripe.Backend
Key string
}

// Get returns the details of an issuing card design.
func Get(id string, params *stripe.IssuingCardDesignParams) (*stripe.IssuingCardDesign, error) {
return getC().Get(id, params)
}

// Get returns the details of an issuing card design.
func (c Client) Get(id string, params *stripe.IssuingCardDesignParams) (*stripe.IssuingCardDesign, error) {
path := stripe.FormatURLPath("/v1/issuing/card_designs/%s", id)
carddesign := &stripe.IssuingCardDesign{}
err := c.B.Call(http.MethodGet, path, c.Key, params, carddesign)
return carddesign, err
}

// Update updates an issuing card design's properties.
func Update(id string, params *stripe.IssuingCardDesignParams) (*stripe.IssuingCardDesign, error) {
return getC().Update(id, params)
}

// Update updates an issuing card design's properties.
func (c Client) Update(id string, params *stripe.IssuingCardDesignParams) (*stripe.IssuingCardDesign, error) {
path := stripe.FormatURLPath("/v1/issuing/card_designs/%s", id)
carddesign := &stripe.IssuingCardDesign{}
err := c.B.Call(http.MethodPost, path, c.Key, params, carddesign)
return carddesign, err
}

// List returns a list of issuing card designs.
func List(params *stripe.IssuingCardDesignListParams) *Iter {
return getC().List(params)
}

// List returns a list of issuing card designs.
func (c Client) List(listParams *stripe.IssuingCardDesignListParams) *Iter {
return &Iter{
Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) {
list := &stripe.IssuingCardDesignList{}
err := c.B.CallRaw(http.MethodGet, "/v1/issuing/card_designs", c.Key, b, p, list)

ret := make([]interface{}, len(list.Data))
for i, v := range list.Data {
ret[i] = v
}

return ret, list, err
}),
}
}

// Iter is an iterator for issuing card designs.
type Iter struct {
*stripe.Iter
}

// IssuingCardDesign returns the issuing card design which the iterator is currently pointing to.
func (i *Iter) IssuingCardDesign() *stripe.IssuingCardDesign {
return i.Current().(*stripe.IssuingCardDesign)
}

// IssuingCardDesignList returns the current list object which the iterator is
// currently using. List objects will change as new API calls are made to
// continue pagination.
func (i *Iter) IssuingCardDesignList() *stripe.IssuingCardDesignList {
return i.List().(*stripe.IssuingCardDesignList)
}

func getC() Client {
return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
}
4 changes: 4 additions & 0 deletions issuing_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ type IssuingCardSpendingControlsParams struct {
// Creates an Issuing Card object.
type IssuingCardParams struct {
Params `form:"*"`
// The card design object belonging to this card.
CardDesign *string `form:"card_design"`
// The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated.
Cardholder *string `form:"cardholder"`
// The currency for the card.
Expand Down Expand Up @@ -302,6 +304,8 @@ type IssuingCard struct {
Brand string `json:"brand"`
// The reason why the card was canceled.
CancellationReason IssuingCardCancellationReason `json:"cancellation_reason"`
// The card design object belonging to this card.
CardDesign *IssuingCardDesign `json:"card_design"`
// An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards.
//
// Related guide: [How to create a Cardholder](https://stripe.com/docs/issuing/cards#create-cardholder)
Expand Down
Loading

0 comments on commit 874fcc6

Please sign in to comment.