diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 688708d739..078614f5b9 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v545 \ No newline at end of file +v565 \ No newline at end of file diff --git a/billingportal_session.go b/billingportal_session.go index e032604c6c..68547104f5 100644 --- a/billingportal_session.go +++ b/billingportal_session.go @@ -211,7 +211,7 @@ type BillingPortalSessionFlowSubscriptionUpdateConfirmDiscount struct { type BillingPortalSessionFlowSubscriptionUpdateConfirmItem struct { // The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. ID string `json:"id"` - // The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). + // The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). Price string `json:"price"` // [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. Quantity int64 `json:"quantity"` diff --git a/customercashbalancetransaction.go b/customercashbalancetransaction.go index 5478e08bc1..8c3697877b 100644 --- a/customercashbalancetransaction.go +++ b/customercashbalancetransaction.go @@ -72,7 +72,7 @@ func (p *CustomerCashBalanceTransactionListParams) AddExpand(f string) { } type CustomerCashBalanceTransactionAdjustedForOverdraft struct { - // The [Balance Transaction](docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. + // The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. BalanceTransaction *BalanceTransaction `json:"balance_transaction"` // The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. LinkedTransaction *CustomerCashBalanceTransaction `json:"linked_transaction"` diff --git a/event.go b/event.go index d155b7da85..366510e618 100644 --- a/event.go +++ b/event.go @@ -119,7 +119,6 @@ const ( EventTypeIssuingTransactionCreated EventType = "issuing_transaction.created" EventTypeIssuingTransactionUpdated EventType = "issuing_transaction.updated" EventTypeMandateUpdated EventType = "mandate.updated" - EventTypeOrderCreated EventType = "order.created" EventTypePaymentIntentAmountCapturableUpdated EventType = "payment_intent.amount_capturable_updated" EventTypePaymentIntentCanceled EventType = "payment_intent.canceled" EventTypePaymentIntentCreated EventType = "payment_intent.created" @@ -160,9 +159,6 @@ const ( EventTypeQuoteFinalized EventType = "quote.finalized" EventTypeRadarEarlyFraudWarningCreated EventType = "radar.early_fraud_warning.created" EventTypeRadarEarlyFraudWarningUpdated EventType = "radar.early_fraud_warning.updated" - EventTypeRecipientCreated EventType = "recipient.created" - EventTypeRecipientDeleted EventType = "recipient.deleted" - EventTypeRecipientUpdated EventType = "recipient.updated" EventTypeRefundCreated EventType = "refund.created" EventTypeRefundUpdated EventType = "refund.updated" EventTypeReportingReportRunFailed EventType = "reporting.report_run.failed" @@ -176,9 +172,6 @@ const ( EventTypeSetupIntentSetupFailed EventType = "setup_intent.setup_failed" EventTypeSetupIntentSucceeded EventType = "setup_intent.succeeded" EventTypeSigmaScheduledQueryRunCreated EventType = "sigma.scheduled_query_run.created" - EventTypeSKUCreated EventType = "sku.created" - EventTypeSKUDeleted EventType = "sku.deleted" - EventTypeSKUUpdated EventType = "sku.updated" EventTypeSourceCanceled EventType = "source.canceled" EventTypeSourceChargeable EventType = "source.chargeable" EventTypeSourceFailed EventType = "source.failed" @@ -240,6 +233,13 @@ const ( EventTypeTreasuryReceivedCreditSucceeded EventType = "treasury.received_credit.succeeded" EventTypeTreasuryReceivedDebitCreated EventType = "treasury.received_debit.created" EventTypeInvoiceItemUpdated EventType = "invoiceitem.updated" + EventTypeOrderCreated EventType = "order.created" + EventTypeRecipientCreated EventType = "recipient.created" + EventTypeRecipientDeleted EventType = "recipient.deleted" + EventTypeRecipientUpdated EventType = "recipient.updated" + EventTypeSKUCreated EventType = "sku.created" + EventTypeSKUDeleted EventType = "sku.deleted" + EventTypeSKUUpdated EventType = "sku.updated" ) // List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). diff --git a/example/generated_examples_test.go b/example/generated_examples_test.go index 410686a337..a000d76d9c 100644 --- a/example/generated_examples_test.go +++ b/example/generated_examples_test.go @@ -3563,3 +3563,10 @@ func TestTestHelpersIssuingTransactionRefund(t *testing.T) { assert.NotNil(t, result) assert.Nil(t, err) } + +func TestSubscriptionDeleteDiscount(t *testing.T) { + params := &stripe.SubscriptionDeleteDiscountParams{} + result, err := subscription.DeleteDiscount("sub_xyz", params) + assert.NotNil(t, result) + assert.Nil(t, err) +} diff --git a/invoice.go b/invoice.go index 65fcd49b6a..093b24ad5f 100644 --- a/invoice.go +++ b/invoice.go @@ -149,6 +149,16 @@ const ( InvoicePaymentSettingsPaymentMethodTypeWeChatPay InvoicePaymentSettingsPaymentMethodType = "wechat_pay" ) +// Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. +type InvoiceRenderingPDFPageSize string + +// List of values that InvoiceRenderingPDFPageSize can take +const ( + InvoiceRenderingPDFPageSizeA4 InvoiceRenderingPDFPageSize = "a4" + InvoiceRenderingPDFPageSizeAuto InvoiceRenderingPDFPageSize = "auto" + InvoiceRenderingPDFPageSizeLetter InvoiceRenderingPDFPageSize = "letter" +) + // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. type InvoiceShippingCostTaxTaxabilityReason string @@ -531,7 +541,22 @@ type InvoicePaymentSettingsParams struct { PaymentMethodTypes []*string `form:"payment_method_types"` } -// Options for invoice PDF rendering. +// Invoice pdf rendering options +type InvoiceRenderingPDFParams struct { + // Page size for invoice PDF. Can be set to a4, letter, or auto. + // If set to auto, page size will be switched to a4 or letter based on customer locale. + PageSize *string `form:"page_size"` +} + +// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. +type InvoiceRenderingParams struct { + // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + AmountTaxDisplay *string `form:"amount_tax_display"` + // Invoice pdf rendering options + PDF *InvoiceRenderingPDFParams `form:"pdf"` +} + +// This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. type InvoiceRenderingOptionsParams struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. AmountTaxDisplay *string `form:"amount_tax_display"` @@ -686,7 +711,9 @@ type InvoiceParams struct { PaymentSettings *InvoicePaymentSettingsParams `form:"payment_settings"` // How to handle pending invoice items on invoice creation. One of `include` or `exclude`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `exclude` if the parameter is omitted. PendingInvoiceItemsBehavior *string `form:"pending_invoice_items_behavior"` - // Options for invoice PDF rendering. + // The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + Rendering *InvoiceRenderingParams `form:"rendering"` + // This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. RenderingOptions *InvoiceRenderingOptionsParams `form:"rendering_options"` // Settings for the cost of shipping for this invoice. ShippingCost *InvoiceShippingCostParams `form:"shipping_cost"` @@ -1212,7 +1239,21 @@ type InvoicePaymentSettings struct { PaymentMethodTypes []InvoicePaymentSettingsPaymentMethodType `json:"payment_method_types"` } -// Options for invoice PDF rendering. +// Invoice pdf rendering options +type InvoiceRenderingPDF struct { + // Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. + PageSize InvoiceRenderingPDFPageSize `json:"page_size"` +} + +// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. +type InvoiceRendering struct { + // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + AmountTaxDisplay string `json:"amount_tax_display"` + // Invoice pdf rendering options + PDF *InvoiceRenderingPDF `json:"pdf"` +} + +// This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. type InvoiceRenderingOptions struct { // How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. AmountTaxDisplay string `json:"amount_tax_display"` @@ -1467,7 +1508,9 @@ type Invoice struct { Quote *Quote `json:"quote"` // This is the transaction number that appears on email receipts sent for this invoice. ReceiptNumber string `json:"receipt_number"` - // Options for invoice PDF rendering. + // The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + Rendering *InvoiceRendering `json:"rendering"` + // This is a legacy field that will be removed soon. For details about `rendering_options`, refer to `rendering` instead. Options for invoice PDF rendering. RenderingOptions *InvoiceRenderingOptions `json:"rendering_options"` // The details of the cost of shipping, including the ShippingRate applied on the invoice. ShippingCost *InvoiceShippingCost `json:"shipping_cost"` diff --git a/mandate.go b/mandate.go index 4e23c00295..17f4987378 100644 --- a/mandate.go +++ b/mandate.go @@ -8,7 +8,7 @@ package stripe import "encoding/json" -// The type of customer acceptance information included with the Mandate. One of `online` or `offline`. +// The mandate includes the type of customer acceptance information, such as: `online` or `offline`. type MandateCustomerAcceptanceType string // List of values that MandateCustomerAcceptanceType can take @@ -56,7 +56,7 @@ const ( MandatePaymentMethodDetailsBACSDebitNetworkStatusRevoked MandatePaymentMethodDetailsBACSDebitNetworkStatus = "revoked" ) -// The type of the payment method associated with this mandate. An additional hash is included on `payment_method_details` with a name matching this value. It contains mandate information specific to the payment method. +// This mandate corresponds with a specific payment method type. The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. type MandatePaymentMethodDetailsType string // List of values that MandatePaymentMethodDetailsType can take @@ -71,7 +71,7 @@ const ( MandatePaymentMethodDetailsTypeUSBankAccount MandatePaymentMethodDetailsType = "us_bank_account" ) -// The status of the mandate, which indicates whether it can be used to initiate a payment. +// The mandate status indicates whether or not you can use it to initiate a payment. type MandateStatus string // List of values that MandateStatus can take @@ -104,17 +104,17 @@ func (p *MandateParams) AddExpand(f string) { type MandateCustomerAcceptanceOffline struct{} type MandateCustomerAcceptanceOnline struct { - // The IP address from which the Mandate was accepted by the customer. + // The customer accepts the mandate from this IP address. IPAddress string `json:"ip_address"` - // The user agent of the browser from which the Mandate was accepted by the customer. + // The customer accepts the mandate using the user agent of the browser. UserAgent string `json:"user_agent"` } type MandateCustomerAcceptance struct { - // The time at which the customer accepted the Mandate. + // The time that the customer accepts the mandate. AcceptedAt int64 `json:"accepted_at"` Offline *MandateCustomerAcceptanceOffline `json:"offline"` Online *MandateCustomerAcceptanceOnline `json:"online"` - // The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + // The mandate includes the type of customer acceptance information, such as: `online` or `offline`. Type MandateCustomerAcceptanceType `json:"type"` } type MandateMultiUse struct{} @@ -165,18 +165,18 @@ type MandatePaymentMethodDetails struct { Link *MandatePaymentMethodDetailsLink `json:"link"` Paypal *MandatePaymentMethodDetailsPaypal `json:"paypal"` SEPADebit *MandatePaymentMethodDetailsSEPADebit `json:"sepa_debit"` - // The type of the payment method associated with this mandate. An additional hash is included on `payment_method_details` with a name matching this value. It contains mandate information specific to the payment method. + // This mandate corresponds with a specific payment method type. The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. Type MandatePaymentMethodDetailsType `json:"type"` USBankAccount *MandatePaymentMethodDetailsUSBankAccount `json:"us_bank_account"` } type MandateSingleUse struct { - // On a single use mandate, the amount of the payment. + // The amount of the payment on a single use mandate. Amount int64 `json:"amount"` - // On a single use mandate, the currency of the payment. + // The currency of the payment on a single use mandate. Currency Currency `json:"currency"` } -// A Mandate is a record of the permission a customer has given you to debit their payment method. +// A Mandate is a record of the permission that your customer gives you to debit their payment method. type Mandate struct { APIResource CustomerAcceptance *MandateCustomerAcceptance `json:"customer_acceptance"` @@ -187,13 +187,13 @@ type Mandate struct { MultiUse *MandateMultiUse `json:"multi_use"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // The account (if any) for which the mandate is intended. + // The account (if any) that the mandate is intended for. OnBehalfOf string `json:"on_behalf_of"` // ID of the payment method associated with this mandate. PaymentMethod *PaymentMethod `json:"payment_method"` PaymentMethodDetails *MandatePaymentMethodDetails `json:"payment_method_details"` SingleUse *MandateSingleUse `json:"single_use"` - // The status of the mandate, which indicates whether it can be used to initiate a payment. + // The mandate status indicates whether or not you can use it to initiate a payment. Status MandateStatus `json:"status"` // The type of the mandate. Type MandateType `json:"type"` diff --git a/paymentintent.go b/paymentintent.go index 3428491f04..c6f4d23255 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -784,7 +784,7 @@ func (p *PaymentIntentSearchParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this PaymentIntent's other parameters. +// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. type PaymentIntentAutomaticPaymentMethodsParams struct { // Controls whether this PaymentIntent will accept redirect-based payment methods. // @@ -1031,8 +1031,8 @@ type PaymentIntentPaymentMethodOptionsAfterpayClearpayParams struct { // // If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. CaptureMethod *string `form:"capture_method"` - // Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - // the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + // An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + // This field differs from the statement descriptor and item name. Reference *string `form:"reference"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -1565,7 +1565,7 @@ type PaymentIntentPaymentMethodOptionsZipParams struct { SetupFutureUsage *string `form:"setup_future_usage"` } -// Payment-method-specific configuration for this PaymentIntent. +// Payment method-specific configuration for this PaymentIntent. type PaymentIntentPaymentMethodOptionsParams struct { // If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. ACSSDebit *PaymentIntentPaymentMethodOptionsACSSDebitParams `form:"acss_debit"` @@ -1635,14 +1635,14 @@ type PaymentIntentPaymentMethodOptionsParams struct { Zip *PaymentIntentPaymentMethodOptionsZipParams `form:"zip"` } -// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +// Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). type PaymentIntentRadarOptionsParams struct { // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. Session *string `form:"session"` } -// The parameters used to automatically create a Transfer when the payment succeeds. -// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +// The parameters that you can use to automatically create a Transfer after the payment succeeds. +// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). type PaymentIntentTransferDataParams struct { // The amount that will be transferred automatically when a charge succeeds. // The amount is capped at the total transaction amount and if no amount is set, @@ -1662,26 +1662,26 @@ type PaymentIntentTransferDataParams struct { // Creates a PaymentIntent object. // // After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) -// to continue the payment. You can read more about the different payment flows -// available via the Payment Intents API [here](https://stripe.com/docs/payments/payment-intents). +// to continue the payment. Learn more about the available payment flows +// with the Payment Intents API. // -// When confirm=true is used during creation, it is equivalent to creating -// and confirming the PaymentIntent in the same call. You may use any parameters -// available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when confirm=true -// is supplied. +// When you use confirm=true during creation, it's equivalent to creating +// and confirming the PaymentIntent in the same call. You can use any parameters +// available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply +// confirm=true. type PaymentIntentParams struct { Params `form:"*"` // Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). Amount *int64 `form:"amount"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` - // When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this PaymentIntent's other parameters. + // When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. AutomaticPaymentMethods *PaymentIntentAutomaticPaymentMethodsParams `form:"automatic_payment_methods"` // Controls when the funds will be captured from the customer's account. CaptureMethod *string `form:"capture_method"` - // The client secret of the PaymentIntent. It's required if you use a publishable key to retrieve the source. + // The client secret of the PaymentIntent. We require it if you use a publishable key to retrieve the source. ClientSecret *string `form:"client_secret"` - // Set to `true` to attempt to [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, parameters available in the [confirm](https://stripe.com/docs/api/payment_intents/confirm) API may also be provided. + // Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). Confirm *bool `form:"confirm"` ConfirmationMethod *string `form:"confirmation_method"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -1696,17 +1696,17 @@ type PaymentIntentParams struct { Description *string `form:"description"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` - // ID of the mandate to be used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + // ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). Mandate *string `form:"mandate"` // This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). MandateData *PaymentIntentMandateDataParams `form:"mandate_data"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata map[string]string `form:"metadata"` - // The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + // The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). OnBehalfOf *string `form:"on_behalf_of"` // ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. // - // If neither the `payment_method` parameter nor the `source` parameter are provided with `confirm=true`, `source` will be automatically populated with `customer.default_source` to improve the migration experience for users of the Charges API. We recommend that you explicitly provide the `payment_method` going forward. + // If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. PaymentMethod *string `form:"payment_method"` // The ID of the payment method configuration to use with this PaymentIntent. PaymentMethodConfiguration *string `form:"payment_method_configuration"` @@ -1716,9 +1716,9 @@ type PaymentIntentParams struct { PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data"` // Payment-method-specific configuration for this PaymentIntent. PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"` - // The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. If this is not provided, defaults to ["card"]. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + // The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). PaymentMethodTypes []*string `form:"payment_method_types"` - // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + // Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). RadarOptions *PaymentIntentRadarOptionsParams `form:"radar_options"` // Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). ReceiptEmail *string `form:"receipt_email"` @@ -1734,19 +1734,19 @@ 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. Must contain at least one letter, maximum 22 characters. + // 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. 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. Maximum 22 characters for the concatenated 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"` - // The parameters used to automatically create a Transfer when the payment succeeds. - // For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + // The parameters that you can use to automatically create a Transfer after the payment succeeds. + // Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). TransferData *PaymentIntentTransferDataParams `form:"transfer_data"` // A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). TransferGroup *string `form:"transfer_group"` // These parameters apply only for paymentIntent.New with `confirm=true` - // Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + // Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). ErrorOnRequiresAction *bool `form:"error_on_requires_action"` - // Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + // Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). OffSession *bool `form:"off_session"` // Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. UseStripeSDK *bool `form:"use_stripe_sdk"` @@ -1769,11 +1769,11 @@ func (p *PaymentIntentParams) AddMetadata(key string, value string) { // Returns a list of PaymentIntents. type PaymentIntentListParams struct { ListParams `form:"*"` - // A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + // A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. Created *int64 `form:"created"` - // A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + // A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. CreatedRange *RangeQueryParams `form:"created"` - // Only return PaymentIntents for the customer specified by this customer ID. + // Only return PaymentIntents for the customer that this customer ID specifies. Customer *string `form:"customer"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` @@ -1784,7 +1784,7 @@ func (p *PaymentIntentListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +// Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). type PaymentIntentConfirmRadarOptionsParams struct { // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. Session *string `form:"session"` @@ -1821,11 +1821,10 @@ type PaymentIntentConfirmParams struct { ErrorOnRequiresAction *bool `form:"error_on_requires_action"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` - // ID of the mandate to be used for this payment. - Mandate *string `form:"mandate"` - // This hash contains details about the Mandate to create + // ID of the mandate that's used for this payment. + Mandate *string `form:"mandate"` MandateData *PaymentIntentMandateDataParams `form:"mandate_data"` - // Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + // Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). OffSession *bool `form:"off_session"` // ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. PaymentMethod *string `form:"payment_method"` @@ -1833,9 +1832,9 @@ type PaymentIntentConfirmParams struct { // in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) // property on the PaymentIntent. PaymentMethodData *PaymentIntentPaymentMethodDataParams `form:"payment_method_data"` - // Payment-method-specific configuration for this PaymentIntent. + // Payment method-specific configuration for this PaymentIntent. PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"` - // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + // Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). RadarOptions *PaymentIntentConfirmRadarOptionsParams `form:"radar_options"` // Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). ReceiptEmail *string `form:"receipt_email"` @@ -1862,14 +1861,14 @@ func (p *PaymentIntentConfirmParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. +// You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. // -// Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable will automatically be refunded. +// After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. // -// You cannot cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. +// You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. type PaymentIntentCancelParams struct { Params `form:"*"` - // Reason for canceling this PaymentIntent. Possible values are `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` + // Reason for canceling this PaymentIntent. Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` CancellationReason *string `form:"cancellation_reason"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` @@ -1882,12 +1881,12 @@ func (p *PaymentIntentCancelParams) AddExpand(f string) { // Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. // -// Uncaptured PaymentIntents will be canceled a set number of days after they are created (7 by default). +// Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. // // Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). type PaymentIntentCaptureParams struct { Params `form:"*"` - // The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. Defaults to the full `amount_capturable` if not provided. + // The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount is automatically refunded. Defaults to the full `amount_capturable` if it's not provided. AmountToCapture *int64 `form:"amount_to_capture"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` @@ -1897,10 +1896,10 @@ type PaymentIntentCaptureParams struct { 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. 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. Maximum 22 characters for the concatenated 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"` - // The parameters used to automatically create a Transfer when the payment - // is captured. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + // The parameters that you can use 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). TransferData *PaymentIntentTransferDataParams `form:"transfer_data"` } @@ -1918,8 +1917,8 @@ func (p *PaymentIntentCaptureParams) AddMetadata(key string, value string) { p.Metadata[key] = value } -// The parameters used to automatically create a Transfer when the payment is captured. -// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +// 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). type PaymentIntentIncrementAuthorizationTransferDataParams struct { // The amount that will be transferred automatically when a charge succeeds. Amount *int64 `form:"amount"` @@ -1932,26 +1931,26 @@ type PaymentIntentIncrementAuthorizationTransferDataParams struct { // must be true. // // Incremental authorizations attempt to increase the authorized amount on -// your customer's card to the new, higher amount provided. As with the -// initial authorization, incremental authorizations may be declined. A +// your customer's card to the new, higher amount provided. Similar to the +// initial authorization, incremental authorizations can be declined. A // single PaymentIntent can call this endpoint multiple times to further // increase the authorized amount. // -// If the incremental authorization succeeds, the PaymentIntent object is -// returned with the updated +// If the incremental authorization succeeds, the PaymentIntent object +// returns with the updated // [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). // If the incremental authorization fails, a -// [card_declined](https://stripe.com/docs/error-codes#card-declined) error is returned, and no -// fields on the PaymentIntent or Charge are updated. The PaymentIntent +// [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other +// fields on the PaymentIntent or Charge update. The PaymentIntent // object remains capturable for the previously authorized amount. // // Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. -// Once captured, a PaymentIntent can no longer be incremented. +// After it's captured, a PaymentIntent can no longer be incremented. // // Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). type PaymentIntentIncrementAuthorizationParams struct { Params `form:"*"` - // The updated total amount you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. + // The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. Amount *int64 `form:"amount"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). ApplicationFeeAmount *int64 `form:"application_fee_amount"` @@ -1963,8 +1962,8 @@ type PaymentIntentIncrementAuthorizationParams struct { 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. StatementDescriptor *string `form:"statement_descriptor"` - // The parameters used to automatically create a Transfer when the payment is captured. - // For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + // 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). TransferData *PaymentIntentIncrementAuthorizationTransferDataParams `form:"transfer_data"` } @@ -2001,13 +2000,13 @@ func (p *PaymentIntentVerifyMicrodepositsParams) AddExpand(f string) { // Manually reconcile the remaining amount for a customer_balance PaymentIntent. type PaymentIntentApplyCustomerBalanceParams struct { Params `form:"*"` - // Amount intended to be applied to this PaymentIntent from the customer's cash balance. + // Amount that you intend to apply to this PaymentIntent from the customer's cash balance. // - // A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + // A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). // // The maximum amount is the amount of the PaymentIntent. // - // When omitted, the amount defaults to the remaining amount requested on the PaymentIntent. + // When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. Amount *int64 `form:"amount"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency *string `form:"currency"` @@ -2363,8 +2362,8 @@ type PaymentIntentPaymentMethodOptionsAffirm struct { type PaymentIntentPaymentMethodOptionsAfterpayClearpay struct { // Controls when the funds will be captured from the customer's account. CaptureMethod PaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod `json:"capture_method"` - // Order identifier shown to the customer in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about - // the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + // An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + // This field differs from the statement descriptor and item name. Reference string `json:"reference"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -2783,12 +2782,12 @@ type PaymentIntentProcessing struct { Type PaymentIntentProcessingType `json:"type"` } -// The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. +// The data that automatically creates a Transfer after the payment finalizes. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). type PaymentIntentTransferData struct { // Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). Amount int64 `json:"amount"` - // The account (if any) the payment will be attributed to for tax - // reporting, and where funds from the payment will be transferred to upon + // The account (if any) that the payment is attributed to for tax + // reporting, and where funds from the payment are transferred to after // payment success. Destination *Account `json:"destination"` } @@ -2811,7 +2810,7 @@ type PaymentIntent struct { // Amount that can be captured from this PaymentIntent. AmountCapturable int64 `json:"amount_capturable"` AmountDetails *PaymentIntentAmountDetails `json:"amount_details"` - // Amount that was collected by this PaymentIntent. + // Amount that this PaymentIntent collects. AmountReceived int64 `json:"amount_received"` // ID of the Connect application that created the PaymentIntent. Application *Application `json:"application"` @@ -2850,11 +2849,11 @@ type PaymentIntent struct { Invoice *Invoice `json:"invoice"` // The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. LastPaymentError *Error `json:"last_payment_error"` - // The latest charge created by this payment intent. + // The latest charge created by this PaymentIntent. LatestCharge *Charge `json:"latest_charge"` // 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. For more information, see the [documentation](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). + // 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. Learn more about [storing information in metadata](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). Metadata map[string]string `json:"metadata"` // If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. NextAction *PaymentIntentNextAction `json:"next_action"` @@ -2892,9 +2891,9 @@ type PaymentIntent struct { StatementDescriptorSuffix string `json:"statement_descriptor_suffix"` // Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). Status PaymentIntentStatus `json:"status"` - // The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + // The data that automatically creates a Transfer after the payment finalizes. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). TransferData *PaymentIntentTransferData `json:"transfer_data"` - // 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. + // A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). TransferGroup string `json:"transfer_group"` } diff --git a/payout.go b/payout.go index c206fdefc1..9623d07b6c 100644 --- a/payout.go +++ b/payout.go @@ -16,7 +16,7 @@ const ( PayoutDestinationTypeCard PayoutDestinationType = "card" ) -// Error code explaining reason for payout failure if available. See [Types of payout failures](https://stripe.com/docs/api#payout_failures) for a list of failure codes. +// Error code that provides a reason for a payout failure, if available. View our [list of failure codes](https://stripe.com/docs/api#payout_failures). type PayoutFailureCode string // List of values that PayoutFailureCode can take @@ -38,7 +38,7 @@ const ( PayoutFailureCodeUnsupportedCard PayoutFailureCode = "unsupported_card" ) -// The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. (See [Bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks) for more information.) +// The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). type PayoutMethodType string // List of values that PayoutMethodType can take @@ -47,7 +47,7 @@ const ( PayoutMethodStandard PayoutMethodType = "standard" ) -// If `completed`, the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) may be used to list all Balance Transactions that were paid out in this payout. +// If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. type PayoutReconciliationStatus string // List of values that PayoutReconciliationStatus can take @@ -57,7 +57,7 @@ const ( PayoutReconciliationStatusNotApplicable PayoutReconciliationStatus = "not_applicable" ) -// The source balance this payout came from. One of `card`, `fpx`, or `bank_account`. +// The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. type PayoutSourceType string // List of values that PayoutSourceType can take @@ -67,7 +67,7 @@ const ( PayoutSourceTypeFPX PayoutSourceType = "fpx" ) -// Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it is submitted to the bank, when it becomes `in_transit`. The status then changes to `paid` if the transaction goes through, or to `failed` or `canceled` (within 5 business days). Some failed payouts may initially show as `paid` but then change to `failed`. +// Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). Some payouts that fail might initially show as `paid`, then change to `failed`. type PayoutStatus string // List of values that PayoutStatus can take @@ -88,7 +88,7 @@ const ( PayoutTypeCard PayoutType = "card" ) -// Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information. +// Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information. type PayoutParams struct { Params `form:"*"` // A positive integer in cents representing how much to payout. @@ -97,17 +97,17 @@ type PayoutParams struct { Currency *string `form:"currency"` // An arbitrary string attached to the object. Often useful for displaying to users. Description *string `form:"description"` - // The ID of a bank account or a card to send the payout to. If no destination is supplied, the default external account for the specified currency will be used. + // The ID of a bank account or a card to send the payout to. If you don't provide a destination, we use the default external account for the specified currency. Destination *string `form:"destination"` // 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"` - // The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. (See [Bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks) for more information.) + // The method used to send this payout, which is `standard` or `instant`. We support `instant` for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). Method *string `form:"method"` - // The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the balances API. One of `bank_account`, `card`, or `fpx`. + // The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the Balances API. One of `bank_account`, `card`, or `fpx`. SourceType *string `form:"source_type"` - // A string to be displayed on the recipient's bank or card statement. This may be at most 22 characters. Attempting to use a `statement_descriptor` longer than 22 characters will return an error. Note: Most banks will truncate this information and/or display it inconsistently. Some may not display it at all. + // A string that displays on the recipient's bank or card statement (up to 22 characters). A `statement_descriptor` that's longer than 22 characters return an error. Most banks truncate this information and display it inconsistently. Some banks might not display it at all. StatementDescriptor *string `form:"statement_descriptor"` } @@ -125,7 +125,7 @@ func (p *PayoutParams) AddMetadata(key string, value string) { p.Metadata[key] = value } -// Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent you. The payouts are returned in sorted order, with the most recently created payouts appearing first. +// Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. type PayoutListParams struct { ListParams `form:"*"` ArrivalDate *int64 `form:"arrival_date"` @@ -145,9 +145,9 @@ func (p *PayoutListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Reverses a payout by debiting the destination bank account. Only payouts for connected accounts to US bank accounts may be reversed at this time. If the payout is in the pending status, /v1/payouts/:id/cancel should be used instead. +// Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. // -// By requesting a reversal via /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account has authorized the debit on the bank account and that no other authorization is required. +// By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. type PayoutReverseParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. @@ -173,18 +173,18 @@ func (p *PayoutReverseParams) AddMetadata(key string, value string) { // A `Payout` object is created when you receive funds from Stripe, or when you // initiate a payout to either a bank account or debit card of a [connected // Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, -// as well as list all payouts. Payouts are made on [varying +// and list all payouts. Payouts are made on [varying // schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and // industry. // // Related guide: [Receiving payouts](https://stripe.com/docs/payouts) type Payout struct { APIResource - // Amount (in cents (or local equivalent)) to be transferred to your bank account or debit card. + // The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. Amount int64 `json:"amount"` - // Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays. + // Date that you can expect the payout to arrive in the bank. This factors in delays to account for weekends or bank holidays. ArrivalDate int64 `json:"arrival_date"` - // Returns `true` if the payout was created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule), and `false` if it was [requested manually](https://stripe.com/docs/payouts#manual-payouts). + // Returns `true` if the payout is created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule) and `false` if it's [requested manually](https://stripe.com/docs/payouts#manual-payouts). Automatic bool `json:"automatic"` // ID of the balance transaction that describes the impact of this payout on your account balance. BalanceTransaction *BalanceTransaction `json:"balance_transaction"` @@ -194,13 +194,13 @@ type Payout struct { Currency Currency `json:"currency"` // An arbitrary string attached to the object. Often useful for displaying to users. Description string `json:"description"` - // ID of the bank account or card the payout was sent to. + // ID of the bank account or card the payout is sent to. Destination *PayoutDestination `json:"destination"` - // If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. + // If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. FailureBalanceTransaction *BalanceTransaction `json:"failure_balance_transaction"` - // Error code explaining reason for payout failure if available. See [Types of payout failures](https://stripe.com/docs/api#payout_failures) for a list of failure codes. + // Error code that provides a reason for a payout failure, if available. View our [list of failure codes](https://stripe.com/docs/api#payout_failures). FailureCode PayoutFailureCode `json:"failure_code"` - // Message to user further explaining reason for payout failure if available. + // Message that provides the reason for a payout failure, if available. FailureMessage string `json:"failure_message"` // Unique identifier for the object. ID string `json:"id"` @@ -208,21 +208,21 @@ type Payout struct { Livemode bool `json:"livemode"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Metadata map[string]string `json:"metadata"` - // The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. (See [Bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks) for more information.) + // The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). Method PayoutMethodType `json:"method"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` // If the payout reverses another, this is the ID of the original payout. OriginalPayout *Payout `json:"original_payout"` - // If `completed`, the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) may be used to list all Balance Transactions that were paid out in this payout. + // If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. ReconciliationStatus PayoutReconciliationStatus `json:"reconciliation_status"` - // If the payout was reversed, this is the ID of the payout that reverses this payout. + // If the payout reverses, this is the ID of the payout that reverses this payout. ReversedBy *Payout `json:"reversed_by"` - // The source balance this payout came from. One of `card`, `fpx`, or `bank_account`. + // The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. SourceType PayoutSourceType `json:"source_type"` - // Extra information about a payout to be displayed on the user's bank statement. + // Extra information about a payout that displays on the user's bank statement. StatementDescriptor string `json:"statement_descriptor"` - // Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it is submitted to the bank, when it becomes `in_transit`. The status then changes to `paid` if the transaction goes through, or to `failed` or `canceled` (within 5 business days). Some failed payouts may initially show as `paid` but then change to `failed`. + // Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). Some payouts that fail might initially show as `paid`, then change to `failed`. Status PayoutStatus `json:"status"` // Can be `bank_account` or `card`. Type PayoutType `json:"type"` diff --git a/refund.go b/refund.go index 349ad91cb8..867e443753 100644 --- a/refund.go +++ b/refund.go @@ -8,7 +8,7 @@ package stripe import "encoding/json" -// If the refund failed, the reason for refund failure if known. Possible values are `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request` or `unknown`. +// Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. type RefundFailureReason string // List of values that RefundFailureReason can take @@ -18,7 +18,7 @@ const ( RefundFailureReasonUnknown RefundFailureReason = "unknown" ) -// Reason for the refund, either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). +// Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). type RefundReason string // List of values that RefundReason can take @@ -29,7 +29,7 @@ const ( RefundReasonRequestedByCustomer RefundReason = "requested_by_customer" ) -// Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Refer to our [refunds](https://stripe.com/docs/refunds#failed-refunds) documentation for more details. +// Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). type RefundStatus string // List of values that RefundStatus can take @@ -41,7 +41,7 @@ const ( RefundStatusRequiresAction RefundStatus = "requires_action" ) -// Returns a list of all refunds you've previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, the 10 most recent refunds are always available by default on the charge object. +// Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. type RefundListParams struct { ListParams `form:"*"` // Only return refunds for the charge specified by this charge ID. @@ -59,11 +59,21 @@ func (p *RefundListParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Create a refund. +// When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. +// +// Creating a new refund will refund a charge that has previously been created but not yet refunded. +// Funds will be refunded to the credit or debit card that was originally charged. +// +// You can optionally refund only part of a charge. +// You can do so multiple times, until the entire charge has been refunded. +// +// Once entirely refunded, a charge can't be refunded again. +// This method will raise an error when called on an already-refunded charge, +// or when trying to refund more money than is left on a charge. type RefundParams struct { Params `form:"*"` - // A positive integer representing how much to refund. - Amount *int64 `form:"amount"` + Amount *int64 `form:"amount"` + // The identifier of the charge to refund. Charge *string `form:"charge"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency *string `form:"currency"` @@ -76,11 +86,17 @@ type RefundParams struct { // 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"` // Origin of the refund - Origin *string `form:"origin"` - PaymentIntent *string `form:"payment_intent"` - Reason *string `form:"reason"` - RefundApplicationFee *bool `form:"refund_application_fee"` - ReverseTransfer *bool `form:"reverse_transfer"` + Origin *string `form:"origin"` + // The identifier of the PaymentIntent to refund. + PaymentIntent *string `form:"payment_intent"` + // String indicating the reason for the refund. If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. + Reason *string `form:"reason"` + // Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. + RefundApplicationFee *bool `form:"refund_application_fee"` + // Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). + // + // A transfer can be reversed only by the application that created the charge. + ReverseTransfer *bool `form:"reverse_transfer"` } // AddExpand appends a new field to expand. @@ -99,7 +115,7 @@ func (p *RefundParams) AddMetadata(key string, value string) { // Cancels a refund with a status of requires_action. // -// Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the requires_action state. +// You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. type RefundCancelParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. @@ -131,9 +147,9 @@ type RefundNextAction struct { Type string `json:"type"` } -// `Refund` objects allow you to refund a charge that has previously been created -// but not yet refunded. Funds will be refunded to the credit or debit card that -// was originally charged. +// Refund objects allow you to refund a previously created charge that isn't +// refunded yet. Funds are refunded to the credit or debit card that's +// initially charged. // // Related guide: [Refunds](https://stripe.com/docs/refunds) type Refund struct { @@ -142,38 +158,38 @@ type Refund struct { Amount int64 `json:"amount"` // Balance transaction that describes the impact on your account balance. BalanceTransaction *BalanceTransaction `json:"balance_transaction"` - // ID of the charge that was refunded. + // ID of the charge that's refunded. Charge *Charge `json:"charge"` // 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. Must be a [supported currency](https://stripe.com/docs/currencies). Currency Currency `json:"currency"` - // An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) + // An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). Description string `json:"description"` - // If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + // After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. FailureBalanceTransaction *BalanceTransaction `json:"failure_balance_transaction"` - // If the refund failed, the reason for refund failure if known. Possible values are `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request` or `unknown`. + // Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. FailureReason RefundFailureReason `json:"failure_reason"` // Unique identifier for the object. ID string `json:"id"` - // For payment methods without native refund support (e.g., Konbini, PromptPay), email for the customer to receive refund instructions. + // For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. InstructionsEmail string `json:"instructions_email"` // 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"` NextAction *RefundNextAction `json:"next_action"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // ID of the PaymentIntent that was refunded. + // ID of the PaymentIntent that's refunded. PaymentIntent *PaymentIntent `json:"payment_intent"` - // Reason for the refund, either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). + // Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). Reason RefundReason `json:"reason"` // This is the transaction number that appears on email receipts sent for this refund. ReceiptNumber string `json:"receipt_number"` - // The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. + // The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. SourceTransferReversal *TransferReversal `json:"source_transfer_reversal"` - // Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Refer to our [refunds](https://stripe.com/docs/refunds#failed-refunds) documentation for more details. + // Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). Status RefundStatus `json:"status"` - // If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. + // This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. TransferReversal *TransferReversal `json:"transfer_reversal"` } diff --git a/setupattempt.go b/setupattempt.go index 3b0c42e67d..bb2bff2c26 100644 --- a/setupattempt.go +++ b/setupattempt.go @@ -97,15 +97,15 @@ const ( SetupAttemptUsageOnSession SetupAttemptUsage = "on_session" ) -// Returns a list of SetupAttempts associated with a provided SetupIntent. +// Returns a list of SetupAttempts that associate with a provided SetupIntent. type SetupAttemptListParams struct { ListParams `form:"*"` // A filter on the list, based on the object `created` field. The value - // can be a string with an integer Unix timestamp, or it can be a + // can be a string with an integer Unix timestamp or a // dictionary with a number of different query options. Created *int64 `form:"created"` // A filter on the list, based on the object `created` field. The value - // can be a string with an integer Unix timestamp, or it can be a + // can be a string with an integer Unix timestamp or a // dictionary with a number of different query options. CreatedRange *RangeQueryParams `form:"created"` // Specifies which fields in the response should be expanded. @@ -276,7 +276,7 @@ type SetupAttemptPaymentMethodDetails struct { } // A SetupAttempt describes one attempted confirmation of a SetupIntent, -// whether that confirmation was successful or unsuccessful. You can use +// whether that confirmation is successful or unsuccessful. You can use // SetupAttempts to inspect details of a specific attempt at setting up a // payment method using a SetupIntent. type SetupAttempt struct { diff --git a/treasury_receivedcredit.go b/treasury_receivedcredit.go index 04c656e733..31afb55d6a 100644 --- a/treasury_receivedcredit.go +++ b/treasury_receivedcredit.go @@ -167,7 +167,7 @@ type TreasuryReceivedCreditLinkedFlowsSourceFlowDetails struct { // A `Payout` object is created when you receive funds from Stripe, or when you // initiate a payout to either a bank account or debit card of a [connected // Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, - // as well as list all payouts. Payouts are made on [varying + // and list all payouts. Payouts are made on [varying // schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and // industry. //