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 #1752

Merged
merged 8 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 75.11.0 - 2023-10-16
* [#1751](https://github.com/stripe/stripe-go/pull/1751) Update generated code
* Add support for new values `issuing_token.created` and `issuing_token.updated` on enum `EventType`
* [#1748](https://github.com/stripe/stripe-go/pull/1748) add NewBackendsWithConfig helper

## 75.11.0-beta.1 - 2023-10-11
* [#1745](https://github.com/stripe/stripe-go/pull/1745) Update generated code for beta
* Add support for new resources `AccountNotice` and `Issuing.CreditUnderwritingRecord`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v597
v602
4 changes: 3 additions & 1 deletion customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,11 @@ type Customer struct {
// If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead.
DefaultSource *PaymentSource `json:"default_source"`
Deleted bool `json:"deleted"`
// If Stripe bills the customer's latest invoice by automatically charging and the latest charge fails, it sets `delinquent`` to `true``. If Stripe bills the invoice by sending it, and the invoice isn't paid by the due date, it also sets `delinquent`` to `true`.
// Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`.
//
// If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`.
//
// If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`.
Delinquent bool `json:"delinquent"`
// An arbitrary string attached to the object. Often useful for displaying to users.
Description string `json:"description"`
Expand Down
2 changes: 2 additions & 0 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ const (
EventTypeIssuingPersonalizationDesignDeactivated EventType = "issuing_personalization_design.deactivated"
EventTypeIssuingPersonalizationDesignRejected EventType = "issuing_personalization_design.rejected"
EventTypeIssuingPersonalizationDesignUpdated EventType = "issuing_personalization_design.updated"
EventTypeIssuingTokenCreated EventType = "issuing_token.created"
EventTypeIssuingTokenUpdated EventType = "issuing_token.updated"
EventTypeIssuingTransactionCreated EventType = "issuing_transaction.created"
EventTypeIssuingTransactionUpdated EventType = "issuing_transaction.updated"
EventTypeMandateUpdated EventType = "mandate.updated"
Expand Down
2 changes: 1 addition & 1 deletion issuing_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ type IssuingTokenNetworkData struct {
WalletProvider *IssuingTokenNetworkDataWalletProvider `json:"wallet_provider"`
}

// An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can view and manage these tokens through Stripe.
// An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can [view and manage these tokens](https://stripe.com/docs/issuing/controls/token-management) through Stripe.
type IssuingToken struct {
APIResource
// Card associated with this token.
Expand Down
2 changes: 1 addition & 1 deletion paymentmethodconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ type PaymentMethodConfigurationWeChatPay struct {
//
// Related guides:
// - [Payment Method Configurations API](https://stripe.com/docs/connect/payment-method-configurations)
// - [Multiple payment method configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs)
// - [Multiple configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs)
// - [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations)
type PaymentMethodConfiguration struct {
APIResource
Expand Down
21 changes: 0 additions & 21 deletions source.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

package stripe

import "encoding/json"

// The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0).
type SourceCodeVerificationStatus string

Expand Down Expand Up @@ -626,22 +624,3 @@ type Source struct {
Usage SourceUsage `json:"usage"`
WeChat *SourceWeChat `json:"wechat"`
}

// UnmarshalJSON handles deserialization of a Source.
// This custom unmarshaling is needed because the resulting
// property may be an id or the full struct if it was expanded.
func (s *Source) UnmarshalJSON(data []byte) error {
if id, ok := ParseID(data); ok {
s.ID = id
return nil
}

type source Source
var v source
if err := json.Unmarshal(data, &v); err != nil {
return err
}

*s = Source(v)
return nil
}
13 changes: 11 additions & 2 deletions stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,8 +1190,7 @@ func Int64Slice(v []int64) []*int64 {
return out
}

// NewBackends creates a new set of backends with the given HTTP client. You
// should only need to use this for testing purposes or on App Engine.
// NewBackends creates a new set of backends with the given HTTP client.
func NewBackends(httpClient *http.Client) *Backends {
apiConfig := &BackendConfig{HTTPClient: httpClient}
connectConfig := &BackendConfig{HTTPClient: httpClient}
Expand All @@ -1203,6 +1202,16 @@ func NewBackends(httpClient *http.Client) *Backends {
}
}

// NewBackendsWithConfig creates a new set of backends with the given config for all backends.
// Useful for setting up client with a custom logger and http client.
func NewBackendsWithConfig(config *BackendConfig) *Backends {
return &Backends{
API: GetBackendWithConfig(APIBackend, config),
Connect: GetBackendWithConfig(ConnectBackend, config),
Uploads: GetBackendWithConfig(UploadsBackend, config),
}
}

// ParseID attempts to parse a string scalar from a given JSON value which is
// still encoded as []byte. If the value was a string, it returns the string
// along with true as the second return value. If not, false is returned as the
Expand Down
Loading