From f0874e76ff09cb2beacf835f7e65edf74171cf69 Mon Sep 17 00:00:00 2001
From: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com>
Date: Fri, 26 Aug 2022 13:22:02 -0400
Subject: [PATCH] API Updates (#1537)
---
OPENAPI_VERSION | 2 +-
billingportal_configuration.go | 21 ++++++++++++++++++++-
charge.go | 2 +-
invoice.go | 2 +-
issuing_card.go | 20 ++++++++++++++++++++
paymentmethod.go | 2 +-
quote.go | 4 ++++
subscriptionschedule.go | 8 ++++++++
8 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION
index c13f8f9598..2386eb3967 100644
--- a/OPENAPI_VERSION
+++ b/OPENAPI_VERSION
@@ -1 +1 @@
-v184
\ No newline at end of file
+v186
\ No newline at end of file
diff --git a/billingportal_configuration.go b/billingportal_configuration.go
index 1db858e01d..f5ac297276 100644
--- a/billingportal_configuration.go
+++ b/billingportal_configuration.go
@@ -175,6 +175,14 @@ type BillingPortalConfigurationFeaturesParams struct {
SubscriptionUpdate *BillingPortalConfigurationFeaturesSubscriptionUpdateParams `form:"subscription_update"`
}
+// The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share).
+type BillingPortalConfigurationLoginPageParams struct {
+ // Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal.
+ //
+ // Set to `false` to deactivate the `login_page.url`.
+ Enabled *bool `form:"enabled"`
+}
+
// Creates a configuration that describes the functionality and behavior of a PortalSession
type BillingPortalConfigurationParams struct {
Params `form:"*"`
@@ -186,6 +194,8 @@ type BillingPortalConfigurationParams struct {
DefaultReturnURL *string `form:"default_return_url"`
// Information about the features available in the portal.
Features *BillingPortalConfigurationFeaturesParams `form:"features"`
+ // The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share).
+ LoginPage *BillingPortalConfigurationLoginPageParams `form:"login_page"`
}
type BillingPortalConfigurationBusinessProfile struct {
// The messaging shown to customers in the portal.
@@ -254,6 +264,14 @@ type BillingPortalConfigurationFeatures struct {
SubscriptionPause *BillingPortalConfigurationFeaturesSubscriptionPause `json:"subscription_pause"`
SubscriptionUpdate *BillingPortalConfigurationFeaturesSubscriptionUpdate `json:"subscription_update"`
}
+type BillingPortalConfigurationLoginPage struct {
+ // If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal.
+ //
+ // If `false`, the previously generated `url`, if any, will be deactivated.
+ Enabled bool `json:"enabled"`
+ // A shareable URL to the hosted portal login page. Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal.
+ URL string `json:"url"`
+}
// A portal configuration describes the functionality and behavior of a portal session.
type BillingPortalConfiguration struct {
@@ -273,7 +291,8 @@ type BillingPortalConfiguration struct {
// Whether the configuration is the default. If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session.
IsDefault bool `json:"is_default"`
// 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"`
+ Livemode bool `json:"livemode"`
+ LoginPage *BillingPortalConfigurationLoginPage `json:"login_page"`
// 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"`
// String representing the object's type. Objects of the same type share the same value.
diff --git a/charge.go b/charge.go
index dd731f008d..4e40bd9d52 100644
--- a/charge.go
+++ b/charge.go
@@ -724,7 +724,7 @@ type ChargePaymentMethodDetailsCardPresent struct {
}
type ChargePaymentMethodDetailsCustomerBalance struct{}
type ChargePaymentMethodDetailsEPS struct {
- // The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
+ // The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
Bank string `json:"bank"`
// Owner's verified full name. Values are verified or provided by EPS directly
// (if supported) at the time of authorization or settlement. They cannot be set or mutated.
diff --git a/invoice.go b/invoice.go
index 62b75cbc39..2ea63bd4f1 100644
--- a/invoice.go
+++ b/invoice.go
@@ -324,7 +324,7 @@ type InvoiceTransferDataParams struct {
Destination *string `form:"destination"`
}
-// This endpoint creates a draft invoice for a given customer. The draft invoice created pulls in all pending invoice items on that customer, including prorations. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
+// This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
type InvoiceParams struct {
Params `form:"*"`
// The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
diff --git a/issuing_card.go b/issuing_card.go
index 76e2b0c1a3..83b98abf0c 100644
--- a/issuing_card.go
+++ b/issuing_card.go
@@ -145,12 +145,22 @@ type IssuingCardListParams struct {
Type *string `form:"type"`
}
+// Customs information for the shipment.
+type IssuingCardShippingCustomsParams struct {
+ // The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe.
+ EORINumber *string `form:"eori_number"`
+}
+
// The address where the card will be shipped.
type IssuingCardShippingParams struct {
// The address that the card is shipped to.
Address *AddressParams `form:"address"`
+ // Customs information for the shipment.
+ Customs *IssuingCardShippingCustomsParams `form:"customs"`
// The name printed on the shipping label when shipping the card.
Name *string `form:"name"`
+ // Phone number of the recipient of the shipment.
+ PhoneNumber *string `form:"phone_number"`
// Shipment service.
Service *string `form:"service"`
// Packaging options.
@@ -210,15 +220,25 @@ type IssuingCardPINParams struct {
EncryptedNumber *string `form:"encrypted_number"`
}
+// Additional information that may be required for clearing customs.
+type IssuingCardShippingCustoms struct {
+ // A registration number used for customs in Europe. See https://www.gov.uk/eori and https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en.
+ EORINumber string `json:"eori_number"`
+}
+
// Where and how the card will be shipped.
type IssuingCardShipping struct {
Address *Address `json:"address"`
// The delivery company that shipped a card.
Carrier IssuingCardShippingCarrier `json:"carrier"`
+ // Additional information that may be required for clearing customs.
+ Customs *IssuingCardShippingCustoms `json:"customs"`
// A unix timestamp representing a best estimate of when the card will be delivered.
ETA int64 `json:"eta"`
// Recipient name.
Name string `json:"name"`
+ // The phone number of the receiver of the bulk shipment. This phone number will be provided to the shipping company, who might use it to contact the receiver in case of delivery issues.
+ PhoneNumber string `json:"phone_number"`
// Shipment service, such as `standard` or `express`.
Service IssuingCardShippingService `json:"service"`
// The delivery status of the card.
diff --git a/paymentmethod.go b/paymentmethod.go
index 909e15f993..7fb37dc7b3 100644
--- a/paymentmethod.go
+++ b/paymentmethod.go
@@ -603,7 +603,7 @@ type PaymentMethodCard struct {
type PaymentMethodCardPresent struct{}
type PaymentMethodCustomerBalance struct{}
type PaymentMethodEPS struct {
- // The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
+ // The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.
Bank string `json:"bank"`
}
type PaymentMethodFPX struct {
diff --git a/quote.go b/quote.go
index 4bafc93829..868214092b 100644
--- a/quote.go
+++ b/quote.go
@@ -153,6 +153,8 @@ type QuoteLineItemParams struct {
// When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created.
type QuoteSubscriptionDataParams struct {
+ // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.
+ Description *string `form:"description"`
// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
EffectiveDate *int64 `form:"effective_date"`
EffectiveDateCurrentPeriodEnd *bool `form:"-"` // See custom AppendTo
@@ -357,6 +359,8 @@ type QuoteStatusTransitions struct {
FinalizedAt int64 `json:"finalized_at"`
}
type QuoteSubscriptionData struct {
+ // The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.
+ Description string `json:"description"`
// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch.
EffectiveDate int64 `json:"effective_date"`
// Integer representing the number of trial period days before the customer is charged for the first time.
diff --git a/subscriptionschedule.go b/subscriptionschedule.go
index 7791821203..5c1eb61ed9 100644
--- a/subscriptionschedule.go
+++ b/subscriptionschedule.go
@@ -108,6 +108,8 @@ type SubscriptionScheduleDefaultSettingsParams struct {
CollectionMethod *string `form:"collection_method"`
// ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
DefaultPaymentMethod *string `form:"default_payment_method"`
+ // Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.
+ Description *string `form:"description"`
// All invoices will be billed using the specified settings.
InvoiceSettings *SubscriptionScheduleDefaultSettingsInvoiceSettingsParams `form:"invoice_settings"`
// The data with which to automatically create a Transfer for each of the associated subscription's invoices.
@@ -176,6 +178,8 @@ type SubscriptionSchedulePhaseParams struct {
DefaultPaymentMethod *string `form:"default_payment_method"`
// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase.
DefaultTaxRates []*string `form:"default_tax_rates"`
+ // Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.
+ Description *string `form:"description"`
// The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.
EndDate *int64 `form:"end_date"`
EndDateNow *bool `form:"-"` // See custom AppendTo
@@ -282,6 +286,8 @@ type SubscriptionScheduleDefaultSettings struct {
CollectionMethod *SubscriptionCollectionMethod `json:"collection_method"`
// ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.
DefaultPaymentMethod *PaymentMethod `json:"default_payment_method"`
+ // Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.
+ Description string `json:"description"`
// The subscription schedule's default invoice settings.
InvoiceSettings *SubscriptionScheduleDefaultSettingsInvoiceSettings `json:"invoice_settings"`
// The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
@@ -339,6 +345,8 @@ type SubscriptionSchedulePhase struct {
DefaultPaymentMethod *PaymentMethod `json:"default_payment_method"`
// The default tax rates to apply to the subscription during this phase of the subscription schedule.
DefaultTaxRates []*TaxRate `json:"default_tax_rates"`
+ // Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.
+ Description string `json:"description"`
// The end of this phase of the subscription schedule.
EndDate int64 `json:"end_date"`
// The invoice settings applicable during this phase.