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

Merged
merged 2 commits into from
Mar 29, 2022
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: 4 additions & 1 deletion charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ const (
ChargeStatusSucceeded ChargeStatus = "succeeded"
)

// Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
// Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type ChargeSearchParams struct {
SearchParams `form:"*"`
// A cursor for pagination across multiple pages of results. Do not include this parameter on the first call. Use the next_page value returned in a response to request subsequent results.
Expand Down
2 changes: 1 addition & 1 deletion checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ type CheckoutSessionLineItemPriceDataProductDataParams struct {
Images []*string `form:"images"`
// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
Metadata map[string]string `form:"metadata"`
// The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
// The product's name, meant to be displayable to the customer.
Name *string `form:"name"`
// A [tax code](https://stripe.com/docs/tax/tax-codes) ID.
TaxCode *string `form:"tax_code"`
Expand Down
4 changes: 4 additions & 0 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import (
terminalconnectiontoken "github.com/stripe/stripe-go/v72/terminal/connectiontoken"
terminallocation "github.com/stripe/stripe-go/v72/terminal/location"
terminalreader "github.com/stripe/stripe-go/v72/terminal/reader"
testhelpersterminalreader "github.com/stripe/stripe-go/v72/testhelpers/terminal/reader"
testhelperstestclock "github.com/stripe/stripe-go/v72/testhelpers/testclock"
"github.com/stripe/stripe-go/v72/token"
"github.com/stripe/stripe-go/v72/topup"
Expand Down Expand Up @@ -242,6 +243,8 @@ type API struct {
TerminalLocations *terminallocation.Client
// TerminalReaders is the client used to invoke /terminal/readers APIs.
TerminalReaders *terminalreader.Client
// TestHelpersTerminalReaders is the client used to invoke /terminal/readers APIs.
TestHelpersTerminalReaders *testhelpersterminalreader.Client
// TestHelpersTestClocks is the client used to invoke /test_helpers/test_clocks APIs.
TestHelpersTestClocks *testhelperstestclock.Client
// Tokens is the client used to invoke /tokens APIs.
Expand Down Expand Up @@ -342,6 +345,7 @@ func (a *API) Init(key string, backends *stripe.Backends) {
a.TerminalConnectionTokens = &terminalconnectiontoken.Client{B: backends.API, Key: key}
a.TerminalLocations = &terminallocation.Client{B: backends.API, Key: key}
a.TerminalReaders = &terminalreader.Client{B: backends.API, Key: key}
a.TestHelpersTerminalReaders = &testhelpersterminalreader.Client{B: backends.API, Key: key}
a.TestHelpersTestClocks = &testhelperstestclock.Client{B: backends.API, Key: key}
a.Tokens = &token.Client{B: backends.API, Key: key}
a.Topups = &topup.Client{B: backends.API, Key: key}
Expand Down
5 changes: 4 additions & 1 deletion customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ const (
CustomerTaxExemptReverse CustomerTaxExempt = "reverse"
)

// Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
// Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type CustomerSearchParams struct {
SearchParams `form:"*"`
// A cursor for pagination across multiple pages of results. Do not include this parameter on the first call. Use the next_page value returned in a response to request subsequent results.
Expand Down
5 changes: 4 additions & 1 deletion invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ const (
InvoiceStatusVoid InvoiceStatus = "void"
)

// Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
// Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type InvoiceSearchParams struct {
SearchParams `form:"*"`
// A cursor for pagination across multiple pages of results. Do not include this parameter on the first call. Use the next_page value returned in a response to request subsequent results.
Expand Down
5 changes: 4 additions & 1 deletion paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,10 @@ const (
PaymentIntentStatusSucceeded PaymentIntentStatus = "succeeded"
)

// Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
// Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type PaymentIntentSearchParams struct {
SearchParams `form:"*"`
// A cursor for pagination across multiple pages of results. Do not include this parameter on the first call. Use the next_page value returned in a response to request subsequent results.
Expand Down
2 changes: 1 addition & 1 deletion plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type PlanProductParams struct {
ID *string `form:"id"`
// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
Metadata map[string]string `form:"metadata"`
// The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
// The product's name, meant to be displayable to the customer.
Name *string `form:"name"`
// An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all.
//
Expand Down
7 changes: 5 additions & 2 deletions price.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ const (
PriceTypeRecurring PriceType = "recurring"
)

// Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
// Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type PriceSearchParams struct {
SearchParams `form:"*"`
// A cursor for pagination across multiple pages of results. Do not include this parameter on the first call. Use the next_page value returned in a response to request subsequent results.
Expand Down Expand Up @@ -132,7 +135,7 @@ type PriceProductDataParams struct {
ID *string `form:"id"`
// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
Metadata map[string]string `form:"metadata"`
// The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
// The product's name, meant to be displayable to the customer.
Name *string `form:"name"`
// An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all.
//
Expand Down
9 changes: 6 additions & 3 deletions product.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const (
ProductTypeService ProductType = "service"
)

// Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
// Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type ProductSearchParams struct {
SearchParams `form:"*"`
// A cursor for pagination across multiple pages of results. Do not include this parameter on the first call. Use the next_page value returned in a response to request subsequent results.
Expand Down Expand Up @@ -53,7 +56,7 @@ type ProductParams struct {
ID *string `form:"id"`
// A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
Images []*string `form:"images"`
// The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
// The product's name, meant to be displayable to the customer.
Name *string `form:"name"`
// The dimensions of this product for shipping purposes.
PackageDimensions *PackageDimensionsParams `form:"package_dimensions"`
Expand Down Expand Up @@ -136,7 +139,7 @@ type Product struct {
Livemode bool `json:"livemode"`
// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Metadata map[string]string `json:"metadata"`
// The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
// The product's name, meant to be displayable to the customer.
Name string `json:"name"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
Expand Down
5 changes: 4 additions & 1 deletion sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ const (
SubscriptionStatusUnpaid SubscriptionStatus = "unpaid"
)

// Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
// Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type SubscriptionSearchParams struct {
SearchParams `form:"*"`
// A cursor for pagination across multiple pages of results. Do not include this parameter on the first call. Use the next_page value returned in a response to request subsequent results.
Expand Down
58 changes: 58 additions & 0 deletions terminal/reader/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,64 @@ func (c Client) Del(id string, params *stripe.TerminalReaderParams) (*stripe.Ter
return reader, err
}

// CancelAction is the method for the `POST /v1/terminal/readers/{reader}/cancel_action` API.
func CancelAction(id string, params *stripe.TerminalReaderCancelActionParams) (*stripe.TerminalReader, error) {
return getC().CancelAction(id, params)
}

// CancelAction is the method for the `POST /v1/terminal/readers/{reader}/cancel_action` API.
func (c Client) CancelAction(id string, params *stripe.TerminalReaderCancelActionParams) (*stripe.TerminalReader, error) {
path := stripe.FormatURLPath("/v1/terminal/readers/%s/cancel_action", id)
reader := &stripe.TerminalReader{}
err := c.B.Call(http.MethodPost, path, c.Key, params, reader)
return reader, err
}

// ProcessPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/process_payment_intent` API.
func ProcessPaymentIntent(id string, params *stripe.TerminalReaderProcessPaymentIntentParams) (*stripe.TerminalReader, error) {
return getC().ProcessPaymentIntent(id, params)
}

// ProcessPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/process_payment_intent` API.
func (c Client) ProcessPaymentIntent(id string, params *stripe.TerminalReaderProcessPaymentIntentParams) (*stripe.TerminalReader, error) {
path := stripe.FormatURLPath(
"/v1/terminal/readers/%s/process_payment_intent",
id,
)
reader := &stripe.TerminalReader{}
err := c.B.Call(http.MethodPost, path, c.Key, params, reader)
return reader, err
}

// ProcessSetupIntent is the method for the `POST /v1/terminal/readers/{reader}/process_setup_intent` API.
func ProcessSetupIntent(id string, params *stripe.TerminalReaderProcessSetupIntentParams) (*stripe.TerminalReader, error) {
return getC().ProcessSetupIntent(id, params)
}

// ProcessSetupIntent is the method for the `POST /v1/terminal/readers/{reader}/process_setup_intent` API.
func (c Client) ProcessSetupIntent(id string, params *stripe.TerminalReaderProcessSetupIntentParams) (*stripe.TerminalReader, error) {
path := stripe.FormatURLPath(
"/v1/terminal/readers/%s/process_setup_intent",
id,
)
reader := &stripe.TerminalReader{}
err := c.B.Call(http.MethodPost, path, c.Key, params, reader)
return reader, err
}

// SetReaderDisplay is the method for the `POST /v1/terminal/readers/{reader}/set_reader_display` API.
func SetReaderDisplay(id string, params *stripe.TerminalReaderSetReaderDisplayParams) (*stripe.TerminalReader, error) {
return getC().SetReaderDisplay(id, params)
}

// SetReaderDisplay is the method for the `POST /v1/terminal/readers/{reader}/set_reader_display` API.
func (c Client) SetReaderDisplay(id string, params *stripe.TerminalReaderSetReaderDisplayParams) (*stripe.TerminalReader, error) {
path := stripe.FormatURLPath("/v1/terminal/readers/%s/set_reader_display", id)
reader := &stripe.TerminalReader{}
err := c.B.Call(http.MethodPost, path, c.Key, params, reader)
return reader, err
}

// List returns a list of terminal readers.
func List(params *stripe.TerminalReaderListParams) *Iter {
return getC().List(params)
Expand Down
Loading