From ff62b33b6cb02b6d0c14d91de4d5fbba40f4d498 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 09:58:51 -0800 Subject: [PATCH 01/18] Update generated code (#1772) * Update generated code for v681 * Update generated code for v682 * Update generated code for v683 * Update generated code for v684 * Update generated code for v685 * Update generated code for v686 * Update generated code for v687 * Update generated code for v689 * Update generated code for v691 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- balancetransaction.go | 8 +- checkout_session.go | 4 + client/api.go | 12 +++ climate/order/client.go | 115 +++++++++++++++++++++++ climate/product/client.go | 77 +++++++++++++++ climate/supplier/client.go | 77 +++++++++++++++ climate_order.go | 185 +++++++++++++++++++++++++++++++++++++ climate_product.go | 95 +++++++++++++++++++ climate_supplier.go | 82 ++++++++++++++++ customer.go | 2 + error.go | 1 + event.go | 7 ++ paymentintent.go | 9 +- setupintent.go | 1 + 15 files changed, 669 insertions(+), 8 deletions(-) create mode 100644 climate/order/client.go create mode 100644 climate/product/client.go create mode 100644 climate/supplier/client.go create mode 100644 climate_order.go create mode 100644 climate_product.go create mode 100644 climate_supplier.go diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 1418e2ae43..794622303c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v680 \ No newline at end of file +v691 \ No newline at end of file diff --git a/balancetransaction.go b/balancetransaction.go index a0389b19a6..a71474374c 100644 --- a/balancetransaction.go +++ b/balancetransaction.go @@ -73,7 +73,7 @@ const ( BalanceTransactionStatusPending BalanceTransactionStatus = "pending" ) -// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. +// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. type BalanceTransactionType string // List of values that BalanceTransactionType can take @@ -85,6 +85,8 @@ const ( BalanceTransactionTypeApplicationFee BalanceTransactionType = "application_fee" BalanceTransactionTypeApplicationFeeRefund BalanceTransactionType = "application_fee_refund" BalanceTransactionTypeCharge BalanceTransactionType = "charge" + BalanceTransactionTypeClimateOrderPurchase BalanceTransactionType = "climate_order_purchase" + BalanceTransactionTypeClimateOrderRefund BalanceTransactionType = "climate_order_refund" BalanceTransactionTypeConnectCollectionTransfer BalanceTransactionType = "connect_collection_transfer" BalanceTransactionTypeContribution BalanceTransactionType = "contribution" BalanceTransactionTypeIssuingAuthorizationHold BalanceTransactionType = "issuing_authorization_hold" @@ -135,7 +137,7 @@ type BalanceTransactionListParams struct { Payout *string `form:"payout"` // Only returns the original transaction. Source *string `form:"source"` - // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Type *string `form:"type"` } @@ -206,7 +208,7 @@ type BalanceTransaction struct { Source *BalanceTransactionSource `json:"source"` // The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. Status BalanceTransactionStatus `json:"status"` - // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. Type BalanceTransactionType `json:"type"` } type BalanceTransactionSource struct { diff --git a/checkout_session.go b/checkout_session.go index cc9528843d..c0f73d17b7 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -738,6 +738,10 @@ type CheckoutSessionListCustomerDetailsParams struct { // Returns a list of Checkout Sessions. type CheckoutSessionListParams struct { ListParams `form:"*"` + // Only return the Checkout Sessions that were created during the given date interval. + Created *int64 `form:"created"` + // Only return the Checkout Sessions that were created during the given date interval. + CreatedRange *RangeQueryParams `form:"created"` // Only return the Checkout Sessions for the Customer specified. Customer *string `form:"customer"` // Only return the Checkout Sessions for the Customer details specified. diff --git a/client/api.go b/client/api.go index 93a2368a75..d9a56c088c 100644 --- a/client/api.go +++ b/client/api.go @@ -25,6 +25,9 @@ import ( "github.com/stripe/stripe-go/v76/cashbalance" "github.com/stripe/stripe-go/v76/charge" checkoutsession "github.com/stripe/stripe-go/v76/checkout/session" + climateorder "github.com/stripe/stripe-go/v76/climate/order" + climateproduct "github.com/stripe/stripe-go/v76/climate/product" + climatesupplier "github.com/stripe/stripe-go/v76/climate/supplier" "github.com/stripe/stripe-go/v76/countryspec" "github.com/stripe/stripe-go/v76/coupon" "github.com/stripe/stripe-go/v76/creditnote" @@ -157,6 +160,12 @@ type API struct { Charges *charge.Client // CheckoutSessions is the client used to invoke /checkout/sessions APIs. CheckoutSessions *checkoutsession.Client + // ClimateOrders is the client used to invoke /climate/orders APIs. + ClimateOrders *climateorder.Client + // ClimateProducts is the client used to invoke /climate/products APIs. + ClimateProducts *climateproduct.Client + // ClimateSuppliers is the client used to invoke /climate/suppliers APIs. + ClimateSuppliers *climatesupplier.Client // CountrySpecs is the client used to invoke /country_specs APIs. CountrySpecs *countryspec.Client // Coupons is the client used to invoke /coupons APIs. @@ -377,6 +386,9 @@ func (a *API) Init(key string, backends *stripe.Backends) { a.CashBalances = &cashbalance.Client{B: backends.API, Key: key} a.Charges = &charge.Client{B: backends.API, Key: key} a.CheckoutSessions = &checkoutsession.Client{B: backends.API, Key: key} + a.ClimateOrders = &climateorder.Client{B: backends.API, Key: key} + a.ClimateProducts = &climateproduct.Client{B: backends.API, Key: key} + a.ClimateSuppliers = &climatesupplier.Client{B: backends.API, Key: key} a.CountrySpecs = &countryspec.Client{B: backends.API, Key: key} a.Coupons = &coupon.Client{B: backends.API, Key: key} a.CreditNotes = &creditnote.Client{B: backends.API, Key: key} diff --git a/climate/order/client.go b/climate/order/client.go new file mode 100644 index 0000000000..cf555e5c25 --- /dev/null +++ b/climate/order/client.go @@ -0,0 +1,115 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package order provides the /climate/orders APIs +package order + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v76" + "github.com/stripe/stripe-go/v76/form" +) + +// Client is used to invoke /climate/orders APIs. +type Client struct { + B stripe.Backend + Key string +} + +// New creates a new climate order. +func New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { + return getC().New(params) +} + +// New creates a new climate order. +func (c Client) New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { + order := &stripe.ClimateOrder{} + err := c.B.Call(http.MethodPost, "/v1/climate/orders", c.Key, params, order) + return order, err +} + +// Get returns the details of a climate order. +func Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { + return getC().Get(id, params) +} + +// Get returns the details of a climate order. +func (c Client) Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { + path := stripe.FormatURLPath("/v1/climate/orders/%s", id) + order := &stripe.ClimateOrder{} + err := c.B.Call(http.MethodGet, path, c.Key, params, order) + return order, err +} + +// Update updates a climate order's properties. +func Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { + return getC().Update(id, params) +} + +// Update updates a climate order's properties. +func (c Client) Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { + path := stripe.FormatURLPath("/v1/climate/orders/%s", id) + order := &stripe.ClimateOrder{} + err := c.B.Call(http.MethodPost, path, c.Key, params, order) + return order, err +} + +// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API. +func Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) { + return getC().Cancel(id, params) +} + +// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API. +func (c Client) Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) { + path := stripe.FormatURLPath("/v1/climate/orders/%s/cancel", id) + order := &stripe.ClimateOrder{} + err := c.B.Call(http.MethodPost, path, c.Key, params, order) + return order, err +} + +// List returns a list of climate orders. +func List(params *stripe.ClimateOrderListParams) *Iter { + return getC().List(params) +} + +// List returns a list of climate orders. +func (c Client) List(listParams *stripe.ClimateOrderListParams) *Iter { + return &Iter{ + Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { + list := &stripe.ClimateOrderList{} + err := c.B.CallRaw(http.MethodGet, "/v1/climate/orders", c.Key, b, p, list) + + ret := make([]interface{}, len(list.Data)) + for i, v := range list.Data { + ret[i] = v + } + + return ret, list, err + }), + } +} + +// Iter is an iterator for climate orders. +type Iter struct { + *stripe.Iter +} + +// ClimateOrder returns the climate order which the iterator is currently pointing to. +func (i *Iter) ClimateOrder() *stripe.ClimateOrder { + return i.Current().(*stripe.ClimateOrder) +} + +// ClimateOrderList returns the current list object which the iterator is +// currently using. List objects will change as new API calls are made to +// continue pagination. +func (i *Iter) ClimateOrderList() *stripe.ClimateOrderList { + return i.List().(*stripe.ClimateOrderList) +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/climate/product/client.go b/climate/product/client.go new file mode 100644 index 0000000000..f13c276107 --- /dev/null +++ b/climate/product/client.go @@ -0,0 +1,77 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package product provides the /climate/products APIs +package product + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v76" + "github.com/stripe/stripe-go/v76/form" +) + +// Client is used to invoke /climate/products APIs. +type Client struct { + B stripe.Backend + Key string +} + +// Get returns the details of a climate product. +func Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) { + return getC().Get(id, params) +} + +// Get returns the details of a climate product. +func (c Client) Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) { + path := stripe.FormatURLPath("/v1/climate/products/%s", id) + product := &stripe.ClimateProduct{} + err := c.B.Call(http.MethodGet, path, c.Key, params, product) + return product, err +} + +// List returns a list of climate products. +func List(params *stripe.ClimateProductListParams) *Iter { + return getC().List(params) +} + +// List returns a list of climate products. +func (c Client) List(listParams *stripe.ClimateProductListParams) *Iter { + return &Iter{ + Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { + list := &stripe.ClimateProductList{} + err := c.B.CallRaw(http.MethodGet, "/v1/climate/products", c.Key, b, p, list) + + ret := make([]interface{}, len(list.Data)) + for i, v := range list.Data { + ret[i] = v + } + + return ret, list, err + }), + } +} + +// Iter is an iterator for climate products. +type Iter struct { + *stripe.Iter +} + +// ClimateProduct returns the climate product which the iterator is currently pointing to. +func (i *Iter) ClimateProduct() *stripe.ClimateProduct { + return i.Current().(*stripe.ClimateProduct) +} + +// ClimateProductList returns the current list object which the iterator is +// currently using. List objects will change as new API calls are made to +// continue pagination. +func (i *Iter) ClimateProductList() *stripe.ClimateProductList { + return i.List().(*stripe.ClimateProductList) +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/climate/supplier/client.go b/climate/supplier/client.go new file mode 100644 index 0000000000..33fddb793f --- /dev/null +++ b/climate/supplier/client.go @@ -0,0 +1,77 @@ +// +// +// File generated from our OpenAPI spec +// +// + +// Package supplier provides the /climate/suppliers APIs +package supplier + +import ( + "net/http" + + stripe "github.com/stripe/stripe-go/v76" + "github.com/stripe/stripe-go/v76/form" +) + +// Client is used to invoke /climate/suppliers APIs. +type Client struct { + B stripe.Backend + Key string +} + +// Get returns the details of a climate supplier. +func Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) { + return getC().Get(id, params) +} + +// Get returns the details of a climate supplier. +func (c Client) Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) { + path := stripe.FormatURLPath("/v1/climate/suppliers/%s", id) + supplier := &stripe.ClimateSupplier{} + err := c.B.Call(http.MethodGet, path, c.Key, params, supplier) + return supplier, err +} + +// List returns a list of climate suppliers. +func List(params *stripe.ClimateSupplierListParams) *Iter { + return getC().List(params) +} + +// List returns a list of climate suppliers. +func (c Client) List(listParams *stripe.ClimateSupplierListParams) *Iter { + return &Iter{ + Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { + list := &stripe.ClimateSupplierList{} + err := c.B.CallRaw(http.MethodGet, "/v1/climate/suppliers", c.Key, b, p, list) + + ret := make([]interface{}, len(list.Data)) + for i, v := range list.Data { + ret[i] = v + } + + return ret, list, err + }), + } +} + +// Iter is an iterator for climate suppliers. +type Iter struct { + *stripe.Iter +} + +// ClimateSupplier returns the climate supplier which the iterator is currently pointing to. +func (i *Iter) ClimateSupplier() *stripe.ClimateSupplier { + return i.Current().(*stripe.ClimateSupplier) +} + +// ClimateSupplierList returns the current list object which the iterator is +// currently using. List objects will change as new API calls are made to +// continue pagination. +func (i *Iter) ClimateSupplierList() *stripe.ClimateSupplierList { + return i.List().(*stripe.ClimateSupplierList) +} + +func getC() Client { + return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} +} diff --git a/climate_order.go b/climate_order.go new file mode 100644 index 0000000000..50ab4019af --- /dev/null +++ b/climate_order.go @@ -0,0 +1,185 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// Reason for the cancellation of this order. +type ClimateOrderCancellationReason string + +// List of values that ClimateOrderCancellationReason can take +const ( + ClimateOrderCancellationReasonExpired ClimateOrderCancellationReason = "expired" + ClimateOrderCancellationReasonProductUnavailable ClimateOrderCancellationReason = "product_unavailable" + ClimateOrderCancellationReasonRequested ClimateOrderCancellationReason = "requested" +) + +// The current status of this order. +type ClimateOrderStatus string + +// List of values that ClimateOrderStatus can take +const ( + ClimateOrderStatusAwaitingFunds ClimateOrderStatus = "awaiting_funds" + ClimateOrderStatusCanceled ClimateOrderStatus = "canceled" + ClimateOrderStatusConfirmed ClimateOrderStatus = "confirmed" + ClimateOrderStatusDelivered ClimateOrderStatus = "delivered" + ClimateOrderStatusOpen ClimateOrderStatus = "open" +) + +// Retrieves the details of a Climate order object with the given ID. +type ClimateOrderParams struct { + Params `form:"*"` + // Requested amount of carbon removal units. Either this or `metric_tons` must be specified. + Amount *int64 `form:"amount"` + // Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. + Beneficiary *ClimateOrderBeneficiaryParams `form:"beneficiary"` + // Request currency for the order as a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a supported [settlement currency for your account](https://stripe.com/docs/currencies). If omitted, the account's default currency will be used. + Currency *string `form:"currency"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` + // 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"` + // Requested number of tons for the order. Either this or `amount` must be specified. + MetricTons *float64 `form:"metric_tons,high_precision"` + // Unique identifier of the Climate product. + Product *string `form:"product"` +} + +// AddExpand appends a new field to expand. +func (p *ClimateOrderParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// AddMetadata adds a new key-value pair to the Metadata. +func (p *ClimateOrderParams) AddMetadata(key string, value string) { + if p.Metadata == nil { + p.Metadata = make(map[string]string) + } + + p.Metadata[key] = value +} + +// Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. +type ClimateOrderBeneficiaryParams struct { + // Publicly displayable name for the end beneficiary of carbon removal. + PublicName *string `form:"public_name"` +} + +// Lists all Climate order objects. The orders are returned sorted by creation date, with the +// most recently created orders appearing first. +type ClimateOrderListParams struct { + ListParams `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *ClimateOrderListParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the +// reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier +// might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe +// provides 90 days advance notice and refunds the amount_total. +type ClimateOrderCancelParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *ClimateOrderCancelParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +type ClimateOrderBeneficiary struct { + // Publicly displayable name for the end beneficiary of carbon removal. + PublicName string `json:"public_name"` +} + +// Specific location of this delivery. +type ClimateOrderDeliveryDetailLocation struct { + // The city where the supplier is located. + City string `json:"city"` + // Two-letter ISO code representing the country where the supplier is located. + Country string `json:"country"` + // The geographic latitude where the supplier is located. + Latitude float64 `json:"latitude"` + // The geographic longitude where the supplier is located. + Longitude float64 `json:"longitude"` + // The state/county/province/region where the supplier is located. + Region string `json:"region"` +} + +// Details about the delivery of carbon removal for this order. +type ClimateOrderDeliveryDetail struct { + // Time at which the delivery occurred. Measured in seconds since the Unix epoch. + DeliveredAt int64 `json:"delivered_at"` + // Specific location of this delivery. + Location *ClimateOrderDeliveryDetailLocation `json:"location"` + // Quantity of carbon removal supplied by this delivery. + MetricTons string `json:"metric_tons"` + // Once retired, a URL to the registry entry for the tons from this delivery. + RegistryURL string `json:"registry_url"` + // A supplier of carbon removal. + Supplier *ClimateSupplier `json:"supplier"` +} + +// Orders represent your intent to purchase a particular Climate product. When you create an order, the +// payment is deducted from your merchant balance. +type ClimateOrder struct { + APIResource + // Total amount of [Frontier](https://frontierclimate.com/)'s service fees in the currency's smallest unit. + AmountFees int64 `json:"amount_fees"` + // Total amount of the carbon removal in the currency's smallest unit. + AmountSubtotal int64 `json:"amount_subtotal"` + // Total amount of the order including fees in the currency's smallest unit. + AmountTotal int64 `json:"amount_total"` + Beneficiary *ClimateOrderBeneficiary `json:"beneficiary"` + // Time at which the order was canceled. Measured in seconds since the Unix epoch. + CanceledAt int64 `json:"canceled_at"` + // Reason for the cancellation of this order. + CancellationReason ClimateOrderCancellationReason `json:"cancellation_reason"` + // For delivered orders, a URL to a delivery certificate for the order. + Certificate string `json:"certificate"` + // Time at which the order was confirmed. Measured in seconds since the Unix epoch. + ConfirmedAt int64 `json:"confirmed_at"` + // Time at which the object was created. Measured in seconds since the Unix epoch. + Created int64 `json:"created"` + // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase, representing the currency for this order. + Currency Currency `json:"currency"` + // Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch. + DelayedAt int64 `json:"delayed_at"` + // Time at which the order was delivered. Measured in seconds since the Unix epoch. + DeliveredAt int64 `json:"delivered_at"` + // Details about the delivery of carbon removal for this order. + DeliveryDetails []*ClimateOrderDeliveryDetail `json:"delivery_details"` + // The year this order is expected to be delivered. + ExpectedDeliveryYear int64 `json:"expected_delivery_year"` + // Unique identifier for the object. + ID string `json:"id"` + // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + 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"` + // Quantity of carbon removal that is included in this order. + MetricTons float64 `json:"metric_tons,string"` + // String representing the object's type. Objects of the same type share the same value. + Object string `json:"object"` + // Unique ID for the Climate `Product` this order is purchasing. + Product *ClimateProduct `json:"product"` + // Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch. + ProductSubstitutedAt int64 `json:"product_substituted_at"` + // The current status of this order. + Status ClimateOrderStatus `json:"status"` +} + +// ClimateOrderList is a list of Orders as retrieved from a list endpoint. +type ClimateOrderList struct { + APIResource + ListMeta + Data []*ClimateOrder `json:"data"` +} diff --git a/climate_product.go b/climate_product.go new file mode 100644 index 0000000000..f557c5eaf3 --- /dev/null +++ b/climate_product.go @@ -0,0 +1,95 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +import "encoding/json" + +// Retrieves the details of a Climate product with the given ID. +type ClimateProductParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *ClimateProductParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Lists all available Climate product objects. +type ClimateProductListParams struct { + ListParams `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *ClimateProductListParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Current prices for a metric ton of carbon removal in a currency's smallest unit. +type ClimateProductCurrentPricesPerMetricTon struct { + // Fees for one metric ton of carbon removal in the currency's smallest unit. + AmountFees int64 `json:"amount_fees"` + // Subtotal for one metric ton of carbon removal (excluding fees) in the currency's smallest unit. + AmountSubtotal int64 `json:"amount_subtotal"` + // Total for one metric ton of carbon removal (including fees) in the currency's smallest unit. + AmountTotal int64 `json:"amount_total"` +} + +// A Climate product represents a type of carbon removal unit available for reservation. +// You can retrieve it to see the current price and availability. +type ClimateProduct struct { + APIResource + // Time at which the object was created. Measured in seconds since the Unix epoch. + Created int64 `json:"created"` + // Current prices for a metric ton of carbon removal in a currency's smallest unit. + CurrentPricesPerMetricTon map[string]*ClimateProductCurrentPricesPerMetricTon `json:"current_prices_per_metric_ton"` + // The year in which the carbon removal is expected to be delivered. + DeliveryYear int64 `json:"delivery_year"` + // Unique identifier for the object. For convenience, Climate product IDs are human-readable strings + // that start with `climsku_`. See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory) + // for a list of available carbon removal products. + ID string `json:"id"` + // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + Livemode bool `json:"livemode"` + // The quantity of metric tons available for reservation. + MetricTonsAvailable float64 `json:"metric_tons_available,string"` + // The Climate product's name. + Name string `json:"name"` + // String representing the object's type. Objects of the same type share the same value. + Object string `json:"object"` + // The carbon removal suppliers that fulfill orders for this Climate product. + Suppliers []*ClimateSupplier `json:"suppliers"` +} + +// ClimateProductList is a list of Products as retrieved from a list endpoint. +type ClimateProductList struct { + APIResource + ListMeta + Data []*ClimateProduct `json:"data"` +} + +// UnmarshalJSON handles deserialization of a ClimateProduct. +// This custom unmarshaling is needed because the resulting +// property may be an id or the full struct if it was expanded. +func (c *ClimateProduct) UnmarshalJSON(data []byte) error { + if id, ok := ParseID(data); ok { + c.ID = id + return nil + } + + type climateProduct ClimateProduct + var v climateProduct + if err := json.Unmarshal(data, &v); err != nil { + return err + } + + *c = ClimateProduct(v) + return nil +} diff --git a/climate_supplier.go b/climate_supplier.go new file mode 100644 index 0000000000..2c850729c1 --- /dev/null +++ b/climate_supplier.go @@ -0,0 +1,82 @@ +// +// +// File generated from our OpenAPI spec +// +// + +package stripe + +// The scientific pathway used for carbon removal. +type ClimateSupplierRemovalPathway string + +// List of values that ClimateSupplierRemovalPathway can take +const ( + ClimateSupplierRemovalPathwayBiomassCarbonRemovalAndStorage ClimateSupplierRemovalPathway = "biomass_carbon_removal_and_storage" + ClimateSupplierRemovalPathwayDirectAirCapture ClimateSupplierRemovalPathway = "direct_air_capture" + ClimateSupplierRemovalPathwayEnhancedWeathering ClimateSupplierRemovalPathway = "enhanced_weathering" + ClimateSupplierRemovalPathwayVarious ClimateSupplierRemovalPathway = "various" +) + +// Retrieves a Climate supplier object. +type ClimateSupplierParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *ClimateSupplierParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// Lists all available Climate supplier objects. +type ClimateSupplierListParams struct { + ListParams `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *ClimateSupplierListParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + +// The locations in which this supplier operates. +type ClimateSupplierLocation struct { + // The city where the supplier is located. + City string `json:"city"` + // Two-letter ISO code representing the country where the supplier is located. + Country string `json:"country"` + // The geographic latitude where the supplier is located. + Latitude float64 `json:"latitude"` + // The geographic longitude where the supplier is located. + Longitude float64 `json:"longitude"` + // The state/county/province/region where the supplier is located. + Region string `json:"region"` +} + +// A supplier of carbon removal. +type ClimateSupplier struct { + APIResource + // Unique identifier for the object. + ID string `json:"id"` + // Link to a webpage to learn more about the supplier. + InfoURL string `json:"info_url"` + // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + Livemode bool `json:"livemode"` + // The locations in which this supplier operates. + Locations []*ClimateSupplierLocation `json:"locations"` + // Name of this carbon removal supplier. + Name string `json:"name"` + // String representing the object's type. Objects of the same type share the same value. + Object string `json:"object"` + // The scientific pathway used for carbon removal. + RemovalPathway ClimateSupplierRemovalPathway `json:"removal_pathway"` +} + +// ClimateSupplierList is a list of Suppliers as retrieved from a list endpoint. +type ClimateSupplierList struct { + APIResource + ListMeta + Data []*ClimateSupplier `json:"data"` +} diff --git a/customer.go b/customer.go index 36ed498f4a..fb9b3a5c89 100644 --- a/customer.go +++ b/customer.go @@ -129,6 +129,8 @@ type CustomerShippingParams struct { type CustomerTaxParams struct { // A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. IPAddress *string `form:"ip_address"` + // A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. + ValidateLocation *string `form:"validate_location"` } // The customer's tax IDs. diff --git a/error.go b/error.go index 5631c8e4ec..521f0fd6a5 100644 --- a/error.go +++ b/error.go @@ -68,6 +68,7 @@ const ( ErrorCodeDebitNotAuthorized ErrorCode = "debit_not_authorized" ErrorCodeEmailInvalid ErrorCode = "email_invalid" ErrorCodeExpiredCard ErrorCode = "expired_card" + ErrorCodeFinancialConnectionsAccountInactive ErrorCode = "financial_connections_account_inactive" ErrorCodeIdempotencyKeyInUse ErrorCode = "idempotency_key_in_use" ErrorCodeIncorrectAddress ErrorCode = "incorrect_address" ErrorCodeIncorrectCVC ErrorCode = "incorrect_cvc" diff --git a/event.go b/event.go index 21897f13b9..f96f3e50fe 100644 --- a/event.go +++ b/event.go @@ -49,6 +49,13 @@ const ( EventTypeCheckoutSessionAsyncPaymentSucceeded EventType = "checkout.session.async_payment_succeeded" EventTypeCheckoutSessionCompleted EventType = "checkout.session.completed" EventTypeCheckoutSessionExpired EventType = "checkout.session.expired" + EventTypeClimateOrderCanceled EventType = "climate.order.canceled" + EventTypeClimateOrderCreated EventType = "climate.order.created" + EventTypeClimateOrderDelayed EventType = "climate.order.delayed" + EventTypeClimateOrderDelivered EventType = "climate.order.delivered" + EventTypeClimateOrderProductSubstituted EventType = "climate.order.product_substituted" + EventTypeClimateProductCreated EventType = "climate.product.created" + EventTypeClimateProductPricingUpdated EventType = "climate.product.pricing_updated" EventTypeCouponCreated EventType = "coupon.created" EventTypeCouponDeleted EventType = "coupon.deleted" EventTypeCouponUpdated EventType = "coupon.updated" diff --git a/paymentintent.go b/paymentintent.go index 28bac46321..9c91a38d04 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -378,6 +378,7 @@ type PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure string const ( PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAny PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" + PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallenge PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge" PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge_only" ) @@ -1858,7 +1859,7 @@ type PaymentIntentParams struct { SetupFutureUsage *string `form:"setup_future_usage"` // Shipping information for this PaymentIntent. Shipping *ShippingDetailsParams `form:"shipping"` - // For non-card charges, you can use this value as the complete description that appears on your customers' statements. It must contain at least one letter and be 1–22 characters long. + // For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. StatementDescriptor *string `form:"statement_descriptor"` // Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters. StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` @@ -2019,7 +2020,7 @@ type PaymentIntentCaptureParams struct { FinalCapture *bool `form:"final_capture"` // 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"` - // For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + // For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. StatementDescriptor *string `form:"statement_descriptor"` // Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must be 1-22 characters long. StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` @@ -2085,7 +2086,7 @@ type PaymentIntentIncrementAuthorizationParams struct { Expand []*string `form:"expand"` // 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"` - // For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + // For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. StatementDescriptor *string `form:"statement_descriptor"` // The parameters used to automatically create a transfer after the payment is captured. // Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). @@ -3044,7 +3045,7 @@ type PaymentIntent struct { Shipping *ShippingDetails `json:"shipping"` // This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. Source *PaymentSource `json:"source"` - // For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + // For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. StatementDescriptor string `json:"statement_descriptor"` // Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix string `json:"statement_descriptor_suffix"` diff --git a/setupintent.go b/setupintent.go index ada1452be0..d7a88a69db 100644 --- a/setupintent.go +++ b/setupintent.go @@ -162,6 +162,7 @@ type SetupIntentPaymentMethodOptionsCardRequestThreeDSecure string const ( SetupIntentPaymentMethodOptionsCardRequestThreeDSecureAny SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" SetupIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" + SetupIntentPaymentMethodOptionsCardRequestThreeDSecureChallenge SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge" SetupIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly SetupIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge_only" ) From bbe27d52d97a242f34171dc8f7b7be2e624c7fd3 Mon Sep 17 00:00:00 2001 From: Annie Li Date: Thu, 30 Nov 2023 10:12:01 -0800 Subject: [PATCH 02/18] Bump version to 76.7.0 --- CHANGELOG.md | 12 ++++++++++++ VERSION | 2 +- stripe.go | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b8edd602f..2851a04308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 76.7.0 - 2023-11-30 +* [#1772](https://github.com/stripe/stripe-go/pull/1772) Update generated code + * Add support for new resources `Climate.Order`, `Climate.Product`, and `Climate.Supplier` + * Add support for `Cancel`, `Get`, `List`, `New`, and `Update` methods on resource `Order` + * Add support for `Get` and `List` methods on resources `Product` and `Supplier` + * Add support for new value `financial_connections_account_inactive` on enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode` + * Add support for new values `climate_order_purchase` and `climate_order_refund` on enum `BalanceTransactionType` + * Add support for `Created` on `CheckoutSessionListParams` + * Add support for `ValidateLocation` on `CustomerTaxParams` + * Add support for new values `climate.order.canceled`, `climate.order.created`, `climate.order.delayed`, `climate.order.delivered`, `climate.order.product_substituted`, `climate.product.created`, and `climate.product.pricing_updated` on enum `EventType` + * Add support for new value `challenge` on enums `PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure` and `SetupIntentPaymentMethodOptionsCardRequestThreeDSecure` + ## 76.6.0 - 2023-11-21 * [#1769](https://github.com/stripe/stripe-go/pull/1769) Update generated code * Add support for `ElectronicCommerceIndicator` on `ChargePaymentMethodDetailsCardThreeDSecure` and `SetupAttemptPaymentMethodDetailsCardThreeDSecure` diff --git a/VERSION b/VERSION index 396d5345bd..9eff320458 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -76.6.0 +76.7.0 diff --git a/stripe.go b/stripe.go index c746b37122..e74503e3ff 100644 --- a/stripe.go +++ b/stripe.go @@ -1226,7 +1226,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "76.6.0" +const clientversion = "76.7.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and From e04b08317ffe124af2aaaf82c28d59201a8d6a6a Mon Sep 17 00:00:00 2001 From: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com> Date: Fri, 1 Dec 2023 13:40:38 -0800 Subject: [PATCH 03/18] Add back PlanParams.ProductID (#1777) --- plan.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plan.go b/plan.go index 435c6aa731..b1a3945fd4 100644 --- a/plan.go +++ b/plan.go @@ -184,6 +184,8 @@ type PlanParams struct { Nickname *string `form:"nickname"` // The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. Product *PlanProductParams `form:"product"` + // The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. + ProductID *string `form:"product"` // Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. Tiers []*PlanTierParams `form:"tiers"` // Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. From f9e090e7d7fd9034d29c529d4068a0258d0db483 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:50:30 +0000 Subject: [PATCH 04/18] Update generated code for v694 --- OPENAPI_VERSION | 2 +- paymentlink.go | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 91fc697f21..181e032acd 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v693 \ No newline at end of file +v694 \ No newline at end of file diff --git a/paymentlink.go b/paymentlink.go index 4a1f24a730..5466bf9d96 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -441,6 +441,18 @@ type PaymentLinkPhoneNumberCollectionParams struct { Enabled *bool `form:"enabled"` } +// Configuration for the `completed_sessions` restriction type. +type PaymentLinkRestrictionsCompletedSessionsParams struct { + // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + Limit *int64 `form:"limit"` +} + +// Settings that restrict the usage of a payment link. +type PaymentLinkRestrictionsParams struct { + // Configuration for the `completed_sessions` restriction type. + CompletedSessions *PaymentLinkRestrictionsCompletedSessionsParams `form:"completed_sessions"` +} + // Configuration for collecting the customer's shipping address. type PaymentLinkShippingAddressCollectionParams struct { // An array of two-letter ISO country codes representing which countries Checkout should provide as options for @@ -535,6 +547,8 @@ type PaymentLinkParams struct { CustomText *PaymentLinkCustomTextParams `form:"custom_text"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` + // The custom message to be displayed to a customer when a payment link is no longer active. + InactiveMessage *string `form:"inactive_message"` // Generate a post-purchase Invoice for one-time payments. InvoiceCreation *PaymentLinkInvoiceCreationParams `form:"invoice_creation"` // The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. @@ -557,6 +571,8 @@ type PaymentLinkParams struct { // // We recommend that you review your privacy policy and check with your legal contacts. PhoneNumberCollection *PaymentLinkPhoneNumberCollectionParams `form:"phone_number_collection"` + // Settings that restrict the usage of a payment link. + Restrictions *PaymentLinkRestrictionsParams `form:"restrictions"` // Configuration for collecting the customer's shipping address. ShippingAddressCollection *PaymentLinkShippingAddressCollectionParams `form:"shipping_address_collection"` // The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. @@ -772,6 +788,17 @@ type PaymentLinkPhoneNumberCollection struct { // If `true`, a phone number will be collected during checkout. Enabled bool `json:"enabled"` } +type PaymentLinkRestrictionsCompletedSessions struct { + // The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + Count int64 `json:"count"` + // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + Limit int64 `json:"limit"` +} + +// Settings that restrict the usage of a payment link. +type PaymentLinkRestrictions struct { + CompletedSessions *PaymentLinkRestrictionsCompletedSessions `json:"completed_sessions"` +} // Configuration for collecting the customer's shipping address. type PaymentLinkShippingAddressCollection struct { @@ -857,6 +884,8 @@ type PaymentLink struct { CustomText *PaymentLinkCustomText `json:"custom_text"` // Unique identifier for the object. ID string `json:"id"` + // The custom message to be displayed to a customer when a payment link is no longer active. + InactiveMessage string `json:"inactive_message"` // Configuration for creating invoice for payment mode payment links. InvoiceCreation *PaymentLinkInvoiceCreation `json:"invoice_creation"` // The line items representing what is being sold. @@ -876,6 +905,8 @@ type PaymentLink struct { // The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). PaymentMethodTypes []PaymentLinkPaymentMethodType `json:"payment_method_types"` PhoneNumberCollection *PaymentLinkPhoneNumberCollection `json:"phone_number_collection"` + // Settings that restrict the usage of a payment link. + Restrictions *PaymentLinkRestrictions `json:"restrictions"` // Configuration for collecting the customer's shipping address. ShippingAddressCollection *PaymentLinkShippingAddressCollection `json:"shipping_address_collection"` // The shipping rate options applied to the session. From f41c8a57ae773567e0005e7581bb6fb29342d5ef Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 18:31:55 +0000 Subject: [PATCH 05/18] Update generated code for v695 --- OPENAPI_VERSION | 2 +- paymentlink.go | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 181e032acd..01b65f4505 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v694 \ No newline at end of file +v695 \ No newline at end of file diff --git a/paymentlink.go b/paymentlink.go index 5466bf9d96..dfdd33fad4 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -172,6 +172,16 @@ const ( PaymentLinkSubscriptionDataInvoiceSettingsIssuerTypeSelf PaymentLinkSubscriptionDataInvoiceSettingsIssuerType = "self" ) +// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod string + +// List of values that PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod can take +const ( + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCancel PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "cancel" + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCreateInvoice PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "create_invoice" + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodPause PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "pause" +) + // Returns a list of your payment links. type PaymentLinkListParams struct { ListParams `form:"*"` @@ -480,6 +490,18 @@ type PaymentLinkSubscriptionDataInvoiceSettingsParams struct { Issuer *PaymentLinkSubscriptionDataInvoiceSettingsIssuerParams `form:"issuer"` } +// Defines how the subscription should behave when the user's free trial ends. +type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams struct { + // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + MissingPaymentMethod *string `form:"missing_payment_method"` +} + +// Settings related to subscription trials. +type PaymentLinkSubscriptionDataTrialSettingsParams struct { + // Defines how the subscription should behave when the user's free trial ends. + EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams `form:"end_behavior"` +} + // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. type PaymentLinkSubscriptionDataParams struct { // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -490,6 +512,8 @@ type PaymentLinkSubscriptionDataParams struct { Metadata map[string]string `form:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. TrialPeriodDays *int64 `form:"trial_period_days"` + // Settings related to subscription trials. + TrialSettings *PaymentLinkSubscriptionDataTrialSettingsParams `form:"trial_settings"` } // AddMetadata adds a new key-value pair to the Metadata. @@ -828,6 +852,18 @@ type PaymentLinkSubscriptionDataInvoiceSettings struct { Issuer *PaymentLinkSubscriptionDataInvoiceSettingsIssuer `json:"issuer"` } +// Defines how a subscription behaves when a free trial ends. +type PaymentLinkSubscriptionDataTrialSettingsEndBehavior struct { + // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + MissingPaymentMethod PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod `json:"missing_payment_method"` +} + +// Settings related to subscription trials. +type PaymentLinkSubscriptionDataTrialSettings struct { + // Defines how a subscription behaves when a free trial ends. + EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehavior `json:"end_behavior"` +} + // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. type PaymentLinkSubscriptionData struct { // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -838,6 +874,8 @@ type PaymentLinkSubscriptionData struct { Metadata map[string]string `json:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. TrialPeriodDays int64 `json:"trial_period_days"` + // Settings related to subscription trials. + TrialSettings *PaymentLinkSubscriptionDataTrialSettings `json:"trial_settings"` } type PaymentLinkTaxIDCollection struct { // Indicates whether tax ID collection is enabled for the session. From b5d7cd4f860b55234ce08312b7117f902ca77ebc Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 00:15:29 +0000 Subject: [PATCH 06/18] Update generated code for v696 --- OPENAPI_VERSION | 2 +- accountsession.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 01b65f4505..8839256403 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v695 \ No newline at end of file +v696 \ No newline at end of file diff --git a/accountsession.go b/accountsession.go index bd7d698d8a..1679e7bec0 100644 --- a/accountsession.go +++ b/accountsession.go @@ -118,9 +118,11 @@ func (p *AccountSessionParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +type AccountSessionComponentsAccountOnboardingFeatures struct{} type AccountSessionComponentsAccountOnboarding struct { // Whether the embedded component is enabled. - Enabled bool `json:"enabled"` + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsAccountOnboardingFeatures `json:"features"` } type AccountSessionComponentsPaymentDetailsFeatures struct { // Whether to allow capturing and cancelling payment intents. This is `true` by default. From 6a031c328e93b0058256dee2d20616abb0f0d930 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:29:02 +0000 Subject: [PATCH 07/18] Update generated code for v697 --- OPENAPI_VERSION | 2 +- error.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8839256403..8e022a57bc 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v696 \ No newline at end of file +v697 \ No newline at end of file diff --git a/error.go b/error.go index 3d6ded8713..0df3c266f7 100644 --- a/error.go +++ b/error.go @@ -65,6 +65,7 @@ const ( ErrorCodeCouponExpired ErrorCode = "coupon_expired" ErrorCodeCustomerMaxPaymentMethods ErrorCode = "customer_max_payment_methods" ErrorCodeCustomerMaxSubscriptions ErrorCode = "customer_max_subscriptions" + ErrorCodeCustomerTaxLocationInvalid ErrorCode = "customer_tax_location_invalid" ErrorCodeDebitNotAuthorized ErrorCode = "debit_not_authorized" ErrorCodeEmailInvalid ErrorCode = "email_invalid" ErrorCodeExpiredCard ErrorCode = "expired_card" From 856ca9be2709352f244afb5736054eada47045b2 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:49:23 +0000 Subject: [PATCH 08/18] Update generated code for v698 --- OPENAPI_VERSION | 2 +- financialconnections_transaction.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8e022a57bc..7562863e7c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v697 \ No newline at end of file +v698 \ No newline at end of file diff --git a/financialconnections_transaction.go b/financialconnections_transaction.go index 504885b1d1..f448e6b988 100644 --- a/financialconnections_transaction.go +++ b/financialconnections_transaction.go @@ -70,7 +70,7 @@ type FinancialConnectionsTransaction struct { StatusTransitions *FinancialConnectionsTransactionStatusTransitions `json:"status_transitions"` // Time at which the transaction was transacted. Measured in seconds since the Unix epoch. TransactedAt int64 `json:"transacted_at"` - // The transaction_refresh object that last updated or created this transaction. + // The token of the transaction refresh that last updated or created this transaction. TransactionRefresh string `json:"transaction_refresh"` // Time at which the object was last updated. Measured in seconds since the Unix epoch. Updated int64 `json:"updated"` From 8dd8c969d06578a23eab9ea7f5d758e5cee733cb Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:03:11 +0000 Subject: [PATCH 09/18] Update generated code for v700 --- OPENAPI_VERSION | 2 +- customersession.go | 61 ++++++++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7562863e7c..520364a221 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v698 \ No newline at end of file +v700 \ No newline at end of file diff --git a/customersession.go b/customersession.go index ab150f1745..c00073c239 100644 --- a/customersession.go +++ b/customersession.go @@ -6,25 +6,34 @@ package stripe -// Whether the payment element supports detaching payment methods. -type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach string +// Controls whether the Payment Element allows the removal of a saved payment method. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove string -// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach can take +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove can take const ( - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetachAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach = "auto" - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetachNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach = "never" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemoveAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove = "auto" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemoveNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove = "never" ) -// Whether the payment element supports setting payment methods as the customer's default. -type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault string +// Controls whether the Payment Element offers to save a new payment method. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave string -// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault can take +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave can take const ( - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefaultAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault = "auto" - CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefaultNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault = "never" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave = "auto" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSaveNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave = "never" ) -// Whether the payment element supports updating payment methods. +// Controls whether the Payment Element offers to set a payment method as the default. +type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsDefault string + +// List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsDefault can take +const ( + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsDefaultAuto CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsDefault = "auto" + CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsDefaultNever CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsDefault = "never" +) + +// Controls whether the Payment Element allows the updating of a saved payment method. type CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate string // List of values that CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate can take @@ -35,11 +44,13 @@ const ( // This hash defines whether the payment element supports certain features. type CustomerSessionComponentsPaymentElementFeaturesParams struct { - // Whether the payment element supports detaching a payment method. - PaymentMethodDetach *string `form:"payment_method_detach"` - // Whether the payment element supports setting a payment method as the customer's default. - PaymentMethodSetAsCustomerDefault *string `form:"payment_method_set_as_customer_default"` - // Whether the payment element supports updating a payment method. + // Controls whether the Payment Element allows the removal of a saved payment method. + PaymentMethodRemove *string `form:"payment_method_remove"` + // Controls whether the Payment Element offers to save a new payment method. + PaymentMethodSave *string `form:"payment_method_save"` + // Controls whether the Payment Element offers to set a payment method as the default. + PaymentMethodSetAsDefault *string `form:"payment_method_set_as_default"` + // Controls whether the Payment Element allows the updating of a saved payment method. PaymentMethodUpdate *string `form:"payment_method_update"` } @@ -53,7 +64,7 @@ type CustomerSessionComponentsPaymentElementParams struct { // Configuration for the pricing table. type CustomerSessionComponentsPricingTableParams struct { - // Whether pricing table is enabled. + // Whether the pricing table is enabled. Enabled *bool `form:"enabled"` } @@ -81,13 +92,15 @@ func (p *CustomerSessionParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// This hash contains the features the Payment Element supports. +// This hash defines whether the payment element supports certain features. type CustomerSessionComponentsPaymentElementFeatures struct { - // Whether the payment element supports detaching payment methods. - PaymentMethodDetach CustomerSessionComponentsPaymentElementFeaturesPaymentMethodDetach `json:"payment_method_detach"` - // Whether the payment element supports setting payment methods as the customer's default. - PaymentMethodSetAsCustomerDefault CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsCustomerDefault `json:"payment_method_set_as_customer_default"` - // Whether the payment element supports updating payment methods. + // Controls whether the Payment Element allows the removal of a saved payment method. + PaymentMethodRemove CustomerSessionComponentsPaymentElementFeaturesPaymentMethodRemove `json:"payment_method_remove"` + // Controls whether the Payment Element offers to save a new payment method. + PaymentMethodSave CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSave `json:"payment_method_save"` + // Controls whether the Payment Element offers to set a payment method as the default. + PaymentMethodSetAsDefault CustomerSessionComponentsPaymentElementFeaturesPaymentMethodSetAsDefault `json:"payment_method_set_as_default"` + // Controls whether the Payment Element allows the updating of a saved payment method. PaymentMethodUpdate CustomerSessionComponentsPaymentElementFeaturesPaymentMethodUpdate `json:"payment_method_update"` } @@ -95,7 +108,7 @@ type CustomerSessionComponentsPaymentElementFeatures struct { type CustomerSessionComponentsPaymentElement struct { // Whether the payment element is enabled. Enabled bool `json:"enabled"` - // This hash contains the features the Payment Element supports. + // This hash defines whether the payment element supports certain features. Features *CustomerSessionComponentsPaymentElementFeatures `json:"features"` } From 45d9d019d3bb613a36089b15e7d5cbc0a3572bca Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:28:29 +0000 Subject: [PATCH 10/18] Update generated code for v701 --- OPENAPI_VERSION | 2 +- price.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 520364a221..8998325def 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v700 \ No newline at end of file +v701 \ No newline at end of file diff --git a/price.go b/price.go index da3708bf43..a17573dfab 100644 --- a/price.go +++ b/price.go @@ -38,7 +38,7 @@ const ( PriceMigrateToBehaviorAtCycleEnd PriceMigrateToBehavior = "at_cycle_end" ) -// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. +// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. type PriceRecurringAggregateUsage string // List of values that PriceRecurringAggregateUsage can take @@ -250,7 +250,7 @@ func (p *PriceProductDataParams) AddMetadata(key string, value string) { // The recurring components of a price such as `interval` and `usage_type`. type PriceRecurringParams struct { - // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. AggregateUsage *string `form:"aggregate_usage"` // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` @@ -421,7 +421,7 @@ type PriceMigrateTo struct { // The recurring components of a price such as `interval` and `usage_type`. type PriceRecurring struct { - // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. AggregateUsage PriceRecurringAggregateUsage `json:"aggregate_usage"` // The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. Interval PriceRecurringInterval `json:"interval"` From d3bb5f85695d6ad66d6fd2906e0b38e1b07fedaf Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 07:20:39 +0000 Subject: [PATCH 11/18] Update generated code for v702 --- OPENAPI_VERSION | 2 +- paymentlink.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8998325def..907f79acd1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v701 \ No newline at end of file +v702 \ No newline at end of file diff --git a/paymentlink.go b/paymentlink.go index dfdd33fad4..37c920cac6 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -432,6 +432,8 @@ type PaymentLinkPaymentIntentDataParams struct { StatementDescriptor *string `form:"statement_descriptor"` // Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` + // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + TransferGroup *string `form:"transfer_group"` } // AddMetadata adds a new key-value pair to the Metadata. @@ -807,6 +809,8 @@ type PaymentLinkPaymentIntentData struct { StatementDescriptor string `json:"statement_descriptor"` // Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix string `json:"statement_descriptor_suffix"` + // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + TransferGroup string `json:"transfer_group"` } type PaymentLinkPhoneNumberCollection struct { // If `true`, a phone number will be collected during checkout. From ddadb2eb02dced4427b09237ab3fe76a5730bc53 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:00:34 +0000 Subject: [PATCH 12/18] Update generated code for v703 --- OPENAPI_VERSION | 2 +- paymentintent.go | 12 +++++------- setupintent.go | 6 +++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 907f79acd1..4da1613442 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v702 \ No newline at end of file +v703 \ No newline at end of file diff --git a/paymentintent.go b/paymentintent.go index 1c86f80509..5a0ec2070a 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -426,15 +426,13 @@ const ( PaymentIntentPaymentMethodOptionsCardRequestOvercaptureNever PaymentIntentPaymentMethodOptionsCardRequestOvercapture = "never" ) -// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. type PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure string // List of values that PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure can take const ( - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAny PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallenge PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge_only" + PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAny PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" + PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" ) // Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1679,7 +1677,7 @@ type PaymentIntentPaymentMethodOptionsCardParams struct { RequestMulticapture *string `form:"request_multicapture"` // Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. RequestOvercapture *string `form:"request_overcapture"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure *string `form:"request_three_d_secure"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -3786,7 +3784,7 @@ type PaymentIntentPaymentMethodOptionsCard struct { RequestMulticapture PaymentIntentPaymentMethodOptionsCardRequestMulticapture `json:"request_multicapture"` // Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. RequestOvercapture PaymentIntentPaymentMethodOptionsCardRequestOvercapture `json:"request_overcapture"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // diff --git a/setupintent.go b/setupintent.go index 25baaea183..f19ed223a3 100644 --- a/setupintent.go +++ b/setupintent.go @@ -155,7 +155,7 @@ const ( SetupIntentPaymentMethodOptionsCardNetworkVisa SetupIntentPaymentMethodOptionsCardNetwork = "visa" ) -// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. type SetupIntentPaymentMethodOptionsCardRequestThreeDSecure string // List of values that SetupIntentPaymentMethodOptionsCardRequestThreeDSecure can take @@ -645,7 +645,7 @@ type SetupIntentPaymentMethodOptionsCardParams struct { MOTO *bool `form:"moto"` // Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. Network *string `form:"network"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure *string `form:"request_three_d_secure"` // If 3D Secure authentication was performed with a third-party provider, // the authentication details to use for this setup. @@ -1278,7 +1278,7 @@ type SetupIntentPaymentMethodOptionsCard struct { MandateOptions *SetupIntentPaymentMethodOptionsCardMandateOptions `json:"mandate_options"` // Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. Network SetupIntentPaymentMethodOptionsCardNetwork `json:"network"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure SetupIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } type SetupIntentPaymentMethodOptionsLink struct { From df0a0016190cf20db266ccf3d157da6becc28454 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:57:07 +0000 Subject: [PATCH 13/18] Update generated code for v704 --- OPENAPI_VERSION | 2 +- error.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4da1613442..55d0a33c44 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v703 \ No newline at end of file +v704 \ No newline at end of file diff --git a/error.go b/error.go index 0df3c266f7..58aa37bad1 100644 --- a/error.go +++ b/error.go @@ -70,6 +70,7 @@ const ( ErrorCodeEmailInvalid ErrorCode = "email_invalid" ErrorCodeExpiredCard ErrorCode = "expired_card" ErrorCodeFinancialConnectionsAccountInactive ErrorCode = "financial_connections_account_inactive" + ErrorCodeFinancialConnectionsNoSuccessfulTransactionRefresh ErrorCode = "financial_connections_no_successful_transaction_refresh" ErrorCodeGiftCardBalanceInsufficient ErrorCode = "gift_card_balance_insufficient" ErrorCodeGiftCardCodeExists ErrorCode = "gift_card_code_exists" ErrorCodeGiftCardInactive ErrorCode = "gift_card_inactive" From e1f130394150a969b014cbbe48a2b22ffe5ceb3b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:04:10 +0000 Subject: [PATCH 14/18] Update generated code for v705 --- OPENAPI_VERSION | 2 +- financialconnections/transaction/client.go | 13 +++++++++++++ financialconnections_transaction.go | 13 +++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 55d0a33c44..d9f690a6ce 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v704 \ No newline at end of file +v705 \ No newline at end of file diff --git a/financialconnections/transaction/client.go b/financialconnections/transaction/client.go index 746949f26e..f21a462e8a 100644 --- a/financialconnections/transaction/client.go +++ b/financialconnections/transaction/client.go @@ -20,6 +20,19 @@ type Client struct { Key string } +// Get returns the details of a financial connections transaction. +func Get(id string, params *stripe.FinancialConnectionsTransactionParams) (*stripe.FinancialConnectionsTransaction, error) { + return getC().Get(id, params) +} + +// Get returns the details of a financial connections transaction. +func (c Client) Get(id string, params *stripe.FinancialConnectionsTransactionParams) (*stripe.FinancialConnectionsTransaction, error) { + path := stripe.FormatURLPath("/v1/financial_connections/transactions/%s", id) + transaction := &stripe.FinancialConnectionsTransaction{} + err := c.B.Call(http.MethodGet, path, c.Key, params, transaction) + return transaction, err +} + // List returns a list of financial connections transactions. func List(params *stripe.FinancialConnectionsTransactionListParams) *Iter { return getC().List(params) diff --git a/financialconnections_transaction.go b/financialconnections_transaction.go index f448e6b988..ba865d1e40 100644 --- a/financialconnections_transaction.go +++ b/financialconnections_transaction.go @@ -16,6 +16,18 @@ const ( FinancialConnectionsTransactionStatusVoid FinancialConnectionsTransactionStatus = "void" ) +// Retrieves the details of a Financial Connections Transaction +type FinancialConnectionsTransactionParams struct { + Params `form:"*"` + // Specifies which fields in the response should be expanded. + Expand []*string `form:"expand"` +} + +// AddExpand appends a new field to expand. +func (p *FinancialConnectionsTransactionParams) AddExpand(f string) { + p.Expand = append(p.Expand, &f) +} + // A filter on the list based on the object `transaction_refresh` field. The value can be a dictionary with the following options: type FinancialConnectionsTransactionListTransactionRefreshParams struct { // Return results where the transactions were created or updated by a refresh that took place after this refresh (non-inclusive). @@ -51,6 +63,7 @@ type FinancialConnectionsTransactionStatusTransitions struct { // A Transaction represents a real transaction that affects a Financial Connections Account balance. type FinancialConnectionsTransaction struct { + APIResource // The ID of the Financial Connections Account this transaction belongs to. Account string `json:"account"` // The amount of this transaction, in cents (or local equivalent). From 1d554719215306dfd6061d35b0691bc9f94d45d5 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:04:44 -0800 Subject: [PATCH 15/18] Update generated code (#1775) * Update generated code for v692 * Update generated code for v693 * Update generated code for v694 * Update generated code for v695 * Update generated code for v696 * Update generated code for v697 * Update generated code for v701 * Update generated code for v702 * Update generated code for v703 * Update generated code for v704 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- accountsession.go | 97 ++++++++++++++++++++++++++++++++++++++++++- balancetransaction.go | 92 ++++++++++++++++++++-------------------- error.go | 2 + paymentintent.go | 12 +++--- paymentlink.go | 73 ++++++++++++++++++++++++++++++++ price.go | 6 +-- setupintent.go | 6 +-- 8 files changed, 230 insertions(+), 60 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 794622303c..55d0a33c44 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v691 \ No newline at end of file +v704 \ No newline at end of file diff --git a/accountsession.go b/accountsession.go index c6c458d376..cecb8be715 100644 --- a/accountsession.go +++ b/accountsession.go @@ -6,16 +6,74 @@ package stripe +// The list of features enabled in the embedded component. +type AccountSessionComponentsAccountOnboardingFeaturesParams struct{} + // Configuration for the account onboarding embedded component. type AccountSessionComponentsAccountOnboardingParams struct { // Whether the embedded component is enabled. Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsAccountOnboardingFeaturesParams `form:"features"` +} + +// The list of features enabled in the embedded component. +type AccountSessionComponentsPaymentDetailsFeaturesParams struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments *bool `form:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement *bool `form:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement *bool `form:"refund_management"` +} + +// Configuration for the payment details embedded component. +type AccountSessionComponentsPaymentDetailsParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsPaymentDetailsFeaturesParams `form:"features"` +} + +// The list of features enabled in the embedded component. +type AccountSessionComponentsPaymentsFeaturesParams struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments *bool `form:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement *bool `form:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement *bool `form:"refund_management"` +} + +// Configuration for the payments embedded component. +type AccountSessionComponentsPaymentsParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsPaymentsFeaturesParams `form:"features"` +} + +// The list of features enabled in the embedded component. +type AccountSessionComponentsPayoutsFeaturesParams struct{} + +// Configuration for the payouts embedded component. +type AccountSessionComponentsPayoutsParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsPayoutsFeaturesParams `form:"features"` } // Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not). type AccountSessionComponentsParams struct { // Configuration for the account onboarding embedded component. AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"` + // Configuration for the payment details embedded component. + PaymentDetails *AccountSessionComponentsPaymentDetailsParams `form:"payment_details"` + // Configuration for the payments embedded component. + Payments *AccountSessionComponentsPaymentsParams `form:"payments"` + // Configuration for the payouts embedded component. + Payouts *AccountSessionComponentsPayoutsParams `form:"payouts"` } // Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. @@ -34,12 +92,49 @@ func (p *AccountSessionParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +type AccountSessionComponentsAccountOnboardingFeatures struct{} type AccountSessionComponentsAccountOnboarding struct { // Whether the embedded component is enabled. - Enabled bool `json:"enabled"` + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsAccountOnboardingFeatures `json:"features"` +} +type AccountSessionComponentsPaymentDetailsFeatures struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments bool `json:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement bool `json:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement bool `json:"refund_management"` +} +type AccountSessionComponentsPaymentDetails struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsPaymentDetailsFeatures `json:"features"` +} +type AccountSessionComponentsPaymentsFeatures struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments bool `json:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement bool `json:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement bool `json:"refund_management"` +} +type AccountSessionComponentsPayments struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsPaymentsFeatures `json:"features"` +} +type AccountSessionComponentsPayoutsFeatures struct{} +type AccountSessionComponentsPayouts struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsPayoutsFeatures `json:"features"` } type AccountSessionComponents struct { AccountOnboarding *AccountSessionComponentsAccountOnboarding `json:"account_onboarding"` + PaymentDetails *AccountSessionComponentsPaymentDetails `json:"payment_details"` + Payments *AccountSessionComponentsPayments `json:"payments"` + Payouts *AccountSessionComponentsPayouts `json:"payouts"` } // An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components. diff --git a/balancetransaction.go b/balancetransaction.go index a71474374c..8b0fec3d34 100644 --- a/balancetransaction.go +++ b/balancetransaction.go @@ -73,53 +73,55 @@ const ( BalanceTransactionStatusPending BalanceTransactionStatus = "pending" ) -// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. +// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. type BalanceTransactionType string // List of values that BalanceTransactionType can take const ( - BalanceTransactionTypeAdjustment BalanceTransactionType = "adjustment" - BalanceTransactionTypeAdvance BalanceTransactionType = "advance" - BalanceTransactionTypeAdvanceFunding BalanceTransactionType = "advance_funding" - BalanceTransactionTypeAnticipationRepayment BalanceTransactionType = "anticipation_repayment" - BalanceTransactionTypeApplicationFee BalanceTransactionType = "application_fee" - BalanceTransactionTypeApplicationFeeRefund BalanceTransactionType = "application_fee_refund" - BalanceTransactionTypeCharge BalanceTransactionType = "charge" - BalanceTransactionTypeClimateOrderPurchase BalanceTransactionType = "climate_order_purchase" - BalanceTransactionTypeClimateOrderRefund BalanceTransactionType = "climate_order_refund" - BalanceTransactionTypeConnectCollectionTransfer BalanceTransactionType = "connect_collection_transfer" - BalanceTransactionTypeContribution BalanceTransactionType = "contribution" - BalanceTransactionTypeIssuingAuthorizationHold BalanceTransactionType = "issuing_authorization_hold" - BalanceTransactionTypeIssuingAuthorizationRelease BalanceTransactionType = "issuing_authorization_release" - BalanceTransactionTypeIssuingDispute BalanceTransactionType = "issuing_dispute" - BalanceTransactionTypeIssuingTransaction BalanceTransactionType = "issuing_transaction" - BalanceTransactionTypeObligationInbound BalanceTransactionType = "obligation_inbound" - BalanceTransactionTypeObligationOutbound BalanceTransactionType = "obligation_outbound" - BalanceTransactionTypeObligationPayout BalanceTransactionType = "obligation_payout" - BalanceTransactionTypeObligationPayoutFailure BalanceTransactionType = "obligation_payout_failure" - BalanceTransactionTypeObligationReversalInbound BalanceTransactionType = "obligation_reversal_inbound" - BalanceTransactionTypeObligationReversalOutbound BalanceTransactionType = "obligation_reversal_outbound" - BalanceTransactionTypePayment BalanceTransactionType = "payment" - BalanceTransactionTypePaymentFailureRefund BalanceTransactionType = "payment_failure_refund" - BalanceTransactionTypePaymentRefund BalanceTransactionType = "payment_refund" - BalanceTransactionTypePaymentReversal BalanceTransactionType = "payment_reversal" - BalanceTransactionTypePaymentUnreconciled BalanceTransactionType = "payment_unreconciled" - BalanceTransactionTypePayout BalanceTransactionType = "payout" - BalanceTransactionTypePayoutCancel BalanceTransactionType = "payout_cancel" - BalanceTransactionTypePayoutFailure BalanceTransactionType = "payout_failure" - BalanceTransactionTypeRefund BalanceTransactionType = "refund" - BalanceTransactionTypeRefundFailure BalanceTransactionType = "refund_failure" - BalanceTransactionTypeReserveTransaction BalanceTransactionType = "reserve_transaction" - BalanceTransactionTypeReservedFunds BalanceTransactionType = "reserved_funds" - BalanceTransactionTypeStripeFee BalanceTransactionType = "stripe_fee" - BalanceTransactionTypeStripeFxFee BalanceTransactionType = "stripe_fx_fee" - BalanceTransactionTypeTaxFee BalanceTransactionType = "tax_fee" - BalanceTransactionTypeTopup BalanceTransactionType = "topup" - BalanceTransactionTypeTopupReversal BalanceTransactionType = "topup_reversal" - BalanceTransactionTypeTransfer BalanceTransactionType = "transfer" - BalanceTransactionTypeTransferCancel BalanceTransactionType = "transfer_cancel" - BalanceTransactionTypeTransferFailure BalanceTransactionType = "transfer_failure" - BalanceTransactionTypeTransferRefund BalanceTransactionType = "transfer_refund" + BalanceTransactionTypeAdjustment BalanceTransactionType = "adjustment" + BalanceTransactionTypeAdvance BalanceTransactionType = "advance" + BalanceTransactionTypeAdvanceFunding BalanceTransactionType = "advance_funding" + BalanceTransactionTypeAnticipationRepayment BalanceTransactionType = "anticipation_repayment" + BalanceTransactionTypeApplicationFee BalanceTransactionType = "application_fee" + BalanceTransactionTypeApplicationFeeRefund BalanceTransactionType = "application_fee_refund" + BalanceTransactionTypeCharge BalanceTransactionType = "charge" + BalanceTransactionTypeClimateOrderPurchase BalanceTransactionType = "climate_order_purchase" + BalanceTransactionTypeClimateOrderRefund BalanceTransactionType = "climate_order_refund" + BalanceTransactionTypeConnectCollectionTransfer BalanceTransactionType = "connect_collection_transfer" + BalanceTransactionTypeContribution BalanceTransactionType = "contribution" + BalanceTransactionTypeIssuingAuthorizationHold BalanceTransactionType = "issuing_authorization_hold" + BalanceTransactionTypeIssuingAuthorizationRelease BalanceTransactionType = "issuing_authorization_release" + BalanceTransactionTypeIssuingDispute BalanceTransactionType = "issuing_dispute" + BalanceTransactionTypeIssuingTransaction BalanceTransactionType = "issuing_transaction" + BalanceTransactionTypeObligationInbound BalanceTransactionType = "obligation_inbound" + BalanceTransactionTypeObligationOutbound BalanceTransactionType = "obligation_outbound" + BalanceTransactionTypeObligationPayout BalanceTransactionType = "obligation_payout" + BalanceTransactionTypeObligationPayoutFailure BalanceTransactionType = "obligation_payout_failure" + BalanceTransactionTypeObligationReversalInbound BalanceTransactionType = "obligation_reversal_inbound" + BalanceTransactionTypeObligationReversalOutbound BalanceTransactionType = "obligation_reversal_outbound" + BalanceTransactionTypePayment BalanceTransactionType = "payment" + BalanceTransactionTypePaymentFailureRefund BalanceTransactionType = "payment_failure_refund" + BalanceTransactionTypePaymentNetworkReserveHold BalanceTransactionType = "payment_network_reserve_hold" + BalanceTransactionTypePaymentNetworkReserveRelease BalanceTransactionType = "payment_network_reserve_release" + BalanceTransactionTypePaymentRefund BalanceTransactionType = "payment_refund" + BalanceTransactionTypePaymentReversal BalanceTransactionType = "payment_reversal" + BalanceTransactionTypePaymentUnreconciled BalanceTransactionType = "payment_unreconciled" + BalanceTransactionTypePayout BalanceTransactionType = "payout" + BalanceTransactionTypePayoutCancel BalanceTransactionType = "payout_cancel" + BalanceTransactionTypePayoutFailure BalanceTransactionType = "payout_failure" + BalanceTransactionTypeRefund BalanceTransactionType = "refund" + BalanceTransactionTypeRefundFailure BalanceTransactionType = "refund_failure" + BalanceTransactionTypeReserveTransaction BalanceTransactionType = "reserve_transaction" + BalanceTransactionTypeReservedFunds BalanceTransactionType = "reserved_funds" + BalanceTransactionTypeStripeFee BalanceTransactionType = "stripe_fee" + BalanceTransactionTypeStripeFxFee BalanceTransactionType = "stripe_fx_fee" + BalanceTransactionTypeTaxFee BalanceTransactionType = "tax_fee" + BalanceTransactionTypeTopup BalanceTransactionType = "topup" + BalanceTransactionTypeTopupReversal BalanceTransactionType = "topup_reversal" + BalanceTransactionTypeTransfer BalanceTransactionType = "transfer" + BalanceTransactionTypeTransferCancel BalanceTransactionType = "transfer_cancel" + BalanceTransactionTypeTransferFailure BalanceTransactionType = "transfer_failure" + BalanceTransactionTypeTransferRefund BalanceTransactionType = "transfer_refund" ) // Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. @@ -137,7 +139,7 @@ type BalanceTransactionListParams struct { Payout *string `form:"payout"` // Only returns the original transaction. Source *string `form:"source"` - // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Type *string `form:"type"` } @@ -208,7 +210,7 @@ type BalanceTransaction struct { Source *BalanceTransactionSource `json:"source"` // The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. Status BalanceTransactionStatus `json:"status"` - // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. Type BalanceTransactionType `json:"type"` } type BalanceTransactionSource struct { diff --git a/error.go b/error.go index 521f0fd6a5..98454219a5 100644 --- a/error.go +++ b/error.go @@ -65,10 +65,12 @@ const ( ErrorCodeCouponExpired ErrorCode = "coupon_expired" ErrorCodeCustomerMaxPaymentMethods ErrorCode = "customer_max_payment_methods" ErrorCodeCustomerMaxSubscriptions ErrorCode = "customer_max_subscriptions" + ErrorCodeCustomerTaxLocationInvalid ErrorCode = "customer_tax_location_invalid" ErrorCodeDebitNotAuthorized ErrorCode = "debit_not_authorized" ErrorCodeEmailInvalid ErrorCode = "email_invalid" ErrorCodeExpiredCard ErrorCode = "expired_card" ErrorCodeFinancialConnectionsAccountInactive ErrorCode = "financial_connections_account_inactive" + ErrorCodeFinancialConnectionsNoSuccessfulTransactionRefresh ErrorCode = "financial_connections_no_successful_transaction_refresh" ErrorCodeIdempotencyKeyInUse ErrorCode = "idempotency_key_in_use" ErrorCodeIncorrectAddress ErrorCode = "incorrect_address" ErrorCodeIncorrectCVC ErrorCode = "incorrect_cvc" diff --git a/paymentintent.go b/paymentintent.go index 9c91a38d04..f36d7fdfee 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -371,15 +371,13 @@ const ( PaymentIntentPaymentMethodOptionsCardRequestOvercaptureNever PaymentIntentPaymentMethodOptionsCardRequestOvercapture = "never" ) -// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. type PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure string // List of values that PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure can take const ( - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAny PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallenge PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge_only" + PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAny PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" + PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" ) // Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1291,7 +1289,7 @@ type PaymentIntentPaymentMethodOptionsCardParams struct { RequestMulticapture *string `form:"request_multicapture"` // Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. RequestOvercapture *string `form:"request_overcapture"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure *string `form:"request_three_d_secure"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -2631,7 +2629,7 @@ type PaymentIntentPaymentMethodOptionsCard struct { RequestMulticapture PaymentIntentPaymentMethodOptionsCardRequestMulticapture `json:"request_multicapture"` // Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. RequestOvercapture PaymentIntentPaymentMethodOptionsCardRequestOvercapture `json:"request_overcapture"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // diff --git a/paymentlink.go b/paymentlink.go index 7015592385..69dc204195 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -145,6 +145,16 @@ const ( PaymentLinkSubmitTypePay PaymentLinkSubmitType = "pay" ) +// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod string + +// List of values that PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod can take +const ( + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCancel PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "cancel" + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCreateInvoice PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "create_invoice" + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodPause PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "pause" +) + // Returns a list of your payment links. type PaymentLinkListParams struct { ListParams `form:"*"` @@ -375,6 +385,8 @@ type PaymentLinkPaymentIntentDataParams struct { StatementDescriptor *string `form:"statement_descriptor"` // Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` + // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + TransferGroup *string `form:"transfer_group"` } // AddMetadata adds a new key-value pair to the Metadata. @@ -394,6 +406,18 @@ type PaymentLinkPhoneNumberCollectionParams struct { Enabled *bool `form:"enabled"` } +// Configuration for the `completed_sessions` restriction type. +type PaymentLinkRestrictionsCompletedSessionsParams struct { + // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + Limit *int64 `form:"limit"` +} + +// Settings that restrict the usage of a payment link. +type PaymentLinkRestrictionsParams struct { + // Configuration for the `completed_sessions` restriction type. + CompletedSessions *PaymentLinkRestrictionsCompletedSessionsParams `form:"completed_sessions"` +} + // Configuration for collecting the customer's shipping address. type PaymentLinkShippingAddressCollectionParams struct { // An array of two-letter ISO country codes representing which countries Checkout should provide as options for @@ -407,6 +431,18 @@ type PaymentLinkShippingOptionParams struct { ShippingRate *string `form:"shipping_rate"` } +// Defines how the subscription should behave when the user's free trial ends. +type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams struct { + // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + MissingPaymentMethod *string `form:"missing_payment_method"` +} + +// Settings related to subscription trials. +type PaymentLinkSubscriptionDataTrialSettingsParams struct { + // Defines how the subscription should behave when the user's free trial ends. + EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams `form:"end_behavior"` +} + // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. type PaymentLinkSubscriptionDataParams struct { // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -415,6 +451,8 @@ type PaymentLinkSubscriptionDataParams struct { Metadata map[string]string `form:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. TrialPeriodDays *int64 `form:"trial_period_days"` + // Settings related to subscription trials. + TrialSettings *PaymentLinkSubscriptionDataTrialSettingsParams `form:"trial_settings"` } // AddMetadata adds a new key-value pair to the Metadata. @@ -472,6 +510,8 @@ type PaymentLinkParams struct { CustomText *PaymentLinkCustomTextParams `form:"custom_text"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` + // The custom message to be displayed to a customer when a payment link is no longer active. + InactiveMessage *string `form:"inactive_message"` // Generate a post-purchase Invoice for one-time payments. InvoiceCreation *PaymentLinkInvoiceCreationParams `form:"invoice_creation"` // The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. @@ -494,6 +534,8 @@ type PaymentLinkParams struct { // // We recommend that you review your privacy policy and check with your legal contacts. PhoneNumberCollection *PaymentLinkPhoneNumberCollectionParams `form:"phone_number_collection"` + // Settings that restrict the usage of a payment link. + Restrictions *PaymentLinkRestrictionsParams `form:"restrictions"` // Configuration for collecting the customer's shipping address. ShippingAddressCollection *PaymentLinkShippingAddressCollectionParams `form:"shipping_address_collection"` // The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. @@ -684,11 +726,24 @@ type PaymentLinkPaymentIntentData struct { StatementDescriptor string `json:"statement_descriptor"` // Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix string `json:"statement_descriptor_suffix"` + // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + TransferGroup string `json:"transfer_group"` } type PaymentLinkPhoneNumberCollection struct { // If `true`, a phone number will be collected during checkout. Enabled bool `json:"enabled"` } +type PaymentLinkRestrictionsCompletedSessions struct { + // The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + Count int64 `json:"count"` + // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + Limit int64 `json:"limit"` +} + +// Settings that restrict the usage of a payment link. +type PaymentLinkRestrictions struct { + CompletedSessions *PaymentLinkRestrictionsCompletedSessions `json:"completed_sessions"` +} // Configuration for collecting the customer's shipping address. type PaymentLinkShippingAddressCollection struct { @@ -704,6 +759,18 @@ type PaymentLinkShippingOption struct { ShippingRate *ShippingRate `json:"shipping_rate"` } +// Defines how a subscription behaves when a free trial ends. +type PaymentLinkSubscriptionDataTrialSettingsEndBehavior struct { + // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + MissingPaymentMethod PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod `json:"missing_payment_method"` +} + +// Settings related to subscription trials. +type PaymentLinkSubscriptionDataTrialSettings struct { + // Defines how a subscription behaves when a free trial ends. + EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehavior `json:"end_behavior"` +} + // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. type PaymentLinkSubscriptionData struct { // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -712,6 +779,8 @@ type PaymentLinkSubscriptionData struct { Metadata map[string]string `json:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. TrialPeriodDays int64 `json:"trial_period_days"` + // Settings related to subscription trials. + TrialSettings *PaymentLinkSubscriptionDataTrialSettings `json:"trial_settings"` } type PaymentLinkTaxIDCollection struct { // Indicates whether tax ID collection is enabled for the session. @@ -758,6 +827,8 @@ type PaymentLink struct { CustomText *PaymentLinkCustomText `json:"custom_text"` // Unique identifier for the object. ID string `json:"id"` + // The custom message to be displayed to a customer when a payment link is no longer active. + InactiveMessage string `json:"inactive_message"` // Configuration for creating invoice for payment mode payment links. InvoiceCreation *PaymentLinkInvoiceCreation `json:"invoice_creation"` // The line items representing what is being sold. @@ -777,6 +848,8 @@ type PaymentLink struct { // The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). PaymentMethodTypes []PaymentLinkPaymentMethodType `json:"payment_method_types"` PhoneNumberCollection *PaymentLinkPhoneNumberCollection `json:"phone_number_collection"` + // Settings that restrict the usage of a payment link. + Restrictions *PaymentLinkRestrictions `json:"restrictions"` // Configuration for collecting the customer's shipping address. ShippingAddressCollection *PaymentLinkShippingAddressCollection `json:"shipping_address_collection"` // The shipping rate options applied to the session. diff --git a/price.go b/price.go index 3073586bac..764c14534b 100644 --- a/price.go +++ b/price.go @@ -30,7 +30,7 @@ const ( PriceCurrencyOptionsTaxBehaviorUnspecified PriceCurrencyOptionsTaxBehavior = "unspecified" ) -// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. +// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. type PriceRecurringAggregateUsage string // List of values that PriceRecurringAggregateUsage can take @@ -242,7 +242,7 @@ func (p *PriceProductDataParams) AddMetadata(key string, value string) { // The recurring components of a price such as `interval` and `usage_type`. type PriceRecurringParams struct { - // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. AggregateUsage *string `form:"aggregate_usage"` // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` @@ -391,7 +391,7 @@ type PriceCustomUnitAmount struct { // The recurring components of a price such as `interval` and `usage_type`. type PriceRecurring struct { - // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. AggregateUsage PriceRecurringAggregateUsage `json:"aggregate_usage"` // The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. Interval PriceRecurringInterval `json:"interval"` diff --git a/setupintent.go b/setupintent.go index d7a88a69db..75ca4c74d0 100644 --- a/setupintent.go +++ b/setupintent.go @@ -155,7 +155,7 @@ const ( SetupIntentPaymentMethodOptionsCardNetworkVisa SetupIntentPaymentMethodOptionsCardNetwork = "visa" ) -// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. type SetupIntentPaymentMethodOptionsCardRequestThreeDSecure string // List of values that SetupIntentPaymentMethodOptionsCardRequestThreeDSecure can take @@ -633,7 +633,7 @@ type SetupIntentPaymentMethodOptionsCardParams struct { MOTO *bool `form:"moto"` // Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. Network *string `form:"network"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure *string `form:"request_three_d_secure"` // If 3D Secure authentication was performed with a third-party provider, // the authentication details to use for this setup. @@ -1247,7 +1247,7 @@ type SetupIntentPaymentMethodOptionsCard struct { MandateOptions *SetupIntentPaymentMethodOptionsCardMandateOptions `json:"mandate_options"` // Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. Network SetupIntentPaymentMethodOptionsCardNetwork `json:"network"` - // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure SetupIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } type SetupIntentPaymentMethodOptionsLink struct { From 2dc80757db8689ad01cef50d7a2c7d81873bcbdf Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 7 Dec 2023 13:12:48 -0800 Subject: [PATCH 16/18] Bump version to 76.8.0 --- CHANGELOG.md | 24 +++++++++++++++++++----- VERSION | 2 +- stripe.go | 2 +- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2851a04308..41aaeb1223 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 76.8.0 - 2023-12-07 +* [#1775](https://github.com/stripe/stripe-go/pull/1775) Update generated code + * Add support for `PaymentDetails`, `Payments`, and `Payouts` on `AccountSessionComponentsParams` and `AccountSessionComponents` + * Add support for `Features` on `AccountSessionComponentsAccountOnboardingParams` and `AccountSessionComponentsAccountOnboarding` + * Add support for new values `customer_tax_location_invalid` and `financial_connections_no_successful_transaction_refresh` on enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode` + * Add support for new values `payment_network_reserve_hold` and `payment_network_reserve_release` on enum `BalanceTransactionType` + * Remove support for value `various` from enum `ClimateSupplierRemovalPathway` + * Remove support for values `challenge_only` and `challenge` from enum `PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure` + * Add support for `InactiveMessage` and `Restrictions` on `PaymentLinkParams` and `PaymentLink` + * Add support for `TransferGroup` on `PaymentLinkPaymentIntentDataParams` and `PaymentLinkPaymentIntentData` + * Add support for `TrialSettings` on `PaymentLinkSubscriptionDataParams` and `PaymentLinkSubscriptionData` +* [#1777](https://github.com/stripe/stripe-go/pull/1777) Add back PlanParams.ProductID + * Add back `PlanParams.ProductID`, which was mistakenly removed starting in v73.0.0. `ProductID` allows creation of a plan for an existing product by serializing `product` as a string . + ## 76.7.0 - 2023-11-30 * [#1772](https://github.com/stripe/stripe-go/pull/1772) Update generated code * Add support for new resources `Climate.Order`, `Climate.Product`, and `Climate.Supplier` @@ -28,11 +42,11 @@ * [#1768](https://github.com/stripe/stripe-go/pull/1768) Update generated code * Add support for `Status` on `CheckoutSessionListParams` * [#1767](https://github.com/stripe/stripe-go/pull/1767) Update generated code - * Add support for `BACSDebitPayments` on `AccountSettingsParams` - * Add support for `ServiceUserNumber` on `AccountSettingsBacsDebitPayments` - * Add support for `CaptureBefore` on `ChargePaymentMethodDetailsCard` - * Add support for `Paypal` on `CheckoutSessionPaymentMethodOptions` - * Add support for `TaxAmounts` on `CreditNoteLinesParams`, `CreditNotePreviewLinesLinesParams`, and `CreditNotePreviewLinesParams` + * Add support for `BACSDebitPayments` on `AccountSettingsParams` + * Add support for `ServiceUserNumber` on `AccountSettingsBacsDebitPayments` + * Add support for `CaptureBefore` on `ChargePaymentMethodDetailsCard` + * Add support for `Paypal` on `CheckoutSessionPaymentMethodOptions` + * Add support for `TaxAmounts` on `CreditNoteLinesParams`, `CreditNotePreviewLinesLinesParams`, and `CreditNotePreviewLinesParams` * Add support for `NetworkData` on `IssuingTransaction` * [#1764](https://github.com/stripe/stripe-go/pull/1764) Fix TestDo_RetryOnTimeout flakiness diff --git a/VERSION b/VERSION index 9eff320458..0fbbf9be90 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -76.7.0 +76.8.0 diff --git a/stripe.go b/stripe.go index e74503e3ff..fd61b420ea 100644 --- a/stripe.go +++ b/stripe.go @@ -1226,7 +1226,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "76.7.0" +const clientversion = "76.8.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and From b606129184b3e90afd1e8a489c85aaabfd9ff66d Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 22:45:50 +0000 Subject: [PATCH 17/18] Update generated code for v706 --- OPENAPI_VERSION | 2 +- accountsession.go | 26 -------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index d9f690a6ce..9f6f080889 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v705 \ No newline at end of file +v706 \ No newline at end of file diff --git a/accountsession.go b/accountsession.go index 1679e7bec0..cecb8be715 100644 --- a/accountsession.go +++ b/accountsession.go @@ -17,28 +17,6 @@ type AccountSessionComponentsAccountOnboardingParams struct { Features *AccountSessionComponentsAccountOnboardingFeaturesParams `form:"features"` } -// The list of features enabled in the embedded component. -type AccountSessionComponentsIssuingCardFeaturesParams struct{} - -// Configuration for the issuing card component. -type AccountSessionComponentsIssuingCardParams struct { - // Whether the embedded component is enabled. - Enabled *bool `form:"enabled"` - // The list of features enabled in the embedded component. - Features *AccountSessionComponentsIssuingCardFeaturesParams `form:"features"` -} - -// The list of features enabled in the embedded component. -type AccountSessionComponentsIssuingCardsListFeaturesParams struct{} - -// Configuration for the issuing cards list component. -type AccountSessionComponentsIssuingCardsListParams struct { - // Whether the embedded component is enabled. - Enabled *bool `form:"enabled"` - // The list of features enabled in the embedded component. - Features *AccountSessionComponentsIssuingCardsListFeaturesParams `form:"features"` -} - // The list of features enabled in the embedded component. type AccountSessionComponentsPaymentDetailsFeaturesParams struct { // Whether to allow capturing and cancelling payment intents. This is `true` by default. @@ -90,10 +68,6 @@ type AccountSessionComponentsPayoutsParams struct { type AccountSessionComponentsParams struct { // Configuration for the account onboarding embedded component. AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"` - // Configuration for the issuing card component. - IssuingCard *AccountSessionComponentsIssuingCardParams `form:"issuing_card"` - // Configuration for the issuing cards list component. - IssuingCardsList *AccountSessionComponentsIssuingCardsListParams `form:"issuing_cards_list"` // Configuration for the payment details embedded component. PaymentDetails *AccountSessionComponentsPaymentDetailsParams `form:"payment_details"` // Configuration for the payments embedded component. From aea38163a42036a55399f677bb67e8ce6e7e05df Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:04:34 +0000 Subject: [PATCH 18/18] Update generated code for v708 --- OPENAPI_VERSION | 2 +- checkout_session.go | 46 +++++++++++++++++++++++++++++++++++++++++++++ paymentlink.go | 46 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9f6f080889..995f50db3f 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v706 \ No newline at end of file +v708 \ No newline at end of file diff --git a/checkout_session.go b/checkout_session.go index 325193bfdf..b11f2585d7 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -52,6 +52,17 @@ const ( CheckoutSessionConsentTermsOfServiceAccepted CheckoutSessionConsentTermsOfService = "accepted" ) +// Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. +// +// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. +type CheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition string + +// List of values that CheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition can take +const ( + CheckoutSessionConsentCollectionPaymentMethodReuseAgreementPositionAuto CheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition = "auto" + CheckoutSessionConsentCollectionPaymentMethodReuseAgreementPositionHidden CheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition = "hidden" +) + // If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout // Session will determine whether to display an option to opt into promotional communication // from the merchant depending on the customer's locale. Only available to US merchants. @@ -825,8 +836,17 @@ type CheckoutSessionAutomaticTaxParams struct { Liability *CheckoutSessionAutomaticTaxLiabilityParams `form:"liability"` } +// Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. +type CheckoutSessionConsentCollectionPaymentMethodReuseAgreementParams struct { + // Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's + // defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + Position *string `form:"position"` +} + // Configure fields for the Checkout Session to gather active consent from customers. type CheckoutSessionConsentCollectionParams struct { + // Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. + PaymentMethodReuseAgreement *CheckoutSessionConsentCollectionPaymentMethodReuseAgreementParams `form:"payment_method_reuse_agreement"` // If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout // Session will determine whether to display an option to opt into promotional communication // from the merchant depending on the customer's locale. Only available to US merchants. @@ -892,6 +912,12 @@ type CheckoutSessionCustomFieldParams struct { Type *string `form:"type"` } +// Custom text that should be displayed after the payment confirmation button. +type CheckoutSessionCustomTextAfterSubmitParams struct { + // Text may be up to 1200 characters in length. + Message *string `form:"message"` +} + // Custom text that should be displayed alongside shipping address collection. type CheckoutSessionCustomTextShippingAddressParams struct { // Text may be up to 1200 characters in length. @@ -912,6 +938,8 @@ type CheckoutSessionCustomTextTermsOfServiceAcceptanceParams struct { // Display additional text for your customers using custom text. type CheckoutSessionCustomTextParams struct { + // Custom text that should be displayed after the payment confirmation button. + AfterSubmit *CheckoutSessionCustomTextAfterSubmitParams `form:"after_submit"` // Custom text that should be displayed alongside shipping address collection. ShippingAddress *CheckoutSessionCustomTextShippingAddressParams `form:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button. @@ -2011,8 +2039,18 @@ type CheckoutSessionConsent struct { TermsOfService CheckoutSessionConsentTermsOfService `json:"terms_of_service"` } +// If set to `hidden`, it will hide legal text related to the reuse of a payment method. +type CheckoutSessionConsentCollectionPaymentMethodReuseAgreement struct { + // Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. + // + // When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + Position CheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition `json:"position"` +} + // When set, provides configuration for the Checkout Session to gather active consent from customers. type CheckoutSessionConsentCollection struct { + // If set to `hidden`, it will hide legal text related to the reuse of a payment method. + PaymentMethodReuseAgreement *CheckoutSessionConsentCollectionPaymentMethodReuseAgreement `json:"payment_method_reuse_agreement"` // If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout // Session will determine whether to display an option to opt into promotional communication // from the merchant depending on the customer's locale. Only available to US merchants. @@ -2083,6 +2121,12 @@ type CheckoutSessionCustomField struct { Type CheckoutSessionCustomFieldType `json:"type"` } +// Custom text that should be displayed after the payment confirmation button. +type CheckoutSessionCustomTextAfterSubmit struct { + // Text may be up to 1200 characters in length. + Message string `json:"message"` +} + // Custom text that should be displayed alongside shipping address collection. type CheckoutSessionCustomTextShippingAddress struct { // Text may be up to 1200 characters in length. @@ -2101,6 +2145,8 @@ type CheckoutSessionCustomTextTermsOfServiceAcceptance struct { Message string `json:"message"` } type CheckoutSessionCustomText struct { + // Custom text that should be displayed after the payment confirmation button. + AfterSubmit *CheckoutSessionCustomTextAfterSubmit `json:"after_submit"` // Custom text that should be displayed alongside shipping address collection. ShippingAddress *CheckoutSessionCustomTextShippingAddress `json:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button. diff --git a/paymentlink.go b/paymentlink.go index 37c920cac6..e7f9df9522 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -35,6 +35,17 @@ const ( PaymentLinkBillingAddressCollectionRequired PaymentLinkBillingAddressCollection = "required" ) +// Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. +// +// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. +type PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition string + +// List of values that PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition can take +const ( + PaymentLinkConsentCollectionPaymentMethodReuseAgreementPositionAuto PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition = "auto" + PaymentLinkConsentCollectionPaymentMethodReuseAgreementPositionHidden PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition = "hidden" +) + // If set to `auto`, enables the collection of customer consent for promotional communications. type PaymentLinkConsentCollectionPromotions string @@ -234,8 +245,17 @@ type PaymentLinkAutomaticTaxParams struct { Liability *PaymentLinkAutomaticTaxLiabilityParams `form:"liability"` } +// Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. +type PaymentLinkConsentCollectionPaymentMethodReuseAgreementParams struct { + // Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's + // defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + Position *string `form:"position"` +} + // Configure fields to gather active consent from customers. type PaymentLinkConsentCollectionParams struct { + // Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. + PaymentMethodReuseAgreement *PaymentLinkConsentCollectionPaymentMethodReuseAgreementParams `form:"payment_method_reuse_agreement"` // If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout // Session will determine whether to display an option to opt into promotional communication // from the merchant depending on the customer's locale. Only available to US merchants. @@ -301,6 +321,12 @@ type PaymentLinkCustomFieldParams struct { Type *string `form:"type"` } +// Custom text that should be displayed after the payment confirmation button. +type PaymentLinkCustomTextAfterSubmitParams struct { + // Text may be up to 1200 characters in length. + Message *string `form:"message"` +} + // Custom text that should be displayed alongside shipping address collection. type PaymentLinkCustomTextShippingAddressParams struct { // Text may be up to 1200 characters in length. @@ -321,6 +347,8 @@ type PaymentLinkCustomTextTermsOfServiceAcceptanceParams struct { // Display additional text for your customers using custom text. type PaymentLinkCustomTextParams struct { + // Custom text that should be displayed after the payment confirmation button. + AfterSubmit *PaymentLinkCustomTextAfterSubmitParams `form:"after_submit"` // Custom text that should be displayed alongside shipping address collection. ShippingAddress *PaymentLinkCustomTextShippingAddressParams `form:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button. @@ -669,8 +697,18 @@ type PaymentLinkAutomaticTax struct { Liability *PaymentLinkAutomaticTaxLiability `json:"liability"` } +// Settings related to the payment method reuse text shown in the Checkout UI. +type PaymentLinkConsentCollectionPaymentMethodReuseAgreement struct { + // Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. + // + // When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + Position PaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition `json:"position"` +} + // When set, provides configuration to gather active consent from customers. type PaymentLinkConsentCollection struct { + // Settings related to the payment method reuse text shown in the Checkout UI. + PaymentMethodReuseAgreement *PaymentLinkConsentCollectionPaymentMethodReuseAgreement `json:"payment_method_reuse_agreement"` // If set to `auto`, enables the collection of customer consent for promotional communications. Promotions PaymentLinkConsentCollectionPromotions `json:"promotions"` // If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service. @@ -721,6 +759,12 @@ type PaymentLinkCustomField struct { Type PaymentLinkCustomFieldType `json:"type"` } +// Custom text that should be displayed after the payment confirmation button. +type PaymentLinkCustomTextAfterSubmit struct { + // Text may be up to 1200 characters in length. + Message string `json:"message"` +} + // Custom text that should be displayed alongside shipping address collection. type PaymentLinkCustomTextShippingAddress struct { // Text may be up to 1200 characters in length. @@ -739,6 +783,8 @@ type PaymentLinkCustomTextTermsOfServiceAcceptance struct { Message string `json:"message"` } type PaymentLinkCustomText struct { + // Custom text that should be displayed after the payment confirmation button. + AfterSubmit *PaymentLinkCustomTextAfterSubmit `json:"after_submit"` // Custom text that should be displayed alongside shipping address collection. ShippingAddress *PaymentLinkCustomTextShippingAddress `json:"shipping_address"` // Custom text that should be displayed alongside the payment confirmation button.