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
codegen: 14 more files #1312
codegen: 14 more files #1312
Conversation
checkout/session/client.go
Outdated
func (i *Iter) CheckoutSessionList() *stripe.CheckoutSessionList { | ||
return i.List().(*stripe.CheckoutSessionList) | ||
} | ||
type LineItemIter lineitem.Iter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make it a breaking change on existing integrations?
Asking as there's an Iter
in lineitem.go
and some broken tests at the bottom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, this is breaking as is -- we need to do type LineItemIter = lineitem.Iter
to make it a transparent type alias and that will fix the test. I thought I had written the correct override for codegen to do this, need to debug.
@@ -429,7 +444,8 @@ type CheckoutSessionTotalDetailsBreakdownDiscount struct { | |||
// CheckoutSessionTotalDetailsBreakdownTax represent the details of tax rate applied to a session. | |||
type CheckoutSessionTotalDetailsBreakdownTax struct { | |||
Amount int64 `json:"amount"` | |||
TaxRate *TaxRate `json:"tax_rate"` | |||
Rate *TaxRate `json:"rate"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have Rate
appear here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah great question, need to call this out in the changelog and should add a comment. This is a bugfix.
The json field is tax_rate
, not rate
, so TaxRate
will never be populated and will always be nil.
https://github.com/stripe/stripe-node/blob/master/types/2020-08-27/Checkout/Sessions.d.ts#L724
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall - small nits.
@@ -99,18 +103,13 @@ type Dispute struct { | |||
IsChargeRefundable bool `json:"is_charge_refundable"` | |||
Livemode bool `json:"livemode"` | |||
Metadata map[string]string `json:"metadata"` | |||
NetworkReasonCode string `json:"network_reason_code"` | |||
Object string `json:"object"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Missing the support for this in the changelog.
func Update(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { | ||
return getC().Update(id, params) | ||
} | ||
|
||
// Update updates a dispute. | ||
// Update updates a dispute's properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Double "update".
Notify
r? @stripe/api-library-reviewers
Summary
Makes 14 more files eligible for codegen. This includes adding a number of missing fields (see below).
The most involved thing here is the type alias
LineItemItem
introduced incheckout/session/client.go
, the type alias ensures that this will not be a breaking change.There is a go vet error that I will fix in a follow-up, please don't block on that.
Changelog
BillingAddressCollection
toCheckoutSession
NetworkReasonCode
toDisputeReason
Object
toEphemeralKey
,ApplicationFee
, andDisputeReason
Description
toRefund
blocked
on enumIssuingCardholderStatus
Rate
onCheckoutSessionTotalDetailsBreakdownTax
-- the existing fieldTaxRate
has the wrong json annotation and should be deprecated.