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

API Updates for beta branch #1589

Merged
merged 7 commits into from
Jan 5, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 74.5.0 - 2023-01-05
* [#1588](https://github.com/stripe/stripe-go/pull/1588) API Updates
* Add support for `CardIssuing` on `IssuingCardholderIndividual`

## 74.5.0-beta.1 - 2022-12-22
* [#1587](https://github.com/stripe/stripe-go/pull/1587) API Updates for beta branch
* Updated stable APIs to the latest version
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v216
v217
3 changes: 1 addition & 2 deletions balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const (
)

// Retrieves the current account balance, based on the authentication that was used to make the request.
//
// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances).
// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances).
type BalanceParams struct {
Params `form:"*"`
}
Expand Down
2 changes: 2 additions & 0 deletions creditnote.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ type CreditNoteLineParams struct {
// its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
// in any combination of the following:
//
//
// Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
// Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
// Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
//
//
// For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
//
// You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
Expand Down
154 changes: 150 additions & 4 deletions example/generated_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ import (
shippingrate "github.com/stripe/stripe-go/v74/shippingrate"
sigma_scheduledqueryrun "github.com/stripe/stripe-go/v74/sigma/scheduledqueryrun"
source "github.com/stripe/stripe-go/v74/source"
subscription "github.com/stripe/stripe-go/v74/subscription"
subscriptionitem "github.com/stripe/stripe-go/v74/subscriptionitem"
subscriptionschedule "github.com/stripe/stripe-go/v74/subscriptionschedule"
taxcode "github.com/stripe/stripe-go/v74/taxcode"
taxid "github.com/stripe/stripe-go/v74/taxid"
taxrate "github.com/stripe/stripe-go/v74/taxrate"
Expand Down Expand Up @@ -82,7 +85,6 @@ import (
treasury_transaction "github.com/stripe/stripe-go/v74/treasury/transaction"
treasury_transactionentry "github.com/stripe/stripe-go/v74/treasury/transactionentry"
usagerecord "github.com/stripe/stripe-go/v74/usagerecord"
usagerecordsummary "github.com/stripe/stripe-go/v74/usagerecordsummary"
webhookendpoint "github.com/stripe/stripe-go/v74/webhookendpoint"
)

Expand Down Expand Up @@ -1988,12 +1990,50 @@ func TestSourceUpdate(t *testing.T) {
assert.NotNil(t, result)
}

func TestUsageRecordSummaryList(t *testing.T) {
params := &stripe.UsageRecordSummaryListParams{
func TestSubscriptionItemList(t *testing.T) {
params := &stripe.SubscriptionItemListParams{
Subscription: stripe.String("sub_xxxxxxxxxxxxx"),
}
result := subscriptionitem.List(params)
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}

func TestSubscriptionItemCreate(t *testing.T) {
params := &stripe.SubscriptionItemParams{
Subscription: stripe.String("sub_xxxxxxxxxxxxx"),
Price: stripe.String("price_xxxxxxxxxxxxx"),
Quantity: stripe.Int64(2),
}
result, _ := subscriptionitem.New(params)
assert.NotNil(t, result)
}

func TestSubscriptionItemDelete(t *testing.T) {
params := &stripe.SubscriptionItemParams{}
result, _ := subscriptionitem.Del("si_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionItemRetrieve(t *testing.T) {
params := &stripe.SubscriptionItemParams{}
result, _ := subscriptionitem.Get("si_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionItemUpdate(t *testing.T) {
params := &stripe.SubscriptionItemParams{}
params.AddMetadata("order_id", "6735")
result, _ := subscriptionitem.Update("si_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionItemUsageRecordSummaries(t *testing.T) {
params := &stripe.SubscriptionItemUsageRecordSummariesParams{
SubscriptionItem: stripe.String("si_xxxxxxxxxxxxx"),
}
params.Limit = stripe.Int64(3)
result := usagerecordsummary.List(params)
result := subscriptionitem.UsageRecordSummaries(params)
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}
Expand All @@ -2007,6 +2047,112 @@ func TestUsageRecordCreate(t *testing.T) {
assert.NotNil(t, result)
}

func TestSubscriptionScheduleList(t *testing.T) {
params := &stripe.SubscriptionScheduleListParams{}
params.Limit = stripe.Int64(3)
result := subscriptionschedule.List(params)
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}

func TestSubscriptionScheduleCreate(t *testing.T) {
params := &stripe.SubscriptionScheduleParams{
Customer: stripe.String("cus_xxxxxxxxxxxxx"),
StartDate: stripe.Int64(1652909005),
EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)),
Phases: []*stripe.SubscriptionSchedulePhaseParams{
&stripe.SubscriptionSchedulePhaseParams{
Items: []*stripe.SubscriptionSchedulePhaseItemParams{
&stripe.SubscriptionSchedulePhaseItemParams{
Price: stripe.String("price_xxxxxxxxxxxxx"),
Quantity: stripe.Int64(1),
},
},
Iterations: stripe.Int64(12),
},
},
}
result, _ := subscriptionschedule.New(params)
assert.NotNil(t, result)
}

func TestSubscriptionScheduleRetrieve(t *testing.T) {
params := &stripe.SubscriptionScheduleParams{}
result, _ := subscriptionschedule.Get("sub_sched_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionScheduleUpdate(t *testing.T) {
params := &stripe.SubscriptionScheduleParams{
EndBehavior: stripe.String(string(stripe.SubscriptionScheduleEndBehaviorRelease)),
}
result, _ := subscriptionschedule.Update("sub_sched_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionScheduleCancel(t *testing.T) {
params := &stripe.SubscriptionScheduleCancelParams{}
result, _ := subscriptionschedule.Cancel("sub_sched_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionScheduleRelease(t *testing.T) {
params := &stripe.SubscriptionScheduleReleaseParams{}
result, _ := subscriptionschedule.Release("sub_sched_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionList(t *testing.T) {
params := &stripe.SubscriptionListParams{}
params.Limit = stripe.Int64(3)
result := subscription.List(params)
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}

func TestSubscriptionCreate(t *testing.T) {
params := &stripe.SubscriptionParams{
Customer: stripe.String("cus_xxxxxxxxxxxxx"),
Items: []*stripe.SubscriptionItemsParams{
&stripe.SubscriptionItemsParams{
Price: stripe.String("price_xxxxxxxxxxxxx"),
},
},
}
result, _ := subscription.New(params)
assert.NotNil(t, result)
}

func TestSubscriptionCancel(t *testing.T) {
params := &stripe.SubscriptionCancelParams{}
result, _ := subscription.Cancel("sub_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionRetrieve(t *testing.T) {
params := &stripe.SubscriptionParams{}
result, _ := subscription.Get("sub_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionUpdate(t *testing.T) {
params := &stripe.SubscriptionParams{}
params.AddMetadata("order_id", "6735")
result, _ := subscription.Update("sub_xxxxxxxxxxxxx", params)
assert.NotNil(t, result)
}

func TestSubscriptionSearch(t *testing.T) {
params := &stripe.SubscriptionSearchParams{
SearchParams: stripe.SearchParams{
Query: "status:'active' AND metadata['order_id']:'6735'",
},
}
result := subscription.Search(params)
assert.NotNil(t, result)
assert.Nil(t, result.Err())
}

func TestTaxCodeList(t *testing.T) {
params := &stripe.TaxCodeListParams{}
params.Limit = stripe.Int64(3)
Expand Down
14 changes: 7 additions & 7 deletions financialconnections_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ const (

// If `category` is `cash`, one of:
//
// - `checking`
// - `savings`
// - `other`
// - `checking`
// - `savings`
// - `other`
//
// If `category` is `credit`, one of:
//
// - `mortgage`
// - `line_of_credit`
// - `credit_card`
// - `other`
// - `mortgage`
// - `line_of_credit`
// - `credit_card`
// - `other`
//
// If `category` is `investment` or `other`, this will be `other`.
type FinancialConnectionsAccountSubcategory string
Expand Down
15 changes: 15 additions & 0 deletions issuing_cardholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,20 @@ type IssuingCardholderCompany struct {
TaxIDProvided bool `json:"tax_id_provided"`
}

// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards).
type IssuingCardholderIndividualCardIssuingUserTermsAcceptance struct {
// The Unix timestamp marking when the cardholder accepted the Authorized User Terms.
Date int64 `json:"date"`
// The IP address from which the cardholder accepted the Authorized User Terms.
IP string `json:"ip"`
// The user agent of the browser from which the cardholder accepted the Authorized User Terms.
UserAgent string `json:"user_agent"`
}
type IssuingCardholderIndividualCardIssuing struct {
// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards).
UserTermsAcceptance *IssuingCardholderIndividualCardIssuingUserTermsAcceptance `json:"user_terms_acceptance"`
}

// The date of birth of this cardholder.
type IssuingCardholderIndividualDOB struct {
// The day of birth, between 1 and 31.
Expand All @@ -196,6 +210,7 @@ type IssuingCardholderIndividualVerification struct {

// Additional information about an `individual` cardholder.
type IssuingCardholderIndividual struct {
CardIssuing *IssuingCardholderIndividualCardIssuing `json:"card_issuing"`
// The date of birth of this cardholder.
DOB *IssuingCardholderIndividualDOB `json:"dob"`
// The first name of this cardholder.
Expand Down
4 changes: 2 additions & 2 deletions paymentmethod.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ type PaymentMethodCardNetworks struct {
Preferred PaymentMethodCardNetworksPreferred `json:"preferred"`
}

// Contains details on how this Card maybe be used for 3D Secure authentication.
// Contains details on how this Card may be used for 3D Secure authentication.
type PaymentMethodCardThreeDSecureUsage struct {
// Whether 3D Secure is supported on this card.
Supported bool `json:"supported"`
Expand Down Expand Up @@ -611,7 +611,7 @@ type PaymentMethodCard struct {
Last4 string `json:"last4"`
// Contains information about card networks that can be used to process the payment.
Networks *PaymentMethodCardNetworks `json:"networks"`
// Contains details on how this Card maybe be used for 3D Secure authentication.
// Contains details on how this Card may be used for 3D Secure authentication.
ThreeDSecureUsage *PaymentMethodCardThreeDSecureUsage `json:"three_d_secure_usage"`
// If this Card is part of a card wallet, this contains the details of the card wallet.
Wallet *PaymentMethodCardWallet `json:"wallet"`
Expand Down
2 changes: 1 addition & 1 deletion plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type PlanProductParams struct {
StatementDescriptor *string `form:"statement_descriptor"`
// A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
TaxCode *string `form:"tax_code"`
// A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions.
// A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
UnitLabel *string `form:"unit_label"`
}

Expand Down
2 changes: 1 addition & 1 deletion price.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ type PriceProductDataParams struct {
StatementDescriptor *string `form:"statement_descriptor"`
// A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
TaxCode *string `form:"tax_code"`
// A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions.
// A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
UnitLabel *string `form:"unit_label"`
}

Expand Down
4 changes: 2 additions & 2 deletions product.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ type ProductParams struct {
TaxCode *string `form:"tax_code"`
// The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons.
Type *string `form:"type"`
// A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions. May only be set if `type=service`.
// A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. May only be set if `type=service`.
UnitLabel *string `form:"unit_label"`
// A URL of a publicly-accessible webpage for this product.
URL *string `form:"url"`
Expand Down Expand Up @@ -289,7 +289,7 @@ type Product struct {
TaxCode *TaxCode `json:"tax_code"`
// The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans.
Type ProductType `json:"type"`
// A label that represents units of this product in Stripe and on customers' receipts and invoices. When set, this will be included in associated invoice line item descriptions.
// A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal.
UnitLabel string `json:"unit_label"`
// Time at which the object was last updated. Measured in seconds since the Unix epoch.
Updated int64 `json:"updated"`
Expand Down
Loading