Skip to content

Commit

Permalink
Fix incompatible combination
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Sep 27, 2023
1 parent fc3a301 commit 38efebb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 25 deletions.
6 changes: 3 additions & 3 deletions capital_financingsummary.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (p *CapitalFinancingSummaryParams) AddExpand(f string) {
type CapitalFinancingSummaryDetailsCurrentRepaymentInterval struct {
// The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account will be debited.
// Given in seconds since unix epoch.
DueAt float64 `json:"due_at"`
DueAt int64 `json:"due_at"`
// The amount that has already been paid in the current repayment interval.
PaidAmount int64 `json:"paid_amount"`
// The amount that is yet to be paid in the current repayment interval.
Expand All @@ -46,7 +46,7 @@ type CapitalFinancingSummaryDetails struct {
// Amount of financing offered, in minor units.
AdvanceAmount int64 `json:"advance_amount"`
// The time at which the funds were paid out the the Connected account's Stripe balance. Given in milliseconds since unix epoch.
AdvancePaidOutAt float64 `json:"advance_paid_out_at"`
AdvancePaidOutAt int64 `json:"advance_paid_out_at"`
// Currency that the financing offer is transacted in. For example, `usd`.
Currency Currency `json:"currency"`
// The chronologically current repayment interval for the financing offer.
Expand All @@ -58,7 +58,7 @@ type CapitalFinancingSummaryDetails struct {
// The balance remaining to be paid on the financing, in minor units.
RemainingAmount int64 `json:"remaining_amount"`
// The time at which Capital will begin withholding from payments. Given in seconds since unix epoch.
RepaymentsBeginAt float64 `json:"repayments_begin_at"`
RepaymentsBeginAt int64 `json:"repayments_begin_at"`
// Per-transaction rate at which Stripe will withhold funds to repay the financing.
WithholdRate float64 `json:"withhold_rate"`
}
Expand Down
7 changes: 7 additions & 0 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ const (
EventTypeTreasuryReceivedCreditSucceeded EventType = "treasury.received_credit.succeeded"
EventTypeTreasuryReceivedDebitCreated EventType = "treasury.received_debit.created"
EventTypeInvoiceItemUpdated EventType = "invoiceitem.updated"
EventTypeOrderCreated EventType = "order.created"
EventTypeRecipientCreated EventType = "recipient.created"
EventTypeRecipientDeleted EventType = "recipient.deleted"
EventTypeRecipientUpdated EventType = "recipient.updated"
EventTypeSKUCreated EventType = "sku.created"
EventTypeSKUDeleted EventType = "sku.deleted"
EventTypeSKUUpdated EventType = "sku.updated"
)

// List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
Expand Down
7 changes: 7 additions & 0 deletions example/generated_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3581,3 +3581,10 @@ func TestTestHelpersIssuingTransactionRefund(t *testing.T) {
assert.NotNil(t, result)
assert.Nil(t, err)
}

func TestSubscriptionDeleteDiscount(t *testing.T) {
params := &stripe.SubscriptionDeleteDiscountParams{}
result, err := subscription.DeleteDiscount("sub_xyz", params)
assert.NotNil(t, result)
assert.Nil(t, err)
}
24 changes: 2 additions & 22 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (p *InvoiceSearchParams) AddExpand(f string) {
}

// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
type InvoiceUpcomingAutomaticTaxLiabilityParams struct {
type InvoiceAutomaticTaxLiabilityParams struct {
// The connected account being referenced when `type` is `account`.
Account *string `form:"account"`
// Type of the account referenced in the request.
Expand All @@ -268,8 +268,6 @@ type InvoiceAutomaticTaxParams struct {
Enabled *bool `form:"enabled"`
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
Liability *InvoiceAutomaticTaxLiabilityParams `form:"liability"`
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
LiabilityTODOINCOMPATIBLECOMBINATION *InvoiceUpcomingAutomaticTaxLiabilityParams `form:"liabilityTODO_INCOMPATIBLE_COMBINATION"`
}
type InvoiceUpcomingAutomaticTaxParams struct {
Enabled *bool `form:"enabled"`
Expand Down Expand Up @@ -314,7 +312,7 @@ type InvoiceUpcomingCustomerDetailsParams struct {
}

// Time span for the redeemed discount.
type InvoiceUpcomingDiscountDiscountEndDurationParams struct {
type InvoiceDiscountDiscountEndDurationParams struct {
// Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
Interval *string `form:"interval"`
// The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
Expand All @@ -325,8 +323,6 @@ type InvoiceUpcomingDiscountDiscountEndDurationParams struct {
type InvoiceDiscountDiscountEndParams struct {
// Time span for the redeemed discount.
Duration *InvoiceDiscountDiscountEndDurationParams `form:"duration"`
// Time span for the redeemed discount.
DurationTODOINCOMPATIBLECOMBINATION *InvoiceUpcomingDiscountDiscountEndDurationParams `form:"durationTODO_INCOMPATIBLE_COMBINATION"`
// A precise Unix timestamp for the discount to end. Must be in the future.
Timestamp *int64 `form:"timestamp"`
// The type of calculation made to determine when the discount ends.
Expand Down Expand Up @@ -490,14 +486,6 @@ func (p *InvoiceUpcomingParams) AppendTo(body *form.Values, keyParts []string) {
}
}

// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
type InvoiceAutomaticTaxLiabilityParams struct {
// The connected account being referenced when `type` is `account`.
Account *string `form:"account"`
// Type of the account referenced in the request.
Type *string `form:"type"`
}

// A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
type InvoiceCustomFieldParams struct {
// The name of the custom field. This may be up to 30 characters.
Expand All @@ -506,14 +494,6 @@ type InvoiceCustomFieldParams struct {
Value *string `form:"value"`
}

// Time span for the redeemed discount.
type InvoiceDiscountDiscountEndDurationParams struct {
// Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
Interval *string `form:"interval"`
// The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
IntervalCount *int64 `form:"interval_count"`
}

// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
type InvoiceIssuerParams struct {
// The connected account being referenced when `type` is `account`.
Expand Down

0 comments on commit 38efebb

Please sign in to comment.