From e5c2c1b8f2ec660b3112fa48000c83c62036407d Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 16:36:55 -0400 Subject: [PATCH 01/12] Update generated code (#1853) Update generated code for v1008 Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- charge.go | 3 + dispute.go | 12 +++- error.go | 1 + invoice.go | 8 ++- paymentintent.go | 2 + tax_calculation.go | 15 +++++ tax_registration.go | 147 ++++++++++++++++++++++++++++++++++++++++++++ tax_transaction.go | 7 +++ 9 files changed, 192 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6eb80deb21..cb70129c35 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v992 \ No newline at end of file +v1008 \ No newline at end of file diff --git a/charge.go b/charge.go index e370011dff..bc6f2afce0 100644 --- a/charge.go +++ b/charge.go @@ -1044,6 +1044,8 @@ type ChargePaymentMethodDetailsLink struct { // You could use this attribute to get a sense of international fees. Country string `json:"country"` } + +// Internal card details type ChargePaymentMethodDetailsMobilepayCard struct { // Brand of the card used in the transaction Brand string `json:"brand"` @@ -1057,6 +1059,7 @@ type ChargePaymentMethodDetailsMobilepayCard struct { Last4 string `json:"last4"` } type ChargePaymentMethodDetailsMobilepay struct { + // Internal card details Card *ChargePaymentMethodDetailsMobilepayCard `json:"card"` } type ChargePaymentMethodDetailsMultibanco struct { diff --git a/dispute.go b/dispute.go index b51cfbc02a..790098e6f5 100644 --- a/dispute.go +++ b/dispute.go @@ -13,7 +13,8 @@ type DisputePaymentMethodDetailsType string // List of values that DisputePaymentMethodDetailsType can take const ( - DisputePaymentMethodDetailsTypeCard DisputePaymentMethodDetailsType = "card" + DisputePaymentMethodDetailsTypeCard DisputePaymentMethodDetailsType = "card" + DisputePaymentMethodDetailsTypePaypal DisputePaymentMethodDetailsType = "paypal" ) // Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). @@ -225,8 +226,15 @@ type DisputePaymentMethodDetailsCard struct { // The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. NetworkReasonCode string `json:"network_reason_code"` } +type DisputePaymentMethodDetailsPaypal struct { + // The ID of the dispute in PayPal. + CaseID string `json:"case_id"` + // The reason for the dispute as defined by PayPal + ReasonCode string `json:"reason_code"` +} type DisputePaymentMethodDetails struct { - Card *DisputePaymentMethodDetailsCard `json:"card"` + Card *DisputePaymentMethodDetailsCard `json:"card"` + Paypal *DisputePaymentMethodDetailsPaypal `json:"paypal"` // Payment method type. Type DisputePaymentMethodDetailsType `json:"type"` } diff --git a/error.go b/error.go index 1b4acf6377..1397a49201 100644 --- a/error.go +++ b/error.go @@ -175,6 +175,7 @@ const ( ErrorCodeSetupIntentMandateInvalid ErrorCode = "setup_intent_mandate_invalid" ErrorCodeSetupIntentSetupAttemptExpired ErrorCode = "setup_intent_setup_attempt_expired" ErrorCodeSetupIntentUnexpectedState ErrorCode = "setup_intent_unexpected_state" + ErrorCodeShippingAddressInvalid ErrorCode = "shipping_address_invalid" ErrorCodeShippingCalculationFailed ErrorCode = "shipping_calculation_failed" ErrorCodeStateUnsupported ErrorCode = "state_unsupported" ErrorCodeStatusTransitionInvalid ErrorCode = "status_transition_invalid" diff --git a/invoice.go b/invoice.go index 110d1dbb97..2ff45a3819 100644 --- a/invoice.go +++ b/invoice.go @@ -1127,6 +1127,8 @@ func (p *InvoiceUpcomingSubscriptionDetailsParams) AppendTo(body *form.Values, k // Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. // // You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) type InvoiceUpcomingParams struct { Params `form:"*"` // Settings for automatic tax lookup for this invoice preview. @@ -2478,6 +2480,8 @@ func (p *InvoiceCreatePreviewSubscriptionDetailsParams) AppendTo(body *form.Valu // Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. // // You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) type InvoiceCreatePreviewParams struct { Params `form:"*"` // Settings for automatic tax lookup for this invoice preview. @@ -2916,9 +2920,9 @@ type Invoice struct { // The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. PaymentIntent *PaymentIntent `json:"payment_intent"` PaymentSettings *InvoicePaymentSettings `json:"payment_settings"` - // End of the usage period during which invoice items were added to this invoice. + // End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. PeriodEnd int64 `json:"period_end"` - // Start of the usage period during which invoice items were added to this invoice. + // Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. PeriodStart int64 `json:"period_start"` // Total amount of all post-payment credit notes issued for this invoice. PostPaymentCreditNotesAmount int64 `json:"post_payment_credit_notes_amount"` diff --git a/paymentintent.go b/paymentintent.go index e75bd3ba03..2b498e9516 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -2177,6 +2177,8 @@ type PaymentIntentConfirmParams 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 (for example, a card) that this PaymentIntent can use. 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. 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). diff --git a/tax_calculation.go b/tax_calculation.go index da247fe8b2..9a1907ecd6 100644 --- a/tax_calculation.go +++ b/tax_calculation.go @@ -270,6 +270,12 @@ type TaxCalculationLineItemParams struct { TaxCode *string `form:"tax_code"` } +// Details about the address from which the goods are being shipped. +type TaxCalculationShipFromDetailsParams struct { + // The address from which the goods are being shipped from. + Address *AddressParams `form:"address"` +} + // Shipping cost details to be used for the calculation. type TaxCalculationShippingCostParams struct { // A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. @@ -295,6 +301,8 @@ type TaxCalculationParams struct { Expand []*string `form:"expand"` // A list of items the customer is purchasing. LineItems []*TaxCalculationLineItemParams `form:"line_items"` + // Details about the address from which the goods are being shipped. + ShipFromDetails *TaxCalculationShipFromDetailsParams `form:"ship_from_details"` // Shipping cost details to be used for the calculation. ShippingCost *TaxCalculationShippingCostParams `form:"shipping_cost"` // Timestamp of date at which the tax rules and rates in effect applies for the calculation. Measured in seconds since the Unix epoch. Can be up to 48 hours in the past, and up to 48 hours in the future. @@ -325,6 +333,11 @@ type TaxCalculationCustomerDetails struct { // The customer's tax IDs (for example, EU VAT numbers). TaxIDs []*TaxCalculationCustomerDetailsTaxID `json:"tax_ids"` } + +// The details of the ship from location, such as the address. +type TaxCalculationShipFromDetails struct { + Address *Address `json:"address"` +} type TaxCalculationShippingCostTaxBreakdownJurisdiction struct { // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Country string `json:"country"` @@ -422,6 +435,8 @@ type TaxCalculation struct { Livemode bool `json:"livemode"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` + // The details of the ship from location, such as the address. + ShipFromDetails *TaxCalculationShipFromDetails `json:"ship_from_details"` // The shipping cost details for the calculation. ShippingCost *TaxCalculationShippingCost `json:"shipping_cost"` // The amount of tax to be collected on top of the line item prices. diff --git a/tax_registration.go b/tax_registration.go index 9ced940bbf..218e46ca34 100644 --- a/tax_registration.go +++ b/tax_registration.go @@ -84,6 +84,14 @@ const ( TaxRegistrationCountryOptionsBGTypeStandard TaxRegistrationCountryOptionsBGType = "standard" ) +// Type of registration in `country`. +type TaxRegistrationCountryOptionsBhType string + +// List of values that TaxRegistrationCountryOptionsBhType can take +const ( + TaxRegistrationCountryOptionsBhTypeStandard TaxRegistrationCountryOptionsBhType = "standard" +) + // Type of registration in Canada. type TaxRegistrationCountryOptionsCaType string @@ -218,6 +226,14 @@ const ( TaxRegistrationCountryOptionsEeTypeStandard TaxRegistrationCountryOptionsEeType = "standard" ) +// Type of registration in `country`. +type TaxRegistrationCountryOptionsEgType string + +// List of values that TaxRegistrationCountryOptionsEgType can take +const ( + TaxRegistrationCountryOptionsEgTypeSimplified TaxRegistrationCountryOptionsEgType = "simplified" +) + // Place of supply scheme used in an EU standard registration. type TaxRegistrationCountryOptionsESStandardPlaceOfSupplyScheme string @@ -286,6 +302,14 @@ const ( TaxRegistrationCountryOptionsGBTypeStandard TaxRegistrationCountryOptionsGBType = "standard" ) +// Type of registration in `country`. +type TaxRegistrationCountryOptionsGeType string + +// List of values that TaxRegistrationCountryOptionsGeType can take +const ( + TaxRegistrationCountryOptionsGeTypeSimplified TaxRegistrationCountryOptionsGeType = "simplified" +) + // Place of supply scheme used in an EU standard registration. type TaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme string @@ -410,6 +434,14 @@ const ( TaxRegistrationCountryOptionsJPTypeStandard TaxRegistrationCountryOptionsJPType = "standard" ) +// Type of registration in `country`. +type TaxRegistrationCountryOptionsKeType string + +// List of values that TaxRegistrationCountryOptionsKeType can take +const ( + TaxRegistrationCountryOptionsKeTypeSimplified TaxRegistrationCountryOptionsKeType = "simplified" +) + // Type of registration in `country`. type TaxRegistrationCountryOptionsKrType string @@ -418,6 +450,14 @@ const ( TaxRegistrationCountryOptionsKrTypeSimplified TaxRegistrationCountryOptionsKrType = "simplified" ) +// Type of registration in `country`. +type TaxRegistrationCountryOptionsKzType string + +// List of values that TaxRegistrationCountryOptionsKzType can take +const ( + TaxRegistrationCountryOptionsKzTypeSimplified TaxRegistrationCountryOptionsKzType = "simplified" +) + // Place of supply scheme used in an EU standard registration. type TaxRegistrationCountryOptionsLTStandardPlaceOfSupplyScheme string @@ -514,6 +554,14 @@ const ( TaxRegistrationCountryOptionsMyTypeSimplified TaxRegistrationCountryOptionsMyType = "simplified" ) +// Type of registration in `country`. +type TaxRegistrationCountryOptionsNgType string + +// List of values that TaxRegistrationCountryOptionsNgType can take +const ( + TaxRegistrationCountryOptionsNgTypeSimplified TaxRegistrationCountryOptionsNgType = "simplified" +) + // Place of supply scheme used in an EU standard registration. type TaxRegistrationCountryOptionsNLStandardPlaceOfSupplyScheme string @@ -550,6 +598,14 @@ const ( TaxRegistrationCountryOptionsNzTypeStandard TaxRegistrationCountryOptionsNzType = "standard" ) +// Type of registration in `country`. +type TaxRegistrationCountryOptionsOmType string + +// List of values that TaxRegistrationCountryOptionsOmType can take +const ( + TaxRegistrationCountryOptionsOmTypeStandard TaxRegistrationCountryOptionsOmType = "standard" +) + // Place of supply scheme used in an EU standard registration. type TaxRegistrationCountryOptionsPLStandardPlaceOfSupplyScheme string @@ -807,6 +863,12 @@ type TaxRegistrationCountryOptionsBGParams struct { Type *string `form:"type"` } +// Options for the registration in BH. +type TaxRegistrationCountryOptionsBhParams struct { + // Type of registration to be created in `country`. + Type *string `form:"type"` +} + // Options for the provincial tax registration. type TaxRegistrationCountryOptionsCaProvinceStandardParams struct { // Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). @@ -909,6 +971,12 @@ type TaxRegistrationCountryOptionsEeParams struct { Type *string `form:"type"` } +// Options for the registration in EG. +type TaxRegistrationCountryOptionsEgParams struct { + // Type of registration to be created in `country`. + Type *string `form:"type"` +} + // Options for the standard registration. type TaxRegistrationCountryOptionsESStandardParams struct { // Place of supply scheme used in an EU standard registration. @@ -957,6 +1025,12 @@ type TaxRegistrationCountryOptionsGBParams struct { Type *string `form:"type"` } +// Options for the registration in GE. +type TaxRegistrationCountryOptionsGeParams struct { + // Type of registration to be created in `country`. + Type *string `form:"type"` +} + // Options for the standard registration. type TaxRegistrationCountryOptionsGrStandardParams struct { // Place of supply scheme used in an EU standard registration. @@ -1045,12 +1119,24 @@ type TaxRegistrationCountryOptionsJPParams struct { Type *string `form:"type"` } +// Options for the registration in KE. +type TaxRegistrationCountryOptionsKeParams struct { + // Type of registration to be created in `country`. + Type *string `form:"type"` +} + // Options for the registration in KR. type TaxRegistrationCountryOptionsKrParams struct { // Type of registration to be created in `country`. Type *string `form:"type"` } +// Options for the registration in KZ. +type TaxRegistrationCountryOptionsKzParams struct { + // Type of registration to be created in `country`. + Type *string `form:"type"` +} + // Options for the standard registration. type TaxRegistrationCountryOptionsLTStandardParams struct { // Place of supply scheme used in an EU standard registration. @@ -1119,6 +1205,12 @@ type TaxRegistrationCountryOptionsMyParams struct { Type *string `form:"type"` } +// Options for the registration in NG. +type TaxRegistrationCountryOptionsNgParams struct { + // Type of registration to be created in `country`. + Type *string `form:"type"` +} + // Options for the standard registration. type TaxRegistrationCountryOptionsNLStandardParams struct { // Place of supply scheme used in an EU standard registration. @@ -1145,6 +1237,12 @@ type TaxRegistrationCountryOptionsNzParams struct { Type *string `form:"type"` } +// Options for the registration in OM. +type TaxRegistrationCountryOptionsOmParams struct { + // Type of registration to be created in `country`. + Type *string `form:"type"` +} + // Options for the standard registration. type TaxRegistrationCountryOptionsPLStandardParams struct { // Place of supply scheme used in an EU standard registration. @@ -1301,6 +1399,8 @@ type TaxRegistrationCountryOptionsParams struct { Be *TaxRegistrationCountryOptionsBeParams `form:"be"` // Options for the registration in BG. BG *TaxRegistrationCountryOptionsBGParams `form:"bg"` + // Options for the registration in BH. + Bh *TaxRegistrationCountryOptionsBhParams `form:"bh"` // Options for the registration in CA. Ca *TaxRegistrationCountryOptionsCaParams `form:"ca"` // Options for the registration in CH. @@ -1319,6 +1419,8 @@ type TaxRegistrationCountryOptionsParams struct { Dk *TaxRegistrationCountryOptionsDkParams `form:"dk"` // Options for the registration in EE. Ee *TaxRegistrationCountryOptionsEeParams `form:"ee"` + // Options for the registration in EG. + Eg *TaxRegistrationCountryOptionsEgParams `form:"eg"` // Options for the registration in ES. ES *TaxRegistrationCountryOptionsESParams `form:"es"` // Options for the registration in FI. @@ -1327,6 +1429,8 @@ type TaxRegistrationCountryOptionsParams struct { FR *TaxRegistrationCountryOptionsFRParams `form:"fr"` // Options for the registration in GB. GB *TaxRegistrationCountryOptionsGBParams `form:"gb"` + // Options for the registration in GE. + Ge *TaxRegistrationCountryOptionsGeParams `form:"ge"` // Options for the registration in GR. Gr *TaxRegistrationCountryOptionsGrParams `form:"gr"` // Options for the registration in HR. @@ -1343,8 +1447,12 @@ type TaxRegistrationCountryOptionsParams struct { IT *TaxRegistrationCountryOptionsITParams `form:"it"` // Options for the registration in JP. JP *TaxRegistrationCountryOptionsJPParams `form:"jp"` + // Options for the registration in KE. + Ke *TaxRegistrationCountryOptionsKeParams `form:"ke"` // Options for the registration in KR. Kr *TaxRegistrationCountryOptionsKrParams `form:"kr"` + // Options for the registration in KZ. + Kz *TaxRegistrationCountryOptionsKzParams `form:"kz"` // Options for the registration in LT. LT *TaxRegistrationCountryOptionsLTParams `form:"lt"` // Options for the registration in LU. @@ -1357,12 +1465,16 @@ type TaxRegistrationCountryOptionsParams struct { MX *TaxRegistrationCountryOptionsMXParams `form:"mx"` // Options for the registration in MY. My *TaxRegistrationCountryOptionsMyParams `form:"my"` + // Options for the registration in NG. + Ng *TaxRegistrationCountryOptionsNgParams `form:"ng"` // Options for the registration in NL. NL *TaxRegistrationCountryOptionsNLParams `form:"nl"` // Options for the registration in NO. No *TaxRegistrationCountryOptionsNoParams `form:"no"` // Options for the registration in NZ. Nz *TaxRegistrationCountryOptionsNzParams `form:"nz"` + // Options for the registration in OM. + Om *TaxRegistrationCountryOptionsOmParams `form:"om"` // Options for the registration in PL. PL *TaxRegistrationCountryOptionsPLParams `form:"pl"` // Options for the registration in PT. @@ -1458,6 +1570,10 @@ type TaxRegistrationCountryOptionsBG struct { // Type of registration in an EU country. Type TaxRegistrationCountryOptionsBGType `json:"type"` } +type TaxRegistrationCountryOptionsBh struct { + // Type of registration in `country`. + Type TaxRegistrationCountryOptionsBhType `json:"type"` +} type TaxRegistrationCountryOptionsCaProvinceStandard struct { // Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). Province string `json:"province"` @@ -1524,6 +1640,10 @@ type TaxRegistrationCountryOptionsEe struct { // Type of registration in an EU country. Type TaxRegistrationCountryOptionsEeType `json:"type"` } +type TaxRegistrationCountryOptionsEg struct { + // Type of registration in `country`. + Type TaxRegistrationCountryOptionsEgType `json:"type"` +} type TaxRegistrationCountryOptionsESStandard struct { // Place of supply scheme used in an EU standard registration. PlaceOfSupplyScheme TaxRegistrationCountryOptionsESStandardPlaceOfSupplyScheme `json:"place_of_supply_scheme"` @@ -1555,6 +1675,10 @@ type TaxRegistrationCountryOptionsGB struct { // Type of registration in `country`. Type TaxRegistrationCountryOptionsGBType `json:"type"` } +type TaxRegistrationCountryOptionsGe struct { + // Type of registration in `country`. + Type TaxRegistrationCountryOptionsGeType `json:"type"` +} type TaxRegistrationCountryOptionsGrStandard struct { // Place of supply scheme used in an EU standard registration. PlaceOfSupplyScheme TaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme `json:"place_of_supply_scheme"` @@ -1612,10 +1736,18 @@ type TaxRegistrationCountryOptionsJP struct { // Type of registration in `country`. Type TaxRegistrationCountryOptionsJPType `json:"type"` } +type TaxRegistrationCountryOptionsKe struct { + // Type of registration in `country`. + Type TaxRegistrationCountryOptionsKeType `json:"type"` +} type TaxRegistrationCountryOptionsKr struct { // Type of registration in `country`. Type TaxRegistrationCountryOptionsKrType `json:"type"` } +type TaxRegistrationCountryOptionsKz struct { + // Type of registration in `country`. + Type TaxRegistrationCountryOptionsKzType `json:"type"` +} type TaxRegistrationCountryOptionsLTStandard struct { // Place of supply scheme used in an EU standard registration. PlaceOfSupplyScheme TaxRegistrationCountryOptionsLTStandardPlaceOfSupplyScheme `json:"place_of_supply_scheme"` @@ -1660,6 +1792,10 @@ type TaxRegistrationCountryOptionsMy struct { // Type of registration in `country`. Type TaxRegistrationCountryOptionsMyType `json:"type"` } +type TaxRegistrationCountryOptionsNg struct { + // Type of registration in `country`. + Type TaxRegistrationCountryOptionsNgType `json:"type"` +} type TaxRegistrationCountryOptionsNLStandard struct { // Place of supply scheme used in an EU standard registration. PlaceOfSupplyScheme TaxRegistrationCountryOptionsNLStandardPlaceOfSupplyScheme `json:"place_of_supply_scheme"` @@ -1677,6 +1813,10 @@ type TaxRegistrationCountryOptionsNz struct { // Type of registration in `country`. Type TaxRegistrationCountryOptionsNzType `json:"type"` } +type TaxRegistrationCountryOptionsOm struct { + // Type of registration in `country`. + Type TaxRegistrationCountryOptionsOmType `json:"type"` +} type TaxRegistrationCountryOptionsPLStandard struct { // Place of supply scheme used in an EU standard registration. PlaceOfSupplyScheme TaxRegistrationCountryOptionsPLStandardPlaceOfSupplyScheme `json:"place_of_supply_scheme"` @@ -1777,6 +1917,7 @@ type TaxRegistrationCountryOptions struct { Au *TaxRegistrationCountryOptionsAu `json:"au"` Be *TaxRegistrationCountryOptionsBe `json:"be"` BG *TaxRegistrationCountryOptionsBG `json:"bg"` + Bh *TaxRegistrationCountryOptionsBh `json:"bh"` Ca *TaxRegistrationCountryOptionsCa `json:"ca"` Ch *TaxRegistrationCountryOptionsCh `json:"ch"` Cl *TaxRegistrationCountryOptionsCl `json:"cl"` @@ -1786,10 +1927,12 @@ type TaxRegistrationCountryOptions struct { DE *TaxRegistrationCountryOptionsDE `json:"de"` Dk *TaxRegistrationCountryOptionsDk `json:"dk"` Ee *TaxRegistrationCountryOptionsEe `json:"ee"` + Eg *TaxRegistrationCountryOptionsEg `json:"eg"` ES *TaxRegistrationCountryOptionsES `json:"es"` FI *TaxRegistrationCountryOptionsFI `json:"fi"` FR *TaxRegistrationCountryOptionsFR `json:"fr"` GB *TaxRegistrationCountryOptionsGB `json:"gb"` + Ge *TaxRegistrationCountryOptionsGe `json:"ge"` Gr *TaxRegistrationCountryOptionsGr `json:"gr"` HR *TaxRegistrationCountryOptionsHR `json:"hr"` HU *TaxRegistrationCountryOptionsHU `json:"hu"` @@ -1798,16 +1941,20 @@ type TaxRegistrationCountryOptions struct { Is *TaxRegistrationCountryOptionsIs `json:"is"` IT *TaxRegistrationCountryOptionsIT `json:"it"` JP *TaxRegistrationCountryOptionsJP `json:"jp"` + Ke *TaxRegistrationCountryOptionsKe `json:"ke"` Kr *TaxRegistrationCountryOptionsKr `json:"kr"` + Kz *TaxRegistrationCountryOptionsKz `json:"kz"` LT *TaxRegistrationCountryOptionsLT `json:"lt"` Lu *TaxRegistrationCountryOptionsLu `json:"lu"` LV *TaxRegistrationCountryOptionsLV `json:"lv"` MT *TaxRegistrationCountryOptionsMT `json:"mt"` MX *TaxRegistrationCountryOptionsMX `json:"mx"` My *TaxRegistrationCountryOptionsMy `json:"my"` + Ng *TaxRegistrationCountryOptionsNg `json:"ng"` NL *TaxRegistrationCountryOptionsNL `json:"nl"` No *TaxRegistrationCountryOptionsNo `json:"no"` Nz *TaxRegistrationCountryOptionsNz `json:"nz"` + Om *TaxRegistrationCountryOptionsOm `json:"om"` PL *TaxRegistrationCountryOptionsPL `json:"pl"` PT *TaxRegistrationCountryOptionsPT `json:"pt"` RO *TaxRegistrationCountryOptionsRO `json:"ro"` diff --git a/tax_transaction.go b/tax_transaction.go index 8640d90125..a818dde6ef 100644 --- a/tax_transaction.go +++ b/tax_transaction.go @@ -329,6 +329,11 @@ type TaxTransactionReversal struct { // The `id` of the reversed `Transaction` object. OriginalTransaction string `json:"original_transaction"` } + +// The details of the ship from location, such as the address. +type TaxTransactionShipFromDetails struct { + Address *Address `json:"address"` +} type TaxTransactionShippingCostTaxBreakdownJurisdiction struct { // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Country string `json:"country"` @@ -407,6 +412,8 @@ type TaxTransaction struct { Reference string `json:"reference"` // If `type=reversal`, contains information about what was reversed. Reversal *TaxTransactionReversal `json:"reversal"` + // The details of the ship from location, such as the address. + ShipFromDetails *TaxTransactionShipFromDetails `json:"ship_from_details"` // The shipping cost details for the transaction. ShippingCost *TaxTransactionShippingCost `json:"shipping_cost"` // Timestamp of date at which the tax rules and rates in effect applies for the calculation. From f57c496d65437319f9899935ca37f766fcaeaf9f Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 2 May 2024 13:58:37 -0700 Subject: [PATCH 02/12] Bump version to 78.5.0 --- CHANGELOG.md | 13 +++++++++++++ VERSION | 2 +- stripe.go | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69e538781..de87699daa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 78.5.0 - 2024-05-02 +* [#1853](https://github.com/stripe/stripe-go/pull/1853) Update generated code + * Add support for new value `shipping_address_invalid` on enums `InvoiceLastFinalizationErrorCode`, `PaymentIntentLastPaymentErrorCode`, `SetupAttemptSetupErrorCode`, `SetupIntentLastSetupErrorCode`, and `StripeErrorCode` + * Add support for `Paypal` on `DisputePaymentMethodDetails` + * Change type of `DisputePaymentMethodDetailsType` from `literal('card')` to `enum('card'|'paypal')` + * Change type of `EntitlementsFeatureMetadataParams` from `map(string: string)` to `emptyable(map(string: string))` + * Add support for `PaymentMethodTypes` on `PaymentIntentConfirmParams` + * Add support for `ShipFromDetails` on `TaxCalculationParams`, `TaxCalculation`, and `TaxTransaction` + * Add support for `Bh`, `Eg`, `Ge`, `Ke`, `Kz`, `Ng`, and `Om` on `TaxRegistrationCountryOptionsParams` and `TaxRegistrationCountryOptions` +* [#1856](https://github.com/stripe/stripe-go/pull/1856) Deprecate Go methods and Params + - Mark as deprecated the `Approve` and `Decline` methods on `issuing/authorization/client.go`. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + - Mark as deprecated the `persistent_token` property on `ConfirmationTokenPaymentMethodPreviewLink.persistent_token`, `PaymentIntentPaymentMethodOptionsLink`, `PaymentIntentPaymentMethodOptionsLinkParams`, `PaymentMethodLink`, `SetupIntentPaymentMethodOptionsCard`, `SetupIntentPaymentMethodOptionsLinkParams`. This is a legacy parameter that no longer has any function. + ## 78.4.0 - 2024-04-25 * [#1852](https://github.com/stripe/stripe-go/pull/1852) Update generated code * Add support for `SetupFutureUsage` on `CheckoutSessionPaymentMethodOptionsAmazonPay`, `CheckoutSessionPaymentMethodOptionsRevolutPay`, `PaymentIntentPaymentMethodOptionsAmazonPay`, and `PaymentIntentPaymentMethodOptionsRevolutPay` diff --git a/VERSION b/VERSION index f87c7cf35a..64d58ba70a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -78.4.0 +78.5.0 diff --git a/stripe.go b/stripe.go index 295c26d921..f64fe760db 100644 --- a/stripe.go +++ b/stripe.go @@ -1279,7 +1279,7 @@ func StringSlice(v []string) []*string { // // clientversion is the binding version -const clientversion = "78.4.0" +const clientversion = "78.5.0" // defaultHTTPTimeout is the default timeout on the http.Client used by the library. // This is chosen to be consistent with the other Stripe language libraries and From 449d3b0290657ea415ae1e2c87ac415bdeda18a3 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 23:39:48 +0000 Subject: [PATCH 03/12] Update generated code for v1010 --- OPENAPI_VERSION | 2 +- capability.go | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7229c6339f..1cb7e2ff9e 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1009 \ No newline at end of file +v1010 \ No newline at end of file diff --git a/capability.go b/capability.go index 49eb08b296..35f2f35ac8 100644 --- a/capability.go +++ b/capability.go @@ -6,13 +6,11 @@ package stripe -// If the capability is disabled, this string describes why. Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.fraud`, `rejected.other`, `platform_paused`, `action_required.requested_capabilities`, `rejected.inactivty`, or `rejected.unsupported_business`. +// If the capability is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.other`, `platform_paused`, `rejected.inactivty`, or `rejected.unsupported_business`. // // `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service, such as in [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses). // // `rejected.inactivity` means that the capability has been paused for inactivity. This disabled reason currently only applies to the Issuing capability. See [Issuing: Managing Inactive Connects](https://support.stripe.com/questions/issuing-managing-inactive-connect-accounts) for more details. -// -// If you believe that a rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance. type CapabilityDisabledReason string // List of values that CapabilityDisabledReason can take @@ -117,13 +115,11 @@ type CapabilityRequirements struct { CurrentDeadline int64 `json:"current_deadline"` // Fields that need to be collected to keep the capability enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. CurrentlyDue []string `json:"currently_due"` - // If the capability is disabled, this string describes why. Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.fraud`, `rejected.other`, `platform_paused`, `action_required.requested_capabilities`, `rejected.inactivty`, or `rejected.unsupported_business`. + // If the capability is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `requirements.fields_needed`, `pending.onboarding`, `pending.review`, `rejected.other`, `platform_paused`, `rejected.inactivty`, or `rejected.unsupported_business`. // // `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service, such as in [Afterpay Clearpay's terms of service](https://stripe.com/afterpay-clearpay/legal#restricted-businesses). // // `rejected.inactivity` means that the capability has been paused for inactivity. This disabled reason currently only applies to the Issuing capability. See [Issuing: Managing Inactive Connects](https://support.stripe.com/questions/issuing-managing-inactive-connect-accounts) for more details. - // - // If you believe that a rejection is in error, please contact support at https://support.stripe.com/contact/ for assistance. DisabledReason CapabilityDisabledReason `json:"disabled_reason"` // Fields that are `currently_due` and need to be collected again because validation or verification failed. Errors []*AccountRequirementsError `json:"errors"` From 70583f547ca4699b892b417133f40815d1c9ca7b Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Mon, 6 May 2024 13:15:21 -0700 Subject: [PATCH 04/12] Update method descriptions to reflect OpenAPI (#1859) * Update method descriptions to OpenAPI descriptions * Fix stash and deprecated --- account/client.go | 74 +++++-- accountlink/client.go | 4 +- accountsession/client.go | 4 +- applepaydomain/client.go | 16 +- applicationfee/client.go | 8 +- apps/secret/client.go | 16 +- balance/client.go | 8 +- balancetransaction/client.go | 16 +- bankaccount/client.go | 29 ++- billing/meter/client.go | 24 +-- billing/meterevent/client.go | 4 +- billing/metereventadjustment/client.go | 4 +- billing/metereventsummary/client.go | 4 +- billingportal/configuration/client.go | 16 +- billingportal/session/client.go | 4 +- capability/client.go | 12 +- card/client.go | 15 +- cashbalance/client.go | 8 +- charge/client.go | 42 ++-- checkout/session/client.go | 24 ++- climate/order/client.go | 30 ++- climate/product/client.go | 8 +- climate/supplier/client.go | 8 +- confirmationtoken/client.go | 4 +- countryspec/client.go | 8 +- coupon/client.go | 24 ++- creditnote/client.go | 54 +++-- customer/client.go | 54 +++-- customerbalancetransaction/client.go | 16 +- customercashbalancetransaction/client.go | 8 +- customersession/client.go | 4 +- dispute/client.go | 24 ++- entitlements/activeentitlement/client.go | 8 +- entitlements/feature/client.go | 16 +- ephemeralkey/client.go | 8 +- event/client.go | 8 +- feerefund/client.go | 36 +++- file/client.go | 16 +- filelink/client.go | 16 +- financialconnections/account/client.go | 28 +-- financialconnections/session/client.go | 8 +- financialconnections/transaction/client.go | 8 +- forwarding/request/client.go | 12 +- identity/verificationreport/client.go | 8 +- identity/verificationsession/client.go | 88 ++++++-- invoice/client.go | 108 +++++++--- invoiceitem/client.go | 20 +- invoicelineitem/client.go | 10 +- issuing/authorization/client.go | 24 ++- issuing/card/client.go | 16 +- issuing/cardholder/client.go | 16 +- issuing/dispute/client.go | 20 +- issuing/personalizationdesign/client.go | 16 +- issuing/physicalbundle/client.go | 8 +- issuing/token/client.go | 12 +- issuing/transaction/client.go | 12 +- loginlink/client.go | 8 +- mandate/client.go | 4 +- paymentintent/client.go | 192 ++++++++++++++++-- paymentlink/client.go | 20 +- paymentmethod/client.go | 52 +++-- paymentmethodconfiguration/client.go | 16 +- paymentmethoddomain/client.go | 30 ++- paymentsource/client.go | 30 ++- payout/client.go | 36 ++-- person/client.go | 20 +- plan/client.go | 20 +- price/client.go | 26 ++- product/client.go | 30 +-- productfeature/client.go | 16 +- promotioncode/client.go | 16 +- quote/client.go | 40 ++-- radar/earlyfraudwarning/client.go | 12 +- radar/valuelist/client.go | 20 +- radar/valuelistitem/client.go | 16 +- refund/client.go | 48 ++++- reporting/reportrun/client.go | 12 +- reporting/reporttype/client.go | 8 +- review/client.go | 12 +- setupattempt/client.go | 4 +- setupintent/client.go | 72 +++++-- shippingrate/client.go | 16 +- sigma/scheduledqueryrun/client.go | 8 +- source/client.go | 20 +- sourcetransaction/client.go | 4 +- subscription/client.go | 94 +++++++-- subscriptionitem/client.go | 28 +-- subscriptionschedule/client.go | 24 +-- tax/calculation/client.go | 8 +- tax/registration/client.go | 20 +- tax/settings/client.go | 8 +- tax/transaction/client.go | 16 +- taxcode/client.go | 8 +- taxid/client.go | 16 +- taxrate/client.go | 16 +- terminal/configuration/client.go | 20 +- terminal/connectiontoken/client.go | 4 +- terminal/location/client.go | 22 +- terminal/reader/client.go | 40 ++-- testhelpers/confirmationtoken/client.go | 4 +- testhelpers/customer/client.go | 4 +- testhelpers/issuing/authorization/client.go | 20 +- testhelpers/issuing/card/client.go | 16 +- .../issuing/personalizationdesign/client.go | 12 +- testhelpers/issuing/transaction/client.go | 12 +- testhelpers/refund/client.go | 4 +- testhelpers/terminal/reader/client.go | 4 +- testhelpers/testclock/client.go | 20 +- .../treasury/inboundtransfer/client.go | 12 +- .../treasury/outboundpayment/client.go | 12 +- .../treasury/outboundtransfer/client.go | 12 +- testhelpers/treasury/receivedcredit/client.go | 4 +- testhelpers/treasury/receiveddebit/client.go | 4 +- token/client.go | 10 +- topup/client.go | 20 +- transfer/client.go | 20 +- transferreversal/client.go | 28 ++- treasury/creditreversal/client.go | 12 +- treasury/debitreversal/client.go | 12 +- treasury/financialaccount/client.go | 24 +-- treasury/inboundtransfer/client.go | 16 +- treasury/outboundpayment/client.go | 16 +- treasury/outboundtransfer/client.go | 16 +- treasury/receivedcredit/client.go | 8 +- treasury/receiveddebit/client.go | 8 +- treasury/transaction/client.go | 8 +- treasury/transactionentry/client.go | 8 +- usagerecord/client.go | 16 +- usagerecordsummary/client.go | 8 +- webhookendpoint/client.go | 20 +- 130 files changed, 1662 insertions(+), 956 deletions(-) diff --git a/account/client.go b/account/client.go index 5a3c375dd9..96dee409da 100644 --- a/account/client.go +++ b/account/client.go @@ -20,12 +20,22 @@ type Client struct { Key string } -// New creates a new account. +// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. +// To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). +// +// If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when +// creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. +// You can prefill any information on the account. func New(params *stripe.AccountParams) (*stripe.Account, error) { return getC().New(params) } -// New creates a new account. +// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. +// To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). +// +// If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when +// creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. +// You can prefill any information on the account. func (c Client) New(params *stripe.AccountParams) (*stripe.Account, error) { account := &stripe.Account{} err := c.B.Call(http.MethodPost, "/v1/accounts", c.Key, params, account) @@ -44,12 +54,12 @@ func (c Client) Get() (*stripe.Account, error) { return account, err } -// GetByID returns the details of an account. +// Retrieves the details of an account. func GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) { return getC().GetByID(id, params) } -// GetByID returns the details of an account. +// Retrieves the details of an account. func (c Client) GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s", id) account := &stripe.Account{} @@ -57,12 +67,36 @@ func (c Client) GetByID(id string, params *stripe.AccountParams) (*stripe.Accoun return account, err } -// Update updates an account's properties. +// Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are +// left unchanged. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is application, which includes Custom accounts, you can update any information on the account. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is stripe, which includes Standard and Express accounts, you can update all information until you create +// an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, +// after which some properties can no longer be updated. +// +// To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our +// [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. func Update(id string, params *stripe.AccountParams) (*stripe.Account, error) { return getC().Update(id, params) } -// Update updates an account's properties. +// Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are +// left unchanged. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is application, which includes Custom accounts, you can update any information on the account. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is stripe, which includes Standard and Express accounts, you can update all information until you create +// an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, +// after which some properties can no longer be updated. +// +// To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our +// [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. func (c Client) Update(id string, params *stripe.AccountParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s", id) account := &stripe.Account{} @@ -70,12 +104,24 @@ func (c Client) Update(id string, params *stripe.AccountParams) (*stripe.Account return account, err } -// Del removes an account. +// With [Connect](https://stripe.com/connect), you can delete accounts you manage. +// +// Test-mode accounts can be deleted at any time. +// +// Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. +// +// If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. func Del(id string, params *stripe.AccountParams) (*stripe.Account, error) { return getC().Del(id, params) } -// Del removes an account. +// With [Connect](https://stripe.com/connect), you can delete accounts you manage. +// +// Test-mode accounts can be deleted at any time. +// +// Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. +// +// If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. func (c Client) Del(id string, params *stripe.AccountParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s", id) account := &stripe.Account{} @@ -83,12 +129,16 @@ func (c Client) Del(id string, params *stripe.AccountParams) (*stripe.Account, e return account, err } -// Reject is the method for the `POST /v1/accounts/{account}/reject` API. +// With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. +// +// Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. func Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, error) { return getC().Reject(id, params) } -// Reject is the method for the `POST /v1/accounts/{account}/reject` API. +// With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. +// +// Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. func (c Client) Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s/reject", id) account := &stripe.Account{} @@ -96,12 +146,12 @@ func (c Client) Reject(id string, params *stripe.AccountRejectParams) (*stripe.A return account, err } -// List returns a list of accounts. +// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. func List(params *stripe.AccountListParams) *Iter { return getC().List(params) } -// List returns a list of accounts. +// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. func (c Client) List(listParams *stripe.AccountListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/accountlink/client.go b/accountlink/client.go index ffe70eb78f..5062be9805 100644 --- a/accountlink/client.go +++ b/accountlink/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new account link. +// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. func New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) { return getC().New(params) } -// New creates a new account link. +// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. func (c Client) New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) { accountlink := &stripe.AccountLink{} err := c.B.Call( diff --git a/accountsession/client.go b/accountsession/client.go index 729fa6631f..d415ff9207 100644 --- a/accountsession/client.go +++ b/accountsession/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new account session. +// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. func New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) { return getC().New(params) } -// New creates a new account session. +// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. func (c Client) New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) { accountsession := &stripe.AccountSession{} err := c.B.Call( diff --git a/applepaydomain/client.go b/applepaydomain/client.go index 79ae8d0554..36ccde950e 100644 --- a/applepaydomain/client.go +++ b/applepaydomain/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new apple pay domain. +// Create an apple pay domain. func New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().New(params) } -// New creates a new apple pay domain. +// Create an apple pay domain. func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { applepaydomain := &stripe.ApplePayDomain{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain return applepaydomain, err } -// Get returns the details of an apple pay domain. +// Retrieve an apple pay domain. func Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().Get(id, params) } -// Get returns the details of an apple pay domain. +// Retrieve an apple pay domain. func (c Client) Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { path := stripe.FormatURLPath("/v1/apple_pay/domains/%s", id) applepaydomain := &stripe.ApplePayDomain{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ApplePayDomainParams) (*stripe.App return applepaydomain, err } -// Del removes an apple pay domain. +// Delete an apple pay domain. func Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().Del(id, params) } -// Del removes an apple pay domain. +// Delete an apple pay domain. func (c Client) Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { path := stripe.FormatURLPath("/v1/apple_pay/domains/%s", id) applepaydomain := &stripe.ApplePayDomain{} @@ -64,12 +64,12 @@ func (c Client) Del(id string, params *stripe.ApplePayDomainParams) (*stripe.App return applepaydomain, err } -// List returns a list of apple pay domains. +// List apple pay domains. func List(params *stripe.ApplePayDomainListParams) *Iter { return getC().List(params) } -// List returns a list of apple pay domains. +// List apple pay domains. func (c Client) List(listParams *stripe.ApplePayDomainListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/applicationfee/client.go b/applicationfee/client.go index 59935b134f..decf73e0ab 100644 --- a/applicationfee/client.go +++ b/applicationfee/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an application fee. +// Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. func Get(id string, params *stripe.ApplicationFeeParams) (*stripe.ApplicationFee, error) { return getC().Get(id, params) } -// Get returns the details of an application fee. +// Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. func (c Client) Get(id string, params *stripe.ApplicationFeeParams) (*stripe.ApplicationFee, error) { path := stripe.FormatURLPath("/v1/application_fees/%s", id) applicationfee := &stripe.ApplicationFee{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ApplicationFeeParams) (*stripe.App return applicationfee, err } -// List returns a list of application fees. +// Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. func List(params *stripe.ApplicationFeeListParams) *Iter { return getC().List(params) } -// List returns a list of application fees. +// Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. func (c Client) List(listParams *stripe.ApplicationFeeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/apps/secret/client.go b/apps/secret/client.go index 6fdad4e5c9..e3c878a979 100644 --- a/apps/secret/client.go +++ b/apps/secret/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new apps secret. +// Create or replace a secret in the secret store. func New(params *stripe.AppsSecretParams) (*stripe.AppsSecret, error) { return getC().New(params) } -// New creates a new apps secret. +// Create or replace a secret in the secret store. func (c Client) New(params *stripe.AppsSecretParams) (*stripe.AppsSecret, error) { secret := &stripe.AppsSecret{} err := c.B.Call(http.MethodPost, "/v1/apps/secrets", c.Key, params, secret) return secret, err } -// DeleteWhere is the method for the `POST /v1/apps/secrets/delete` API. +// Deletes a secret from the secret store by name and scope. func DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe.AppsSecret, error) { return getC().DeleteWhere(params) } -// DeleteWhere is the method for the `POST /v1/apps/secrets/delete` API. +// Deletes a secret from the secret store by name and scope. func (c Client) DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe.AppsSecret, error) { secret := &stripe.AppsSecret{} err := c.B.Call( @@ -50,12 +50,12 @@ func (c Client) DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe return secret, err } -// Find is the method for the `GET /v1/apps/secrets/find` API. +// Finds a secret in the secret store by name and scope. func Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, error) { return getC().Find(params) } -// Find is the method for the `GET /v1/apps/secrets/find` API. +// Finds a secret in the secret store by name and scope. func (c Client) Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, error) { secret := &stripe.AppsSecret{} err := c.B.Call( @@ -68,12 +68,12 @@ func (c Client) Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, e return secret, err } -// List returns a list of apps secrets. +// List all secrets stored on the given scope. func List(params *stripe.AppsSecretListParams) *Iter { return getC().List(params) } -// List returns a list of apps secrets. +// List all secrets stored on the given scope. func (c Client) List(listParams *stripe.AppsSecretListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/balance/client.go b/balance/client.go index d9560ec473..a956010f6c 100644 --- a/balance/client.go +++ b/balance/client.go @@ -19,12 +19,16 @@ type Client struct { Key string } -// Get returns the details of a balance. +// Retrieves the current account balance, based on the authentication that was used to make the request. +// +// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). func Get(params *stripe.BalanceParams) (*stripe.Balance, error) { return getC().Get(params) } -// Get returns the details of a balance. +// Retrieves the current account balance, based on the authentication that was used to make the request. +// +// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). func (c Client) Get(params *stripe.BalanceParams) (*stripe.Balance, error) { balance := &stripe.Balance{} err := c.B.Call(http.MethodGet, "/v1/balance", c.Key, params, balance) diff --git a/balancetransaction/client.go b/balancetransaction/client.go index e924440713..d6b17ed34f 100644 --- a/balancetransaction/client.go +++ b/balancetransaction/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// Get returns the details of a balance transaction. +// Retrieves the balance transaction with the given ID. +// +// Note that this endpoint previously used the path /v1/balance/history/:id. func Get(id string, params *stripe.BalanceTransactionParams) (*stripe.BalanceTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a balance transaction. +// Retrieves the balance transaction with the given ID. +// +// Note that this endpoint previously used the path /v1/balance/history/:id. func (c Client) Get(id string, params *stripe.BalanceTransactionParams) (*stripe.BalanceTransaction, error) { path := stripe.FormatURLPath("/v1/balance_transactions/%s", id) balancetransaction := &stripe.BalanceTransaction{} @@ -33,12 +37,16 @@ func (c Client) Get(id string, params *stripe.BalanceTransactionParams) (*stripe return balancetransaction, err } -// List returns a list of balance transactions. +// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. +// +// Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. func List(params *stripe.BalanceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of balance transactions. +// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. +// +// Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. func (c Client) List(listParams *stripe.BalanceTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/bankaccount/client.go b/bankaccount/client.go index 9472ecbfb5..59310dcea7 100644 --- a/bankaccount/client.go +++ b/bankaccount/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new bank account. +// New creates a new bank account func New(params *stripe.BankAccountParams) (*stripe.BankAccount, error) { return getC().New(params) } -// New creates a new bank account. +// New creates a new bank account func (c Client) New(params *stripe.BankAccountParams) (*stripe.BankAccount, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -81,12 +81,26 @@ func (c Client) Get(id string, params *stripe.BankAccountParams) (*stripe.BankAc return bankaccount, err } -// Update updates a bank account's properties. +// Updates the metadata, account holder name, account holder type of a bank account belonging to +// a connected account and optionally sets it as the default for its currency. Other bank account +// details are not editable by design. +// +// You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). +// +// You can re-enable a disabled bank account by performing an update call without providing any +// arguments or changes. func Update(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { return getC().Update(id, params) } -// Update updates a bank account's properties. +// Updates the metadata, account holder name, account holder type of a bank account belonging to +// a connected account and optionally sets it as the default for its currency. Other bank account +// details are not editable by design. +// +// You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). +// +// You can re-enable a disabled bank account by performing an update call without providing any +// arguments or changes. func (c Client) Update(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -106,12 +120,12 @@ func (c Client) Update(id string, params *stripe.BankAccountParams) (*stripe.Ban return bankaccount, err } -// Del removes a bank account. +// Delete a specified external account for a given account. func Del(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { return getC().Del(id, params) } -// Del removes a bank account. +// Delete a specified external account for a given account. func (c Client) Del(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -130,13 +144,10 @@ func (c Client) Del(id string, params *stripe.BankAccountParams) (*stripe.BankAc err := c.B.Call(http.MethodDelete, path, c.Key, params, bankaccount) return bankaccount, err } - -// List returns a list of bank accounts. func List(params *stripe.BankAccountListParams) *Iter { return getC().List(params) } -// List returns a list of bank accounts. func (c Client) List(listParams *stripe.BankAccountListParams) *Iter { var path string var outerErr error diff --git a/billing/meter/client.go b/billing/meter/client.go index 57d21e7c7d..4b02eae189 100644 --- a/billing/meter/client.go +++ b/billing/meter/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new billing meter. +// Creates a billing meter func New(params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { return getC().New(params) } -// New creates a new billing meter. +// Creates a billing meter func (c Client) New(params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { meter := &stripe.BillingMeter{} err := c.B.Call(http.MethodPost, "/v1/billing/meters", c.Key, params, meter) return meter, err } -// Get returns the details of a billing meter. +// Retrieves a billing meter given an ID func Get(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { return getC().Get(id, params) } -// Get returns the details of a billing meter. +// Retrieves a billing meter given an ID func (c Client) Get(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s", id) meter := &stripe.BillingMeter{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.BillingMeterParams) (*stripe.Billi return meter, err } -// Update updates a billing meter's properties. +// Updates a billing meter func Update(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { return getC().Update(id, params) } -// Update updates a billing meter's properties. +// Updates a billing meter func (c Client) Update(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s", id) meter := &stripe.BillingMeter{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.BillingMeterParams) (*stripe.Bi return meter, err } -// Deactivate is the method for the `POST /v1/billing/meters/{id}/deactivate` API. +// Deactivates a billing meter func Deactivate(id string, params *stripe.BillingMeterDeactivateParams) (*stripe.BillingMeter, error) { return getC().Deactivate(id, params) } -// Deactivate is the method for the `POST /v1/billing/meters/{id}/deactivate` API. +// Deactivates a billing meter func (c Client) Deactivate(id string, params *stripe.BillingMeterDeactivateParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s/deactivate", id) meter := &stripe.BillingMeter{} @@ -71,12 +71,12 @@ func (c Client) Deactivate(id string, params *stripe.BillingMeterDeactivateParam return meter, err } -// Reactivate is the method for the `POST /v1/billing/meters/{id}/reactivate` API. +// Reactivates a billing meter func Reactivate(id string, params *stripe.BillingMeterReactivateParams) (*stripe.BillingMeter, error) { return getC().Reactivate(id, params) } -// Reactivate is the method for the `POST /v1/billing/meters/{id}/reactivate` API. +// Reactivates a billing meter func (c Client) Reactivate(id string, params *stripe.BillingMeterReactivateParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s/reactivate", id) meter := &stripe.BillingMeter{} @@ -84,12 +84,12 @@ func (c Client) Reactivate(id string, params *stripe.BillingMeterReactivateParam return meter, err } -// List returns a list of billing meters. +// Retrieve a list of billing meters. func List(params *stripe.BillingMeterListParams) *Iter { return getC().List(params) } -// List returns a list of billing meters. +// Retrieve a list of billing meters. func (c Client) List(listParams *stripe.BillingMeterListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/billing/meterevent/client.go b/billing/meterevent/client.go index b51d877382..a99594b9a4 100644 --- a/billing/meterevent/client.go +++ b/billing/meterevent/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new billing meter event. +// Creates a billing meter event func New(params *stripe.BillingMeterEventParams) (*stripe.BillingMeterEvent, error) { return getC().New(params) } -// New creates a new billing meter event. +// Creates a billing meter event func (c Client) New(params *stripe.BillingMeterEventParams) (*stripe.BillingMeterEvent, error) { meterevent := &stripe.BillingMeterEvent{} err := c.B.Call( diff --git a/billing/metereventadjustment/client.go b/billing/metereventadjustment/client.go index 3db0c17513..625ef3d649 100644 --- a/billing/metereventadjustment/client.go +++ b/billing/metereventadjustment/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new billing meter event adjustment. +// Creates a billing meter event adjustment func New(params *stripe.BillingMeterEventAdjustmentParams) (*stripe.BillingMeterEventAdjustment, error) { return getC().New(params) } -// New creates a new billing meter event adjustment. +// Creates a billing meter event adjustment func (c Client) New(params *stripe.BillingMeterEventAdjustmentParams) (*stripe.BillingMeterEventAdjustment, error) { metereventadjustment := &stripe.BillingMeterEventAdjustment{} err := c.B.Call( diff --git a/billing/metereventsummary/client.go b/billing/metereventsummary/client.go index faa46aee6c..368170b150 100644 --- a/billing/metereventsummary/client.go +++ b/billing/metereventsummary/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// List returns a list of billing meter event summaries. +// Retrieve a list of billing meter event summaries. func List(params *stripe.BillingMeterEventSummaryListParams) *Iter { return getC().List(params) } -// List returns a list of billing meter event summaries. +// Retrieve a list of billing meter event summaries. func (c Client) List(listParams *stripe.BillingMeterEventSummaryListParams) *Iter { path := stripe.FormatURLPath( "/v1/billing/meters/%s/event_summaries", diff --git a/billingportal/configuration/client.go b/billingportal/configuration/client.go index 4adfc6eb6d..7554b59ce7 100644 --- a/billingportal/configuration/client.go +++ b/billingportal/configuration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new billing portal configuration. +// Creates a configuration that describes the functionality and behavior of a PortalSession func New(params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { return getC().New(params) } -// New creates a new billing portal configuration. +// Creates a configuration that describes the functionality and behavior of a PortalSession func (c Client) New(params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { configuration := &stripe.BillingPortalConfiguration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.BillingPortalConfigurationParams) (*stripe.Bi return configuration, err } -// Get returns the details of a billing portal configuration. +// Retrieves a configuration that describes the functionality of the customer portal. func Get(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { return getC().Get(id, params) } -// Get returns the details of a billing portal configuration. +// Retrieves a configuration that describes the functionality of the customer portal. func (c Client) Get(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { path := stripe.FormatURLPath("/v1/billing_portal/configurations/%s", id) configuration := &stripe.BillingPortalConfiguration{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.BillingPortalConfigurationParams) return configuration, err } -// Update updates a billing portal configuration's properties. +// Updates a configuration that describes the functionality of the customer portal. func Update(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { return getC().Update(id, params) } -// Update updates a billing portal configuration's properties. +// Updates a configuration that describes the functionality of the customer portal. func (c Client) Update(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { path := stripe.FormatURLPath("/v1/billing_portal/configurations/%s", id) configuration := &stripe.BillingPortalConfiguration{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.BillingPortalConfigurationParam return configuration, err } -// List returns a list of billing portal configurations. +// Returns a list of configurations that describe the functionality of the customer portal. func List(params *stripe.BillingPortalConfigurationListParams) *Iter { return getC().List(params) } -// List returns a list of billing portal configurations. +// Returns a list of configurations that describe the functionality of the customer portal. func (c Client) List(listParams *stripe.BillingPortalConfigurationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/billingportal/session/client.go b/billingportal/session/client.go index 3fa5000448..a7d4ee9555 100644 --- a/billingportal/session/client.go +++ b/billingportal/session/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new billing portal session. +// Creates a session of the customer portal. func New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSession, error) { return getC().New(params) } -// New creates a new billing portal session. +// Creates a session of the customer portal. func (c Client) New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSession, error) { session := &stripe.BillingPortalSession{} err := c.B.Call( diff --git a/capability/client.go b/capability/client.go index 5379094140..03ee6027b8 100644 --- a/capability/client.go +++ b/capability/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// Get returns the details of a capability. +// Retrieves information about the specified Account Capability. func Get(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { return getC().Get(id, params) } -// Get returns the details of a capability. +// Retrieves information about the specified Account Capability. func (c Client) Get(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { if params == nil { return nil, fmt.Errorf( @@ -43,12 +43,12 @@ func (c Client) Get(id string, params *stripe.CapabilityParams) (*stripe.Capabil return capability, err } -// Update updates a capability's properties. +// Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. func Update(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { return getC().Update(id, params) } -// Update updates a capability's properties. +// Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. func (c Client) Update(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/capabilities/%s", @@ -60,12 +60,12 @@ func (c Client) Update(id string, params *stripe.CapabilityParams) (*stripe.Capa return capability, err } -// List returns a list of capabilities. +// Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. func List(params *stripe.CapabilityListParams) *Iter { return getC().List(params) } -// List returns a list of capabilities. +// Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. func (c Client) List(listParams *stripe.CapabilityListParams) *Iter { path := stripe.FormatURLPath( "/v1/accounts/%s/capabilities", diff --git a/card/client.go b/card/client.go index 87163b2d1d..90415a41e8 100644 --- a/card/client.go +++ b/card/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new card. +// New creates a new card func New(params *stripe.CardParams) (*stripe.Card, error) { return getC().New(params) } -// New creates a new card. +// New creates a new card func (c Client) New(params *stripe.CardParams) (*stripe.Card, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -81,12 +81,12 @@ func (c Client) Get(id string, params *stripe.CardParams) (*stripe.Card, error) return card, err } -// Update updates a card's properties. +// Update a specified source for a given customer. func Update(id string, params *stripe.CardParams) (*stripe.Card, error) { return getC().Update(id, params) } -// Update updates a card's properties. +// Update a specified source for a given customer. func (c Client) Update(id string, params *stripe.CardParams) (*stripe.Card, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -106,12 +106,12 @@ func (c Client) Update(id string, params *stripe.CardParams) (*stripe.Card, erro return card, err } -// Del removes a card. +// Delete a specified source for a given customer. func Del(id string, params *stripe.CardParams) (*stripe.Card, error) { return getC().Del(id, params) } -// Del removes a card. +// Delete a specified source for a given customer. func (c Client) Del(id string, params *stripe.CardParams) (*stripe.Card, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -130,13 +130,10 @@ func (c Client) Del(id string, params *stripe.CardParams) (*stripe.Card, error) err := c.B.Call(http.MethodDelete, path, c.Key, params, card) return card, err } - -// List returns a list of cards. func List(params *stripe.CardListParams) *Iter { return getC().List(params) } -// List returns a list of cards. func (c Client) List(listParams *stripe.CardListParams) *Iter { var path string var outerErr error diff --git a/cashbalance/client.go b/cashbalance/client.go index a5927aa28e..b63970acae 100644 --- a/cashbalance/client.go +++ b/cashbalance/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a cash balance. +// Retrieves a customer's cash balance. func Get(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { return getC().Get(params) } -// Get returns the details of a cash balance. +// Retrieves a customer's cash balance. func (c Client) Get(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { if params == nil || params.Customer == nil { return nil, fmt.Errorf( @@ -41,12 +41,12 @@ func (c Client) Get(params *stripe.CashBalanceParams) (*stripe.CashBalance, erro return cashbalance, err } -// Update updates a cash balance's properties. +// Changes the settings on a customer's cash balance. func Update(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { return getC().Update(params) } -// Update updates a cash balance's properties. +// Changes the settings on a customer's cash balance. func (c Client) Update(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { if params == nil || params.Customer == nil { return nil, fmt.Errorf( diff --git a/charge/client.go b/charge/client.go index 441b55e6fd..17aa0f08a5 100644 --- a/charge/client.go +++ b/charge/client.go @@ -20,24 +20,28 @@ type Client struct { Key string } -// New creates a new charge. +// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) +// to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge +// object used to request payment. func New(params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().New(params) } -// New creates a new charge. +// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) +// to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge +// object used to request payment. func (c Client) New(params *stripe.ChargeParams) (*stripe.Charge, error) { charge := &stripe.Charge{} err := c.B.Call(http.MethodPost, "/v1/charges", c.Key, params, charge) return charge, err } -// Get returns the details of a charge. +// Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. func Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().Get(id, params) } -// Get returns the details of a charge. +// Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. func (c Client) Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { path := stripe.FormatURLPath("/v1/charges/%s", id) charge := &stripe.Charge{} @@ -45,12 +49,12 @@ func (c Client) Get(id string, params *stripe.ChargeParams) (*stripe.Charge, err return charge, err } -// Update updates a charge's properties. +// Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().Update(id, params) } -// Update updates a charge's properties. +// Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { path := stripe.FormatURLPath("/v1/charges/%s", id) charge := &stripe.Charge{} @@ -58,12 +62,20 @@ func (c Client) Update(id string, params *stripe.ChargeParams) (*stripe.Charge, return charge, err } -// Capture is the method for the `POST /v1/charges/{charge}/capture` API. +// Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. +// +// Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. +// +// Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). func Capture(id string, params *stripe.ChargeCaptureParams) (*stripe.Charge, error) { return getC().Capture(id, params) } -// Capture is the method for the `POST /v1/charges/{charge}/capture` API. +// Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. +// +// Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. +// +// Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). func (c Client) Capture(id string, params *stripe.ChargeCaptureParams) (*stripe.Charge, error) { path := stripe.FormatURLPath("/v1/charges/%s/capture", id) charge := &stripe.Charge{} @@ -71,12 +83,12 @@ func (c Client) Capture(id string, params *stripe.ChargeCaptureParams) (*stripe. return charge, err } -// List returns a list of charges. +// Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. func List(params *stripe.ChargeListParams) *Iter { return getC().List(params) } -// List returns a list of charges. +// Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. func (c Client) List(listParams *stripe.ChargeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -110,12 +122,18 @@ func (i *Iter) ChargeList() *stripe.ChargeList { return i.List().(*stripe.ChargeList) } -// Search returns a search result containing charges. +// Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.ChargeSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing charges. +// Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.ChargeSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/checkout/session/client.go b/checkout/session/client.go index d88ddbc110..e727403d3e 100644 --- a/checkout/session/client.go +++ b/checkout/session/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new checkout session. +// Creates a Session object. func New(params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { return getC().New(params) } -// New creates a new checkout session. +// Creates a Session object. func (c Client) New(params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { session := &stripe.CheckoutSession{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.CheckoutSessionParams) (*stripe.CheckoutSessi return session, err } -// Get returns the details of a checkout session. +// Retrieves a Session object. func Get(id string, params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { return getC().Get(id, params) } -// Get returns the details of a checkout session. +// Retrieves a Session object. func (c Client) Get(id string, params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { path := stripe.FormatURLPath("/v1/checkout/sessions/%s", id) session := &stripe.CheckoutSession{} @@ -51,12 +51,16 @@ func (c Client) Get(id string, params *stripe.CheckoutSessionParams) (*stripe.Ch return session, err } -// Expire is the method for the `POST /v1/checkout/sessions/{session}/expire` API. +// A Session can be expired when it is in one of these statuses: open +// +// After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. func Expire(id string, params *stripe.CheckoutSessionExpireParams) (*stripe.CheckoutSession, error) { return getC().Expire(id, params) } -// Expire is the method for the `POST /v1/checkout/sessions/{session}/expire` API. +// A Session can be expired when it is in one of these statuses: open +// +// After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. func (c Client) Expire(id string, params *stripe.CheckoutSessionExpireParams) (*stripe.CheckoutSession, error) { path := stripe.FormatURLPath("/v1/checkout/sessions/%s/expire", id) session := &stripe.CheckoutSession{} @@ -64,12 +68,12 @@ func (c Client) Expire(id string, params *stripe.CheckoutSessionExpireParams) (* return session, err } -// List returns a list of checkout sessions. +// Returns a list of Checkout Sessions. func List(params *stripe.CheckoutSessionListParams) *Iter { return getC().List(params) } -// List returns a list of checkout sessions. +// Returns a list of Checkout Sessions. func (c Client) List(listParams *stripe.CheckoutSessionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -103,12 +107,12 @@ func (i *Iter) CheckoutSessionList() *stripe.CheckoutSessionList { return i.List().(*stripe.CheckoutSessionList) } -// ListLineItems is the method for the `GET /v1/checkout/sessions/{session}/line_items` API. +// When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.CheckoutSessionListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/checkout/sessions/{session}/line_items` API. +// When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.CheckoutSessionListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/checkout/sessions/%s/line_items", diff --git a/climate/order/client.go b/climate/order/client.go index d55c5b8087..52454e5c1d 100644 --- a/climate/order/client.go +++ b/climate/order/client.go @@ -20,24 +20,26 @@ type Client struct { Key string } -// New creates a new climate order. +// Creates a Climate order object for a given Climate product. The order will be processed immediately +// after creation and payment will be deducted your Stripe balance. func New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { return getC().New(params) } -// New creates a new climate order. +// Creates a Climate order object for a given Climate product. The order will be processed immediately +// after creation and payment will be deducted your Stripe balance. func (c Client) New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { order := &stripe.ClimateOrder{} err := c.B.Call(http.MethodPost, "/v1/climate/orders", c.Key, params, order) return order, err } -// Get returns the details of a climate order. +// Retrieves the details of a Climate order object with the given ID. func Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { return getC().Get(id, params) } -// Get returns the details of a climate order. +// Retrieves the details of a Climate order object with the given ID. func (c Client) Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { path := stripe.FormatURLPath("/v1/climate/orders/%s", id) order := &stripe.ClimateOrder{} @@ -45,12 +47,12 @@ func (c Client) Get(id string, params *stripe.ClimateOrderParams) (*stripe.Clima return order, err } -// Update updates a climate order's properties. +// Updates the specified order by setting the values of the parameters passed. func Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { return getC().Update(id, params) } -// Update updates a climate order's properties. +// Updates the specified order by setting the values of the parameters passed. func (c Client) Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { path := stripe.FormatURLPath("/v1/climate/orders/%s", id) order := &stripe.ClimateOrder{} @@ -58,12 +60,18 @@ func (c Client) Update(id string, params *stripe.ClimateOrderParams) (*stripe.Cl return order, err } -// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API. +// Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the +// reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier +// might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe +// provides 90 days advance notice and refunds the amount_total. func Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API. +// Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the +// reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier +// might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe +// provides 90 days advance notice and refunds the amount_total. func (c Client) Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) { path := stripe.FormatURLPath("/v1/climate/orders/%s/cancel", id) order := &stripe.ClimateOrder{} @@ -71,12 +79,14 @@ func (c Client) Cancel(id string, params *stripe.ClimateOrderCancelParams) (*str return order, err } -// List returns a list of climate orders. +// Lists all Climate order objects. The orders are returned sorted by creation date, with the +// most recently created orders appearing first. func List(params *stripe.ClimateOrderListParams) *Iter { return getC().List(params) } -// List returns a list of climate orders. +// Lists all Climate order objects. The orders are returned sorted by creation date, with the +// most recently created orders appearing first. func (c Client) List(listParams *stripe.ClimateOrderListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/climate/product/client.go b/climate/product/client.go index 90d25395dd..adb5173e8f 100644 --- a/climate/product/client.go +++ b/climate/product/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a climate product. +// Retrieves the details of a Climate product with the given ID. func Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) { return getC().Get(id, params) } -// Get returns the details of a climate product. +// Retrieves the details of a Climate product with the given ID. func (c Client) Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) { path := stripe.FormatURLPath("/v1/climate/products/%s", id) product := &stripe.ClimateProduct{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ClimateProductParams) (*stripe.Cli return product, err } -// List returns a list of climate products. +// Lists all available Climate product objects. func List(params *stripe.ClimateProductListParams) *Iter { return getC().List(params) } -// List returns a list of climate products. +// Lists all available Climate product objects. func (c Client) List(listParams *stripe.ClimateProductListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/climate/supplier/client.go b/climate/supplier/client.go index c9cc98d623..cb3d48b601 100644 --- a/climate/supplier/client.go +++ b/climate/supplier/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a climate supplier. +// Retrieves a Climate supplier object. func Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) { return getC().Get(id, params) } -// Get returns the details of a climate supplier. +// Retrieves a Climate supplier object. func (c Client) Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) { path := stripe.FormatURLPath("/v1/climate/suppliers/%s", id) supplier := &stripe.ClimateSupplier{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ClimateSupplierParams) (*stripe.Cl return supplier, err } -// List returns a list of climate suppliers. +// Lists all available Climate supplier objects. func List(params *stripe.ClimateSupplierListParams) *Iter { return getC().List(params) } -// List returns a list of climate suppliers. +// Lists all available Climate supplier objects. func (c Client) List(listParams *stripe.ClimateSupplierListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/confirmationtoken/client.go b/confirmationtoken/client.go index 72ea9f98ce..f076be962e 100644 --- a/confirmationtoken/client.go +++ b/confirmationtoken/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Get returns the details of a confirmation token. +// Retrieves an existing ConfirmationToken object func Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { return getC().Get(id, params) } -// Get returns the details of a confirmation token. +// Retrieves an existing ConfirmationToken object func (c Client) Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { path := stripe.FormatURLPath("/v1/confirmation_tokens/%s", id) confirmationtoken := &stripe.ConfirmationToken{} diff --git a/countryspec/client.go b/countryspec/client.go index 841bea87fd..f408fc765d 100644 --- a/countryspec/client.go +++ b/countryspec/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a country spec. +// Returns a Country Spec for a given Country code. func Get(id string, params *stripe.CountrySpecParams) (*stripe.CountrySpec, error) { return getC().Get(id, params) } -// Get returns the details of a country spec. +// Returns a Country Spec for a given Country code. func (c Client) Get(id string, params *stripe.CountrySpecParams) (*stripe.CountrySpec, error) { path := stripe.FormatURLPath("/v1/country_specs/%s", id) countryspec := &stripe.CountrySpec{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.CountrySpecParams) (*stripe.Countr return countryspec, err } -// List returns a list of country specs. +// Lists all Country Spec objects available in the API. func List(params *stripe.CountrySpecListParams) *Iter { return getC().List(params) } -// List returns a list of country specs. +// Lists all Country Spec objects available in the API. func (c Client) List(listParams *stripe.CountrySpecListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/coupon/client.go b/coupon/client.go index a800622403..bd4690b4fc 100644 --- a/coupon/client.go +++ b/coupon/client.go @@ -20,24 +20,28 @@ type Client struct { Key string } -// New creates a new coupon. +// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. +// +// A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. func New(params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().New(params) } -// New creates a new coupon. +// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. +// +// A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. func (c Client) New(params *stripe.CouponParams) (*stripe.Coupon, error) { coupon := &stripe.Coupon{} err := c.B.Call(http.MethodPost, "/v1/coupons", c.Key, params, coupon) return coupon, err } -// Get returns the details of a coupon. +// Retrieves the coupon with the given ID. func Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().Get(id, params) } -// Get returns the details of a coupon. +// Retrieves the coupon with the given ID. func (c Client) Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { path := stripe.FormatURLPath("/v1/coupons/%s", id) coupon := &stripe.Coupon{} @@ -45,12 +49,12 @@ func (c Client) Get(id string, params *stripe.CouponParams) (*stripe.Coupon, err return coupon, err } -// Update updates a coupon's properties. +// Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. func Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().Update(id, params) } -// Update updates a coupon's properties. +// Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. func (c Client) Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { path := stripe.FormatURLPath("/v1/coupons/%s", id) coupon := &stripe.Coupon{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.CouponParams) (*stripe.Coupon, return coupon, err } -// Del removes a coupon. +// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. func Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().Del(id, params) } -// Del removes a coupon. +// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. func (c Client) Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { path := stripe.FormatURLPath("/v1/coupons/%s", id) coupon := &stripe.Coupon{} @@ -71,12 +75,12 @@ func (c Client) Del(id string, params *stripe.CouponParams) (*stripe.Coupon, err return coupon, err } -// List returns a list of coupons. +// Returns a list of your coupons. func List(params *stripe.CouponListParams) *Iter { return getC().List(params) } -// List returns a list of coupons. +// Returns a list of your coupons. func (c Client) List(listParams *stripe.CouponListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/creditnote/client.go b/creditnote/client.go index ba9aa9c60c..548da732c9 100644 --- a/creditnote/client.go +++ b/creditnote/client.go @@ -20,12 +20,34 @@ type Client struct { Key string } -// New creates a new credit note. +// Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces +// its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result +// in any combination of the following: +// +// Refund: create a new refund (using refund_amount) or link an existing refund (using refund). +// Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. +// Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). +// +// For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. +// +// You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount +// or post_payment_credit_notes_amount depending on its status at the time of credit note creation. func New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { return getC().New(params) } -// New creates a new credit note. +// Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces +// its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result +// in any combination of the following: +// +// Refund: create a new refund (using refund_amount) or link an existing refund (using refund). +// Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. +// Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). +// +// For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. +// +// You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount +// or post_payment_credit_notes_amount depending on its status at the time of credit note creation. func (c Client) New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { creditnote := &stripe.CreditNote{} err := c.B.Call( @@ -38,12 +60,12 @@ func (c Client) New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error) return creditnote, err } -// Get returns the details of a credit note. +// Retrieves the credit note object with the given identifier. func Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { return getC().Get(id, params) } -// Get returns the details of a credit note. +// Retrieves the credit note object with the given identifier. func (c Client) Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { path := stripe.FormatURLPath("/v1/credit_notes/%s", id) creditnote := &stripe.CreditNote{} @@ -51,12 +73,12 @@ func (c Client) Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditN return creditnote, err } -// Update updates a credit note's properties. +// Updates an existing credit note. func Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { return getC().Update(id, params) } -// Update updates a credit note's properties. +// Updates an existing credit note. func (c Client) Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { path := stripe.FormatURLPath("/v1/credit_notes/%s", id) creditnote := &stripe.CreditNote{} @@ -64,12 +86,12 @@ func (c Client) Update(id string, params *stripe.CreditNoteParams) (*stripe.Cred return creditnote, err } -// Preview is the method for the `GET /v1/credit_notes/preview` API. +// Get a preview of a credit note without creating it. func Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error) { return getC().Preview(params) } -// Preview is the method for the `GET /v1/credit_notes/preview` API. +// Get a preview of a credit note without creating it. func (c Client) Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error) { creditnote := &stripe.CreditNote{} err := c.B.Call( @@ -82,12 +104,12 @@ func (c Client) Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditN return creditnote, err } -// VoidCreditNote is the method for the `POST /v1/credit_notes/{id}/void` API. +// Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). func VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error) { return getC().VoidCreditNote(id, params) } -// VoidCreditNote is the method for the `POST /v1/credit_notes/{id}/void` API. +// Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). func (c Client) VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error) { path := stripe.FormatURLPath("/v1/credit_notes/%s/void", id) creditnote := &stripe.CreditNote{} @@ -95,12 +117,12 @@ func (c Client) VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNot return creditnote, err } -// List returns a list of credit notes. +// Returns a list of credit notes. func List(params *stripe.CreditNoteListParams) *Iter { return getC().List(params) } -// List returns a list of credit notes. +// Returns a list of credit notes. func (c Client) List(listParams *stripe.CreditNoteListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -134,12 +156,12 @@ func (i *Iter) CreditNoteList() *stripe.CreditNoteList { return i.List().(*stripe.CreditNoteList) } -// ListLines is the method for the `GET /v1/credit_notes/{credit_note}/lines` API. +// When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLines(params *stripe.CreditNoteListLinesParams) *LineItemIter { return getC().ListLines(params) } -// ListLines is the method for the `GET /v1/credit_notes/{credit_note}/lines` API. +// When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLines(listParams *stripe.CreditNoteListLinesParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/credit_notes/%s/lines", @@ -160,12 +182,12 @@ func (c Client) ListLines(listParams *stripe.CreditNoteListLinesParams) *LineIte } } -// PreviewLines is the method for the `GET /v1/credit_notes/preview/lines` API. +// When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. func PreviewLines(params *stripe.CreditNotePreviewLinesParams) *LineItemIter { return getC().PreviewLines(params) } -// PreviewLines is the method for the `GET /v1/credit_notes/preview/lines` API. +// When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. func (c Client) PreviewLines(listParams *stripe.CreditNotePreviewLinesParams) *LineItemIter { return &LineItemIter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/customer/client.go b/customer/client.go index b2f2bba68e..7479fb3e18 100644 --- a/customer/client.go +++ b/customer/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new customer. +// Creates a new customer object. func New(params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().New(params) } -// New creates a new customer. +// Creates a new customer object. func (c Client) New(params *stripe.CustomerParams) (*stripe.Customer, error) { customer := &stripe.Customer{} err := c.B.Call(http.MethodPost, "/v1/customers", c.Key, params, customer) return customer, err } -// Get returns the details of a customer. +// Retrieves a Customer object. func Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Get(id, params) } -// Get returns the details of a customer. +// Retrieves a Customer object. func (c Client) Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) customer := &stripe.Customer{} @@ -45,12 +45,16 @@ func (c Client) Get(id string, params *stripe.CustomerParams) (*stripe.Customer, return customer, err } -// Update updates a customer's properties. +// Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. +// +// This request accepts mostly the same arguments as the customer creation call. func Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Update(id, params) } -// Update updates a customer's properties. +// Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. +// +// This request accepts mostly the same arguments as the customer creation call. func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) customer := &stripe.Customer{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Custom return customer, err } -// Del removes a customer. +// Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. func Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Del(id, params) } -// Del removes a customer. +// Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. func (c Client) Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) customer := &stripe.Customer{} @@ -71,12 +75,16 @@ func (c Client) Del(id string, params *stripe.CustomerParams) (*stripe.Customer, return customer, err } -// CreateFundingInstructions is the method for the `POST /v1/customers/{customer}/funding_instructions` API. +// Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new +// funding instructions will be created. If funding instructions have already been created for a given customer, the same +// funding instructions will be retrieved. In other words, we will return the same funding instructions each time. func CreateFundingInstructions(id string, params *stripe.CustomerCreateFundingInstructionsParams) (*stripe.FundingInstructions, error) { return getC().CreateFundingInstructions(id, params) } -// CreateFundingInstructions is the method for the `POST /v1/customers/{customer}/funding_instructions` API. +// Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new +// funding instructions will be created. If funding instructions have already been created for a given customer, the same +// funding instructions will be retrieved. In other words, we will return the same funding instructions each time. func (c Client) CreateFundingInstructions(id string, params *stripe.CustomerCreateFundingInstructionsParams) (*stripe.FundingInstructions, error) { path := stripe.FormatURLPath("/v1/customers/%s/funding_instructions", id) fundinginstructions := &stripe.FundingInstructions{} @@ -84,12 +92,12 @@ func (c Client) CreateFundingInstructions(id string, params *stripe.CustomerCrea return fundinginstructions, err } -// DeleteDiscount is the method for the `DELETE /v1/customers/{customer}/discount` API. +// Removes the currently applied discount on a customer. func DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountParams) (*stripe.Customer, error) { return getC().DeleteDiscount(id, params) } -// DeleteDiscount is the method for the `DELETE /v1/customers/{customer}/discount` API. +// Removes the currently applied discount on a customer. func (c Client) DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s/discount", id) customer := &stripe.Customer{} @@ -97,12 +105,12 @@ func (c Client) DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountP return customer, err } -// RetrievePaymentMethod is the method for the `GET /v1/customers/{customer}/payment_methods/{payment_method}` API. +// Retrieves a PaymentMethod object for a given Customer. func RetrievePaymentMethod(id string, params *stripe.CustomerRetrievePaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().RetrievePaymentMethod(id, params) } -// RetrievePaymentMethod is the method for the `GET /v1/customers/{customer}/payment_methods/{payment_method}` API. +// Retrieves a PaymentMethod object for a given Customer. func (c Client) RetrievePaymentMethod(id string, params *stripe.CustomerRetrievePaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath( "/v1/customers/%s/payment_methods/%s", @@ -114,12 +122,12 @@ func (c Client) RetrievePaymentMethod(id string, params *stripe.CustomerRetrieve return paymentmethod, err } -// List returns a list of customers. +// Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. func List(params *stripe.CustomerListParams) *Iter { return getC().List(params) } -// List returns a list of customers. +// Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. func (c Client) List(listParams *stripe.CustomerListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -153,12 +161,12 @@ func (i *Iter) CustomerList() *stripe.CustomerList { return i.List().(*stripe.CustomerList) } -// ListPaymentMethods is the method for the `GET /v1/customers/{customer}/payment_methods` API. +// Returns a list of PaymentMethods for a given Customer func ListPaymentMethods(params *stripe.CustomerListPaymentMethodsParams) *PaymentMethodIter { return getC().ListPaymentMethods(params) } -// ListPaymentMethods is the method for the `GET /v1/customers/{customer}/payment_methods` API. +// Returns a list of PaymentMethods for a given Customer func (c Client) ListPaymentMethods(listParams *stripe.CustomerListPaymentMethodsParams) *PaymentMethodIter { path := stripe.FormatURLPath( "/v1/customers/%s/payment_methods", @@ -196,12 +204,18 @@ func (i *PaymentMethodIter) PaymentMethodList() *stripe.PaymentMethodList { return i.List().(*stripe.PaymentMethodList) } -// Search returns a search result containing customers. +// Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.CustomerSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing customers. +// Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.CustomerSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/customerbalancetransaction/client.go b/customerbalancetransaction/client.go index af77120999..c2ac1df806 100644 --- a/customerbalancetransaction/client.go +++ b/customerbalancetransaction/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new customer balance transaction. +// Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). func New(params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { return getC().New(params) } -// New creates a new customer balance transaction. +// Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). func (c Client) New(params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { if params == nil { return nil, fmt.Errorf( @@ -48,12 +48,12 @@ func (c Client) New(params *stripe.CustomerBalanceTransactionParams) (*stripe.Cu return customerbalancetransaction, err } -// Get returns the details of a customer balance transaction. +// Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func Get(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a customer balance transaction. +// Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func (c Client) Get(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { if params == nil { return nil, fmt.Errorf( @@ -76,12 +76,12 @@ func (c Client) Get(id string, params *stripe.CustomerBalanceTransactionParams) return customerbalancetransaction, err } -// Update updates a customer balance transaction's properties. +// Most credit balance transaction fields are immutable, but you may update its description and metadata. func Update(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { return getC().Update(id, params) } -// Update updates a customer balance transaction's properties. +// Most credit balance transaction fields are immutable, but you may update its description and metadata. func (c Client) Update(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { path := stripe.FormatURLPath( "/v1/customers/%s/balance_transactions/%s", @@ -99,12 +99,12 @@ func (c Client) Update(id string, params *stripe.CustomerBalanceTransactionParam return customerbalancetransaction, err } -// List returns a list of customer balance transactions. +// Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func List(params *stripe.CustomerBalanceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of customer balance transactions. +// Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func (c Client) List(listParams *stripe.CustomerBalanceTransactionListParams) *Iter { path := stripe.FormatURLPath( "/v1/customers/%s/balance_transactions", diff --git a/customercashbalancetransaction/client.go b/customercashbalancetransaction/client.go index 381c47ad5a..6cf9929598 100644 --- a/customercashbalancetransaction/client.go +++ b/customercashbalancetransaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a customer cash balance transaction. +// Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func Get(id string, params *stripe.CustomerCashBalanceTransactionParams) (*stripe.CustomerCashBalanceTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a customer cash balance transaction. +// Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func (c Client) Get(id string, params *stripe.CustomerCashBalanceTransactionParams) (*stripe.CustomerCashBalanceTransaction, error) { path := stripe.FormatURLPath( "/v1/customers/%s/cash_balance_transactions/%s", @@ -43,12 +43,12 @@ func (c Client) Get(id string, params *stripe.CustomerCashBalanceTransactionPara return customercashbalancetransaction, err } -// List returns a list of customer cash balance transactions. +// Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func List(params *stripe.CustomerCashBalanceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of customer cash balance transactions. +// Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func (c Client) List(listParams *stripe.CustomerCashBalanceTransactionListParams) *Iter { path := stripe.FormatURLPath( "/v1/customers/%s/cash_balance_transactions", diff --git a/customersession/client.go b/customersession/client.go index e3ba90a9e0..67c3ac035e 100644 --- a/customersession/client.go +++ b/customersession/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new customer session. +// Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. func New(params *stripe.CustomerSessionParams) (*stripe.CustomerSession, error) { return getC().New(params) } -// New creates a new customer session. +// Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. func (c Client) New(params *stripe.CustomerSessionParams) (*stripe.CustomerSession, error) { customersession := &stripe.CustomerSession{} err := c.B.Call( diff --git a/dispute/client.go b/dispute/client.go index 68af454c96..d1d2dc7713 100644 --- a/dispute/client.go +++ b/dispute/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a dispute. +// Retrieves the dispute with the given ID. func Get(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { return getC().Get(id, params) } -// Get returns the details of a dispute. +// Retrieves the dispute with the given ID. func (c Client) Get(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { path := stripe.FormatURLPath("/v1/disputes/%s", id) dispute := &stripe.Dispute{} @@ -33,12 +33,16 @@ func (c Client) Get(id string, params *stripe.DisputeParams) (*stripe.Dispute, e return dispute, err } -// Update updates a dispute's properties. +// When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. +// +// Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). func Update(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { return getC().Update(id, params) } -// Update updates a dispute's properties. +// When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. +// +// Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). func (c Client) Update(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { path := stripe.FormatURLPath("/v1/disputes/%s", id) dispute := &stripe.Dispute{} @@ -46,12 +50,16 @@ func (c Client) Update(id string, params *stripe.DisputeParams) (*stripe.Dispute return dispute, err } -// Close is the method for the `POST /v1/disputes/{dispute}/close` API. +// Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. +// +// The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. func Close(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { return getC().Close(id, params) } -// Close is the method for the `POST /v1/disputes/{dispute}/close` API. +// Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. +// +// The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. func (c Client) Close(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { path := stripe.FormatURLPath("/v1/disputes/%s/close", id) dispute := &stripe.Dispute{} @@ -59,12 +67,12 @@ func (c Client) Close(id string, params *stripe.DisputeParams) (*stripe.Dispute, return dispute, err } -// List returns a list of disputes. +// Returns a list of your disputes. func List(params *stripe.DisputeListParams) *Iter { return getC().List(params) } -// List returns a list of disputes. +// Returns a list of your disputes. func (c Client) List(listParams *stripe.DisputeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/entitlements/activeentitlement/client.go b/entitlements/activeentitlement/client.go index e0b9606f5a..5a79927095 100644 --- a/entitlements/activeentitlement/client.go +++ b/entitlements/activeentitlement/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an entitlements active entitlement. +// Retrieve an active entitlement func Get(id string, params *stripe.EntitlementsActiveEntitlementParams) (*stripe.EntitlementsActiveEntitlement, error) { return getC().Get(id, params) } -// Get returns the details of an entitlements active entitlement. +// Retrieve an active entitlement func (c Client) Get(id string, params *stripe.EntitlementsActiveEntitlementParams) (*stripe.EntitlementsActiveEntitlement, error) { path := stripe.FormatURLPath("/v1/entitlements/active_entitlements/%s", id) activeentitlement := &stripe.EntitlementsActiveEntitlement{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.EntitlementsActiveEntitlementParam return activeentitlement, err } -// List returns a list of entitlements active entitlements. +// Retrieve a list of active entitlements for a customer func List(params *stripe.EntitlementsActiveEntitlementListParams) *Iter { return getC().List(params) } -// List returns a list of entitlements active entitlements. +// Retrieve a list of active entitlements for a customer func (c Client) List(listParams *stripe.EntitlementsActiveEntitlementListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/entitlements/feature/client.go b/entitlements/feature/client.go index ba6f549853..929115ba3d 100644 --- a/entitlements/feature/client.go +++ b/entitlements/feature/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new entitlements feature. +// Creates a feature func New(params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { return getC().New(params) } -// New creates a new entitlements feature. +// Creates a feature func (c Client) New(params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { feature := &stripe.EntitlementsFeature{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.EntitlementsFeatureParams) (*stripe.Entitleme return feature, err } -// Get returns the details of an entitlements feature. +// Retrieves a feature func Get(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { return getC().Get(id, params) } -// Get returns the details of an entitlements feature. +// Retrieves a feature func (c Client) Get(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { path := stripe.FormatURLPath("/v1/entitlements/features/%s", id) feature := &stripe.EntitlementsFeature{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.EntitlementsFeatureParams) (*strip return feature, err } -// Update updates an entitlements feature's properties. +// Update a feature's metadata or permanently deactivate it. func Update(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { return getC().Update(id, params) } -// Update updates an entitlements feature's properties. +// Update a feature's metadata or permanently deactivate it. func (c Client) Update(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { path := stripe.FormatURLPath("/v1/entitlements/features/%s", id) feature := &stripe.EntitlementsFeature{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.EntitlementsFeatureParams) (*st return feature, err } -// List returns a list of entitlements features. +// Retrieve a list of features func List(params *stripe.EntitlementsFeatureListParams) *Iter { return getC().List(params) } -// List returns a list of entitlements features. +// Retrieve a list of features func (c Client) List(listParams *stripe.EntitlementsFeatureListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/ephemeralkey/client.go b/ephemeralkey/client.go index a723063f72..0c21e5585d 100644 --- a/ephemeralkey/client.go +++ b/ephemeralkey/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new ephemeral key. +// Creates a short-lived API key for a given resource. func New(params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { return getC().New(params) } -// New creates a new ephemeral key. +// Creates a short-lived API key for a given resource. func (c Client) New(params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { if params.StripeVersion == nil || len(stripe.StringValue(params.StripeVersion)) == 0 { return nil, fmt.Errorf("params.StripeVersion must be specified") @@ -47,12 +47,12 @@ func (c Client) New(params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, er return ephemeralkey, err } -// Del removes an ephemeral key. +// Invalidates a short-lived API key for a given resource. func Del(id string, params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { return getC().Del(id, params) } -// Del removes an ephemeral key. +// Invalidates a short-lived API key for a given resource. func (c Client) Del(id string, params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { path := stripe.FormatURLPath("/v1/ephemeral_keys/%s", id) ephemeralkey := &stripe.EphemeralKey{} diff --git a/event/client.go b/event/client.go index 0bda8d3010..433bbdc2c2 100644 --- a/event/client.go +++ b/event/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an event. +// Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. func Get(id string, params *stripe.EventParams) (*stripe.Event, error) { return getC().Get(id, params) } -// Get returns the details of an event. +// Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. func (c Client) Get(id string, params *stripe.EventParams) (*stripe.Event, error) { path := stripe.FormatURLPath("/v1/events/%s", id) event := &stripe.Event{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.EventParams) (*stripe.Event, error return event, err } -// List returns a list of events. +// 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://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). func List(params *stripe.EventListParams) *Iter { return getC().List(params) } -// List returns a list of events. +// 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://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). func (c Client) List(listParams *stripe.EventListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/feerefund/client.go b/feerefund/client.go index 31c53ba837..cd2e1d3d0e 100644 --- a/feerefund/client.go +++ b/feerefund/client.go @@ -21,12 +21,28 @@ type Client struct { Key string } -// New creates a new fee refund. +// Refunds an application fee that has previously been collected but not yet refunded. +// Funds will be refunded to the Stripe account from which the fee was originally collected. +// +// You can optionally refund only part of an application fee. +// You can do so multiple times, until the entire fee has been refunded. +// +// Once entirely refunded, an application fee can't be refunded again. +// This method will raise an error when called on an already-refunded application fee, +// or when trying to refund more money than is left on an application fee. func New(params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return getC().New(params) } -// New creates a new fee refund. +// Refunds an application fee that has previously been collected but not yet refunded. +// Funds will be refunded to the Stripe account from which the fee was originally collected. +// +// You can optionally refund only part of an application fee. +// You can do so multiple times, until the entire fee has been refunded. +// +// Once entirely refunded, an application fee can't be refunded again. +// This method will raise an error when called on an already-refunded application fee, +// or when trying to refund more money than is left on an application fee. func (c Client) New(params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil") @@ -43,12 +59,12 @@ func (c Client) New(params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return feerefund, err } -// Get returns the details of a fee refund. +// By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. func Get(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return getC().Get(id, params) } -// Get returns the details of a fee refund. +// By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. func (c Client) Get(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil") @@ -66,12 +82,16 @@ func (c Client) Get(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefun return feerefund, err } -// Update updates a fee refund's properties. +// Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata as an argument. func Update(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return getC().Update(id, params) } -// Update updates a fee refund's properties. +// Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata as an argument. func (c Client) Update(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil") @@ -89,12 +109,12 @@ func (c Client) Update(id string, params *stripe.FeeRefundParams) (*stripe.FeeRe return feerefund, err } -// List returns a list of fee refunds. +// You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. func List(params *stripe.FeeRefundListParams) *Iter { return getC().List(params) } -// List returns a list of fee refunds. +// You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. func (c Client) List(listParams *stripe.FeeRefundListParams) *Iter { path := stripe.FormatURLPath( "/v1/application_fees/%s/refunds", diff --git a/file/client.go b/file/client.go index f20ca6857e..b1d1791fe6 100644 --- a/file/client.go +++ b/file/client.go @@ -22,12 +22,16 @@ type Client struct { Key string } -// New creates a new file. +// To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. +// +// All of Stripe's officially supported Client libraries support sending multipart/form-data. func New(params *stripe.FileParams) (*stripe.File, error) { return getC().New(params) } -// New creates a new file. +// To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. +// +// All of Stripe's officially supported Client libraries support sending multipart/form-data. func (c Client) New(params *stripe.FileParams) (*stripe.File, error) { if params == nil { return nil, fmt.Errorf( @@ -46,12 +50,12 @@ func (c Client) New(params *stripe.FileParams) (*stripe.File, error) { return file, err } -// Get returns the details of a file. +// Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). func Get(id string, params *stripe.FileParams) (*stripe.File, error) { return getC().Get(id, params) } -// Get returns the details of a file. +// Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). func (c Client) Get(id string, params *stripe.FileParams) (*stripe.File, error) { path := stripe.FormatURLPath("/v1/files/%s", id) file := &stripe.File{} @@ -59,12 +63,12 @@ func (c Client) Get(id string, params *stripe.FileParams) (*stripe.File, error) return file, err } -// List returns a list of files. +// Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. func List(params *stripe.FileListParams) *Iter { return getC().List(params) } -// List returns a list of files. +// Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. func (c Client) List(listParams *stripe.FileListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/filelink/client.go b/filelink/client.go index 4300f4e7e0..05bf459b01 100644 --- a/filelink/client.go +++ b/filelink/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new file link. +// Creates a new file link object. func New(params *stripe.FileLinkParams) (*stripe.FileLink, error) { return getC().New(params) } -// New creates a new file link. +// Creates a new file link object. func (c Client) New(params *stripe.FileLinkParams) (*stripe.FileLink, error) { filelink := &stripe.FileLink{} err := c.B.Call(http.MethodPost, "/v1/file_links", c.Key, params, filelink) return filelink, err } -// Get returns the details of a file link. +// Retrieves the file link with the given ID. func Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { return getC().Get(id, params) } -// Get returns the details of a file link. +// Retrieves the file link with the given ID. func (c Client) Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { path := stripe.FormatURLPath("/v1/file_links/%s", id) filelink := &stripe.FileLink{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, return filelink, err } -// Update updates a file link's properties. +// Updates an existing file link object. Expired links can no longer be updated. func Update(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { return getC().Update(id, params) } -// Update updates a file link's properties. +// Updates an existing file link object. Expired links can no longer be updated. func (c Client) Update(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { path := stripe.FormatURLPath("/v1/file_links/%s", id) filelink := &stripe.FileLink{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.FileLinkParams) (*stripe.FileLi return filelink, err } -// List returns a list of file links. +// Returns a list of file links. func List(params *stripe.FileLinkListParams) *Iter { return getC().List(params) } -// List returns a list of file links. +// Returns a list of file links. func (c Client) List(listParams *stripe.FileLinkListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/financialconnections/account/client.go b/financialconnections/account/client.go index 6aae0a61e0..2d27a6d9fc 100644 --- a/financialconnections/account/client.go +++ b/financialconnections/account/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// GetByID returns the details of a financial connections account. +// Retrieves the details of an Financial Connections Account. func GetByID(id string, params *stripe.FinancialConnectionsAccountParams) (*stripe.FinancialConnectionsAccount, error) { return getC().GetByID(id, params) } -// GetByID returns the details of a financial connections account. +// Retrieves the details of an Financial Connections Account. func (c Client) GetByID(id string, params *stripe.FinancialConnectionsAccountParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath("/v1/financial_connections/accounts/%s", id) account := &stripe.FinancialConnectionsAccount{} @@ -33,12 +33,12 @@ func (c Client) GetByID(id string, params *stripe.FinancialConnectionsAccountPar return account, err } -// Disconnect is the method for the `POST /v1/financial_connections/accounts/{account}/disconnect` API. +// Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). func Disconnect(id string, params *stripe.FinancialConnectionsAccountDisconnectParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Disconnect(id, params) } -// Disconnect is the method for the `POST /v1/financial_connections/accounts/{account}/disconnect` API. +// Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). func (c Client) Disconnect(id string, params *stripe.FinancialConnectionsAccountDisconnectParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/disconnect", @@ -49,12 +49,12 @@ func (c Client) Disconnect(id string, params *stripe.FinancialConnectionsAccount return account, err } -// Refresh is the method for the `POST /v1/financial_connections/accounts/{account}/refresh` API. +// Refreshes the data associated with a Financial Connections Account. func Refresh(id string, params *stripe.FinancialConnectionsAccountRefreshParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Refresh(id, params) } -// Refresh is the method for the `POST /v1/financial_connections/accounts/{account}/refresh` API. +// Refreshes the data associated with a Financial Connections Account. func (c Client) Refresh(id string, params *stripe.FinancialConnectionsAccountRefreshParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/refresh", @@ -65,12 +65,12 @@ func (c Client) Refresh(id string, params *stripe.FinancialConnectionsAccountRef return account, err } -// Subscribe is the method for the `POST /v1/financial_connections/accounts/{account}/subscribe` API. +// Subscribes to periodic refreshes of data associated with a Financial Connections Account. func Subscribe(id string, params *stripe.FinancialConnectionsAccountSubscribeParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Subscribe(id, params) } -// Subscribe is the method for the `POST /v1/financial_connections/accounts/{account}/subscribe` API. +// Subscribes to periodic refreshes of data associated with a Financial Connections Account. func (c Client) Subscribe(id string, params *stripe.FinancialConnectionsAccountSubscribeParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/subscribe", @@ -81,12 +81,12 @@ func (c Client) Subscribe(id string, params *stripe.FinancialConnectionsAccountS return account, err } -// Unsubscribe is the method for the `POST /v1/financial_connections/accounts/{account}/unsubscribe` API. +// Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. func Unsubscribe(id string, params *stripe.FinancialConnectionsAccountUnsubscribeParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Unsubscribe(id, params) } -// Unsubscribe is the method for the `POST /v1/financial_connections/accounts/{account}/unsubscribe` API. +// Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. func (c Client) Unsubscribe(id string, params *stripe.FinancialConnectionsAccountUnsubscribeParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/unsubscribe", @@ -97,12 +97,12 @@ func (c Client) Unsubscribe(id string, params *stripe.FinancialConnectionsAccoun return account, err } -// List returns a list of financial connections accounts. +// Returns a list of Financial Connections Account objects. func List(params *stripe.FinancialConnectionsAccountListParams) *Iter { return getC().List(params) } -// List returns a list of financial connections accounts. +// Returns a list of Financial Connections Account objects. func (c Client) List(listParams *stripe.FinancialConnectionsAccountListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -136,12 +136,12 @@ func (i *Iter) FinancialConnectionsAccountList() *stripe.FinancialConnectionsAcc return i.List().(*stripe.FinancialConnectionsAccountList) } -// ListOwners is the method for the `GET /v1/financial_connections/accounts/{account}/owners` API. +// Lists all owners for a given Account func ListOwners(params *stripe.FinancialConnectionsAccountListOwnersParams) *OwnerIter { return getC().ListOwners(params) } -// ListOwners is the method for the `GET /v1/financial_connections/accounts/{account}/owners` API. +// Lists all owners for a given Account func (c Client) ListOwners(listParams *stripe.FinancialConnectionsAccountListOwnersParams) *OwnerIter { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/owners", diff --git a/financialconnections/session/client.go b/financialconnections/session/client.go index 11896dd16b..2c4a8bfd32 100644 --- a/financialconnections/session/client.go +++ b/financialconnections/session/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new financial connections session. +// To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. func New(params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { return getC().New(params) } -// New creates a new financial connections session. +// To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. func (c Client) New(params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { session := &stripe.FinancialConnectionsSession{} err := c.B.Call( @@ -37,12 +37,12 @@ func (c Client) New(params *stripe.FinancialConnectionsSessionParams) (*stripe.F return session, err } -// Get returns the details of a financial connections session. +// Retrieves the details of a Financial Connections Session func Get(id string, params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { return getC().Get(id, params) } -// Get returns the details of a financial connections session. +// Retrieves the details of a Financial Connections Session func (c Client) Get(id string, params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { path := stripe.FormatURLPath("/v1/financial_connections/sessions/%s", id) session := &stripe.FinancialConnectionsSession{} diff --git a/financialconnections/transaction/client.go b/financialconnections/transaction/client.go index c2bde58571..b16c39ba26 100644 --- a/financialconnections/transaction/client.go +++ b/financialconnections/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a financial connections transaction. +// Retrieves the details of a Financial Connections Transaction func Get(id string, params *stripe.FinancialConnectionsTransactionParams) (*stripe.FinancialConnectionsTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a financial connections transaction. +// Retrieves the details of a Financial Connections Transaction func (c Client) Get(id string, params *stripe.FinancialConnectionsTransactionParams) (*stripe.FinancialConnectionsTransaction, error) { path := stripe.FormatURLPath("/v1/financial_connections/transactions/%s", id) transaction := &stripe.FinancialConnectionsTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.FinancialConnectionsTransactionPar return transaction, err } -// List returns a list of financial connections transactions. +// Returns a list of Financial Connections Transaction objects. func List(params *stripe.FinancialConnectionsTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of financial connections transactions. +// Returns a list of Financial Connections Transaction objects. func (c Client) List(listParams *stripe.FinancialConnectionsTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/forwarding/request/client.go b/forwarding/request/client.go index 07ccc68fbf..4e60a53945 100644 --- a/forwarding/request/client.go +++ b/forwarding/request/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new forwarding request. +// Creates a ForwardingRequest object. func New(params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { return getC().New(params) } -// New creates a new forwarding request. +// Creates a ForwardingRequest object. func (c Client) New(params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { request := &stripe.ForwardingRequest{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ForwardingRequestParams) (*stripe.ForwardingR return request, err } -// Get returns the details of a forwarding request. +// Retrieves a ForwardingRequest object. func Get(id string, params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { return getC().Get(id, params) } -// Get returns the details of a forwarding request. +// Retrieves a ForwardingRequest object. func (c Client) Get(id string, params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { path := stripe.FormatURLPath("/v1/forwarding/requests/%s", id) request := &stripe.ForwardingRequest{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ForwardingRequestParams) (*stripe. return request, err } -// List returns a list of forwarding requests. +// Lists all ForwardingRequest objects. func List(params *stripe.ForwardingRequestListParams) *Iter { return getC().List(params) } -// List returns a list of forwarding requests. +// Lists all ForwardingRequest objects. func (c Client) List(listParams *stripe.ForwardingRequestListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/identity/verificationreport/client.go b/identity/verificationreport/client.go index fbbf25450a..df6aadd599 100644 --- a/identity/verificationreport/client.go +++ b/identity/verificationreport/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an identity verification report. +// Retrieves an existing VerificationReport func Get(id string, params *stripe.IdentityVerificationReportParams) (*stripe.IdentityVerificationReport, error) { return getC().Get(id, params) } -// Get returns the details of an identity verification report. +// Retrieves an existing VerificationReport func (c Client) Get(id string, params *stripe.IdentityVerificationReportParams) (*stripe.IdentityVerificationReport, error) { path := stripe.FormatURLPath("/v1/identity/verification_reports/%s", id) verificationreport := &stripe.IdentityVerificationReport{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IdentityVerificationReportParams) return verificationreport, err } -// List returns a list of identity verification reports. +// List all verification reports. func List(params *stripe.IdentityVerificationReportListParams) *Iter { return getC().List(params) } -// List returns a list of identity verification reports. +// List all verification reports. func (c Client) List(listParams *stripe.IdentityVerificationReportListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/identity/verificationsession/client.go b/identity/verificationsession/client.go index f8c93dbc30..24504b85a2 100644 --- a/identity/verificationsession/client.go +++ b/identity/verificationsession/client.go @@ -20,12 +20,24 @@ type Client struct { Key string } -// New creates a new identity verification session. +// Creates a VerificationSession object. +// +// After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. +// +// If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. +// +// Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) func New(params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { return getC().New(params) } -// New creates a new identity verification session. +// Creates a VerificationSession object. +// +// After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. +// +// If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. +// +// Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) func (c Client) New(params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { verificationsession := &stripe.IdentityVerificationSession{} err := c.B.Call( @@ -38,12 +50,18 @@ func (c Client) New(params *stripe.IdentityVerificationSessionParams) (*stripe.I return verificationsession, err } -// Get returns the details of an identity verification session. +// Retrieves the details of a VerificationSession that was previously created. +// +// When the session status is requires_input, you can use this method to retrieve a valid +// client_secret or url to allow re-submission. func Get(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { return getC().Get(id, params) } -// Get returns the details of an identity verification session. +// Retrieves the details of a VerificationSession that was previously created. +// +// When the session status is requires_input, you can use this method to retrieve a valid +// client_secret or url to allow re-submission. func (c Client) Get(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath("/v1/identity/verification_sessions/%s", id) verificationsession := &stripe.IdentityVerificationSession{} @@ -51,12 +69,18 @@ func (c Client) Get(id string, params *stripe.IdentityVerificationSessionParams) return verificationsession, err } -// Update updates an identity verification session's properties. +// Updates a VerificationSession object. +// +// When the session status is requires_input, you can use this method to update the +// verification check and options. func Update(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { return getC().Update(id, params) } -// Update updates an identity verification session's properties. +// Updates a VerificationSession object. +// +// When the session status is requires_input, you can use this method to update the +// verification check and options. func (c Client) Update(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath("/v1/identity/verification_sessions/%s", id) verificationsession := &stripe.IdentityVerificationSession{} @@ -64,12 +88,16 @@ func (c Client) Update(id string, params *stripe.IdentityVerificationSessionPara return verificationsession, err } -// Cancel is the method for the `POST /v1/identity/verification_sessions/{session}/cancel` API. +// A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). +// +// Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). func Cancel(id string, params *stripe.IdentityVerificationSessionCancelParams) (*stripe.IdentityVerificationSession, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/identity/verification_sessions/{session}/cancel` API. +// A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). +// +// Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). func (c Client) Cancel(id string, params *stripe.IdentityVerificationSessionCancelParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath( "/v1/identity/verification_sessions/%s/cancel", @@ -80,12 +108,48 @@ func (c Client) Cancel(id string, params *stripe.IdentityVerificationSessionCanc return verificationsession, err } -// Redact is the method for the `POST /v1/identity/verification_sessions/{session}/redact` API. +// Redact a VerificationSession to remove all collected information from Stripe. This will redact +// the VerificationSession and all objects related to it, including VerificationReports, Events, +// request logs, etc. +// +// A VerificationSession object can be redacted when it is in requires_input or verified +// [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action +// state will automatically cancel it. +// +// The redaction process may take up to four days. When the redaction process is in progress, the +// VerificationSession's redaction.status field will be set to processing; when the process is +// finished, it will change to redacted and an identity.verification_session.redacted event +// will be emitted. +// +// Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the +// fields that contain personal data will be replaced by the string [redacted] or a similar +// placeholder. The metadata field will also be erased. Redacted objects cannot be updated or +// used for any purpose. +// +// [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). func Redact(id string, params *stripe.IdentityVerificationSessionRedactParams) (*stripe.IdentityVerificationSession, error) { return getC().Redact(id, params) } -// Redact is the method for the `POST /v1/identity/verification_sessions/{session}/redact` API. +// Redact a VerificationSession to remove all collected information from Stripe. This will redact +// the VerificationSession and all objects related to it, including VerificationReports, Events, +// request logs, etc. +// +// A VerificationSession object can be redacted when it is in requires_input or verified +// [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action +// state will automatically cancel it. +// +// The redaction process may take up to four days. When the redaction process is in progress, the +// VerificationSession's redaction.status field will be set to processing; when the process is +// finished, it will change to redacted and an identity.verification_session.redacted event +// will be emitted. +// +// Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the +// fields that contain personal data will be replaced by the string [redacted] or a similar +// placeholder. The metadata field will also be erased. Redacted objects cannot be updated or +// used for any purpose. +// +// [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). func (c Client) Redact(id string, params *stripe.IdentityVerificationSessionRedactParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath( "/v1/identity/verification_sessions/%s/redact", @@ -96,12 +160,12 @@ func (c Client) Redact(id string, params *stripe.IdentityVerificationSessionReda return verificationsession, err } -// List returns a list of identity verification sessions. +// Returns a list of VerificationSessions func List(params *stripe.IdentityVerificationSessionListParams) *Iter { return getC().List(params) } -// List returns a list of identity verification sessions. +// Returns a list of VerificationSessions func (c Client) List(listParams *stripe.IdentityVerificationSessionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/invoice/client.go b/invoice/client.go index 736b9c92e7..9146ab75a1 100644 --- a/invoice/client.go +++ b/invoice/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new invoice. +// 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. func New(params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().New(params) } -// New creates a new invoice. +// 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. func (c Client) New(params *stripe.InvoiceParams) (*stripe.Invoice, error) { invoice := &stripe.Invoice{} err := c.B.Call(http.MethodPost, "/v1/invoices", c.Key, params, invoice) return invoice, err } -// Get returns the details of an invoice. +// Retrieves the invoice with the given ID. func Get(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Get(id, params) } -// Get returns the details of an invoice. +// Retrieves the invoice with the given ID. func (c Client) Get(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s", id) invoice := &stripe.Invoice{} @@ -45,12 +45,22 @@ func (c Client) Get(id string, params *stripe.InvoiceParams) (*stripe.Invoice, e return invoice, err } -// Update updates an invoice's properties. +// Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), +// monetary values, as well as collection_method, become uneditable. +// +// If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, +// sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass +// auto_advance=false. func Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Update(id, params) } -// Update updates an invoice's properties. +// Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), +// monetary values, as well as collection_method, become uneditable. +// +// If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, +// sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass +// auto_advance=false. func (c Client) Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s", id) invoice := &stripe.Invoice{} @@ -58,12 +68,12 @@ func (c Client) Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice return invoice, err } -// Del removes an invoice. +// Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). func Del(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Del(id, params) } -// Del removes an invoice. +// Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). func (c Client) Del(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s", id) invoice := &stripe.Invoice{} @@ -71,12 +81,24 @@ func (c Client) Del(id string, params *stripe.InvoiceParams) (*stripe.Invoice, e return invoice, err } -// CreatePreview is the method for the `POST /v1/invoices/create_preview` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func CreatePreview(params *stripe.InvoiceCreatePreviewParams) (*stripe.Invoice, error) { return getC().CreatePreview(params) } -// CreatePreview is the method for the `POST /v1/invoices/create_preview` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func (c Client) CreatePreview(params *stripe.InvoiceCreatePreviewParams) (*stripe.Invoice, error) { invoice := &stripe.Invoice{} err := c.B.Call( @@ -89,12 +111,12 @@ func (c Client) CreatePreview(params *stripe.InvoiceCreatePreviewParams) (*strip return invoice, err } -// FinalizeInvoice is the method for the `POST /v1/invoices/{invoice}/finalize` API. +// Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. func FinalizeInvoice(id string, params *stripe.InvoiceFinalizeInvoiceParams) (*stripe.Invoice, error) { return getC().FinalizeInvoice(id, params) } -// FinalizeInvoice is the method for the `POST /v1/invoices/{invoice}/finalize` API. +// Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. func (c Client) FinalizeInvoice(id string, params *stripe.InvoiceFinalizeInvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/finalize", id) invoice := &stripe.Invoice{} @@ -102,12 +124,12 @@ func (c Client) FinalizeInvoice(id string, params *stripe.InvoiceFinalizeInvoice return invoice, err } -// MarkUncollectible is the method for the `POST /v1/invoices/{invoice}/mark_uncollectible` API. +// Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. func MarkUncollectible(id string, params *stripe.InvoiceMarkUncollectibleParams) (*stripe.Invoice, error) { return getC().MarkUncollectible(id, params) } -// MarkUncollectible is the method for the `POST /v1/invoices/{invoice}/mark_uncollectible` API. +// Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. func (c Client) MarkUncollectible(id string, params *stripe.InvoiceMarkUncollectibleParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/mark_uncollectible", id) invoice := &stripe.Invoice{} @@ -115,12 +137,12 @@ func (c Client) MarkUncollectible(id string, params *stripe.InvoiceMarkUncollect return invoice, err } -// Pay is the method for the `POST /v1/invoices/{invoice}/pay` API. +// Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. func Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice, error) { return getC().Pay(id, params) } -// Pay is the method for the `POST /v1/invoices/{invoice}/pay` API. +// Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. func (c Client) Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/pay", id) invoice := &stripe.Invoice{} @@ -128,12 +150,16 @@ func (c Client) Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice return invoice, err } -// SendInvoice is the method for the `POST /v1/invoices/{invoice}/send` API. +// Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. +// +// Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. func SendInvoice(id string, params *stripe.InvoiceSendInvoiceParams) (*stripe.Invoice, error) { return getC().SendInvoice(id, params) } -// SendInvoice is the method for the `POST /v1/invoices/{invoice}/send` API. +// Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. +// +// Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. func (c Client) SendInvoice(id string, params *stripe.InvoiceSendInvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/send", id) invoice := &stripe.Invoice{} @@ -141,12 +167,24 @@ func (c Client) SendInvoice(id string, params *stripe.InvoiceSendInvoiceParams) return invoice, err } -// Upcoming is the method for the `GET /v1/invoices/upcoming` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func Upcoming(params *stripe.InvoiceUpcomingParams) (*stripe.Invoice, error) { return getC().Upcoming(params) } -// Upcoming is the method for the `GET /v1/invoices/upcoming` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func (c Client) Upcoming(params *stripe.InvoiceUpcomingParams) (*stripe.Invoice, error) { invoice := &stripe.Invoice{} err := c.B.Call( @@ -159,12 +197,16 @@ func (c Client) Upcoming(params *stripe.InvoiceUpcomingParams) (*stripe.Invoice, return invoice, err } -// VoidInvoice is the method for the `POST /v1/invoices/{invoice}/void` API. +// Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. +// +// Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. func VoidInvoice(id string, params *stripe.InvoiceVoidInvoiceParams) (*stripe.Invoice, error) { return getC().VoidInvoice(id, params) } -// VoidInvoice is the method for the `POST /v1/invoices/{invoice}/void` API. +// Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. +// +// Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. func (c Client) VoidInvoice(id string, params *stripe.InvoiceVoidInvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/void", id) invoice := &stripe.Invoice{} @@ -172,12 +214,12 @@ func (c Client) VoidInvoice(id string, params *stripe.InvoiceVoidInvoiceParams) return invoice, err } -// List returns a list of invoices. +// You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. func List(params *stripe.InvoiceListParams) *Iter { return getC().List(params) } -// List returns a list of invoices. +// You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. func (c Client) List(listParams *stripe.InvoiceListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -211,12 +253,12 @@ func (i *Iter) InvoiceList() *stripe.InvoiceList { return i.List().(*stripe.InvoiceList) } -// ListLines is the method for the `GET /v1/invoices/{invoice}/lines` API. +// When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLines(params *stripe.InvoiceListLinesParams) *LineItemIter { return getC().ListLines(params) } -// ListLines is the method for the `GET /v1/invoices/{invoice}/lines` API. +// When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLines(listParams *stripe.InvoiceListLinesParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/invoices/%s/lines", @@ -237,12 +279,12 @@ func (c Client) ListLines(listParams *stripe.InvoiceListLinesParams) *LineItemIt } } -// UpcomingLines is the method for the `GET /v1/invoices/upcoming/lines` API. +// When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func UpcomingLines(params *stripe.InvoiceUpcomingLinesParams) *LineItemIter { return getC().UpcomingLines(params) } -// UpcomingLines is the method for the `GET /v1/invoices/upcoming/lines` API. +// When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) UpcomingLines(listParams *stripe.InvoiceUpcomingLinesParams) *LineItemIter { return &LineItemIter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -276,12 +318,18 @@ func (i *LineItemIter) InvoiceLineItemList() *stripe.InvoiceLineItemList { return i.List().(*stripe.InvoiceLineItemList) } -// Search returns a search result containing invoices. +// Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.InvoiceSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing invoices. +// Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.InvoiceSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/invoiceitem/client.go b/invoiceitem/client.go index b69701c607..71495d2268 100644 --- a/invoiceitem/client.go +++ b/invoiceitem/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new invoice item. +// Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. func New(params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().New(params) } -// New creates a new invoice item. +// Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. func (c Client) New(params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { invoiceitem := &stripe.InvoiceItem{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, erro return invoiceitem, err } -// Get returns the details of an invoice item. +// Retrieves the invoice item with the given ID. func Get(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().Get(id, params) } -// Get returns the details of an invoice item. +// Retrieves the invoice item with the given ID. func (c Client) Get(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) invoiceitem := &stripe.InvoiceItem{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.InvoiceItemParams) (*stripe.Invoic return invoiceitem, err } -// Update updates an invoice item's properties. +// Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. func Update(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().Update(id, params) } -// Update updates an invoice item's properties. +// Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. func (c Client) Update(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) invoiceitem := &stripe.InvoiceItem{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.InvoiceItemParams) (*stripe.Inv return invoiceitem, err } -// Del removes an invoice item. +// Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. func Del(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().Del(id, params) } -// Del removes an invoice item. +// Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. func (c Client) Del(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) invoiceitem := &stripe.InvoiceItem{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.InvoiceItemParams) (*stripe.Invoic return invoiceitem, err } -// List returns a list of invoice items. +// Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. func List(params *stripe.InvoiceItemListParams) *Iter { return getC().List(params) } -// List returns a list of invoice items. +// Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. func (c Client) List(listParams *stripe.InvoiceItemListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/invoicelineitem/client.go b/invoicelineitem/client.go index 1ed7f58e96..3e08877c32 100644 --- a/invoicelineitem/client.go +++ b/invoicelineitem/client.go @@ -19,12 +19,18 @@ type Client struct { Key string } -// Update updates an invoice line item's properties. +// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, +// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice +// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. +// Updating an invoice's line item is only possible before the invoice is finalized. func Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { return getC().Update(id, params) } -// Update updates an invoice line item's properties. +// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, +// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice +// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. +// Updating an invoice's line item is only possible before the invoice is finalized. func (c Client) Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { path := stripe.FormatURLPath( "/v1/invoices/%s/lines/%s", diff --git a/issuing/authorization/client.go b/issuing/authorization/client.go index 64d6f567a9..7c89910042 100644 --- a/issuing/authorization/client.go +++ b/issuing/authorization/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing authorization. +// Retrieves an Issuing Authorization object. func Get(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().Get(id, params) } -// Get returns the details of an issuing authorization. +// Retrieves an Issuing Authorization object. func (c Client) Get(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s", id) authorization := &stripe.IssuingAuthorization{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingAuthorizationParams) (*stri return authorization, err } -// Update updates an issuing authorization's properties. +// Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().Update(id, params) } -// Update updates an issuing authorization's properties. +// Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s", id) authorization := &stripe.IssuingAuthorization{} @@ -46,13 +46,15 @@ func (c Client) Update(id string, params *stripe.IssuingAuthorizationParams) (*s return authorization, err } -// Approve is the method for the `POST /v1/issuing/authorizations/{authorization}/approve` API. +// [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func Approve(id string, params *stripe.IssuingAuthorizationApproveParams) (*stripe.IssuingAuthorization, error) { return getC().Approve(id, params) } -// Approve is the method for the `POST /v1/issuing/authorizations/{authorization}/approve` API. +// [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func (c Client) Approve(id string, params *stripe.IssuingAuthorizationApproveParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s/approve", id) @@ -61,13 +63,15 @@ func (c Client) Approve(id string, params *stripe.IssuingAuthorizationApprovePar return authorization, err } -// Decline is the method for the `POST /v1/issuing/authorizations/{authorization}/decline` API. +// [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func Decline(id string, params *stripe.IssuingAuthorizationDeclineParams) (*stripe.IssuingAuthorization, error) { return getC().Decline(id, params) } -// Decline is the method for the `POST /v1/issuing/authorizations/{authorization}/decline` API. +// [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func (c Client) Decline(id string, params *stripe.IssuingAuthorizationDeclineParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s/decline", id) @@ -76,12 +80,12 @@ func (c Client) Decline(id string, params *stripe.IssuingAuthorizationDeclinePar return authorization, err } -// List returns a list of issuing authorizations. +// Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingAuthorizationListParams) *Iter { return getC().List(params) } -// List returns a list of issuing authorizations. +// Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingAuthorizationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/card/client.go b/issuing/card/client.go index 57f08913a0..f5f068758e 100644 --- a/issuing/card/client.go +++ b/issuing/card/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new issuing card. +// Creates an Issuing Card object. func New(params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { return getC().New(params) } -// New creates a new issuing card. +// Creates an Issuing Card object. func (c Client) New(params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { card := &stripe.IssuingCard{} err := c.B.Call(http.MethodPost, "/v1/issuing/cards", c.Key, params, card) return card, err } -// Get returns the details of an issuing card. +// Retrieves an Issuing Card object. func Get(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { return getC().Get(id, params) } -// Get returns the details of an issuing card. +// Retrieves an Issuing Card object. func (c Client) Get(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath("/v1/issuing/cards/%s", id) card := &stripe.IssuingCard{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.IssuingCardParams) (*stripe.Issuin return card, err } -// Update updates an issuing card's properties. +// Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { return getC().Update(id, params) } -// Update updates an issuing card's properties. +// Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath("/v1/issuing/cards/%s", id) card := &stripe.IssuingCard{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.IssuingCardParams) (*stripe.Iss return card, err } -// List returns a list of issuing cards. +// Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingCardListParams) *Iter { return getC().List(params) } -// List returns a list of issuing cards. +// Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingCardListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/cardholder/client.go b/issuing/cardholder/client.go index dee93f095b..20f8643ca3 100644 --- a/issuing/cardholder/client.go +++ b/issuing/cardholder/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new issuing cardholder. +// Creates a new Issuing Cardholder object that can be issued cards. func New(params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { return getC().New(params) } -// New creates a new issuing cardholder. +// Creates a new Issuing Cardholder object that can be issued cards. func (c Client) New(params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { cardholder := &stripe.IssuingCardholder{} err := c.B.Call( @@ -39,12 +39,12 @@ func (c Client) New(params *stripe.IssuingCardholderParams) (*stripe.IssuingCard return cardholder, err } -// Get returns the details of an issuing cardholder. +// Retrieves an Issuing Cardholder object. func Get(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { return getC().Get(id, params) } -// Get returns the details of an issuing cardholder. +// Retrieves an Issuing Cardholder object. func (c Client) Get(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { path := stripe.FormatURLPath("/v1/issuing/cardholders/%s", id) cardholder := &stripe.IssuingCardholder{} @@ -52,12 +52,12 @@ func (c Client) Get(id string, params *stripe.IssuingCardholderParams) (*stripe. return cardholder, err } -// Update updates an issuing cardholder's properties. +// Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { return getC().Update(id, params) } -// Update updates an issuing cardholder's properties. +// Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { path := stripe.FormatURLPath("/v1/issuing/cardholders/%s", id) cardholder := &stripe.IssuingCardholder{} @@ -65,12 +65,12 @@ func (c Client) Update(id string, params *stripe.IssuingCardholderParams) (*stri return cardholder, err } -// List returns a list of issuing cardholders. +// Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingCardholderListParams) *Iter { return getC().List(params) } -// List returns a list of issuing cardholders. +// Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingCardholderListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/dispute/client.go b/issuing/dispute/client.go index f29eb63a69..92f8218577 100644 --- a/issuing/dispute/client.go +++ b/issuing/dispute/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new issuing dispute. +// Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. func New(params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().New(params) } -// New creates a new issuing dispute. +// Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. func (c Client) New(params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { dispute := &stripe.IssuingDispute{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute return dispute, err } -// Get returns the details of an issuing dispute. +// Retrieves an Issuing Dispute object. func Get(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().Get(id, params) } -// Get returns the details of an issuing dispute. +// Retrieves an Issuing Dispute object. func (c Client) Get(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { path := stripe.FormatURLPath("/v1/issuing/disputes/%s", id) dispute := &stripe.IssuingDispute{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.IssuingDisputeParams) (*stripe.Iss return dispute, err } -// Update updates an issuing dispute's properties. +// Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. func Update(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().Update(id, params) } -// Update updates an issuing dispute's properties. +// Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. func (c Client) Update(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { path := stripe.FormatURLPath("/v1/issuing/disputes/%s", id) dispute := &stripe.IssuingDispute{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.IssuingDisputeParams) (*stripe. return dispute, err } -// Submit is the method for the `POST /v1/issuing/disputes/{dispute}/submit` API. +// Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). func Submit(id string, params *stripe.IssuingDisputeSubmitParams) (*stripe.IssuingDispute, error) { return getC().Submit(id, params) } -// Submit is the method for the `POST /v1/issuing/disputes/{dispute}/submit` API. +// Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). func (c Client) Submit(id string, params *stripe.IssuingDisputeSubmitParams) (*stripe.IssuingDispute, error) { path := stripe.FormatURLPath("/v1/issuing/disputes/%s/submit", id) dispute := &stripe.IssuingDispute{} @@ -77,12 +77,12 @@ func (c Client) Submit(id string, params *stripe.IssuingDisputeSubmitParams) (*s return dispute, err } -// List returns a list of issuing disputes. +// Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingDisputeListParams) *Iter { return getC().List(params) } -// List returns a list of issuing disputes. +// Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingDisputeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/personalizationdesign/client.go b/issuing/personalizationdesign/client.go index 7b17ab85d4..f4a4cd83db 100644 --- a/issuing/personalizationdesign/client.go +++ b/issuing/personalizationdesign/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new issuing personalization design. +// Creates a personalization design object. func New(params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().New(params) } -// New creates a new issuing personalization design. +// Creates a personalization design object. func (c Client) New(params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { personalizationdesign := &stripe.IssuingPersonalizationDesign{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.IssuingPersonalizationDesignParams) (*stripe. return personalizationdesign, err } -// Get returns the details of an issuing personalization design. +// Retrieves a personalization design object. func Get(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Get(id, params) } -// Get returns the details of an issuing personalization design. +// Retrieves a personalization design object. func (c Client) Get(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath("/v1/issuing/personalization_designs/%s", id) personalizationdesign := &stripe.IssuingPersonalizationDesign{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.IssuingPersonalizationDesignParams return personalizationdesign, err } -// Update updates an issuing personalization design's properties. +// Updates a card personalization object. func Update(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Update(id, params) } -// Update updates an issuing personalization design's properties. +// Updates a card personalization object. func (c Client) Update(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath("/v1/issuing/personalization_designs/%s", id) personalizationdesign := &stripe.IssuingPersonalizationDesign{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.IssuingPersonalizationDesignPar return personalizationdesign, err } -// List returns a list of issuing personalization designs. +// Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingPersonalizationDesignListParams) *Iter { return getC().List(params) } -// List returns a list of issuing personalization designs. +// Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingPersonalizationDesignListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/physicalbundle/client.go b/issuing/physicalbundle/client.go index a07a6d24f2..364bcb1cf2 100644 --- a/issuing/physicalbundle/client.go +++ b/issuing/physicalbundle/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing physical bundle. +// Retrieves a physical bundle object. func Get(id string, params *stripe.IssuingPhysicalBundleParams) (*stripe.IssuingPhysicalBundle, error) { return getC().Get(id, params) } -// Get returns the details of an issuing physical bundle. +// Retrieves a physical bundle object. func (c Client) Get(id string, params *stripe.IssuingPhysicalBundleParams) (*stripe.IssuingPhysicalBundle, error) { path := stripe.FormatURLPath("/v1/issuing/physical_bundles/%s", id) physicalbundle := &stripe.IssuingPhysicalBundle{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingPhysicalBundleParams) (*str return physicalbundle, err } -// List returns a list of issuing physical bundles. +// Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingPhysicalBundleListParams) *Iter { return getC().List(params) } -// List returns a list of issuing physical bundles. +// Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingPhysicalBundleListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/token/client.go b/issuing/token/client.go index bff28fd2b2..83354489cf 100644 --- a/issuing/token/client.go +++ b/issuing/token/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing token. +// Retrieves an Issuing Token object. func Get(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { return getC().Get(id, params) } -// Get returns the details of an issuing token. +// Retrieves an Issuing Token object. func (c Client) Get(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { path := stripe.FormatURLPath("/v1/issuing/tokens/%s", id) token := &stripe.IssuingToken{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingTokenParams) (*stripe.Issui return token, err } -// Update updates an issuing token's properties. +// Attempts to update the specified Issuing Token object to the status specified. func Update(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { return getC().Update(id, params) } -// Update updates an issuing token's properties. +// Attempts to update the specified Issuing Token object to the status specified. func (c Client) Update(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { path := stripe.FormatURLPath("/v1/issuing/tokens/%s", id) token := &stripe.IssuingToken{} @@ -46,12 +46,12 @@ func (c Client) Update(id string, params *stripe.IssuingTokenParams) (*stripe.Is return token, err } -// List returns a list of issuing tokens. +// Lists all Issuing Token objects for a given card. func List(params *stripe.IssuingTokenListParams) *Iter { return getC().List(params) } -// List returns a list of issuing tokens. +// Lists all Issuing Token objects for a given card. func (c Client) List(listParams *stripe.IssuingTokenListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/transaction/client.go b/issuing/transaction/client.go index 82b76278d6..427878d1a6 100644 --- a/issuing/transaction/client.go +++ b/issuing/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing transaction. +// Retrieves an Issuing Transaction object. func Get(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { return getC().Get(id, params) } -// Get returns the details of an issuing transaction. +// Retrieves an Issuing Transaction object. func (c Client) Get(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath("/v1/issuing/transactions/%s", id) transaction := &stripe.IssuingTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingTransactionParams) (*stripe return transaction, err } -// Update updates an issuing transaction's properties. +// Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { return getC().Update(id, params) } -// Update updates an issuing transaction's properties. +// Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath("/v1/issuing/transactions/%s", id) transaction := &stripe.IssuingTransaction{} @@ -46,12 +46,12 @@ func (c Client) Update(id string, params *stripe.IssuingTransactionParams) (*str return transaction, err } -// List returns a list of issuing transactions. +// Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of issuing transactions. +// Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/loginlink/client.go b/loginlink/client.go index 4f30566e55..a1682f98b6 100644 --- a/loginlink/client.go +++ b/loginlink/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// New creates a new login link. +// Creates a single-use login link for a connected account to access the Express Dashboard. +// +// You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. func New(params *stripe.LoginLinkParams) (*stripe.LoginLink, error) { return getC().New(params) } -// New creates a new login link. +// Creates a single-use login link for a connected account to access the Express Dashboard. +// +// You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. func (c Client) New(params *stripe.LoginLinkParams) (*stripe.LoginLink, error) { if params.Account == nil { return nil, fmt.Errorf("Invalid login link params: Account must be set") diff --git a/mandate/client.go b/mandate/client.go index 798f1a457a..7c2a5237a1 100644 --- a/mandate/client.go +++ b/mandate/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Get returns the details of a mandate. +// Retrieves a Mandate object. func Get(id string, params *stripe.MandateParams) (*stripe.Mandate, error) { return getC().Get(id, params) } -// Get returns the details of a mandate. +// Retrieves a Mandate object. func (c Client) Get(id string, params *stripe.MandateParams) (*stripe.Mandate, error) { path := stripe.FormatURLPath("/v1/mandates/%s", id) mandate := &stripe.Mandate{} diff --git a/paymentintent/client.go b/paymentintent/client.go index d30cf997a3..472e9571b1 100644 --- a/paymentintent/client.go +++ b/paymentintent/client.go @@ -20,12 +20,30 @@ type Client struct { Key string } -// New creates a new payment intent. +// 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. Learn more about the available payment flows +// with the Payment Intents API. +// +// 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. func New(params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { return getC().New(params) } -// New creates a new payment intent. +// 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. Learn more about the available payment flows +// with the Payment Intents API. +// +// 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. func (c Client) New(params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { paymentintent := &stripe.PaymentIntent{} err := c.B.Call( @@ -38,12 +56,20 @@ func (c Client) New(params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, return paymentintent, err } -// Get returns the details of a payment intent. +// Retrieves the details of a PaymentIntent that has previously been created. +// +// You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. +// +// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. func Get(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { return getC().Get(id, params) } -// Get returns the details of a payment intent. +// Retrieves the details of a PaymentIntent that has previously been created. +// +// You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. +// +// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. func (c Client) Get(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s", id) paymentintent := &stripe.PaymentIntent{} @@ -51,12 +77,24 @@ func (c Client) Get(id string, params *stripe.PaymentIntentParams) (*stripe.Paym return paymentintent, err } -// Update updates a payment intent's properties. +// Updates properties on a PaymentIntent object without confirming. +// +// Depending on which properties you update, you might need to confirm the +// PaymentIntent again. For example, updating the payment_method +// always requires you to confirm the PaymentIntent again. If you prefer to +// update and confirm at the same time, we recommend updating properties through +// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. func Update(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { return getC().Update(id, params) } -// Update updates a payment intent's properties. +// Updates properties on a PaymentIntent object without confirming. +// +// Depending on which properties you update, you might need to confirm the +// PaymentIntent again. For example, updating the payment_method +// always requires you to confirm the PaymentIntent again. If you prefer to +// update and confirm at the same time, we recommend updating properties through +// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. func (c Client) Update(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s", id) paymentintent := &stripe.PaymentIntent{} @@ -64,12 +102,12 @@ func (c Client) Update(id string, params *stripe.PaymentIntentParams) (*stripe.P return paymentintent, err } -// ApplyCustomerBalance is the method for the `POST /v1/payment_intents/{intent}/apply_customer_balance` API. +// Manually reconcile the remaining amount for a customer_balance PaymentIntent. func ApplyCustomerBalance(id string, params *stripe.PaymentIntentApplyCustomerBalanceParams) (*stripe.PaymentIntent, error) { return getC().ApplyCustomerBalance(id, params) } -// ApplyCustomerBalance is the method for the `POST /v1/payment_intents/{intent}/apply_customer_balance` API. +// Manually reconcile the remaining amount for a customer_balance PaymentIntent. func (c Client) ApplyCustomerBalance(id string, params *stripe.PaymentIntentApplyCustomerBalanceParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath( "/v1/payment_intents/%s/apply_customer_balance", @@ -80,12 +118,20 @@ func (c Client) ApplyCustomerBalance(id string, params *stripe.PaymentIntentAppl return paymentintent, err } -// Cancel is the method for the `POST /v1/payment_intents/{intent}/cancel` API. +// 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. +// +// 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 can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. func Cancel(id string, params *stripe.PaymentIntentCancelParams) (*stripe.PaymentIntent, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/payment_intents/{intent}/cancel` API. +// 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. +// +// 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 can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. func (c Client) Cancel(id string, params *stripe.PaymentIntentCancelParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s/cancel", id) paymentintent := &stripe.PaymentIntent{} @@ -93,12 +139,20 @@ func (c Client) Cancel(id string, params *stripe.PaymentIntentCancelParams) (*st return paymentintent, err } -// Capture is the method for the `POST /v1/payment_intents/{intent}/capture` API. +// Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. +// +// 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). func Capture(id string, params *stripe.PaymentIntentCaptureParams) (*stripe.PaymentIntent, error) { return getC().Capture(id, params) } -// Capture is the method for the `POST /v1/payment_intents/{intent}/capture` API. +// Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. +// +// 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). func (c Client) Capture(id string, params *stripe.PaymentIntentCaptureParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s/capture", id) paymentintent := &stripe.PaymentIntent{} @@ -106,12 +160,54 @@ func (c Client) Capture(id string, params *stripe.PaymentIntentCaptureParams) (* return paymentintent, err } -// Confirm is the method for the `POST /v1/payment_intents/{intent}/confirm` API. +// Confirm that your customer intends to pay with current or provided +// payment method. Upon confirmation, the PaymentIntent will attempt to initiate +// a payment. +// If the selected payment method requires additional authentication steps, the +// PaymentIntent will transition to the requires_action status and +// suggest additional actions via next_action. If payment fails, +// the PaymentIntent transitions to the requires_payment_method status or the +// canceled status if the confirmation limit is reached. If +// payment succeeds, the PaymentIntent will transition to the succeeded +// status (or requires_capture, if capture_method is set to manual). +// If the confirmation_method is automatic, payment may be attempted +// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) +// and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). +// After next_actions are handled by the client, no additional +// confirmation is required to complete the payment. +// If the confirmation_method is manual, all payment attempts must be +// initiated using a secret key. +// If any actions are required for the payment, the PaymentIntent will +// return to the requires_confirmation state +// after those actions are completed. Your server needs to then +// explicitly re-confirm the PaymentIntent to initiate the next payment +// attempt. func Confirm(id string, params *stripe.PaymentIntentConfirmParams) (*stripe.PaymentIntent, error) { return getC().Confirm(id, params) } -// Confirm is the method for the `POST /v1/payment_intents/{intent}/confirm` API. +// Confirm that your customer intends to pay with current or provided +// payment method. Upon confirmation, the PaymentIntent will attempt to initiate +// a payment. +// If the selected payment method requires additional authentication steps, the +// PaymentIntent will transition to the requires_action status and +// suggest additional actions via next_action. If payment fails, +// the PaymentIntent transitions to the requires_payment_method status or the +// canceled status if the confirmation limit is reached. If +// payment succeeds, the PaymentIntent will transition to the succeeded +// status (or requires_capture, if capture_method is set to manual). +// If the confirmation_method is automatic, payment may be attempted +// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) +// and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). +// After next_actions are handled by the client, no additional +// confirmation is required to complete the payment. +// If the confirmation_method is manual, all payment attempts must be +// initiated using a secret key. +// If any actions are required for the payment, the PaymentIntent will +// return to the requires_confirmation state +// after those actions are completed. Your server needs to then +// explicitly re-confirm the PaymentIntent to initiate the next payment +// attempt. func (c Client) Confirm(id string, params *stripe.PaymentIntentConfirmParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s/confirm", id) paymentintent := &stripe.PaymentIntent{} @@ -119,12 +215,58 @@ func (c Client) Confirm(id string, params *stripe.PaymentIntentConfirmParams) (* return paymentintent, err } -// IncrementAuthorization is the method for the `POST /v1/payment_intents/{intent}/increment_authorization` API. +// Perform an incremental authorization on an eligible +// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the +// PaymentIntent's status must be requires_capture and +// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) +// must be true. +// +// Incremental authorizations attempt to increase the authorized amount on +// 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 +// 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 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. +// After it's captured, a PaymentIntent can no longer be incremented. +// +// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). func IncrementAuthorization(id string, params *stripe.PaymentIntentIncrementAuthorizationParams) (*stripe.PaymentIntent, error) { return getC().IncrementAuthorization(id, params) } -// IncrementAuthorization is the method for the `POST /v1/payment_intents/{intent}/increment_authorization` API. +// Perform an incremental authorization on an eligible +// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the +// PaymentIntent's status must be requires_capture and +// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) +// must be true. +// +// Incremental authorizations attempt to increase the authorized amount on +// 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 +// 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 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. +// After it's captured, a PaymentIntent can no longer be incremented. +// +// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). func (c Client) IncrementAuthorization(id string, params *stripe.PaymentIntentIncrementAuthorizationParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath( "/v1/payment_intents/%s/increment_authorization", @@ -135,12 +277,12 @@ func (c Client) IncrementAuthorization(id string, params *stripe.PaymentIntentIn return paymentintent, err } -// VerifyMicrodeposits is the method for the `POST /v1/payment_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a PaymentIntent object. func VerifyMicrodeposits(id string, params *stripe.PaymentIntentVerifyMicrodepositsParams) (*stripe.PaymentIntent, error) { return getC().VerifyMicrodeposits(id, params) } -// VerifyMicrodeposits is the method for the `POST /v1/payment_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a PaymentIntent object. func (c Client) VerifyMicrodeposits(id string, params *stripe.PaymentIntentVerifyMicrodepositsParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath( "/v1/payment_intents/%s/verify_microdeposits", @@ -151,12 +293,12 @@ func (c Client) VerifyMicrodeposits(id string, params *stripe.PaymentIntentVerif return paymentintent, err } -// List returns a list of payment intents. +// Returns a list of PaymentIntents. func List(params *stripe.PaymentIntentListParams) *Iter { return getC().List(params) } -// List returns a list of payment intents. +// Returns a list of PaymentIntents. func (c Client) List(listParams *stripe.PaymentIntentListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -190,12 +332,18 @@ func (i *Iter) PaymentIntentList() *stripe.PaymentIntentList { return i.List().(*stripe.PaymentIntentList) } -// Search returns a search result containing payment intents. +// Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.PaymentIntentSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing payment intents. +// Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.PaymentIntentSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/paymentlink/client.go b/paymentlink/client.go index e7f8e65d53..8be4c21e6d 100644 --- a/paymentlink/client.go +++ b/paymentlink/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new payment link. +// Creates a payment link. func New(params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { return getC().New(params) } -// New creates a new payment link. +// Creates a payment link. func (c Client) New(params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { paymentlink := &stripe.PaymentLink{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PaymentLinkParams) (*stripe.PaymentLink, erro return paymentlink, err } -// Get returns the details of a payment link. +// Retrieve a payment link. func Get(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { return getC().Get(id, params) } -// Get returns the details of a payment link. +// Retrieve a payment link. func (c Client) Get(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { path := stripe.FormatURLPath("/v1/payment_links/%s", id) paymentlink := &stripe.PaymentLink{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.PaymentLinkParams) (*stripe.Paymen return paymentlink, err } -// Update updates a payment link's properties. +// Updates a payment link. func Update(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { return getC().Update(id, params) } -// Update updates a payment link's properties. +// Updates a payment link. func (c Client) Update(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { path := stripe.FormatURLPath("/v1/payment_links/%s", id) paymentlink := &stripe.PaymentLink{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.PaymentLinkParams) (*stripe.Pay return paymentlink, err } -// List returns a list of payment links. +// Returns a list of your payment links. func List(params *stripe.PaymentLinkListParams) *Iter { return getC().List(params) } -// List returns a list of payment links. +// Returns a list of your payment links. func (c Client) List(listParams *stripe.PaymentLinkListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -103,12 +103,12 @@ func (i *Iter) PaymentLinkList() *stripe.PaymentLinkList { return i.List().(*stripe.PaymentLinkList) } -// ListLineItems is the method for the `GET /v1/payment_links/{payment_link}/line_items` API. +// When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.PaymentLinkListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/payment_links/{payment_link}/line_items` API. +// When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.PaymentLinkListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/payment_links/%s/line_items", diff --git a/paymentmethod/client.go b/paymentmethod/client.go index 24597e0ed4..87f5493524 100644 --- a/paymentmethod/client.go +++ b/paymentmethod/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// New creates a new payment method. +// Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. +// +// Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. func New(params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().New(params) } -// New creates a new payment method. +// Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. +// +// Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. func (c Client) New(params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { paymentmethod := &stripe.PaymentMethod{} err := c.B.Call( @@ -38,12 +42,12 @@ func (c Client) New(params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, return paymentmethod, err } -// Get returns the details of a payment method. +// Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) func Get(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().Get(id, params) } -// Get returns the details of a payment method. +// Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) func (c Client) Get(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s", id) paymentmethod := &stripe.PaymentMethod{} @@ -51,12 +55,12 @@ func (c Client) Get(id string, params *stripe.PaymentMethodParams) (*stripe.Paym return paymentmethod, err } -// Update updates a payment method's properties. +// Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. func Update(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().Update(id, params) } -// Update updates a payment method's properties. +// Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. func (c Client) Update(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s", id) paymentmethod := &stripe.PaymentMethod{} @@ -64,12 +68,36 @@ func (c Client) Update(id string, params *stripe.PaymentMethodParams) (*stripe.P return paymentmethod, err } -// Attach is the method for the `POST /v1/payment_methods/{payment_method}/attach` API. +// Attaches a PaymentMethod object to a Customer. +// +// To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) +// or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). +// These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach +// endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for +// future use, which makes later declines and payment friction more likely. +// See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up +// future payments. +// +// To use this PaymentMethod as the default for invoice or subscription payments, +// set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), +// on the Customer to the PaymentMethod's ID. func Attach(id string, params *stripe.PaymentMethodAttachParams) (*stripe.PaymentMethod, error) { return getC().Attach(id, params) } -// Attach is the method for the `POST /v1/payment_methods/{payment_method}/attach` API. +// Attaches a PaymentMethod object to a Customer. +// +// To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) +// or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). +// These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach +// endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for +// future use, which makes later declines and payment friction more likely. +// See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up +// future payments. +// +// To use this PaymentMethod as the default for invoice or subscription payments, +// set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), +// on the Customer to the PaymentMethod's ID. func (c Client) Attach(id string, params *stripe.PaymentMethodAttachParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s/attach", id) paymentmethod := &stripe.PaymentMethod{} @@ -77,12 +105,12 @@ func (c Client) Attach(id string, params *stripe.PaymentMethodAttachParams) (*st return paymentmethod, err } -// Detach is the method for the `POST /v1/payment_methods/{payment_method}/detach` API. +// Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. func Detach(id string, params *stripe.PaymentMethodDetachParams) (*stripe.PaymentMethod, error) { return getC().Detach(id, params) } -// Detach is the method for the `POST /v1/payment_methods/{payment_method}/detach` API. +// Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. func (c Client) Detach(id string, params *stripe.PaymentMethodDetachParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s/detach", id) paymentmethod := &stripe.PaymentMethod{} @@ -90,12 +118,12 @@ func (c Client) Detach(id string, params *stripe.PaymentMethodDetachParams) (*st return paymentmethod, err } -// List returns a list of payment methods. +// Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. func List(params *stripe.PaymentMethodListParams) *Iter { return getC().List(params) } -// List returns a list of payment methods. +// Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. func (c Client) List(listParams *stripe.PaymentMethodListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/paymentmethodconfiguration/client.go b/paymentmethodconfiguration/client.go index 5276b78e49..16f8b6d290 100644 --- a/paymentmethodconfiguration/client.go +++ b/paymentmethodconfiguration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new payment method configuration. +// Creates a payment method configuration func New(params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { return getC().New(params) } -// New creates a new payment method configuration. +// Creates a payment method configuration func (c Client) New(params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { paymentmethodconfiguration := &stripe.PaymentMethodConfiguration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PaymentMethodConfigurationParams) (*stripe.Pa return paymentmethodconfiguration, err } -// Get returns the details of a payment method configuration. +// Retrieve payment method configuration func Get(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { return getC().Get(id, params) } -// Get returns the details of a payment method configuration. +// Retrieve payment method configuration func (c Client) Get(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { path := stripe.FormatURLPath("/v1/payment_method_configurations/%s", id) paymentmethodconfiguration := &stripe.PaymentMethodConfiguration{} @@ -57,12 +57,12 @@ func (c Client) Get(id string, params *stripe.PaymentMethodConfigurationParams) return paymentmethodconfiguration, err } -// Update updates a payment method configuration's properties. +// Update payment method configuration func Update(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { return getC().Update(id, params) } -// Update updates a payment method configuration's properties. +// Update payment method configuration func (c Client) Update(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { path := stripe.FormatURLPath("/v1/payment_method_configurations/%s", id) paymentmethodconfiguration := &stripe.PaymentMethodConfiguration{} @@ -76,12 +76,12 @@ func (c Client) Update(id string, params *stripe.PaymentMethodConfigurationParam return paymentmethodconfiguration, err } -// List returns a list of payment method configurations. +// List payment method configurations func List(params *stripe.PaymentMethodConfigurationListParams) *Iter { return getC().List(params) } -// List returns a list of payment method configurations. +// List payment method configurations func (c Client) List(listParams *stripe.PaymentMethodConfigurationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/paymentmethoddomain/client.go b/paymentmethoddomain/client.go index 157df28a09..c95ee9188b 100644 --- a/paymentmethoddomain/client.go +++ b/paymentmethoddomain/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new payment method domain. +// Creates a payment method domain. func New(params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { return getC().New(params) } -// New creates a new payment method domain. +// Creates a payment method domain. func (c Client) New(params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { paymentmethoddomain := &stripe.PaymentMethodDomain{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMe return paymentmethoddomain, err } -// Get returns the details of a payment method domain. +// Retrieves the details of an existing payment method domain. func Get(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { return getC().Get(id, params) } -// Get returns the details of a payment method domain. +// Retrieves the details of an existing payment method domain. func (c Client) Get(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { path := stripe.FormatURLPath("/v1/payment_method_domains/%s", id) paymentmethoddomain := &stripe.PaymentMethodDomain{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.PaymentMethodDomainParams) (*strip return paymentmethoddomain, err } -// Update updates a payment method domain's properties. +// Updates an existing payment method domain. func Update(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { return getC().Update(id, params) } -// Update updates a payment method domain's properties. +// Updates an existing payment method domain. func (c Client) Update(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { path := stripe.FormatURLPath("/v1/payment_method_domains/%s", id) paymentmethoddomain := &stripe.PaymentMethodDomain{} @@ -64,12 +64,22 @@ func (c Client) Update(id string, params *stripe.PaymentMethodDomainParams) (*st return paymentmethoddomain, err } -// Validate is the method for the `POST /v1/payment_method_domains/{payment_method_domain}/validate` API. +// Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. +// The payment method doesn't appear in Elements for this domain until it is active. +// +// To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. +// +// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). func Validate(id string, params *stripe.PaymentMethodDomainValidateParams) (*stripe.PaymentMethodDomain, error) { return getC().Validate(id, params) } -// Validate is the method for the `POST /v1/payment_method_domains/{payment_method_domain}/validate` API. +// Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. +// The payment method doesn't appear in Elements for this domain until it is active. +// +// To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. +// +// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). func (c Client) Validate(id string, params *stripe.PaymentMethodDomainValidateParams) (*stripe.PaymentMethodDomain, error) { path := stripe.FormatURLPath("/v1/payment_method_domains/%s/validate", id) paymentmethoddomain := &stripe.PaymentMethodDomain{} @@ -77,12 +87,12 @@ func (c Client) Validate(id string, params *stripe.PaymentMethodDomainValidatePa return paymentmethoddomain, err } -// List returns a list of payment method domains. +// Lists the details of existing payment method domains. func List(params *stripe.PaymentMethodDomainListParams) *Iter { return getC().List(params) } -// List returns a list of payment method domains. +// Lists the details of existing payment method domains. func (c Client) List(listParams *stripe.PaymentMethodDomainListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/paymentsource/client.go b/paymentsource/client.go index a7cab3104b..b55cf8ce9f 100644 --- a/paymentsource/client.go +++ b/paymentsource/client.go @@ -21,12 +21,20 @@ type Client struct { Key string } -// New creates a new payment source. +// When you create a new credit card, you must specify a customer or recipient on which to create it. +// +// If the card's owner has no default card, then the new card will become the default. +// However, if the owner already has a default, then it will not change. +// To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. func New(params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().New(params) } -// New creates a new payment source. +// When you create a new credit card, you must specify a customer or recipient on which to create it. +// +// If the card's owner has no default card, then the new card will become the default. +// However, if the owner already has a default, then it will not change. +// To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. func (c Client) New(params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -43,12 +51,12 @@ func (c Client) New(params *stripe.PaymentSourceParams) (*stripe.PaymentSource, return paymentsource, err } -// Get returns the details of a payment source. +// Retrieve a specified source for a given customer. func Get(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().Get(id, params) } -// Get returns the details of a payment source. +// Retrieve a specified source for a given customer. func (c Client) Get(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -66,12 +74,12 @@ func (c Client) Get(id string, params *stripe.PaymentSourceParams) (*stripe.Paym return paymentsource, err } -// Update updates a payment source's properties. +// Update a specified source for a given customer. func Update(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().Update(id, params) } -// Update updates a payment source's properties. +// Update a specified source for a given customer. func (c Client) Update(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -89,12 +97,12 @@ func (c Client) Update(id string, params *stripe.PaymentSourceParams) (*stripe.P return paymentsource, err } -// Del removes a payment source. +// Delete a specified source for a given customer. func Del(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().Del(id, params) } -// Del removes a payment source. +// Delete a specified source for a given customer. func (c Client) Del(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -113,11 +121,13 @@ func (c Client) Del(id string, params *stripe.PaymentSourceParams) (*stripe.Paym } // Verify verifies a source which is used for bank accounts. +// Verify a specified bank account for a given customer. func Verify(id string, params *stripe.PaymentSourceVerifyParams) (*stripe.PaymentSource, error) { return getC().Verify(id, params) } // Verify verifies a source which is used for bank accounts. +// Verify a specified bank account for a given customer. func (c Client) Verify(id string, params *stripe.PaymentSourceVerifyParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -138,12 +148,12 @@ func (c Client) Verify(id string, params *stripe.PaymentSourceVerifyParams) (*st return source, err } -// List returns a list of payment sources. +// List sources for a specified customer. func List(params *stripe.PaymentSourceListParams) *Iter { return getC().List(params) } -// List returns a list of payment sources. +// List sources for a specified customer. func (c Client) List(listParams *stripe.PaymentSourceListParams) *Iter { var outerErr error var path string diff --git a/payout/client.go b/payout/client.go index 6822726d6b..70f05ef6f4 100644 --- a/payout/client.go +++ b/payout/client.go @@ -20,24 +20,32 @@ type Client struct { Key string } -// New creates a new payout. +// To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. +// +// If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. +// +// If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. func New(params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().New(params) } -// New creates a new payout. +// To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. +// +// If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. +// +// If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. func (c Client) New(params *stripe.PayoutParams) (*stripe.Payout, error) { payout := &stripe.Payout{} err := c.B.Call(http.MethodPost, "/v1/payouts", c.Key, params, payout) return payout, err } -// Get returns the details of a payout. +// 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. func Get(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().Get(id, params) } -// Get returns the details of a payout. +// 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. func (c Client) Get(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s", id) payout := &stripe.Payout{} @@ -45,12 +53,12 @@ func (c Client) Get(id string, params *stripe.PayoutParams) (*stripe.Payout, err return payout, err } -// Update updates a payout's properties. +// Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. func Update(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().Update(id, params) } -// Update updates a payout's properties. +// Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. func (c Client) Update(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s", id) payout := &stripe.Payout{} @@ -58,12 +66,12 @@ func (c Client) Update(id string, params *stripe.PayoutParams) (*stripe.Payout, return payout, err } -// Cancel is the method for the `POST /v1/payouts/{payout}/cancel` API. +// You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. func Cancel(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/payouts/{payout}/cancel` API. +// You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. func (c Client) Cancel(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s/cancel", id) payout := &stripe.Payout{} @@ -71,12 +79,16 @@ func (c Client) Cancel(id string, params *stripe.PayoutParams) (*stripe.Payout, return payout, err } -// Reverse is the method for the `POST /v1/payouts/{payout}/reverse` API. +// 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 manual and in the pending status, use /v1/payouts/:id/cancel instead. +// +// 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. func Reverse(id string, params *stripe.PayoutReverseParams) (*stripe.Payout, error) { return getC().Reverse(id, params) } -// Reverse is the method for the `POST /v1/payouts/{payout}/reverse` API. +// 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 manual and in the pending status, use /v1/payouts/:id/cancel instead. +// +// 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. func (c Client) Reverse(id string, params *stripe.PayoutReverseParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s/reverse", id) payout := &stripe.Payout{} @@ -84,12 +96,12 @@ func (c Client) Reverse(id string, params *stripe.PayoutReverseParams) (*stripe. return payout, err } -// List returns a list of payouts. +// 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. func List(params *stripe.PayoutListParams) *Iter { return getC().List(params) } -// List returns a list of payouts. +// 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. func (c Client) List(listParams *stripe.PayoutListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/person/client.go b/person/client.go index e458179914..f2ba2dd6ea 100644 --- a/person/client.go +++ b/person/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new person. +// Creates a new person. func New(params *stripe.PersonParams) (*stripe.Person, error) { return getC().New(params) } -// New creates a new person. +// Creates a new person. func (c Client) New(params *stripe.PersonParams) (*stripe.Person, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/persons", @@ -37,12 +37,12 @@ func (c Client) New(params *stripe.PersonParams) (*stripe.Person, error) { return person, err } -// Get returns the details of a person. +// Retrieves an existing person. func Get(id string, params *stripe.PersonParams) (*stripe.Person, error) { return getC().Get(id, params) } -// Get returns the details of a person. +// Retrieves an existing person. func (c Client) Get(id string, params *stripe.PersonParams) (*stripe.Person, error) { if params == nil { return nil, fmt.Errorf( @@ -59,12 +59,12 @@ func (c Client) Get(id string, params *stripe.PersonParams) (*stripe.Person, err return person, err } -// Update updates a person's properties. +// Updates an existing person. func Update(id string, params *stripe.PersonParams) (*stripe.Person, error) { return getC().Update(id, params) } -// Update updates a person's properties. +// Updates an existing person. func (c Client) Update(id string, params *stripe.PersonParams) (*stripe.Person, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/persons/%s", @@ -76,12 +76,12 @@ func (c Client) Update(id string, params *stripe.PersonParams) (*stripe.Person, return person, err } -// Del removes a person. +// Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. func Del(id string, params *stripe.PersonParams) (*stripe.Person, error) { return getC().Del(id, params) } -// Del removes a person. +// Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. func (c Client) Del(id string, params *stripe.PersonParams) (*stripe.Person, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/persons/%s", @@ -93,12 +93,12 @@ func (c Client) Del(id string, params *stripe.PersonParams) (*stripe.Person, err return person, err } -// List returns a list of persons. +// Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. func List(params *stripe.PersonListParams) *Iter { return getC().List(params) } -// List returns a list of persons. +// Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. func (c Client) List(listParams *stripe.PersonListParams) *Iter { path := stripe.FormatURLPath( "/v1/accounts/%s/persons", diff --git a/plan/client.go b/plan/client.go index 650f99a81e..6159e5db3b 100644 --- a/plan/client.go +++ b/plan/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new plan. +// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. func New(params *stripe.PlanParams) (*stripe.Plan, error) { return getC().New(params) } -// New creates a new plan. +// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. func (c Client) New(params *stripe.PlanParams) (*stripe.Plan, error) { plan := &stripe.Plan{} err := c.B.Call(http.MethodPost, "/v1/plans", c.Key, params, plan) return plan, err } -// Get returns the details of a plan. +// Retrieves the plan with the given ID. func Get(id string, params *stripe.PlanParams) (*stripe.Plan, error) { return getC().Get(id, params) } -// Get returns the details of a plan. +// Retrieves the plan with the given ID. func (c Client) Get(id string, params *stripe.PlanParams) (*stripe.Plan, error) { path := stripe.FormatURLPath("/v1/plans/%s", id) plan := &stripe.Plan{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.PlanParams) (*stripe.Plan, error) return plan, err } -// Update updates a plan's properties. +// Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. func Update(id string, params *stripe.PlanParams) (*stripe.Plan, error) { return getC().Update(id, params) } -// Update updates a plan's properties. +// Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. func (c Client) Update(id string, params *stripe.PlanParams) (*stripe.Plan, error) { path := stripe.FormatURLPath("/v1/plans/%s", id) plan := &stripe.Plan{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.PlanParams) (*stripe.Plan, erro return plan, err } -// Del removes a plan. +// Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. func Del(id string, params *stripe.PlanParams) (*stripe.Plan, error) { return getC().Del(id, params) } -// Del removes a plan. +// Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. func (c Client) Del(id string, params *stripe.PlanParams) (*stripe.Plan, error) { path := stripe.FormatURLPath("/v1/plans/%s", id) plan := &stripe.Plan{} @@ -71,12 +71,12 @@ func (c Client) Del(id string, params *stripe.PlanParams) (*stripe.Plan, error) return plan, err } -// List returns a list of plans. +// Returns a list of your plans. func List(params *stripe.PlanListParams) *Iter { return getC().List(params) } -// List returns a list of plans. +// Returns a list of your plans. func (c Client) List(listParams *stripe.PlanListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/price/client.go b/price/client.go index 2ccd6d83ae..0d11800428 100644 --- a/price/client.go +++ b/price/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new price. +// Creates a new price for an existing product. The price can be recurring or one-time. func New(params *stripe.PriceParams) (*stripe.Price, error) { return getC().New(params) } -// New creates a new price. +// Creates a new price for an existing product. The price can be recurring or one-time. func (c Client) New(params *stripe.PriceParams) (*stripe.Price, error) { price := &stripe.Price{} err := c.B.Call(http.MethodPost, "/v1/prices", c.Key, params, price) return price, err } -// Get returns the details of a price. +// Retrieves the price with the given ID. func Get(id string, params *stripe.PriceParams) (*stripe.Price, error) { return getC().Get(id, params) } -// Get returns the details of a price. +// Retrieves the price with the given ID. func (c Client) Get(id string, params *stripe.PriceParams) (*stripe.Price, error) { path := stripe.FormatURLPath("/v1/prices/%s", id) price := &stripe.Price{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.PriceParams) (*stripe.Price, error return price, err } -// Update updates a price's properties. +// Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. func Update(id string, params *stripe.PriceParams) (*stripe.Price, error) { return getC().Update(id, params) } -// Update updates a price's properties. +// Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. func (c Client) Update(id string, params *stripe.PriceParams) (*stripe.Price, error) { path := stripe.FormatURLPath("/v1/prices/%s", id) price := &stripe.Price{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.PriceParams) (*stripe.Price, er return price, err } -// List returns a list of prices. +// Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. func List(params *stripe.PriceListParams) *Iter { return getC().List(params) } -// List returns a list of prices. +// Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. func (c Client) List(listParams *stripe.PriceListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -97,12 +97,18 @@ func (i *Iter) PriceList() *stripe.PriceList { return i.List().(*stripe.PriceList) } -// Search returns a search result containing prices. +// Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.PriceSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing prices. +// Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.PriceSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/product/client.go b/product/client.go index e485fc958f..231b2847fa 100644 --- a/product/client.go +++ b/product/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new product. +// Creates a new product object. func New(params *stripe.ProductParams) (*stripe.Product, error) { return getC().New(params) } -// New creates a new product. +// Creates a new product object. func (c Client) New(params *stripe.ProductParams) (*stripe.Product, error) { product := &stripe.Product{} err := c.B.Call(http.MethodPost, "/v1/products", c.Key, params, product) return product, err } -// Get returns the details of a product. +// Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. func Get(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Get(id, params) } -// Get returns the details of a product. +// Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. func (c Client) Get(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) product := &stripe.Product{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.ProductParams) (*stripe.Product, e return product, err } -// Update updates a product's properties. +// Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Update(id, params) } -// Update updates a product's properties. +// Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) product := &stripe.Product{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.ProductParams) (*stripe.Product return product, err } -// Del removes a product. +// Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. func Del(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Del(id, params) } -// Del removes a product. +// Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. func (c Client) Del(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) product := &stripe.Product{} @@ -71,12 +71,12 @@ func (c Client) Del(id string, params *stripe.ProductParams) (*stripe.Product, e return product, err } -// List returns a list of products. +// Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. func List(params *stripe.ProductListParams) *Iter { return getC().List(params) } -// List returns a list of products. +// Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. func (c Client) List(listParams *stripe.ProductListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -110,12 +110,18 @@ func (i *Iter) ProductList() *stripe.ProductList { return i.List().(*stripe.ProductList) } -// Search returns a search result containing products. +// Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.ProductSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing products. +// Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.ProductSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/productfeature/client.go b/productfeature/client.go index 3b4d8b53e0..d5770792ad 100644 --- a/productfeature/client.go +++ b/productfeature/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new product feature. +// Creates a product_feature, which represents a feature attachment to a product func New(params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { return getC().New(params) } -// New creates a new product feature. +// Creates a product_feature, which represents a feature attachment to a product func (c Client) New(params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { path := stripe.FormatURLPath( "/v1/products/%s/features", @@ -36,12 +36,12 @@ func (c Client) New(params *stripe.ProductFeatureParams) (*stripe.ProductFeature return productfeature, err } -// Get returns the details of a product feature. +// Retrieves a product_feature, which represents a feature attachment to a product func Get(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { return getC().Get(id, params) } -// Get returns the details of a product feature. +// Retrieves a product_feature, which represents a feature attachment to a product func (c Client) Get(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { path := stripe.FormatURLPath( "/v1/products/%s/features/%s", @@ -53,12 +53,12 @@ func (c Client) Get(id string, params *stripe.ProductFeatureParams) (*stripe.Pro return productfeature, err } -// Del removes a product feature. +// Deletes the feature attachment to a product func Del(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { return getC().Del(id, params) } -// Del removes a product feature. +// Deletes the feature attachment to a product func (c Client) Del(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { path := stripe.FormatURLPath( "/v1/products/%s/features/%s", @@ -70,12 +70,12 @@ func (c Client) Del(id string, params *stripe.ProductFeatureParams) (*stripe.Pro return productfeature, err } -// List returns a list of product features. +// Retrieve a list of features for a product func List(params *stripe.ProductFeatureListParams) *Iter { return getC().List(params) } -// List returns a list of product features. +// Retrieve a list of features for a product func (c Client) List(listParams *stripe.ProductFeatureListParams) *Iter { path := stripe.FormatURLPath( "/v1/products/%s/features", diff --git a/promotioncode/client.go b/promotioncode/client.go index ff8acea206..510891fd3b 100644 --- a/promotioncode/client.go +++ b/promotioncode/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new promotion code. +// A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. func New(params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { return getC().New(params) } -// New creates a new promotion code. +// A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. func (c Client) New(params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { promotioncode := &stripe.PromotionCode{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PromotionCodeParams) (*stripe.PromotionCode, return promotioncode, err } -// Get returns the details of a promotion code. +// Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. func Get(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { return getC().Get(id, params) } -// Get returns the details of a promotion code. +// Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. func (c Client) Get(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { path := stripe.FormatURLPath("/v1/promotion_codes/%s", id) promotioncode := &stripe.PromotionCode{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.PromotionCodeParams) (*stripe.Prom return promotioncode, err } -// Update updates a promotion code's properties. +// Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. func Update(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { return getC().Update(id, params) } -// Update updates a promotion code's properties. +// Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. func (c Client) Update(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { path := stripe.FormatURLPath("/v1/promotion_codes/%s", id) promotioncode := &stripe.PromotionCode{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.PromotionCodeParams) (*stripe.P return promotioncode, err } -// List returns a list of promotion codes. +// Returns a list of your promotion codes. func List(params *stripe.PromotionCodeListParams) *Iter { return getC().List(params) } -// List returns a list of promotion codes. +// Returns a list of your promotion codes. func (c Client) List(listParams *stripe.PromotionCodeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/quote/client.go b/quote/client.go index 6944227376..ab882b6a0b 100644 --- a/quote/client.go +++ b/quote/client.go @@ -21,24 +21,24 @@ type Client struct { Key string } -// New creates a new quote. +// A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). func New(params *stripe.QuoteParams) (*stripe.Quote, error) { return getC().New(params) } -// New creates a new quote. +// A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). func (c Client) New(params *stripe.QuoteParams) (*stripe.Quote, error) { quote := &stripe.Quote{} err := c.B.Call(http.MethodPost, "/v1/quotes", c.Key, params, quote) return quote, err } -// Get returns the details of a quote. +// Retrieves the quote with the given ID. func Get(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { return getC().Get(id, params) } -// Get returns the details of a quote. +// Retrieves the quote with the given ID. func (c Client) Get(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s", id) quote := &stripe.Quote{} @@ -46,12 +46,12 @@ func (c Client) Get(id string, params *stripe.QuoteParams) (*stripe.Quote, error return quote, err } -// Update updates a quote's properties. +// A quote models prices and services for a customer. func Update(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { return getC().Update(id, params) } -// Update updates a quote's properties. +// A quote models prices and services for a customer. func (c Client) Update(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s", id) quote := &stripe.Quote{} @@ -59,12 +59,12 @@ func (c Client) Update(id string, params *stripe.QuoteParams) (*stripe.Quote, er return quote, err } -// Accept is the method for the `POST /v1/quotes/{quote}/accept` API. +// Accepts the specified quote. func Accept(id string, params *stripe.QuoteAcceptParams) (*stripe.Quote, error) { return getC().Accept(id, params) } -// Accept is the method for the `POST /v1/quotes/{quote}/accept` API. +// Accepts the specified quote. func (c Client) Accept(id string, params *stripe.QuoteAcceptParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/accept", id) quote := &stripe.Quote{} @@ -72,12 +72,12 @@ func (c Client) Accept(id string, params *stripe.QuoteAcceptParams) (*stripe.Quo return quote, err } -// Cancel is the method for the `POST /v1/quotes/{quote}/cancel` API. +// Cancels the quote. func Cancel(id string, params *stripe.QuoteCancelParams) (*stripe.Quote, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/quotes/{quote}/cancel` API. +// Cancels the quote. func (c Client) Cancel(id string, params *stripe.QuoteCancelParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/cancel", id) quote := &stripe.Quote{} @@ -85,12 +85,12 @@ func (c Client) Cancel(id string, params *stripe.QuoteCancelParams) (*stripe.Quo return quote, err } -// FinalizeQuote is the method for the `POST /v1/quotes/{quote}/finalize` API. +// Finalizes the quote. func FinalizeQuote(id string, params *stripe.QuoteFinalizeQuoteParams) (*stripe.Quote, error) { return getC().FinalizeQuote(id, params) } -// FinalizeQuote is the method for the `POST /v1/quotes/{quote}/finalize` API. +// Finalizes the quote. func (c Client) FinalizeQuote(id string, params *stripe.QuoteFinalizeQuoteParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/finalize", id) quote := &stripe.Quote{} @@ -98,12 +98,12 @@ func (c Client) FinalizeQuote(id string, params *stripe.QuoteFinalizeQuoteParams return quote, err } -// PDF is the method for the `GET /v1/quotes/{quote}/pdf` API. +// Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) func PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { return getC().PDF(id, params) } -// PDF is the method for the `GET /v1/quotes/{quote}/pdf` API. +// Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) func (c Client) PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { path := stripe.FormatURLPath("/v1/quotes/%s/pdf", id) stream := &stripe.APIStream{} @@ -111,12 +111,12 @@ func (c Client) PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream return stream, err } -// List returns a list of quotes. +// Returns a list of your quotes. func List(params *stripe.QuoteListParams) *Iter { return getC().List(params) } -// List returns a list of quotes. +// Returns a list of your quotes. func (c Client) List(listParams *stripe.QuoteListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -150,12 +150,12 @@ func (i *Iter) QuoteList() *stripe.QuoteList { return i.List().(*stripe.QuoteList) } -// ListComputedUpfrontLineItems is the method for the `GET /v1/quotes/{quote}/computed_upfront_line_items` API. +// When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. func ListComputedUpfrontLineItems(params *stripe.QuoteListComputedUpfrontLineItemsParams) *LineItemIter { return getC().ListComputedUpfrontLineItems(params) } -// ListComputedUpfrontLineItems is the method for the `GET /v1/quotes/{quote}/computed_upfront_line_items` API. +// When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. func (c Client) ListComputedUpfrontLineItems(listParams *stripe.QuoteListComputedUpfrontLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/quotes/%s/computed_upfront_line_items", @@ -193,12 +193,12 @@ func (i *LineItemIter) LineItemList() *stripe.LineItemList { return i.List().(*stripe.LineItemList) } -// ListLineItems is the method for the `GET /v1/quotes/{quote}/line_items` API. +// When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.QuoteListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/quotes/{quote}/line_items` API. +// When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.QuoteListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/quotes/%s/line_items", diff --git a/radar/earlyfraudwarning/client.go b/radar/earlyfraudwarning/client.go index 37c725c96a..8274e63bf1 100644 --- a/radar/earlyfraudwarning/client.go +++ b/radar/earlyfraudwarning/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// Get returns the details of a radar early fraud warning. +// Retrieves the details of an early fraud warning that has previously been created. +// +// Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. func Get(id string, params *stripe.RadarEarlyFraudWarningParams) (*stripe.RadarEarlyFraudWarning, error) { return getC().Get(id, params) } -// Get returns the details of a radar early fraud warning. +// Retrieves the details of an early fraud warning that has previously been created. +// +// Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. func (c Client) Get(id string, params *stripe.RadarEarlyFraudWarningParams) (*stripe.RadarEarlyFraudWarning, error) { path := stripe.FormatURLPath("/v1/radar/early_fraud_warnings/%s", id) earlyfraudwarning := &stripe.RadarEarlyFraudWarning{} @@ -33,12 +37,12 @@ func (c Client) Get(id string, params *stripe.RadarEarlyFraudWarningParams) (*st return earlyfraudwarning, err } -// List returns a list of radar early fraud warnings. +// Returns a list of early fraud warnings. func List(params *stripe.RadarEarlyFraudWarningListParams) *Iter { return getC().List(params) } -// List returns a list of radar early fraud warnings. +// Returns a list of early fraud warnings. func (c Client) List(listParams *stripe.RadarEarlyFraudWarningListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/radar/valuelist/client.go b/radar/valuelist/client.go index 7b7577bc99..f47e74e584 100644 --- a/radar/valuelist/client.go +++ b/radar/valuelist/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new radar value list. +// Creates a new ValueList object, which can then be referenced in rules. func New(params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().New(params) } -// New creates a new radar value list. +// Creates a new ValueList object, which can then be referenced in rules. func (c Client) New(params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { valuelist := &stripe.RadarValueList{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.RadarValueListParams) (*stripe.RadarValueList return valuelist, err } -// Get returns the details of a radar value list. +// Retrieves a ValueList object. func Get(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().Get(id, params) } -// Get returns the details of a radar value list. +// Retrieves a ValueList object. func (c Client) Get(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { path := stripe.FormatURLPath("/v1/radar/value_lists/%s", id) valuelist := &stripe.RadarValueList{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.RadarValueListParams) (*stripe.Rad return valuelist, err } -// Update updates a radar value list's properties. +// Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. func Update(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().Update(id, params) } -// Update updates a radar value list's properties. +// Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. func (c Client) Update(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { path := stripe.FormatURLPath("/v1/radar/value_lists/%s", id) valuelist := &stripe.RadarValueList{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.RadarValueListParams) (*stripe. return valuelist, err } -// Del removes a radar value list. +// Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. func Del(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().Del(id, params) } -// Del removes a radar value list. +// Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. func (c Client) Del(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { path := stripe.FormatURLPath("/v1/radar/value_lists/%s", id) valuelist := &stripe.RadarValueList{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.RadarValueListParams) (*stripe.Rad return valuelist, err } -// List returns a list of radar value lists. +// Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.RadarValueListListParams) *Iter { return getC().List(params) } -// List returns a list of radar value lists. +// Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.RadarValueListListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/radar/valuelistitem/client.go b/radar/valuelistitem/client.go index 339802f33a..f444f2ec6e 100644 --- a/radar/valuelistitem/client.go +++ b/radar/valuelistitem/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new radar value list item. +// Creates a new ValueListItem object, which is added to the specified parent value list. func New(params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { return getC().New(params) } -// New creates a new radar value list item. +// Creates a new ValueListItem object, which is added to the specified parent value list. func (c Client) New(params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { valuelistitem := &stripe.RadarValueListItem{} err := c.B.Call( @@ -39,12 +39,12 @@ func (c Client) New(params *stripe.RadarValueListItemParams) (*stripe.RadarValue return valuelistitem, err } -// Get returns the details of a radar value list item. +// Retrieves a ValueListItem object. func Get(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { return getC().Get(id, params) } -// Get returns the details of a radar value list item. +// Retrieves a ValueListItem object. func (c Client) Get(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { path := stripe.FormatURLPath("/v1/radar/value_list_items/%s", id) valuelistitem := &stripe.RadarValueListItem{} @@ -52,12 +52,12 @@ func (c Client) Get(id string, params *stripe.RadarValueListItemParams) (*stripe return valuelistitem, err } -// Del removes a radar value list item. +// Deletes a ValueListItem object, removing it from its parent value list. func Del(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { return getC().Del(id, params) } -// Del removes a radar value list item. +// Deletes a ValueListItem object, removing it from its parent value list. func (c Client) Del(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { path := stripe.FormatURLPath("/v1/radar/value_list_items/%s", id) valuelistitem := &stripe.RadarValueListItem{} @@ -65,12 +65,12 @@ func (c Client) Del(id string, params *stripe.RadarValueListItemParams) (*stripe return valuelistitem, err } -// List returns a list of radar value list items. +// Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.RadarValueListItemListParams) *Iter { return getC().List(params) } -// List returns a list of radar value list items. +// Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.RadarValueListItemListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/refund/client.go b/refund/client.go index 7e243ce78d..aa847786d9 100644 --- a/refund/client.go +++ b/refund/client.go @@ -20,24 +20,44 @@ type Client struct { Key string } -// New creates a new 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. func New(params *stripe.RefundParams) (*stripe.Refund, error) { return getC().New(params) } -// New creates a new 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. func (c Client) New(params *stripe.RefundParams) (*stripe.Refund, error) { refund := &stripe.Refund{} err := c.B.Call(http.MethodPost, "/v1/refunds", c.Key, params, refund) return refund, err } -// Get returns the details of a refund. +// Retrieves the details of an existing refund. func Get(id string, params *stripe.RefundParams) (*stripe.Refund, error) { return getC().Get(id, params) } -// Get returns the details of a refund. +// Retrieves the details of an existing refund. func (c Client) Get(id string, params *stripe.RefundParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s", id) refund := &stripe.Refund{} @@ -45,12 +65,16 @@ func (c Client) Get(id string, params *stripe.RefundParams) (*stripe.Refund, err return refund, err } -// Update updates a refund's properties. +// Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. +// +// This request only accepts metadata as an argument. func Update(id string, params *stripe.RefundParams) (*stripe.Refund, error) { return getC().Update(id, params) } -// Update updates a refund's properties. +// Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. +// +// This request only accepts metadata as an argument. func (c Client) Update(id string, params *stripe.RefundParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s", id) refund := &stripe.Refund{} @@ -58,12 +82,16 @@ func (c Client) Update(id string, params *stripe.RefundParams) (*stripe.Refund, return refund, err } -// Cancel is the method for the `POST /v1/refunds/{refund}/cancel` API. +// Cancels a refund with a status of requires_action. +// +// You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. func Cancel(id string, params *stripe.RefundCancelParams) (*stripe.Refund, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/refunds/{refund}/cancel` API. +// Cancels a refund with a status of requires_action. +// +// You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. func (c Client) Cancel(id string, params *stripe.RefundCancelParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s/cancel", id) refund := &stripe.Refund{} @@ -71,12 +99,12 @@ func (c Client) Cancel(id string, params *stripe.RefundCancelParams) (*stripe.Re return refund, err } -// List returns a list of refunds. +// 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. func List(params *stripe.RefundListParams) *Iter { return getC().List(params) } -// List returns a list of refunds. +// 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. func (c Client) List(listParams *stripe.RefundListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/reporting/reportrun/client.go b/reporting/reportrun/client.go index 01dcb8a115..f23eb78a41 100644 --- a/reporting/reportrun/client.go +++ b/reporting/reportrun/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new reporting report run. +// Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func New(params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { return getC().New(params) } -// New creates a new reporting report run. +// Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func (c Client) New(params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { reportrun := &stripe.ReportingReportRun{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ReportingReportRunParams) (*stripe.ReportingR return reportrun, err } -// Get returns the details of a reporting report run. +// Retrieves the details of an existing Report Run. func Get(id string, params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { return getC().Get(id, params) } -// Get returns the details of a reporting report run. +// Retrieves the details of an existing Report Run. func (c Client) Get(id string, params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { path := stripe.FormatURLPath("/v1/reporting/report_runs/%s", id) reportrun := &stripe.ReportingReportRun{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ReportingReportRunParams) (*stripe return reportrun, err } -// List returns a list of reporting report runs. +// Returns a list of Report Runs, with the most recent appearing first. func List(params *stripe.ReportingReportRunListParams) *Iter { return getC().List(params) } -// List returns a list of reporting report runs. +// Returns a list of Report Runs, with the most recent appearing first. func (c Client) List(listParams *stripe.ReportingReportRunListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/reporting/reporttype/client.go b/reporting/reporttype/client.go index 25881aab05..ebda1a2372 100644 --- a/reporting/reporttype/client.go +++ b/reporting/reporttype/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a reporting report type. +// Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func Get(id string, params *stripe.ReportingReportTypeParams) (*stripe.ReportingReportType, error) { return getC().Get(id, params) } -// Get returns the details of a reporting report type. +// Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func (c Client) Get(id string, params *stripe.ReportingReportTypeParams) (*stripe.ReportingReportType, error) { path := stripe.FormatURLPath("/v1/reporting/report_types/%s", id) reporttype := &stripe.ReportingReportType{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ReportingReportTypeParams) (*strip return reporttype, err } -// List returns a list of reporting report types. +// Returns a full list of Report Types. func List(params *stripe.ReportingReportTypeListParams) *Iter { return getC().List(params) } -// List returns a list of reporting report types. +// Returns a full list of Report Types. func (c Client) List(listParams *stripe.ReportingReportTypeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/review/client.go b/review/client.go index 9cf4c12136..6781b244d6 100644 --- a/review/client.go +++ b/review/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a review. +// Retrieves a Review object. func Get(id string, params *stripe.ReviewParams) (*stripe.Review, error) { return getC().Get(id, params) } -// Get returns the details of a review. +// Retrieves a Review object. func (c Client) Get(id string, params *stripe.ReviewParams) (*stripe.Review, error) { path := stripe.FormatURLPath("/v1/reviews/%s", id) review := &stripe.Review{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ReviewParams) (*stripe.Review, err return review, err } -// Approve is the method for the `POST /v1/reviews/{review}/approve` API. +// Approves a Review object, closing it and removing it from the list of reviews. func Approve(id string, params *stripe.ReviewApproveParams) (*stripe.Review, error) { return getC().Approve(id, params) } -// Approve is the method for the `POST /v1/reviews/{review}/approve` API. +// Approves a Review object, closing it and removing it from the list of reviews. func (c Client) Approve(id string, params *stripe.ReviewApproveParams) (*stripe.Review, error) { path := stripe.FormatURLPath("/v1/reviews/%s/approve", id) review := &stripe.Review{} @@ -46,12 +46,12 @@ func (c Client) Approve(id string, params *stripe.ReviewApproveParams) (*stripe. return review, err } -// List returns a list of reviews. +// Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.ReviewListParams) *Iter { return getC().List(params) } -// List returns a list of reviews. +// Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.ReviewListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/setupattempt/client.go b/setupattempt/client.go index 5f61a23701..fd4cea77e9 100644 --- a/setupattempt/client.go +++ b/setupattempt/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// List returns a list of setup attempts. +// Returns a list of SetupAttempts that associate with a provided SetupIntent. func List(params *stripe.SetupAttemptListParams) *Iter { return getC().List(params) } -// List returns a list of setup attempts. +// Returns a list of SetupAttempts that associate with a provided SetupIntent. func (c Client) List(listParams *stripe.SetupAttemptListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/setupintent/client.go b/setupintent/client.go index 421f5cb6fb..c9baad4ce8 100644 --- a/setupintent/client.go +++ b/setupintent/client.go @@ -20,12 +20,18 @@ type Client struct { Key string } -// New creates a new setup intent. +// Creates a SetupIntent object. +// +// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) +// it to collect any required permissions to charge the payment method later. func New(params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { return getC().New(params) } -// New creates a new setup intent. +// Creates a SetupIntent object. +// +// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) +// it to collect any required permissions to charge the payment method later. func (c Client) New(params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { setupintent := &stripe.SetupIntent{} err := c.B.Call( @@ -38,12 +44,20 @@ func (c Client) New(params *stripe.SetupIntentParams) (*stripe.SetupIntent, erro return setupintent, err } -// Get returns the details of a setup intent. +// Retrieves the details of a SetupIntent that has previously been created. +// +// Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. +// +// When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. func Get(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { return getC().Get(id, params) } -// Get returns the details of a setup intent. +// Retrieves the details of a SetupIntent that has previously been created. +// +// Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. +// +// When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. func (c Client) Get(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s", id) setupintent := &stripe.SetupIntent{} @@ -51,12 +65,12 @@ func (c Client) Get(id string, params *stripe.SetupIntentParams) (*stripe.SetupI return setupintent, err } -// Update updates a setup intent's properties. +// Updates a SetupIntent object. func Update(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { return getC().Update(id, params) } -// Update updates a setup intent's properties. +// Updates a SetupIntent object. func (c Client) Update(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s", id) setupintent := &stripe.SetupIntent{} @@ -64,12 +78,16 @@ func (c Client) Update(id string, params *stripe.SetupIntentParams) (*stripe.Set return setupintent, err } -// Cancel is the method for the `POST /v1/setup_intents/{intent}/cancel` API. +// You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. +// +// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. func Cancel(id string, params *stripe.SetupIntentCancelParams) (*stripe.SetupIntent, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/setup_intents/{intent}/cancel` API. +// You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. +// +// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. func (c Client) Cancel(id string, params *stripe.SetupIntentCancelParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s/cancel", id) setupintent := &stripe.SetupIntent{} @@ -77,12 +95,38 @@ func (c Client) Cancel(id string, params *stripe.SetupIntentCancelParams) (*stri return setupintent, err } -// Confirm is the method for the `POST /v1/setup_intents/{intent}/confirm` API. +// Confirm that your customer intends to set up the current or +// provided payment method. For example, you would confirm a SetupIntent +// when a customer hits the “Save” button on a payment method management +// page on your website. +// +// If the selected payment method does not require any additional +// steps from the customer, the SetupIntent will transition to the +// succeeded status. +// +// Otherwise, it will transition to the requires_action status and +// suggest additional actions via next_action. If setup fails, +// the SetupIntent will transition to the +// requires_payment_method status or the canceled status if the +// confirmation limit is reached. func Confirm(id string, params *stripe.SetupIntentConfirmParams) (*stripe.SetupIntent, error) { return getC().Confirm(id, params) } -// Confirm is the method for the `POST /v1/setup_intents/{intent}/confirm` API. +// Confirm that your customer intends to set up the current or +// provided payment method. For example, you would confirm a SetupIntent +// when a customer hits the “Save” button on a payment method management +// page on your website. +// +// If the selected payment method does not require any additional +// steps from the customer, the SetupIntent will transition to the +// succeeded status. +// +// Otherwise, it will transition to the requires_action status and +// suggest additional actions via next_action. If setup fails, +// the SetupIntent will transition to the +// requires_payment_method status or the canceled status if the +// confirmation limit is reached. func (c Client) Confirm(id string, params *stripe.SetupIntentConfirmParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s/confirm", id) setupintent := &stripe.SetupIntent{} @@ -90,12 +134,12 @@ func (c Client) Confirm(id string, params *stripe.SetupIntentConfirmParams) (*st return setupintent, err } -// VerifyMicrodeposits is the method for the `POST /v1/setup_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a SetupIntent object. func VerifyMicrodeposits(id string, params *stripe.SetupIntentVerifyMicrodepositsParams) (*stripe.SetupIntent, error) { return getC().VerifyMicrodeposits(id, params) } -// VerifyMicrodeposits is the method for the `POST /v1/setup_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a SetupIntent object. func (c Client) VerifyMicrodeposits(id string, params *stripe.SetupIntentVerifyMicrodepositsParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s/verify_microdeposits", id) setupintent := &stripe.SetupIntent{} @@ -103,12 +147,12 @@ func (c Client) VerifyMicrodeposits(id string, params *stripe.SetupIntentVerifyM return setupintent, err } -// List returns a list of setup intents. +// Returns a list of SetupIntents. func List(params *stripe.SetupIntentListParams) *Iter { return getC().List(params) } -// List returns a list of setup intents. +// Returns a list of SetupIntents. func (c Client) List(listParams *stripe.SetupIntentListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/shippingrate/client.go b/shippingrate/client.go index 275feea3a8..9ec05de13e 100644 --- a/shippingrate/client.go +++ b/shippingrate/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new shipping rate. +// Creates a new shipping rate object. func New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { return getC().New(params) } -// New creates a new shipping rate. +// Creates a new shipping rate object. func (c Client) New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { shippingrate := &stripe.ShippingRate{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, er return shippingrate, err } -// Get returns the details of a shipping rate. +// Returns the shipping rate object with the given ID. func Get(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { return getC().Get(id, params) } -// Get returns the details of a shipping rate. +// Returns the shipping rate object with the given ID. func (c Client) Get(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { path := stripe.FormatURLPath("/v1/shipping_rates/%s", id) shippingrate := &stripe.ShippingRate{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ShippingRateParams) (*stripe.Shipp return shippingrate, err } -// Update updates a shipping rate's properties. +// Updates an existing shipping rate object. func Update(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { return getC().Update(id, params) } -// Update updates a shipping rate's properties. +// Updates an existing shipping rate object. func (c Client) Update(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { path := stripe.FormatURLPath("/v1/shipping_rates/%s", id) shippingrate := &stripe.ShippingRate{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.ShippingRateParams) (*stripe.Sh return shippingrate, err } -// List returns a list of shipping rates. +// Returns a list of your shipping rates. func List(params *stripe.ShippingRateListParams) *Iter { return getC().List(params) } -// List returns a list of shipping rates. +// Returns a list of your shipping rates. func (c Client) List(listParams *stripe.ShippingRateListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/sigma/scheduledqueryrun/client.go b/sigma/scheduledqueryrun/client.go index df3b796b2e..f3de28f846 100644 --- a/sigma/scheduledqueryrun/client.go +++ b/sigma/scheduledqueryrun/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// Get returns the details of a sigma scheduled query run. +// Retrieves the details of an scheduled query run. func Get(id string, params *stripe.SigmaScheduledQueryRunParams) (*stripe.SigmaScheduledQueryRun, error) { return getC().Get(id, params) } -// Get returns the details of a sigma scheduled query run. +// Retrieves the details of an scheduled query run. func (c Client) Get(id string, params *stripe.SigmaScheduledQueryRunParams) (*stripe.SigmaScheduledQueryRun, error) { path := stripe.FormatURLPath("/v1/sigma/scheduled_query_runs/%s", id) scheduledqueryrun := &stripe.SigmaScheduledQueryRun{} @@ -34,12 +34,12 @@ func (c Client) Get(id string, params *stripe.SigmaScheduledQueryRunParams) (*st return scheduledqueryrun, err } -// List returns a list of sigma scheduled query runs. +// Returns a list of scheduled query runs. func List(params *stripe.SigmaScheduledQueryRunListParams) *Iter { return getC().List(params) } -// List returns a list of sigma scheduled query runs. +// Returns a list of scheduled query runs. func (c Client) List(listParams *stripe.SigmaScheduledQueryRunListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/source/client.go b/source/client.go index 96e68cc981..168e781c00 100644 --- a/source/client.go +++ b/source/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new source. +// Creates a new source object. func New(params *stripe.SourceParams) (*stripe.Source, error) { return getC().New(params) } -// New creates a new source. +// Creates a new source object. func (c Client) New(params *stripe.SourceParams) (*stripe.Source, error) { source := &stripe.Source{} err := c.B.Call(http.MethodPost, "/v1/sources", c.Key, params, source) return source, err } -// Get returns the details of a source. +// Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. func Get(id string, params *stripe.SourceParams) (*stripe.Source, error) { return getC().Get(id, params) } -// Get returns the details of a source. +// Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. func (c Client) Get(id string, params *stripe.SourceParams) (*stripe.Source, error) { path := stripe.FormatURLPath("/v1/sources/%s", id) source := &stripe.Source{} @@ -45,12 +45,16 @@ func (c Client) Get(id string, params *stripe.SourceParams) (*stripe.Source, err return source, err } -// Update updates a source's properties. +// Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. func Update(id string, params *stripe.SourceParams) (*stripe.Source, error) { return getC().Update(id, params) } -// Update updates a source's properties. +// Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. func (c Client) Update(id string, params *stripe.SourceParams) (*stripe.Source, error) { path := stripe.FormatURLPath("/v1/sources/%s", id) source := &stripe.Source{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.SourceParams) (*stripe.Source, return source, err } -// Detach is the method for the `DELETE /v1/customers/{customer}/sources/{id}` API. +// Delete a specified source for a given customer. func Detach(id string, params *stripe.SourceDetachParams) (*stripe.Source, error) { return getC().Detach(id, params) } -// Detach is the method for the `DELETE /v1/customers/{customer}/sources/{id}` API. +// Delete a specified source for a given customer. func (c Client) Detach(id string, params *stripe.SourceDetachParams) (*stripe.Source, error) { if params.Customer == nil { return nil, fmt.Errorf( diff --git a/sourcetransaction/client.go b/sourcetransaction/client.go index 56f8261867..b7f13858cd 100644 --- a/sourcetransaction/client.go +++ b/sourcetransaction/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// List returns a list of source transactions. +// List source transactions for a given source. func List(params *stripe.SourceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of source transactions. +// List source transactions for a given source. func (c Client) List(listParams *stripe.SourceTransactionListParams) *Iter { if listParams == nil || listParams.Source == nil { return &Iter{ diff --git a/subscription/client.go b/subscription/client.go index dd00b0cf0d..5d43918ab3 100644 --- a/subscription/client.go +++ b/subscription/client.go @@ -20,12 +20,24 @@ type Client struct { Key string } -// New creates a new subscription. +// Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. +// +// When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. +// The payment_behavior parameter determines the exact behavior of the initial payment. +// +// To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. +// Schedules provide the flexibility to model more complex billing configurations that change over time. func New(params *stripe.SubscriptionParams) (*stripe.Subscription, error) { return getC().New(params) } -// New creates a new subscription. +// Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. +// +// When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. +// The payment_behavior parameter determines the exact behavior of the initial payment. +// +// To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. +// Schedules provide the flexibility to model more complex billing configurations that change over time. func (c Client) New(params *stripe.SubscriptionParams) (*stripe.Subscription, error) { subscription := &stripe.Subscription{} err := c.B.Call( @@ -38,12 +50,12 @@ func (c Client) New(params *stripe.SubscriptionParams) (*stripe.Subscription, er return subscription, err } -// Get returns the details of a subscription. +// Retrieves the subscription with the given ID. func Get(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { return getC().Get(id, params) } -// Get returns the details of a subscription. +// Retrieves the subscription with the given ID. func (c Client) Get(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s", id) subscription := &stripe.Subscription{} @@ -51,12 +63,48 @@ func (c Client) Get(id string, params *stripe.SubscriptionParams) (*stripe.Subsc return subscription, err } -// Update updates a subscription's properties. +// Updates an existing subscription to match the specified parameters. +// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. +// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. +// +// By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. +// +// Switching prices does not normally change the billing date or generate an immediate charge unless: +// +// The billing interval is changed (for example, from monthly to yearly). +// The subscription moves from free to paid, or paid to free. +// A trial starts or ends. +// +// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. +// +// If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). +// +// If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. +// +// Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. func Update(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { return getC().Update(id, params) } -// Update updates a subscription's properties. +// Updates an existing subscription to match the specified parameters. +// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. +// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. +// +// By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. +// +// Switching prices does not normally change the billing date or generate an immediate charge unless: +// +// The billing interval is changed (for example, from monthly to yearly). +// The subscription moves from free to paid, or paid to free. +// A trial starts or ends. +// +// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. +// +// If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). +// +// If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. +// +// Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. func (c Client) Update(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s", id) subscription := &stripe.Subscription{} @@ -64,12 +112,20 @@ func (c Client) Update(id string, params *stripe.SubscriptionParams) (*stripe.Su return subscription, err } -// Cancel is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}` API. +// Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. +// +// Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. +// +// By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. func Cancel(id string, params *stripe.SubscriptionCancelParams) (*stripe.Subscription, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}` API. +// Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. +// +// Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. +// +// By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. func (c Client) Cancel(id string, params *stripe.SubscriptionCancelParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s", id) subscription := &stripe.Subscription{} @@ -77,12 +133,12 @@ func (c Client) Cancel(id string, params *stripe.SubscriptionCancelParams) (*str return subscription, err } -// DeleteDiscount is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}/discount` API. +// Removes the currently applied discount on a subscription. func DeleteDiscount(id string, params *stripe.SubscriptionDeleteDiscountParams) (*stripe.Subscription, error) { return getC().DeleteDiscount(id, params) } -// DeleteDiscount is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}/discount` API. +// Removes the currently applied discount on a subscription. func (c Client) DeleteDiscount(id string, params *stripe.SubscriptionDeleteDiscountParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s/discount", id) subscription := &stripe.Subscription{} @@ -90,12 +146,12 @@ func (c Client) DeleteDiscount(id string, params *stripe.SubscriptionDeleteDisco return subscription, err } -// Resume is the method for the `POST /v1/subscriptions/{subscription}/resume` API. +// Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. func Resume(id string, params *stripe.SubscriptionResumeParams) (*stripe.Subscription, error) { return getC().Resume(id, params) } -// Resume is the method for the `POST /v1/subscriptions/{subscription}/resume` API. +// Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. func (c Client) Resume(id string, params *stripe.SubscriptionResumeParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s/resume", id) subscription := &stripe.Subscription{} @@ -103,12 +159,12 @@ func (c Client) Resume(id string, params *stripe.SubscriptionResumeParams) (*str return subscription, err } -// List returns a list of subscriptions. +// By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. func List(params *stripe.SubscriptionListParams) *Iter { return getC().List(params) } -// List returns a list of subscriptions. +// By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. func (c Client) List(listParams *stripe.SubscriptionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -142,12 +198,18 @@ func (i *Iter) SubscriptionList() *stripe.SubscriptionList { return i.List().(*stripe.SubscriptionList) } -// Search returns a search result containing subscriptions. +// Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.SubscriptionSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing subscriptions. +// Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.SubscriptionSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/subscriptionitem/client.go b/subscriptionitem/client.go index a946de3824..e937f72b9f 100644 --- a/subscriptionitem/client.go +++ b/subscriptionitem/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new subscription item. +// Adds a new item to an existing subscription. No existing items will be changed or replaced. func New(params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().New(params) } -// New creates a new subscription item. +// Adds a new item to an existing subscription. No existing items will be changed or replaced. func (c Client) New(params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { subscriptionitem := &stripe.SubscriptionItem{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.SubscriptionItemParams) (*stripe.Subscription return subscriptionitem, err } -// Get returns the details of a subscription item. +// Retrieves the subscription item with the given ID. func Get(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().Get(id, params) } -// Get returns the details of a subscription item. +// Retrieves the subscription item with the given ID. func (c Client) Get(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { path := stripe.FormatURLPath("/v1/subscription_items/%s", id) subscriptionitem := &stripe.SubscriptionItem{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.SubscriptionItemParams) (*stripe.S return subscriptionitem, err } -// Update updates a subscription item's properties. +// Updates the plan or quantity of an item on a current subscription. func Update(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().Update(id, params) } -// Update updates a subscription item's properties. +// Updates the plan or quantity of an item on a current subscription. func (c Client) Update(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { path := stripe.FormatURLPath("/v1/subscription_items/%s", id) subscriptionitem := &stripe.SubscriptionItem{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.SubscriptionItemParams) (*strip return subscriptionitem, err } -// Del removes a subscription item. +// Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. func Del(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().Del(id, params) } -// Del removes a subscription item. +// Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. func (c Client) Del(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { path := stripe.FormatURLPath("/v1/subscription_items/%s", id) subscriptionitem := &stripe.SubscriptionItem{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.SubscriptionItemParams) (*stripe.S return subscriptionitem, err } -// List returns a list of subscription items. +// Returns a list of your subscription items for a given subscription. func List(params *stripe.SubscriptionItemListParams) *Iter { return getC().List(params) } -// List returns a list of subscription items. +// Returns a list of your subscription items for a given subscription. func (c Client) List(listParams *stripe.SubscriptionItemListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -116,12 +116,16 @@ func (i *Iter) SubscriptionItemList() *stripe.SubscriptionItemList { return i.List().(*stripe.SubscriptionItemList) } -// UsageRecordSummaries is the method for the `GET /v1/subscription_items/{subscription_item}/usage_record_summaries` API. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func UsageRecordSummaries(params *stripe.SubscriptionItemUsageRecordSummariesParams) *UsageRecordSummaryIter { return getC().UsageRecordSummaries(params) } -// UsageRecordSummaries is the method for the `GET /v1/subscription_items/{subscription_item}/usage_record_summaries` API. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func (c Client) UsageRecordSummaries(listParams *stripe.SubscriptionItemUsageRecordSummariesParams) *UsageRecordSummaryIter { path := stripe.FormatURLPath( "/v1/subscription_items/%s/usage_record_summaries", diff --git a/subscriptionschedule/client.go b/subscriptionschedule/client.go index 6f05fd16a2..18f0a2c00b 100644 --- a/subscriptionschedule/client.go +++ b/subscriptionschedule/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new subscription schedule. +// Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. func New(params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().New(params) } -// New creates a new subscription schedule. +// Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. func (c Client) New(params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { subscriptionschedule := &stripe.SubscriptionSchedule{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.SubscriptionScheduleParams) (*stripe.Subscrip return subscriptionschedule, err } -// Get returns the details of a subscription schedule. +// Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. func Get(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().Get(id, params) } -// Get returns the details of a subscription schedule. +// Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. func (c Client) Get(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.SubscriptionScheduleParams) (*stri return subscriptionschedule, err } -// Update updates a subscription schedule's properties. +// Updates an existing subscription schedule. func Update(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().Update(id, params) } -// Update updates a subscription schedule's properties. +// Updates an existing subscription schedule. func (c Client) Update(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.SubscriptionScheduleParams) (*s return subscriptionschedule, err } -// Cancel is the method for the `POST /v1/subscription_schedules/{schedule}/cancel` API. +// Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. func Cancel(id string, params *stripe.SubscriptionScheduleCancelParams) (*stripe.SubscriptionSchedule, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/subscription_schedules/{schedule}/cancel` API. +// Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. func (c Client) Cancel(id string, params *stripe.SubscriptionScheduleCancelParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s/cancel", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -77,12 +77,12 @@ func (c Client) Cancel(id string, params *stripe.SubscriptionScheduleCancelParam return subscriptionschedule, err } -// Release is the method for the `POST /v1/subscription_schedules/{schedule}/release` API. +// Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. func Release(id string, params *stripe.SubscriptionScheduleReleaseParams) (*stripe.SubscriptionSchedule, error) { return getC().Release(id, params) } -// Release is the method for the `POST /v1/subscription_schedules/{schedule}/release` API. +// Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. func (c Client) Release(id string, params *stripe.SubscriptionScheduleReleaseParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s/release", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -90,12 +90,12 @@ func (c Client) Release(id string, params *stripe.SubscriptionScheduleReleasePar return subscriptionschedule, err } -// List returns a list of subscription schedules. +// Retrieves the list of your subscription schedules. func List(params *stripe.SubscriptionScheduleListParams) *Iter { return getC().List(params) } -// List returns a list of subscription schedules. +// Retrieves the list of your subscription schedules. func (c Client) List(listParams *stripe.SubscriptionScheduleListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/tax/calculation/client.go b/tax/calculation/client.go index 4f326f99b7..d9201aa7f8 100644 --- a/tax/calculation/client.go +++ b/tax/calculation/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new tax calculation. +// Calculates tax based on input and returns a Tax Calculation object. func New(params *stripe.TaxCalculationParams) (*stripe.TaxCalculation, error) { return getC().New(params) } -// New creates a new tax calculation. +// Calculates tax based on input and returns a Tax Calculation object. func (c Client) New(params *stripe.TaxCalculationParams) (*stripe.TaxCalculation, error) { calculation := &stripe.TaxCalculation{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TaxCalculationParams) (*stripe.TaxCalculation return calculation, err } -// ListLineItems is the method for the `GET /v1/tax/calculations/{calculation}/line_items` API. +// Retrieves the line items of a persisted tax calculation as a collection. func ListLineItems(params *stripe.TaxCalculationListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/tax/calculations/{calculation}/line_items` API. +// Retrieves the line items of a persisted tax calculation as a collection. func (c Client) ListLineItems(listParams *stripe.TaxCalculationListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/tax/calculations/%s/line_items", diff --git a/tax/registration/client.go b/tax/registration/client.go index f2af0e91ba..316dfab503 100644 --- a/tax/registration/client.go +++ b/tax/registration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new tax registration. +// Creates a new Tax Registration object. func New(params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { return getC().New(params) } -// New creates a new tax registration. +// Creates a new Tax Registration object. func (c Client) New(params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { registration := &stripe.TaxRegistration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TaxRegistrationParams) (*stripe.TaxRegistrati return registration, err } -// Get returns the details of a tax registration. +// Returns a Tax Registration object. func Get(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { return getC().Get(id, params) } -// Get returns the details of a tax registration. +// Returns a Tax Registration object. func (c Client) Get(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { path := stripe.FormatURLPath("/v1/tax/registrations/%s", id) registration := &stripe.TaxRegistration{} @@ -51,12 +51,16 @@ func (c Client) Get(id string, params *stripe.TaxRegistrationParams) (*stripe.Ta return registration, err } -// Update updates a tax registration's properties. +// Updates an existing Tax Registration object. +// +// A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. func Update(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { return getC().Update(id, params) } -// Update updates a tax registration's properties. +// Updates an existing Tax Registration object. +// +// A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. func (c Client) Update(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { path := stripe.FormatURLPath("/v1/tax/registrations/%s", id) registration := &stripe.TaxRegistration{} @@ -64,12 +68,12 @@ func (c Client) Update(id string, params *stripe.TaxRegistrationParams) (*stripe return registration, err } -// List returns a list of tax registrations. +// Returns a list of Tax Registration objects. func List(params *stripe.TaxRegistrationListParams) *Iter { return getC().List(params) } -// List returns a list of tax registrations. +// Returns a list of Tax Registration objects. func (c Client) List(listParams *stripe.TaxRegistrationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/tax/settings/client.go b/tax/settings/client.go index a773446387..755b259695 100644 --- a/tax/settings/client.go +++ b/tax/settings/client.go @@ -19,24 +19,24 @@ type Client struct { Key string } -// Get returns the details of a tax settings. +// Retrieves Tax Settings for a merchant. func Get(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { return getC().Get(params) } -// Get returns the details of a tax settings. +// Retrieves Tax Settings for a merchant. func (c Client) Get(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { settings := &stripe.TaxSettings{} err := c.B.Call(http.MethodGet, "/v1/tax/settings", c.Key, params, settings) return settings, err } -// Update updates a tax settings's properties. +// Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. func Update(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { return getC().Update(params) } -// Update updates a tax settings's properties. +// Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. func (c Client) Update(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { settings := &stripe.TaxSettings{} err := c.B.Call(http.MethodPost, "/v1/tax/settings", c.Key, params, settings) diff --git a/tax/transaction/client.go b/tax/transaction/client.go index a3848bbd65..bf54bca4a1 100644 --- a/tax/transaction/client.go +++ b/tax/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a tax transaction. +// Retrieves a Tax Transaction object. func Get(id string, params *stripe.TaxTransactionParams) (*stripe.TaxTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a tax transaction. +// Retrieves a Tax Transaction object. func (c Client) Get(id string, params *stripe.TaxTransactionParams) (*stripe.TaxTransaction, error) { path := stripe.FormatURLPath("/v1/tax/transactions/%s", id) transaction := &stripe.TaxTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TaxTransactionParams) (*stripe.Tax return transaction, err } -// CreateFromCalculation is the method for the `POST /v1/tax/transactions/create_from_calculation` API. +// Creates a Tax Transaction from a calculation. func CreateFromCalculation(params *stripe.TaxTransactionCreateFromCalculationParams) (*stripe.TaxTransaction, error) { return getC().CreateFromCalculation(params) } -// CreateFromCalculation is the method for the `POST /v1/tax/transactions/create_from_calculation` API. +// Creates a Tax Transaction from a calculation. func (c Client) CreateFromCalculation(params *stripe.TaxTransactionCreateFromCalculationParams) (*stripe.TaxTransaction, error) { transaction := &stripe.TaxTransaction{} err := c.B.Call( @@ -51,12 +51,12 @@ func (c Client) CreateFromCalculation(params *stripe.TaxTransactionCreateFromCal return transaction, err } -// CreateReversal is the method for the `POST /v1/tax/transactions/create_reversal` API. +// Partially or fully reverses a previously created Transaction. func CreateReversal(params *stripe.TaxTransactionCreateReversalParams) (*stripe.TaxTransaction, error) { return getC().CreateReversal(params) } -// CreateReversal is the method for the `POST /v1/tax/transactions/create_reversal` API. +// Partially or fully reverses a previously created Transaction. func (c Client) CreateReversal(params *stripe.TaxTransactionCreateReversalParams) (*stripe.TaxTransaction, error) { transaction := &stripe.TaxTransaction{} err := c.B.Call( @@ -69,12 +69,12 @@ func (c Client) CreateReversal(params *stripe.TaxTransactionCreateReversalParams return transaction, err } -// ListLineItems is the method for the `GET /v1/tax/transactions/{transaction}/line_items` API. +// Retrieves the line items of a committed standalone transaction as a collection. func ListLineItems(params *stripe.TaxTransactionListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/tax/transactions/{transaction}/line_items` API. +// Retrieves the line items of a committed standalone transaction as a collection. func (c Client) ListLineItems(listParams *stripe.TaxTransactionListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/tax/transactions/%s/line_items", diff --git a/taxcode/client.go b/taxcode/client.go index b450705658..284da8e338 100644 --- a/taxcode/client.go +++ b/taxcode/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a tax code. +// Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. func Get(id string, params *stripe.TaxCodeParams) (*stripe.TaxCode, error) { return getC().Get(id, params) } -// Get returns the details of a tax code. +// Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. func (c Client) Get(id string, params *stripe.TaxCodeParams) (*stripe.TaxCode, error) { path := stripe.FormatURLPath("/v1/tax_codes/%s", id) taxcode := &stripe.TaxCode{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TaxCodeParams) (*stripe.TaxCode, e return taxcode, err } -// List returns a list of tax codes. +// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. func List(params *stripe.TaxCodeListParams) *Iter { return getC().List(params) } -// List returns a list of tax codes. +// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. func (c Client) List(listParams *stripe.TaxCodeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/taxid/client.go b/taxid/client.go index f6a345d200..9cd8e2826e 100644 --- a/taxid/client.go +++ b/taxid/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new tax id. +// Creates a new tax_id object for a customer. func New(params *stripe.TaxIDParams) (*stripe.TaxID, error) { return getC().New(params) } -// New creates a new tax id. +// Creates a new tax_id object for a customer. func (c Client) New(params *stripe.TaxIDParams) (*stripe.TaxID, error) { path := "/v1/tax_ids" if params.Customer != nil { @@ -39,12 +39,12 @@ func (c Client) New(params *stripe.TaxIDParams) (*stripe.TaxID, error) { return taxid, err } -// Get returns the details of a tax id. +// Retrieves the tax_id object with the given identifier. func Get(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { return getC().Get(id, params) } -// Get returns the details of a tax id. +// Retrieves the tax_id object with the given identifier. func (c Client) Get(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { path := stripe.FormatURLPath( "/v1/tax_ids/%s", @@ -62,12 +62,12 @@ func (c Client) Get(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error return taxid, err } -// Del removes a tax id. +// Deletes an existing tax_id object. func Del(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { return getC().Del(id, params) } -// Del removes a tax id. +// Deletes an existing tax_id object. func (c Client) Del(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { path := stripe.FormatURLPath( "/v1/tax_ids/%s", @@ -85,12 +85,12 @@ func (c Client) Del(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error return taxid, err } -// List returns a list of tax ids. +// Returns a list of tax IDs for a customer. func List(params *stripe.TaxIDListParams) *Iter { return getC().List(params) } -// List returns a list of tax ids. +// Returns a list of tax IDs for a customer. func (c Client) List(listParams *stripe.TaxIDListParams) *Iter { path := "/v1/tax_ids" if listParams != nil && listParams.Customer != nil { diff --git a/taxrate/client.go b/taxrate/client.go index 6137eb560f..8763af721a 100644 --- a/taxrate/client.go +++ b/taxrate/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new tax rate. +// Creates a new tax rate. func New(params *stripe.TaxRateParams) (*stripe.TaxRate, error) { return getC().New(params) } -// New creates a new tax rate. +// Creates a new tax rate. func (c Client) New(params *stripe.TaxRateParams) (*stripe.TaxRate, error) { taxrate := &stripe.TaxRate{} err := c.B.Call(http.MethodPost, "/v1/tax_rates", c.Key, params, taxrate) return taxrate, err } -// Get returns the details of a tax rate. +// Retrieves a tax rate with the given ID func Get(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { return getC().Get(id, params) } -// Get returns the details of a tax rate. +// Retrieves a tax rate with the given ID func (c Client) Get(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { path := stripe.FormatURLPath("/v1/tax_rates/%s", id) taxrate := &stripe.TaxRate{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, e return taxrate, err } -// Update updates a tax rate's properties. +// Updates an existing tax rate. func Update(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { return getC().Update(id, params) } -// Update updates a tax rate's properties. +// Updates an existing tax rate. func (c Client) Update(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { path := stripe.FormatURLPath("/v1/tax_rates/%s", id) taxrate := &stripe.TaxRate{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.TaxRateParams) (*stripe.TaxRate return taxrate, err } -// List returns a list of tax rates. +// Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. func List(params *stripe.TaxRateListParams) *Iter { return getC().List(params) } -// List returns a list of tax rates. +// Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. func (c Client) List(listParams *stripe.TaxRateListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/terminal/configuration/client.go b/terminal/configuration/client.go index fc7d680299..29319f42bc 100644 --- a/terminal/configuration/client.go +++ b/terminal/configuration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new terminal configuration. +// Creates a new Configuration object. func New(params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().New(params) } -// New creates a new terminal configuration. +// Creates a new Configuration object. func (c Client) New(params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { configuration := &stripe.TerminalConfiguration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TerminalConfigurationParams) (*stripe.Termina return configuration, err } -// Get returns the details of a terminal configuration. +// Retrieves a Configuration object. func Get(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().Get(id, params) } -// Get returns the details of a terminal configuration. +// Retrieves a Configuration object. func (c Client) Get(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { path := stripe.FormatURLPath("/v1/terminal/configurations/%s", id) configuration := &stripe.TerminalConfiguration{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TerminalConfigurationParams) (*str return configuration, err } -// Update updates a terminal configuration's properties. +// Updates a new Configuration object. func Update(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().Update(id, params) } -// Update updates a terminal configuration's properties. +// Updates a new Configuration object. func (c Client) Update(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { path := stripe.FormatURLPath("/v1/terminal/configurations/%s", id) configuration := &stripe.TerminalConfiguration{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.TerminalConfigurationParams) (* return configuration, err } -// Del removes a terminal configuration. +// Deletes a Configuration object. func Del(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().Del(id, params) } -// Del removes a terminal configuration. +// Deletes a Configuration object. func (c Client) Del(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { path := stripe.FormatURLPath("/v1/terminal/configurations/%s", id) configuration := &stripe.TerminalConfiguration{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.TerminalConfigurationParams) (*str return configuration, err } -// List returns a list of terminal configurations. +// Returns a list of Configuration objects. func List(params *stripe.TerminalConfigurationListParams) *Iter { return getC().List(params) } -// List returns a list of terminal configurations. +// Returns a list of Configuration objects. func (c Client) List(listParams *stripe.TerminalConfigurationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/terminal/connectiontoken/client.go b/terminal/connectiontoken/client.go index 7cbcf6ee43..7e6aa816bc 100644 --- a/terminal/connectiontoken/client.go +++ b/terminal/connectiontoken/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new terminal connection token. +// To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. func New(params *stripe.TerminalConnectionTokenParams) (*stripe.TerminalConnectionToken, error) { return getC().New(params) } -// New creates a new terminal connection token. +// To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. func (c Client) New(params *stripe.TerminalConnectionTokenParams) (*stripe.TerminalConnectionToken, error) { connectiontoken := &stripe.TerminalConnectionToken{} err := c.B.Call( diff --git a/terminal/location/client.go b/terminal/location/client.go index 01c9a3ea0b..c16363ad01 100644 --- a/terminal/location/client.go +++ b/terminal/location/client.go @@ -20,12 +20,14 @@ type Client struct { Key string } -// New creates a new terminal location. +// Creates a new Location object. +// For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. func New(params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().New(params) } -// New creates a new terminal location. +// Creates a new Location object. +// For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. func (c Client) New(params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { location := &stripe.TerminalLocation{} err := c.B.Call( @@ -38,12 +40,12 @@ func (c Client) New(params *stripe.TerminalLocationParams) (*stripe.TerminalLoca return location, err } -// Get returns the details of a terminal location. +// Retrieves a Location object. func Get(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Get(id, params) } -// Get returns the details of a terminal location. +// Retrieves a Location object. func (c Client) Get(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} @@ -51,12 +53,12 @@ func (c Client) Get(id string, params *stripe.TerminalLocationParams) (*stripe.T return location, err } -// Update updates a terminal location's properties. +// Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Update(id, params) } -// Update updates a terminal location's properties. +// Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} @@ -64,12 +66,12 @@ func (c Client) Update(id string, params *stripe.TerminalLocationParams) (*strip return location, err } -// Del removes a terminal location. +// Deletes a Location object. func Del(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Del(id, params) } -// Del removes a terminal location. +// Deletes a Location object. func (c Client) Del(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} @@ -77,12 +79,12 @@ func (c Client) Del(id string, params *stripe.TerminalLocationParams) (*stripe.T return location, err } -// List returns a list of terminal locations. +// Returns a list of Location objects. func List(params *stripe.TerminalLocationListParams) *Iter { return getC().List(params) } -// List returns a list of terminal locations. +// Returns a list of Location objects. func (c Client) List(listParams *stripe.TerminalLocationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/terminal/reader/client.go b/terminal/reader/client.go index 98b75677a4..7c9d16ab0f 100644 --- a/terminal/reader/client.go +++ b/terminal/reader/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new terminal reader. +// Creates a new Reader object. func New(params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().New(params) } -// New creates a new terminal reader. +// Creates a new Reader object. func (c Client) New(params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { reader := &stripe.TerminalReader{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TerminalReaderParams) (*stripe.TerminalReader return reader, err } -// Get returns the details of a terminal reader. +// Retrieves a Reader object. func Get(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().Get(id, params) } -// Get returns the details of a terminal reader. +// Retrieves a Reader object. func (c Client) Get(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s", id) reader := &stripe.TerminalReader{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TerminalReaderParams) (*stripe.Ter return reader, err } -// Update updates a terminal reader's properties. +// Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().Update(id, params) } -// Update updates a terminal reader's properties. +// Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s", id) reader := &stripe.TerminalReader{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.TerminalReaderParams) (*stripe. return reader, err } -// Del removes a terminal reader. +// Deletes a Reader object. func Del(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().Del(id, params) } -// Del removes a terminal reader. +// Deletes a Reader object. func (c Client) Del(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s", id) reader := &stripe.TerminalReader{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.TerminalReaderParams) (*stripe.Ter return reader, err } -// CancelAction is the method for the `POST /v1/terminal/readers/{reader}/cancel_action` API. +// Cancels the current reader action. func CancelAction(id string, params *stripe.TerminalReaderCancelActionParams) (*stripe.TerminalReader, error) { return getC().CancelAction(id, params) } -// CancelAction is the method for the `POST /v1/terminal/readers/{reader}/cancel_action` API. +// Cancels the current reader action. func (c Client) CancelAction(id string, params *stripe.TerminalReaderCancelActionParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s/cancel_action", id) reader := &stripe.TerminalReader{} @@ -90,12 +90,12 @@ func (c Client) CancelAction(id string, params *stripe.TerminalReaderCancelActio return reader, err } -// ProcessPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/process_payment_intent` API. +// Initiates a payment flow on a Reader. func ProcessPaymentIntent(id string, params *stripe.TerminalReaderProcessPaymentIntentParams) (*stripe.TerminalReader, error) { return getC().ProcessPaymentIntent(id, params) } -// ProcessPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/process_payment_intent` API. +// Initiates a payment flow on a Reader. func (c Client) ProcessPaymentIntent(id string, params *stripe.TerminalReaderProcessPaymentIntentParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/terminal/readers/%s/process_payment_intent", @@ -106,12 +106,12 @@ func (c Client) ProcessPaymentIntent(id string, params *stripe.TerminalReaderPro return reader, err } -// ProcessSetupIntent is the method for the `POST /v1/terminal/readers/{reader}/process_setup_intent` API. +// Initiates a setup intent flow on a Reader. func ProcessSetupIntent(id string, params *stripe.TerminalReaderProcessSetupIntentParams) (*stripe.TerminalReader, error) { return getC().ProcessSetupIntent(id, params) } -// ProcessSetupIntent is the method for the `POST /v1/terminal/readers/{reader}/process_setup_intent` API. +// Initiates a setup intent flow on a Reader. func (c Client) ProcessSetupIntent(id string, params *stripe.TerminalReaderProcessSetupIntentParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/terminal/readers/%s/process_setup_intent", @@ -122,12 +122,12 @@ func (c Client) ProcessSetupIntent(id string, params *stripe.TerminalReaderProce return reader, err } -// RefundPayment is the method for the `POST /v1/terminal/readers/{reader}/refund_payment` API. +// Initiates a refund on a Reader func RefundPayment(id string, params *stripe.TerminalReaderRefundPaymentParams) (*stripe.TerminalReader, error) { return getC().RefundPayment(id, params) } -// RefundPayment is the method for the `POST /v1/terminal/readers/{reader}/refund_payment` API. +// Initiates a refund on a Reader func (c Client) RefundPayment(id string, params *stripe.TerminalReaderRefundPaymentParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s/refund_payment", id) reader := &stripe.TerminalReader{} @@ -135,12 +135,12 @@ func (c Client) RefundPayment(id string, params *stripe.TerminalReaderRefundPaym return reader, err } -// SetReaderDisplay is the method for the `POST /v1/terminal/readers/{reader}/set_reader_display` API. +// Sets reader display to show cart details. func SetReaderDisplay(id string, params *stripe.TerminalReaderSetReaderDisplayParams) (*stripe.TerminalReader, error) { return getC().SetReaderDisplay(id, params) } -// SetReaderDisplay is the method for the `POST /v1/terminal/readers/{reader}/set_reader_display` API. +// Sets reader display to show cart details. func (c Client) SetReaderDisplay(id string, params *stripe.TerminalReaderSetReaderDisplayParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s/set_reader_display", id) reader := &stripe.TerminalReader{} @@ -148,12 +148,12 @@ func (c Client) SetReaderDisplay(id string, params *stripe.TerminalReaderSetRead return reader, err } -// List returns a list of terminal readers. +// Returns a list of Reader objects. func List(params *stripe.TerminalReaderListParams) *Iter { return getC().List(params) } -// List returns a list of terminal readers. +// Returns a list of Reader objects. func (c Client) List(listParams *stripe.TerminalReaderListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/testhelpers/confirmationtoken/client.go b/testhelpers/confirmationtoken/client.go index 35c903026f..be286b23c1 100644 --- a/testhelpers/confirmationtoken/client.go +++ b/testhelpers/confirmationtoken/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new confirmation token. +// Creates a test mode Confirmation Token server side for your integration tests. func New(params *stripe.TestHelpersConfirmationTokenParams) (*stripe.ConfirmationToken, error) { return getC().New(params) } -// New creates a new confirmation token. +// Creates a test mode Confirmation Token server side for your integration tests. func (c Client) New(params *stripe.TestHelpersConfirmationTokenParams) (*stripe.ConfirmationToken, error) { confirmationtoken := &stripe.ConfirmationToken{} err := c.B.Call( diff --git a/testhelpers/customer/client.go b/testhelpers/customer/client.go index c0d321cea6..98a996e526 100644 --- a/testhelpers/customer/client.go +++ b/testhelpers/customer/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// FundCashBalance is the method for the `POST /v1/test_helpers/customers/{customer}/fund_cash_balance` API. +// Create an incoming testmode bank transfer func FundCashBalance(id string, params *stripe.TestHelpersCustomerFundCashBalanceParams) (*stripe.CustomerCashBalanceTransaction, error) { return getC().FundCashBalance(id, params) } -// FundCashBalance is the method for the `POST /v1/test_helpers/customers/{customer}/fund_cash_balance` API. +// Create an incoming testmode bank transfer func (c Client) FundCashBalance(id string, params *stripe.TestHelpersCustomerFundCashBalanceParams) (*stripe.CustomerCashBalanceTransaction, error) { path := stripe.FormatURLPath( "/v1/test_helpers/customers/%s/fund_cash_balance", diff --git a/testhelpers/issuing/authorization/client.go b/testhelpers/issuing/authorization/client.go index 6ebfeb5fc5..3de0d332b6 100644 --- a/testhelpers/issuing/authorization/client.go +++ b/testhelpers/issuing/authorization/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new issuing authorization. +// Create a test-mode authorization. func New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().New(params) } -// New creates a new issuing authorization. +// Create a test-mode authorization. func (c Client) New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { authorization := &stripe.IssuingAuthorization{} err := c.B.Call( @@ -37,12 +37,12 @@ func (c Client) New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stri return authorization, err } -// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API. +// Capture a test-mode authorization. func Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) { return getC().Capture(id, params) } -// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API. +// Capture a test-mode authorization. func (c Client) Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/capture", @@ -53,12 +53,12 @@ func (c Client) Capture(id string, params *stripe.TestHelpersIssuingAuthorizatio return authorization, err } -// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API. +// Expire a test-mode Authorization. func Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) { return getC().Expire(id, params) } -// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API. +// Expire a test-mode Authorization. func (c Client) Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/expire", @@ -69,12 +69,12 @@ func (c Client) Expire(id string, params *stripe.TestHelpersIssuingAuthorization return authorization, err } -// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API. +// Increment a test-mode Authorization. func Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) { return getC().Increment(id, params) } -// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API. +// Increment a test-mode Authorization. func (c Client) Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/increment", @@ -85,12 +85,12 @@ func (c Client) Increment(id string, params *stripe.TestHelpersIssuingAuthorizat return authorization, err } -// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API. +// Reverse a test-mode Authorization. func Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) { return getC().Reverse(id, params) } -// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API. +// Reverse a test-mode Authorization. func (c Client) Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/reverse", diff --git a/testhelpers/issuing/card/client.go b/testhelpers/issuing/card/client.go index b889d3d06d..edabfdeaec 100644 --- a/testhelpers/issuing/card/client.go +++ b/testhelpers/issuing/card/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// DeliverCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/deliver` API. +// Updates the shipping status of the specified Issuing Card object to delivered. func DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeliverCardParams) (*stripe.IssuingCard, error) { return getC().DeliverCard(id, params) } -// DeliverCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/deliver` API. +// Updates the shipping status of the specified Issuing Card object to delivered. func (c Client) DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeliverCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/deliver", @@ -35,12 +35,12 @@ func (c Client) DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeli return card, err } -// FailCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/fail` API. +// Updates the shipping status of the specified Issuing Card object to failure. func FailCard(id string, params *stripe.TestHelpersIssuingCardFailCardParams) (*stripe.IssuingCard, error) { return getC().FailCard(id, params) } -// FailCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/fail` API. +// Updates the shipping status of the specified Issuing Card object to failure. func (c Client) FailCard(id string, params *stripe.TestHelpersIssuingCardFailCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/fail", @@ -51,12 +51,12 @@ func (c Client) FailCard(id string, params *stripe.TestHelpersIssuingCardFailCar return card, err } -// ReturnCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/return` API. +// Updates the shipping status of the specified Issuing Card object to returned. func ReturnCard(id string, params *stripe.TestHelpersIssuingCardReturnCardParams) (*stripe.IssuingCard, error) { return getC().ReturnCard(id, params) } -// ReturnCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/return` API. +// Updates the shipping status of the specified Issuing Card object to returned. func (c Client) ReturnCard(id string, params *stripe.TestHelpersIssuingCardReturnCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/return", @@ -67,12 +67,12 @@ func (c Client) ReturnCard(id string, params *stripe.TestHelpersIssuingCardRetur return card, err } -// ShipCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/ship` API. +// Updates the shipping status of the specified Issuing Card object to shipped. func ShipCard(id string, params *stripe.TestHelpersIssuingCardShipCardParams) (*stripe.IssuingCard, error) { return getC().ShipCard(id, params) } -// ShipCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/ship` API. +// Updates the shipping status of the specified Issuing Card object to shipped. func (c Client) ShipCard(id string, params *stripe.TestHelpersIssuingCardShipCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/ship", diff --git a/testhelpers/issuing/personalizationdesign/client.go b/testhelpers/issuing/personalizationdesign/client.go index 09c95a8c3b..a1a7da3d87 100644 --- a/testhelpers/issuing/personalizationdesign/client.go +++ b/testhelpers/issuing/personalizationdesign/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Activate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate` API. +// Updates the status of the specified testmode personalization design object to active. func Activate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignActivateParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Activate(id, params) } -// Activate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate` API. +// Updates the status of the specified testmode personalization design object to active. func (c Client) Activate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignActivateParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/personalization_designs/%s/activate", @@ -35,12 +35,12 @@ func (c Client) Activate(id string, params *stripe.TestHelpersIssuingPersonaliza return personalizationdesign, err } -// Deactivate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate` API. +// Updates the status of the specified testmode personalization design object to inactive. func Deactivate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignDeactivateParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Deactivate(id, params) } -// Deactivate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate` API. +// Updates the status of the specified testmode personalization design object to inactive. func (c Client) Deactivate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignDeactivateParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/personalization_designs/%s/deactivate", @@ -51,12 +51,12 @@ func (c Client) Deactivate(id string, params *stripe.TestHelpersIssuingPersonali return personalizationdesign, err } -// Reject is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject` API. +// Updates the status of the specified testmode personalization design object to rejected. func Reject(id string, params *stripe.TestHelpersIssuingPersonalizationDesignRejectParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Reject(id, params) } -// Reject is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject` API. +// Updates the status of the specified testmode personalization design object to rejected. func (c Client) Reject(id string, params *stripe.TestHelpersIssuingPersonalizationDesignRejectParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/personalization_designs/%s/reject", diff --git a/testhelpers/issuing/transaction/client.go b/testhelpers/issuing/transaction/client.go index e13d5ac6d8..0d2dd043f4 100644 --- a/testhelpers/issuing/transaction/client.go +++ b/testhelpers/issuing/transaction/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API. +// Allows the user to capture an arbitrary amount, also known as a forced capture. func CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) { return getC().CreateForceCapture(params) } -// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API. +// Allows the user to capture an arbitrary amount, also known as a forced capture. func (c Client) CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) { transaction := &stripe.IssuingTransaction{} err := c.B.Call( @@ -37,12 +37,12 @@ func (c Client) CreateForceCapture(params *stripe.TestHelpersIssuingTransactionC return transaction, err } -// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API. +// Allows the user to refund an arbitrary amount, also known as a unlinked refund. func CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) { return getC().CreateUnlinkedRefund(params) } -// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API. +// Allows the user to refund an arbitrary amount, also known as a unlinked refund. func (c Client) CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) { transaction := &stripe.IssuingTransaction{} err := c.B.Call( @@ -55,12 +55,12 @@ func (c Client) CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactio return transaction, err } -// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API. +// Refund a test-mode Transaction. func Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) { return getC().Refund(id, params) } -// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API. +// Refund a test-mode Transaction. func (c Client) Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/transactions/%s/refund", diff --git a/testhelpers/refund/client.go b/testhelpers/refund/client.go index ef7f8d4d77..82b83fbbab 100644 --- a/testhelpers/refund/client.go +++ b/testhelpers/refund/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Expire is the method for the `POST /v1/test_helpers/refunds/{refund}/expire` API. +// Expire a refund with a status of requires_action. func Expire(id string, params *stripe.TestHelpersRefundExpireParams) (*stripe.Refund, error) { return getC().Expire(id, params) } -// Expire is the method for the `POST /v1/test_helpers/refunds/{refund}/expire` API. +// Expire a refund with a status of requires_action. func (c Client) Expire(id string, params *stripe.TestHelpersRefundExpireParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/test_helpers/refunds/%s/expire", id) refund := &stripe.Refund{} diff --git a/testhelpers/terminal/reader/client.go b/testhelpers/terminal/reader/client.go index 311467481e..8865eddf54 100644 --- a/testhelpers/terminal/reader/client.go +++ b/testhelpers/terminal/reader/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// PresentPaymentMethod is the method for the `POST /v1/test_helpers/terminal/readers/{reader}/present_payment_method` API. +// Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. func PresentPaymentMethod(id string, params *stripe.TestHelpersTerminalReaderPresentPaymentMethodParams) (*stripe.TerminalReader, error) { return getC().PresentPaymentMethod(id, params) } -// PresentPaymentMethod is the method for the `POST /v1/test_helpers/terminal/readers/{reader}/present_payment_method` API. +// Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. func (c Client) PresentPaymentMethod(id string, params *stripe.TestHelpersTerminalReaderPresentPaymentMethodParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/test_helpers/terminal/readers/%s/present_payment_method", diff --git a/testhelpers/testclock/client.go b/testhelpers/testclock/client.go index c68481cc3c..09ccb2bb0e 100644 --- a/testhelpers/testclock/client.go +++ b/testhelpers/testclock/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new test helpers test clock. +// Creates a new test clock that can be attached to new customers and quotes. func New(params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { return getC().New(params) } -// New creates a new test helpers test clock. +// Creates a new test clock that can be attached to new customers and quotes. func (c Client) New(params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { testclock := &stripe.TestHelpersTestClock{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TestHelpersTestClockParams) (*stripe.TestHelp return testclock, err } -// Get returns the details of a test helpers test clock. +// Retrieves a test clock. func Get(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { return getC().Get(id, params) } -// Get returns the details of a test helpers test clock. +// Retrieves a test clock. func (c Client) Get(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { path := stripe.FormatURLPath("/v1/test_helpers/test_clocks/%s", id) testclock := &stripe.TestHelpersTestClock{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TestHelpersTestClockParams) (*stri return testclock, err } -// Del removes a test helpers test clock. +// Deletes a test clock. func Del(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { return getC().Del(id, params) } -// Del removes a test helpers test clock. +// Deletes a test clock. func (c Client) Del(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { path := stripe.FormatURLPath("/v1/test_helpers/test_clocks/%s", id) testclock := &stripe.TestHelpersTestClock{} @@ -64,12 +64,12 @@ func (c Client) Del(id string, params *stripe.TestHelpersTestClockParams) (*stri return testclock, err } -// Advance is the method for the `POST /v1/test_helpers/test_clocks/{test_clock}/advance` API. +// Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. func Advance(id string, params *stripe.TestHelpersTestClockAdvanceParams) (*stripe.TestHelpersTestClock, error) { return getC().Advance(id, params) } -// Advance is the method for the `POST /v1/test_helpers/test_clocks/{test_clock}/advance` API. +// Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. func (c Client) Advance(id string, params *stripe.TestHelpersTestClockAdvanceParams) (*stripe.TestHelpersTestClock, error) { path := stripe.FormatURLPath("/v1/test_helpers/test_clocks/%s/advance", id) testclock := &stripe.TestHelpersTestClock{} @@ -77,12 +77,12 @@ func (c Client) Advance(id string, params *stripe.TestHelpersTestClockAdvancePar return testclock, err } -// List returns a list of test helpers test clocks. +// Returns a list of your test clocks. func List(params *stripe.TestHelpersTestClockListParams) *Iter { return getC().List(params) } -// List returns a list of test helpers test clocks. +// Returns a list of your test clocks. func (c Client) List(listParams *stripe.TestHelpersTestClockListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/testhelpers/treasury/inboundtransfer/client.go b/testhelpers/treasury/inboundtransfer/client.go index c45e93c95a..1a60afdf00 100644 --- a/testhelpers/treasury/inboundtransfer/client.go +++ b/testhelpers/treasury/inboundtransfer/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Fail is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/fail` API. +// Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. func Fail(id string, params *stripe.TestHelpersTreasuryInboundTransferFailParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Fail(id, params) } -// Fail is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/fail` API. +// Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryInboundTransferFailParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/inbound_transfers/%s/fail", @@ -35,12 +35,12 @@ func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryInboundTransfe return inboundtransfer, err } -// ReturnInboundTransfer is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/return` API. +// Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. func ReturnInboundTransfer(id string, params *stripe.TestHelpersTreasuryInboundTransferReturnInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { return getC().ReturnInboundTransfer(id, params) } -// ReturnInboundTransfer is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/return` API. +// Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. func (c Client) ReturnInboundTransfer(id string, params *stripe.TestHelpersTreasuryInboundTransferReturnInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/inbound_transfers/%s/return", @@ -51,12 +51,12 @@ func (c Client) ReturnInboundTransfer(id string, params *stripe.TestHelpersTreas return inboundtransfer, err } -// Succeed is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/succeed` API. +// Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. func Succeed(id string, params *stripe.TestHelpersTreasuryInboundTransferSucceedParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Succeed(id, params) } -// Succeed is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/succeed` API. +// Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. func (c Client) Succeed(id string, params *stripe.TestHelpersTreasuryInboundTransferSucceedParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/inbound_transfers/%s/succeed", diff --git a/testhelpers/treasury/outboundpayment/client.go b/testhelpers/treasury/outboundpayment/client.go index 96eab6ab15..cd2467c5aa 100644 --- a/testhelpers/treasury/outboundpayment/client.go +++ b/testhelpers/treasury/outboundpayment/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/fail` API. +// Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. func Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymentFailParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Fail(id, params) } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/fail` API. +// Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymentFailParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_payments/%s/fail", @@ -35,12 +35,12 @@ func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymen return outboundpayment, err } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/post` API. +// Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. func Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymentPostParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Post(id, params) } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/post` API. +// Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymentPostParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_payments/%s/post", @@ -51,12 +51,12 @@ func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymen return outboundpayment, err } -// ReturnOutboundPayment is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/return` API. +// Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. func ReturnOutboundPayment(id string, params *stripe.TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { return getC().ReturnOutboundPayment(id, params) } -// ReturnOutboundPayment is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/return` API. +// Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. func (c Client) ReturnOutboundPayment(id string, params *stripe.TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_payments/%s/return", diff --git a/testhelpers/treasury/outboundtransfer/client.go b/testhelpers/treasury/outboundtransfer/client.go index e8f102b5c5..a0736dc12f 100644 --- a/testhelpers/treasury/outboundtransfer/client.go +++ b/testhelpers/treasury/outboundtransfer/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail` API. +// Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. func Fail(id string, params *stripe.TestHelpersTreasuryOutboundTransferFailParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Fail(id, params) } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail` API. +// Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundTransferFailParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_transfers/%s/fail", @@ -35,12 +35,12 @@ func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundTransf return outboundtransfer, err } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post` API. +// Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. func Post(id string, params *stripe.TestHelpersTreasuryOutboundTransferPostParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Post(id, params) } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post` API. +// Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundTransferPostParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_transfers/%s/post", @@ -51,12 +51,12 @@ func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundTransf return outboundtransfer, err } -// ReturnOutboundTransfer is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return` API. +// Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. func ReturnOutboundTransfer(id string, params *stripe.TestHelpersTreasuryOutboundTransferReturnOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().ReturnOutboundTransfer(id, params) } -// ReturnOutboundTransfer is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return` API. +// Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. func (c Client) ReturnOutboundTransfer(id string, params *stripe.TestHelpersTreasuryOutboundTransferReturnOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_transfers/%s/return", diff --git a/testhelpers/treasury/receivedcredit/client.go b/testhelpers/treasury/receivedcredit/client.go index 5d5629f846..b7386d898d 100644 --- a/testhelpers/treasury/receivedcredit/client.go +++ b/testhelpers/treasury/receivedcredit/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new treasury received credit. +// Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. func New(params *stripe.TestHelpersTreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { return getC().New(params) } -// New creates a new treasury received credit. +// Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. func (c Client) New(params *stripe.TestHelpersTreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { receivedcredit := &stripe.TreasuryReceivedCredit{} err := c.B.Call( diff --git a/testhelpers/treasury/receiveddebit/client.go b/testhelpers/treasury/receiveddebit/client.go index 0f60f586cc..e7160a436c 100644 --- a/testhelpers/treasury/receiveddebit/client.go +++ b/testhelpers/treasury/receiveddebit/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new treasury received debit. +// Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. func New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { return getC().New(params) } -// New creates a new treasury received debit. +// Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. func (c Client) New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { receiveddebit := &stripe.TreasuryReceivedDebit{} err := c.B.Call( diff --git a/token/client.go b/token/client.go index 4a2a6d86af..fcaaa9368e 100644 --- a/token/client.go +++ b/token/client.go @@ -19,24 +19,26 @@ type Client struct { Key string } -// New creates a new token. +// Creates a single-use token that represents a bank account's details. +// You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. func New(params *stripe.TokenParams) (*stripe.Token, error) { return getC().New(params) } -// New creates a new token. +// Creates a single-use token that represents a bank account's details. +// You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. func (c Client) New(params *stripe.TokenParams) (*stripe.Token, error) { token := &stripe.Token{} err := c.B.Call(http.MethodPost, "/v1/tokens", c.Key, params, token) return token, err } -// Get returns the details of a token. +// Retrieves the token with the given ID. func Get(id string, params *stripe.TokenParams) (*stripe.Token, error) { return getC().Get(id, params) } -// Get returns the details of a token. +// Retrieves the token with the given ID. func (c Client) Get(id string, params *stripe.TokenParams) (*stripe.Token, error) { path := stripe.FormatURLPath("/v1/tokens/%s", id) token := &stripe.Token{} diff --git a/topup/client.go b/topup/client.go index 6cb9a3a5c0..5ead7d55cf 100644 --- a/topup/client.go +++ b/topup/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new topup. +// Top up the balance of an account func New(params *stripe.TopupParams) (*stripe.Topup, error) { return getC().New(params) } -// New creates a new topup. +// Top up the balance of an account func (c Client) New(params *stripe.TopupParams) (*stripe.Topup, error) { topup := &stripe.Topup{} err := c.B.Call(http.MethodPost, "/v1/topups", c.Key, params, topup) return topup, err } -// Get returns the details of a topup. +// Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. func Get(id string, params *stripe.TopupParams) (*stripe.Topup, error) { return getC().Get(id, params) } -// Get returns the details of a topup. +// Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. func (c Client) Get(id string, params *stripe.TopupParams) (*stripe.Topup, error) { path := stripe.FormatURLPath("/v1/topups/%s", id) topup := &stripe.Topup{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.TopupParams) (*stripe.Topup, error return topup, err } -// Update updates a topup's properties. +// Updates the metadata of a top-up. Other top-up details are not editable by design. func Update(id string, params *stripe.TopupParams) (*stripe.Topup, error) { return getC().Update(id, params) } -// Update updates a topup's properties. +// Updates the metadata of a top-up. Other top-up details are not editable by design. func (c Client) Update(id string, params *stripe.TopupParams) (*stripe.Topup, error) { path := stripe.FormatURLPath("/v1/topups/%s", id) topup := &stripe.Topup{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.TopupParams) (*stripe.Topup, er return topup, err } -// Cancel is the method for the `POST /v1/topups/{topup}/cancel` API. +// Cancels a top-up. Only pending top-ups can be canceled. func Cancel(id string, params *stripe.TopupParams) (*stripe.Topup, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/topups/{topup}/cancel` API. +// Cancels a top-up. Only pending top-ups can be canceled. func (c Client) Cancel(id string, params *stripe.TopupParams) (*stripe.Topup, error) { path := stripe.FormatURLPath("/v1/topups/%s/cancel", id) topup := &stripe.Topup{} @@ -71,12 +71,12 @@ func (c Client) Cancel(id string, params *stripe.TopupParams) (*stripe.Topup, er return topup, err } -// List returns a list of topups. +// Returns a list of top-ups. func List(params *stripe.TopupListParams) *Iter { return getC().List(params) } -// List returns a list of topups. +// Returns a list of top-ups. func (c Client) List(listParams *stripe.TopupListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/transfer/client.go b/transfer/client.go index 56bd1184d1..75a9fd3df1 100644 --- a/transfer/client.go +++ b/transfer/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new transfer. +// To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. func New(params *stripe.TransferParams) (*stripe.Transfer, error) { return getC().New(params) } -// New creates a new transfer. +// To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. func (c Client) New(params *stripe.TransferParams) (*stripe.Transfer, error) { transfer := &stripe.Transfer{} err := c.B.Call(http.MethodPost, "/v1/transfers", c.Key, params, transfer) return transfer, err } -// Get returns the details of a transfer. +// Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. func Get(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { return getC().Get(id, params) } -// Get returns the details of a transfer. +// Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. func (c Client) Get(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { path := stripe.FormatURLPath("/v1/transfers/%s", id) transfer := &stripe.Transfer{} @@ -45,12 +45,16 @@ func (c Client) Get(id string, params *stripe.TransferParams) (*stripe.Transfer, return transfer, err } -// Update updates a transfer's properties. +// Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts only metadata as an argument. func Update(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { return getC().Update(id, params) } -// Update updates a transfer's properties. +// Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts only metadata as an argument. func (c Client) Update(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { path := stripe.FormatURLPath("/v1/transfers/%s", id) transfer := &stripe.Transfer{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.TransferParams) (*stripe.Transf return transfer, err } -// List returns a list of transfers. +// Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. func List(params *stripe.TransferListParams) *Iter { return getC().List(params) } -// List returns a list of transfers. +// Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. func (c Client) List(listParams *stripe.TransferListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/transferreversal/client.go b/transferreversal/client.go index df54859577..b11b7966a5 100644 --- a/transferreversal/client.go +++ b/transferreversal/client.go @@ -21,12 +21,20 @@ type Client struct { Key string } -// New creates a new transfer reversal. +// When you create a new reversal, you must specify a transfer to create it on. +// +// When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. +// +// Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. func New(params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { return getC().New(params) } -// New creates a new transfer reversal. +// When you create a new reversal, you must specify a transfer to create it on. +// +// When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. +// +// Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. func (c Client) New(params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { path := stripe.FormatURLPath( "/v1/transfers/%s/reversals", @@ -37,12 +45,12 @@ func (c Client) New(params *stripe.TransferReversalParams) (*stripe.TransferReve return transferreversal, err } -// Get returns the details of a transfer reversal. +// By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. func Get(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { return getC().Get(id, params) } -// Get returns the details of a transfer reversal. +// By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. func (c Client) Get(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { if params == nil { return nil, fmt.Errorf( @@ -59,12 +67,16 @@ func (c Client) Get(id string, params *stripe.TransferReversalParams) (*stripe.T return transferreversal, err } -// Update updates a transfer reversal's properties. +// Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata and description as arguments. func Update(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { return getC().Update(id, params) } -// Update updates a transfer reversal's properties. +// Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata and description as arguments. func (c Client) Update(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { path := stripe.FormatURLPath( "/v1/transfers/%s/reversals/%s", @@ -76,12 +88,12 @@ func (c Client) Update(id string, params *stripe.TransferReversalParams) (*strip return transferreversal, err } -// List returns a list of transfer reversals. +// You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. func List(params *stripe.TransferReversalListParams) *Iter { return getC().List(params) } -// List returns a list of transfer reversals. +// You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. func (c Client) List(listParams *stripe.TransferReversalListParams) *Iter { path := stripe.FormatURLPath( "/v1/transfers/%s/reversals", diff --git a/treasury/creditreversal/client.go b/treasury/creditreversal/client.go index d0b457b6b0..92b002bfac 100644 --- a/treasury/creditreversal/client.go +++ b/treasury/creditreversal/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury credit reversal. +// Reverses a ReceivedCredit and creates a CreditReversal object. func New(params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { return getC().New(params) } -// New creates a new treasury credit reversal. +// Reverses a ReceivedCredit and creates a CreditReversal object. func (c Client) New(params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { creditreversal := &stripe.TreasuryCreditReversal{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryCreditReversalParams) (*stripe.Treasu return creditreversal, err } -// Get returns the details of a treasury credit reversal. +// Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list func Get(id string, params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { return getC().Get(id, params) } -// Get returns the details of a treasury credit reversal. +// Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list func (c Client) Get(id string, params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { path := stripe.FormatURLPath("/v1/treasury/credit_reversals/%s", id) creditreversal := &stripe.TreasuryCreditReversal{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryCreditReversalParams) (*st return creditreversal, err } -// List returns a list of treasury credit reversals. +// Returns a list of CreditReversals. func List(params *stripe.TreasuryCreditReversalListParams) *Iter { return getC().List(params) } -// List returns a list of treasury credit reversals. +// Returns a list of CreditReversals. func (c Client) List(listParams *stripe.TreasuryCreditReversalListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/debitreversal/client.go b/treasury/debitreversal/client.go index 2edac59f27..6adc2688a5 100644 --- a/treasury/debitreversal/client.go +++ b/treasury/debitreversal/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury debit reversal. +// Reverses a ReceivedDebit and creates a DebitReversal object. func New(params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { return getC().New(params) } -// New creates a new treasury debit reversal. +// Reverses a ReceivedDebit and creates a DebitReversal object. func (c Client) New(params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { debitreversal := &stripe.TreasuryDebitReversal{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryDebitReversalParams) (*stripe.Treasur return debitreversal, err } -// Get returns the details of a treasury debit reversal. +// Retrieves a DebitReversal object. func Get(id string, params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { return getC().Get(id, params) } -// Get returns the details of a treasury debit reversal. +// Retrieves a DebitReversal object. func (c Client) Get(id string, params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { path := stripe.FormatURLPath("/v1/treasury/debit_reversals/%s", id) debitreversal := &stripe.TreasuryDebitReversal{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryDebitReversalParams) (*str return debitreversal, err } -// List returns a list of treasury debit reversals. +// Returns a list of DebitReversals. func List(params *stripe.TreasuryDebitReversalListParams) *Iter { return getC().List(params) } -// List returns a list of treasury debit reversals. +// Returns a list of DebitReversals. func (c Client) List(listParams *stripe.TreasuryDebitReversalListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/financialaccount/client.go b/treasury/financialaccount/client.go index ff930909ec..cb783db773 100644 --- a/treasury/financialaccount/client.go +++ b/treasury/financialaccount/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury financial account. +// Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. func New(params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { return getC().New(params) } -// New creates a new treasury financial account. +// Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. func (c Client) New(params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { financialaccount := &stripe.TreasuryFinancialAccount{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryFinancialAccountParams) (*stripe.Trea return financialaccount, err } -// Get returns the details of a treasury financial account. +// Retrieves the details of a FinancialAccount. func Get(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { return getC().Get(id, params) } -// Get returns the details of a treasury financial account. +// Retrieves the details of a FinancialAccount. func (c Client) Get(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { path := stripe.FormatURLPath("/v1/treasury/financial_accounts/%s", id) financialaccount := &stripe.TreasuryFinancialAccount{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryFinancialAccountParams) (* return financialaccount, err } -// Update updates a treasury financial account's properties. +// Updates the details of a FinancialAccount. func Update(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { return getC().Update(id, params) } -// Update updates a treasury financial account's properties. +// Updates the details of a FinancialAccount. func (c Client) Update(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { path := stripe.FormatURLPath("/v1/treasury/financial_accounts/%s", id) financialaccount := &stripe.TreasuryFinancialAccount{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.TreasuryFinancialAccountParams) return financialaccount, err } -// RetrieveFeatures is the method for the `GET /v1/treasury/financial_accounts/{financial_account}/features` API. +// Retrieves Features information associated with the FinancialAccount. func RetrieveFeatures(id string, params *stripe.TreasuryFinancialAccountRetrieveFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { return getC().RetrieveFeatures(id, params) } -// RetrieveFeatures is the method for the `GET /v1/treasury/financial_accounts/{financial_account}/features` API. +// Retrieves Features information associated with the FinancialAccount. func (c Client) RetrieveFeatures(id string, params *stripe.TreasuryFinancialAccountRetrieveFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { path := stripe.FormatURLPath( "/v1/treasury/financial_accounts/%s/features", @@ -80,12 +80,12 @@ func (c Client) RetrieveFeatures(id string, params *stripe.TreasuryFinancialAcco return financialaccountfeatures, err } -// UpdateFeatures is the method for the `POST /v1/treasury/financial_accounts/{financial_account}/features` API. +// Updates the Features associated with a FinancialAccount. func UpdateFeatures(id string, params *stripe.TreasuryFinancialAccountUpdateFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { return getC().UpdateFeatures(id, params) } -// UpdateFeatures is the method for the `POST /v1/treasury/financial_accounts/{financial_account}/features` API. +// Updates the Features associated with a FinancialAccount. func (c Client) UpdateFeatures(id string, params *stripe.TreasuryFinancialAccountUpdateFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { path := stripe.FormatURLPath( "/v1/treasury/financial_accounts/%s/features", @@ -102,12 +102,12 @@ func (c Client) UpdateFeatures(id string, params *stripe.TreasuryFinancialAccoun return financialaccountfeatures, err } -// List returns a list of treasury financial accounts. +// Returns a list of FinancialAccounts. func List(params *stripe.TreasuryFinancialAccountListParams) *Iter { return getC().List(params) } -// List returns a list of treasury financial accounts. +// Returns a list of FinancialAccounts. func (c Client) List(listParams *stripe.TreasuryFinancialAccountListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/inboundtransfer/client.go b/treasury/inboundtransfer/client.go index e6728c4418..bba052372d 100644 --- a/treasury/inboundtransfer/client.go +++ b/treasury/inboundtransfer/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury inbound transfer. +// Creates an InboundTransfer. func New(params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { return getC().New(params) } -// New creates a new treasury inbound transfer. +// Creates an InboundTransfer. func (c Client) New(params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { inboundtransfer := &stripe.TreasuryInboundTransfer{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryInboundTransferParams) (*stripe.Treas return inboundtransfer, err } -// Get returns the details of a treasury inbound transfer. +// Retrieves the details of an existing InboundTransfer. func Get(id string, params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Get(id, params) } -// Get returns the details of a treasury inbound transfer. +// Retrieves the details of an existing InboundTransfer. func (c Client) Get(id string, params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/inbound_transfers/%s", id) inboundtransfer := &stripe.TreasuryInboundTransfer{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryInboundTransferParams) (*s return inboundtransfer, err } -// Cancel is the method for the `POST /v1/treasury/inbound_transfers/{inbound_transfer}/cancel` API. +// Cancels an InboundTransfer. func Cancel(id string, params *stripe.TreasuryInboundTransferCancelParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/treasury/inbound_transfers/{inbound_transfer}/cancel` API. +// Cancels an InboundTransfer. func (c Client) Cancel(id string, params *stripe.TreasuryInboundTransferCancelParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/inbound_transfers/%s/cancel", id) inboundtransfer := &stripe.TreasuryInboundTransfer{} @@ -64,12 +64,12 @@ func (c Client) Cancel(id string, params *stripe.TreasuryInboundTransferCancelPa return inboundtransfer, err } -// List returns a list of treasury inbound transfers. +// Returns a list of InboundTransfers sent from the specified FinancialAccount. func List(params *stripe.TreasuryInboundTransferListParams) *Iter { return getC().List(params) } -// List returns a list of treasury inbound transfers. +// Returns a list of InboundTransfers sent from the specified FinancialAccount. func (c Client) List(listParams *stripe.TreasuryInboundTransferListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/outboundpayment/client.go b/treasury/outboundpayment/client.go index 6b93f2856e..b2cd130862 100644 --- a/treasury/outboundpayment/client.go +++ b/treasury/outboundpayment/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury outbound payment. +// Creates an OutboundPayment. func New(params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { return getC().New(params) } -// New creates a new treasury outbound payment. +// Creates an OutboundPayment. func (c Client) New(params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { outboundpayment := &stripe.TreasuryOutboundPayment{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryOutboundPaymentParams) (*stripe.Treas return outboundpayment, err } -// Get returns the details of a treasury outbound payment. +// Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. func Get(id string, params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Get(id, params) } -// Get returns the details of a treasury outbound payment. +// Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. func (c Client) Get(id string, params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_payments/%s", id) outboundpayment := &stripe.TreasuryOutboundPayment{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryOutboundPaymentParams) (*s return outboundpayment, err } -// Cancel is the method for the `POST /v1/treasury/outbound_payments/{id}/cancel` API. +// Cancel an OutboundPayment. func Cancel(id string, params *stripe.TreasuryOutboundPaymentCancelParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/treasury/outbound_payments/{id}/cancel` API. +// Cancel an OutboundPayment. func (c Client) Cancel(id string, params *stripe.TreasuryOutboundPaymentCancelParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_payments/%s/cancel", id) outboundpayment := &stripe.TreasuryOutboundPayment{} @@ -64,12 +64,12 @@ func (c Client) Cancel(id string, params *stripe.TreasuryOutboundPaymentCancelPa return outboundpayment, err } -// List returns a list of treasury outbound payments. +// Returns a list of OutboundPayments sent from the specified FinancialAccount. func List(params *stripe.TreasuryOutboundPaymentListParams) *Iter { return getC().List(params) } -// List returns a list of treasury outbound payments. +// Returns a list of OutboundPayments sent from the specified FinancialAccount. func (c Client) List(listParams *stripe.TreasuryOutboundPaymentListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/outboundtransfer/client.go b/treasury/outboundtransfer/client.go index 2795b2009a..3119218a20 100644 --- a/treasury/outboundtransfer/client.go +++ b/treasury/outboundtransfer/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury outbound transfer. +// Creates an OutboundTransfer. func New(params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().New(params) } -// New creates a new treasury outbound transfer. +// Creates an OutboundTransfer. func (c Client) New(params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { outboundtransfer := &stripe.TreasuryOutboundTransfer{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryOutboundTransferParams) (*stripe.Trea return outboundtransfer, err } -// Get returns the details of a treasury outbound transfer. +// Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. func Get(id string, params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Get(id, params) } -// Get returns the details of a treasury outbound transfer. +// Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. func (c Client) Get(id string, params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_transfers/%s", id) outboundtransfer := &stripe.TreasuryOutboundTransfer{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryOutboundTransferParams) (* return outboundtransfer, err } -// Cancel is the method for the `POST /v1/treasury/outbound_transfers/{outbound_transfer}/cancel` API. +// An OutboundTransfer can be canceled if the funds have not yet been paid out. func Cancel(id string, params *stripe.TreasuryOutboundTransferCancelParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/treasury/outbound_transfers/{outbound_transfer}/cancel` API. +// An OutboundTransfer can be canceled if the funds have not yet been paid out. func (c Client) Cancel(id string, params *stripe.TreasuryOutboundTransferCancelParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_transfers/%s/cancel", id) outboundtransfer := &stripe.TreasuryOutboundTransfer{} @@ -64,12 +64,12 @@ func (c Client) Cancel(id string, params *stripe.TreasuryOutboundTransferCancelP return outboundtransfer, err } -// List returns a list of treasury outbound transfers. +// Returns a list of OutboundTransfers sent from the specified FinancialAccount. func List(params *stripe.TreasuryOutboundTransferListParams) *Iter { return getC().List(params) } -// List returns a list of treasury outbound transfers. +// Returns a list of OutboundTransfers sent from the specified FinancialAccount. func (c Client) List(listParams *stripe.TreasuryOutboundTransferListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/receivedcredit/client.go b/treasury/receivedcredit/client.go index 9bb2deaee8..e5b5d4e523 100644 --- a/treasury/receivedcredit/client.go +++ b/treasury/receivedcredit/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury received credit. +// Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. func Get(id string, params *stripe.TreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { return getC().Get(id, params) } -// Get returns the details of a treasury received credit. +// Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. func (c Client) Get(id string, params *stripe.TreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { path := stripe.FormatURLPath("/v1/treasury/received_credits/%s", id) receivedcredit := &stripe.TreasuryReceivedCredit{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryReceivedCreditParams) (*st return receivedcredit, err } -// List returns a list of treasury received credits. +// Returns a list of ReceivedCredits. func List(params *stripe.TreasuryReceivedCreditListParams) *Iter { return getC().List(params) } -// List returns a list of treasury received credits. +// Returns a list of ReceivedCredits. func (c Client) List(listParams *stripe.TreasuryReceivedCreditListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/receiveddebit/client.go b/treasury/receiveddebit/client.go index 022af73f23..2f868a7829 100644 --- a/treasury/receiveddebit/client.go +++ b/treasury/receiveddebit/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury received debit. +// Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list func Get(id string, params *stripe.TreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { return getC().Get(id, params) } -// Get returns the details of a treasury received debit. +// Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list func (c Client) Get(id string, params *stripe.TreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { path := stripe.FormatURLPath("/v1/treasury/received_debits/%s", id) receiveddebit := &stripe.TreasuryReceivedDebit{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryReceivedDebitParams) (*str return receiveddebit, err } -// List returns a list of treasury received debits. +// Returns a list of ReceivedDebits. func List(params *stripe.TreasuryReceivedDebitListParams) *Iter { return getC().List(params) } -// List returns a list of treasury received debits. +// Returns a list of ReceivedDebits. func (c Client) List(listParams *stripe.TreasuryReceivedDebitListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/transaction/client.go b/treasury/transaction/client.go index 4e0ddb3b33..a77eb0978d 100644 --- a/treasury/transaction/client.go +++ b/treasury/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury transaction. +// Retrieves the details of an existing Transaction. func Get(id string, params *stripe.TreasuryTransactionParams) (*stripe.TreasuryTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a treasury transaction. +// Retrieves the details of an existing Transaction. func (c Client) Get(id string, params *stripe.TreasuryTransactionParams) (*stripe.TreasuryTransaction, error) { path := stripe.FormatURLPath("/v1/treasury/transactions/%s", id) transaction := &stripe.TreasuryTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryTransactionParams) (*strip return transaction, err } -// List returns a list of treasury transactions. +// Retrieves a list of Transaction objects. func List(params *stripe.TreasuryTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of treasury transactions. +// Retrieves a list of Transaction objects. func (c Client) List(listParams *stripe.TreasuryTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/transactionentry/client.go b/treasury/transactionentry/client.go index 051ea8c4b9..4eb43de285 100644 --- a/treasury/transactionentry/client.go +++ b/treasury/transactionentry/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury transaction entry. +// Retrieves a TransactionEntry object. func Get(id string, params *stripe.TreasuryTransactionEntryParams) (*stripe.TreasuryTransactionEntry, error) { return getC().Get(id, params) } -// Get returns the details of a treasury transaction entry. +// Retrieves a TransactionEntry object. func (c Client) Get(id string, params *stripe.TreasuryTransactionEntryParams) (*stripe.TreasuryTransactionEntry, error) { path := stripe.FormatURLPath("/v1/treasury/transaction_entries/%s", id) transactionentry := &stripe.TreasuryTransactionEntry{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryTransactionEntryParams) (* return transactionentry, err } -// List returns a list of treasury transaction entries. +// Retrieves a list of TransactionEntry objects. func List(params *stripe.TreasuryTransactionEntryListParams) *Iter { return getC().List(params) } -// List returns a list of treasury transaction entries. +// Retrieves a list of TransactionEntry objects. func (c Client) List(listParams *stripe.TreasuryTransactionEntryListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/usagerecord/client.go b/usagerecord/client.go index 1cd0fb5a8f..cf08fdb77c 100644 --- a/usagerecord/client.go +++ b/usagerecord/client.go @@ -19,12 +19,24 @@ type Client struct { Key string } -// New creates a new usage record. +// Creates a usage record for a specified subscription item and date, and fills it with a quantity. +// +// Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. +// +// The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. +// +// The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. func New(params *stripe.UsageRecordParams) (*stripe.UsageRecord, error) { return getC().New(params) } -// New creates a new usage record. +// Creates a usage record for a specified subscription item and date, and fills it with a quantity. +// +// Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. +// +// The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. +// +// The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. func (c Client) New(params *stripe.UsageRecordParams) (*stripe.UsageRecord, error) { path := stripe.FormatURLPath( "/v1/subscription_items/%s/usage_records", diff --git a/usagerecordsummary/client.go b/usagerecordsummary/client.go index 9a65ed0602..c8ce3c4a23 100644 --- a/usagerecordsummary/client.go +++ b/usagerecordsummary/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// List returns a list of usage record summaries. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func List(params *stripe.UsageRecordSummaryListParams) *Iter { return getC().List(params) } -// List returns a list of usage record summaries. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func (c Client) List(listParams *stripe.UsageRecordSummaryListParams) *Iter { path := stripe.FormatURLPath( "/v1/subscription_items/%s/usage_record_summaries", diff --git a/webhookendpoint/client.go b/webhookendpoint/client.go index 985a5d84fb..d5b6ce281c 100644 --- a/webhookendpoint/client.go +++ b/webhookendpoint/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new webhook endpoint. +// A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. func New(params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().New(params) } -// New creates a new webhook endpoint. +// A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. func (c Client) New(params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { webhookendpoint := &stripe.WebhookEndpoint{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoi return webhookendpoint, err } -// Get returns the details of a webhook endpoint. +// Retrieves the webhook endpoint with the given ID. func Get(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().Get(id, params) } -// Get returns the details of a webhook endpoint. +// Retrieves the webhook endpoint with the given ID. func (c Client) Get(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { path := stripe.FormatURLPath("/v1/webhook_endpoints/%s", id) webhookendpoint := &stripe.WebhookEndpoint{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.WebhookEndpointParams) (*stripe.We return webhookendpoint, err } -// Update updates a webhook endpoint's properties. +// Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. func Update(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().Update(id, params) } -// Update updates a webhook endpoint's properties. +// Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. func (c Client) Update(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { path := stripe.FormatURLPath("/v1/webhook_endpoints/%s", id) webhookendpoint := &stripe.WebhookEndpoint{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.WebhookEndpointParams) (*stripe return webhookendpoint, err } -// Del removes a webhook endpoint. +// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. func Del(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().Del(id, params) } -// Del removes a webhook endpoint. +// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. func (c Client) Del(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { path := stripe.FormatURLPath("/v1/webhook_endpoints/%s", id) webhookendpoint := &stripe.WebhookEndpoint{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.WebhookEndpointParams) (*stripe.We return webhookendpoint, err } -// List returns a list of webhook endpoints. +// Returns a list of your webhook endpoints. func List(params *stripe.WebhookEndpointListParams) *Iter { return getC().List(params) } -// List returns a list of webhook endpoints. +// Returns a list of your webhook endpoints. func (c Client) List(listParams *stripe.WebhookEndpointListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { From fbd9bf2d9b0827ca3ae9ea9d1b680da26a3efe46 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 20:21:11 +0000 Subject: [PATCH 05/12] Update generated code for v1011 --- account/client.go | 74 +++++- accountlink/client.go | 4 +- accountnotice/client.go | 12 +- accountsession/client.go | 4 +- applepaydomain/client.go | 16 +- applicationfee/client.go | 8 +- apps/secret/client.go | 16 +- balance/client.go | 8 +- balancetransaction/client.go | 16 +- bankaccount/client.go | 29 ++- billing/meter/client.go | 24 +- billing/meterevent/client.go | 4 +- billing/metereventadjustment/client.go | 4 +- billing/metereventsummary/client.go | 4 +- billingportal/configuration/client.go | 16 +- billingportal/session/client.go | 4 +- capability/client.go | 12 +- capital/financingoffer/client.go | 14 +- capital/financingsummary/client.go | 4 +- capital/financingtransaction/client.go | 10 +- card/client.go | 15 +- cashbalance/client.go | 8 +- charge/client.go | 42 +++- checkout/session/client.go | 24 +- climate/order/client.go | 30 ++- climate/product/client.go | 8 +- climate/supplier/client.go | 8 +- confirmationtoken/client.go | 4 +- countryspec/client.go | 8 +- coupon/client.go | 24 +- creditnote/client.go | 54 +++-- customer/client.go | 54 +++-- customerbalancetransaction/client.go | 16 +- customercashbalancetransaction/client.go | 8 +- customersession/client.go | 4 +- dispute/client.go | 24 +- entitlements/activeentitlement/client.go | 8 +- entitlements/feature/client.go | 16 +- ephemeralkey/client.go | 8 +- event/client.go | 8 +- feerefund/client.go | 36 ++- file/client.go | 16 +- filelink/client.go | 16 +- financialconnections/account/client.go | 28 +-- .../accountinferredbalance/client.go | 4 +- financialconnections/session/client.go | 8 +- financialconnections/transaction/client.go | 8 +- forwarding/request/client.go | 12 +- giftcards/card/client.go | 20 +- giftcards/transaction/client.go | 24 +- identity/verificationreport/client.go | 8 +- identity/verificationsession/client.go | 88 ++++++- invoice/client.go | 140 ++++++++--- invoiceitem/client.go | 20 +- invoicelineitem/client.go | 10 +- invoicepayment/client.go | 8 +- issuing/authorization/client.go | 24 +- issuing/card/client.go | 16 +- issuing/cardholder/client.go | 16 +- issuing/creditunderwritingrecord/client.go | 24 +- issuing/dispute/client.go | 20 +- issuing/personalizationdesign/client.go | 16 +- issuing/physicalbundle/client.go | 8 +- issuing/token/client.go | 12 +- issuing/transaction/client.go | 12 +- loginlink/client.go | 8 +- mandate/client.go | 4 +- margin/client.go | 16 +- order/client.go | 32 +-- paymentintent/client.go | 226 ++++++++++++++++-- paymentlink/client.go | 20 +- paymentmethod/client.go | 52 +++- paymentmethodconfiguration/client.go | 16 +- paymentmethoddomain/client.go | 30 ++- paymentsource/client.go | 30 ++- payout/client.go | 36 ++- person/client.go | 20 +- plan/client.go | 20 +- price/client.go | 26 +- product/client.go | 30 ++- productfeature/client.go | 16 +- promotioncode/client.go | 16 +- quote/client.go | 60 ++--- quotephase/client.go | 12 +- quotepreviewinvoice/client.go | 4 +- quotepreviewsubscriptionschedule/client.go | 4 +- radar/earlyfraudwarning/client.go | 12 +- radar/valuelist/client.go | 20 +- radar/valuelistitem/client.go | 16 +- refund/client.go | 48 +++- reporting/reportrun/client.go | 12 +- reporting/reporttype/client.go | 8 +- review/client.go | 12 +- setupattempt/client.go | 4 +- setupintent/client.go | 72 ++++-- shippingrate/client.go | 16 +- sigma/scheduledqueryrun/client.go | 8 +- source/client.go | 20 +- sourcetransaction/client.go | 4 +- subscription/client.go | 94 ++++++-- subscriptionitem/client.go | 28 ++- subscriptionschedule/client.go | 28 +-- tax/calculation/client.go | 8 +- tax/form/client.go | 12 +- tax/registration/client.go | 20 +- tax/settings/client.go | 8 +- tax/transaction/client.go | 16 +- taxcode/client.go | 8 +- taxid/client.go | 16 +- taxrate/client.go | 16 +- terminal/configuration/client.go | 20 +- terminal/connectiontoken/client.go | 4 +- terminal/location/client.go | 22 +- terminal/reader/client.go | 52 ++-- testhelpers/confirmationtoken/client.go | 4 +- testhelpers/customer/client.go | 4 +- testhelpers/issuing/authorization/client.go | 20 +- testhelpers/issuing/card/client.go | 16 +- .../issuing/personalizationdesign/client.go | 12 +- testhelpers/issuing/transaction/client.go | 12 +- testhelpers/refund/client.go | 4 +- testhelpers/terminal/reader/client.go | 4 +- testhelpers/testclock/client.go | 20 +- .../treasury/inboundtransfer/client.go | 12 +- .../treasury/outboundpayment/client.go | 16 +- .../treasury/outboundtransfer/client.go | 16 +- testhelpers/treasury/receivedcredit/client.go | 4 +- testhelpers/treasury/receiveddebit/client.go | 4 +- token/client.go | 10 +- topup/client.go | 20 +- transfer/client.go | 20 +- transferreversal/client.go | 28 ++- treasury/creditreversal/client.go | 12 +- treasury/debitreversal/client.go | 12 +- treasury/financialaccount/client.go | 24 +- treasury/inboundtransfer/client.go | 16 +- treasury/outboundpayment/client.go | 16 +- treasury/outboundtransfer/client.go | 16 +- treasury/receivedcredit/client.go | 8 +- treasury/receiveddebit/client.go | 8 +- treasury/transaction/client.go | 8 +- treasury/transactionentry/client.go | 8 +- usagerecord/client.go | 16 +- usagerecordsummary/client.go | 8 +- webhookendpoint/client.go | 20 +- 145 files changed, 1842 insertions(+), 1086 deletions(-) diff --git a/account/client.go b/account/client.go index 5a3c375dd9..96dee409da 100644 --- a/account/client.go +++ b/account/client.go @@ -20,12 +20,22 @@ type Client struct { Key string } -// New creates a new account. +// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. +// To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). +// +// If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when +// creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. +// You can prefill any information on the account. func New(params *stripe.AccountParams) (*stripe.Account, error) { return getC().New(params) } -// New creates a new account. +// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. +// To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). +// +// If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when +// creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. +// You can prefill any information on the account. func (c Client) New(params *stripe.AccountParams) (*stripe.Account, error) { account := &stripe.Account{} err := c.B.Call(http.MethodPost, "/v1/accounts", c.Key, params, account) @@ -44,12 +54,12 @@ func (c Client) Get() (*stripe.Account, error) { return account, err } -// GetByID returns the details of an account. +// Retrieves the details of an account. func GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) { return getC().GetByID(id, params) } -// GetByID returns the details of an account. +// Retrieves the details of an account. func (c Client) GetByID(id string, params *stripe.AccountParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s", id) account := &stripe.Account{} @@ -57,12 +67,36 @@ func (c Client) GetByID(id string, params *stripe.AccountParams) (*stripe.Accoun return account, err } -// Update updates an account's properties. +// Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are +// left unchanged. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is application, which includes Custom accounts, you can update any information on the account. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is stripe, which includes Standard and Express accounts, you can update all information until you create +// an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, +// after which some properties can no longer be updated. +// +// To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our +// [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. func Update(id string, params *stripe.AccountParams) (*stripe.Account, error) { return getC().Update(id, params) } -// Update updates an account's properties. +// Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are +// left unchanged. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is application, which includes Custom accounts, you can update any information on the account. +// +// For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) +// is stripe, which includes Standard and Express accounts, you can update all information until you create +// an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, +// after which some properties can no longer be updated. +// +// To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our +// [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. func (c Client) Update(id string, params *stripe.AccountParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s", id) account := &stripe.Account{} @@ -70,12 +104,24 @@ func (c Client) Update(id string, params *stripe.AccountParams) (*stripe.Account return account, err } -// Del removes an account. +// With [Connect](https://stripe.com/connect), you can delete accounts you manage. +// +// Test-mode accounts can be deleted at any time. +// +// Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. +// +// If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. func Del(id string, params *stripe.AccountParams) (*stripe.Account, error) { return getC().Del(id, params) } -// Del removes an account. +// With [Connect](https://stripe.com/connect), you can delete accounts you manage. +// +// Test-mode accounts can be deleted at any time. +// +// Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. +// +// If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. func (c Client) Del(id string, params *stripe.AccountParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s", id) account := &stripe.Account{} @@ -83,12 +129,16 @@ func (c Client) Del(id string, params *stripe.AccountParams) (*stripe.Account, e return account, err } -// Reject is the method for the `POST /v1/accounts/{account}/reject` API. +// With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. +// +// Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. func Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, error) { return getC().Reject(id, params) } -// Reject is the method for the `POST /v1/accounts/{account}/reject` API. +// With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. +// +// Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. func (c Client) Reject(id string, params *stripe.AccountRejectParams) (*stripe.Account, error) { path := stripe.FormatURLPath("/v1/accounts/%s/reject", id) account := &stripe.Account{} @@ -96,12 +146,12 @@ func (c Client) Reject(id string, params *stripe.AccountRejectParams) (*stripe.A return account, err } -// List returns a list of accounts. +// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. func List(params *stripe.AccountListParams) *Iter { return getC().List(params) } -// List returns a list of accounts. +// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. func (c Client) List(listParams *stripe.AccountListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/accountlink/client.go b/accountlink/client.go index ffe70eb78f..5062be9805 100644 --- a/accountlink/client.go +++ b/accountlink/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new account link. +// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. func New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) { return getC().New(params) } -// New creates a new account link. +// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. func (c Client) New(params *stripe.AccountLinkParams) (*stripe.AccountLink, error) { accountlink := &stripe.AccountLink{} err := c.B.Call( diff --git a/accountnotice/client.go b/accountnotice/client.go index b49fbc7c92..17f656ee5d 100644 --- a/accountnotice/client.go +++ b/accountnotice/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an account notice. +// Retrieves an AccountNotice object. func Get(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) { return getC().Get(id, params) } -// Get returns the details of an account notice. +// Retrieves an AccountNotice object. func (c Client) Get(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) { path := stripe.FormatURLPath("/v1/account_notices/%s", id) accountnotice := &stripe.AccountNotice{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.AccountNoticeParams) (*stripe.Acco return accountnotice, err } -// Update updates an account notice's properties. +// Updates an AccountNotice object. func Update(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) { return getC().Update(id, params) } -// Update updates an account notice's properties. +// Updates an AccountNotice object. func (c Client) Update(id string, params *stripe.AccountNoticeParams) (*stripe.AccountNotice, error) { path := stripe.FormatURLPath("/v1/account_notices/%s", id) accountnotice := &stripe.AccountNotice{} @@ -46,12 +46,12 @@ func (c Client) Update(id string, params *stripe.AccountNoticeParams) (*stripe.A return accountnotice, err } -// List returns a list of account notices. +// Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. func List(params *stripe.AccountNoticeListParams) *Iter { return getC().List(params) } -// List returns a list of account notices. +// Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. func (c Client) List(listParams *stripe.AccountNoticeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/accountsession/client.go b/accountsession/client.go index 729fa6631f..d415ff9207 100644 --- a/accountsession/client.go +++ b/accountsession/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new account session. +// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. func New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) { return getC().New(params) } -// New creates a new account session. +// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. func (c Client) New(params *stripe.AccountSessionParams) (*stripe.AccountSession, error) { accountsession := &stripe.AccountSession{} err := c.B.Call( diff --git a/applepaydomain/client.go b/applepaydomain/client.go index 79ae8d0554..36ccde950e 100644 --- a/applepaydomain/client.go +++ b/applepaydomain/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new apple pay domain. +// Create an apple pay domain. func New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().New(params) } -// New creates a new apple pay domain. +// Create an apple pay domain. func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { applepaydomain := &stripe.ApplePayDomain{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain return applepaydomain, err } -// Get returns the details of an apple pay domain. +// Retrieve an apple pay domain. func Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().Get(id, params) } -// Get returns the details of an apple pay domain. +// Retrieve an apple pay domain. func (c Client) Get(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { path := stripe.FormatURLPath("/v1/apple_pay/domains/%s", id) applepaydomain := &stripe.ApplePayDomain{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ApplePayDomainParams) (*stripe.App return applepaydomain, err } -// Del removes an apple pay domain. +// Delete an apple pay domain. func Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { return getC().Del(id, params) } -// Del removes an apple pay domain. +// Delete an apple pay domain. func (c Client) Del(id string, params *stripe.ApplePayDomainParams) (*stripe.ApplePayDomain, error) { path := stripe.FormatURLPath("/v1/apple_pay/domains/%s", id) applepaydomain := &stripe.ApplePayDomain{} @@ -64,12 +64,12 @@ func (c Client) Del(id string, params *stripe.ApplePayDomainParams) (*stripe.App return applepaydomain, err } -// List returns a list of apple pay domains. +// List apple pay domains. func List(params *stripe.ApplePayDomainListParams) *Iter { return getC().List(params) } -// List returns a list of apple pay domains. +// List apple pay domains. func (c Client) List(listParams *stripe.ApplePayDomainListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/applicationfee/client.go b/applicationfee/client.go index 59935b134f..decf73e0ab 100644 --- a/applicationfee/client.go +++ b/applicationfee/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an application fee. +// Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. func Get(id string, params *stripe.ApplicationFeeParams) (*stripe.ApplicationFee, error) { return getC().Get(id, params) } -// Get returns the details of an application fee. +// Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. func (c Client) Get(id string, params *stripe.ApplicationFeeParams) (*stripe.ApplicationFee, error) { path := stripe.FormatURLPath("/v1/application_fees/%s", id) applicationfee := &stripe.ApplicationFee{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ApplicationFeeParams) (*stripe.App return applicationfee, err } -// List returns a list of application fees. +// Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. func List(params *stripe.ApplicationFeeListParams) *Iter { return getC().List(params) } -// List returns a list of application fees. +// Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. func (c Client) List(listParams *stripe.ApplicationFeeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/apps/secret/client.go b/apps/secret/client.go index 6fdad4e5c9..e3c878a979 100644 --- a/apps/secret/client.go +++ b/apps/secret/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new apps secret. +// Create or replace a secret in the secret store. func New(params *stripe.AppsSecretParams) (*stripe.AppsSecret, error) { return getC().New(params) } -// New creates a new apps secret. +// Create or replace a secret in the secret store. func (c Client) New(params *stripe.AppsSecretParams) (*stripe.AppsSecret, error) { secret := &stripe.AppsSecret{} err := c.B.Call(http.MethodPost, "/v1/apps/secrets", c.Key, params, secret) return secret, err } -// DeleteWhere is the method for the `POST /v1/apps/secrets/delete` API. +// Deletes a secret from the secret store by name and scope. func DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe.AppsSecret, error) { return getC().DeleteWhere(params) } -// DeleteWhere is the method for the `POST /v1/apps/secrets/delete` API. +// Deletes a secret from the secret store by name and scope. func (c Client) DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe.AppsSecret, error) { secret := &stripe.AppsSecret{} err := c.B.Call( @@ -50,12 +50,12 @@ func (c Client) DeleteWhere(params *stripe.AppsSecretDeleteWhereParams) (*stripe return secret, err } -// Find is the method for the `GET /v1/apps/secrets/find` API. +// Finds a secret in the secret store by name and scope. func Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, error) { return getC().Find(params) } -// Find is the method for the `GET /v1/apps/secrets/find` API. +// Finds a secret in the secret store by name and scope. func (c Client) Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, error) { secret := &stripe.AppsSecret{} err := c.B.Call( @@ -68,12 +68,12 @@ func (c Client) Find(params *stripe.AppsSecretFindParams) (*stripe.AppsSecret, e return secret, err } -// List returns a list of apps secrets. +// List all secrets stored on the given scope. func List(params *stripe.AppsSecretListParams) *Iter { return getC().List(params) } -// List returns a list of apps secrets. +// List all secrets stored on the given scope. func (c Client) List(listParams *stripe.AppsSecretListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/balance/client.go b/balance/client.go index d9560ec473..a956010f6c 100644 --- a/balance/client.go +++ b/balance/client.go @@ -19,12 +19,16 @@ type Client struct { Key string } -// Get returns the details of a balance. +// Retrieves the current account balance, based on the authentication that was used to make the request. +// +// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). func Get(params *stripe.BalanceParams) (*stripe.Balance, error) { return getC().Get(params) } -// Get returns the details of a balance. +// Retrieves the current account balance, based on the authentication that was used to make the request. +// +// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). func (c Client) Get(params *stripe.BalanceParams) (*stripe.Balance, error) { balance := &stripe.Balance{} err := c.B.Call(http.MethodGet, "/v1/balance", c.Key, params, balance) diff --git a/balancetransaction/client.go b/balancetransaction/client.go index e924440713..d6b17ed34f 100644 --- a/balancetransaction/client.go +++ b/balancetransaction/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// Get returns the details of a balance transaction. +// Retrieves the balance transaction with the given ID. +// +// Note that this endpoint previously used the path /v1/balance/history/:id. func Get(id string, params *stripe.BalanceTransactionParams) (*stripe.BalanceTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a balance transaction. +// Retrieves the balance transaction with the given ID. +// +// Note that this endpoint previously used the path /v1/balance/history/:id. func (c Client) Get(id string, params *stripe.BalanceTransactionParams) (*stripe.BalanceTransaction, error) { path := stripe.FormatURLPath("/v1/balance_transactions/%s", id) balancetransaction := &stripe.BalanceTransaction{} @@ -33,12 +37,16 @@ func (c Client) Get(id string, params *stripe.BalanceTransactionParams) (*stripe return balancetransaction, err } -// List returns a list of balance transactions. +// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. +// +// Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. func List(params *stripe.BalanceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of balance transactions. +// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. +// +// Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. func (c Client) List(listParams *stripe.BalanceTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/bankaccount/client.go b/bankaccount/client.go index 9472ecbfb5..59310dcea7 100644 --- a/bankaccount/client.go +++ b/bankaccount/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new bank account. +// New creates a new bank account func New(params *stripe.BankAccountParams) (*stripe.BankAccount, error) { return getC().New(params) } -// New creates a new bank account. +// New creates a new bank account func (c Client) New(params *stripe.BankAccountParams) (*stripe.BankAccount, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -81,12 +81,26 @@ func (c Client) Get(id string, params *stripe.BankAccountParams) (*stripe.BankAc return bankaccount, err } -// Update updates a bank account's properties. +// Updates the metadata, account holder name, account holder type of a bank account belonging to +// a connected account and optionally sets it as the default for its currency. Other bank account +// details are not editable by design. +// +// You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). +// +// You can re-enable a disabled bank account by performing an update call without providing any +// arguments or changes. func Update(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { return getC().Update(id, params) } -// Update updates a bank account's properties. +// Updates the metadata, account holder name, account holder type of a bank account belonging to +// a connected account and optionally sets it as the default for its currency. Other bank account +// details are not editable by design. +// +// You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). +// +// You can re-enable a disabled bank account by performing an update call without providing any +// arguments or changes. func (c Client) Update(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -106,12 +120,12 @@ func (c Client) Update(id string, params *stripe.BankAccountParams) (*stripe.Ban return bankaccount, err } -// Del removes a bank account. +// Delete a specified external account for a given account. func Del(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { return getC().Del(id, params) } -// Del removes a bank account. +// Delete a specified external account for a given account. func (c Client) Del(id string, params *stripe.BankAccountParams) (*stripe.BankAccount, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -130,13 +144,10 @@ func (c Client) Del(id string, params *stripe.BankAccountParams) (*stripe.BankAc err := c.B.Call(http.MethodDelete, path, c.Key, params, bankaccount) return bankaccount, err } - -// List returns a list of bank accounts. func List(params *stripe.BankAccountListParams) *Iter { return getC().List(params) } -// List returns a list of bank accounts. func (c Client) List(listParams *stripe.BankAccountListParams) *Iter { var path string var outerErr error diff --git a/billing/meter/client.go b/billing/meter/client.go index 57d21e7c7d..4b02eae189 100644 --- a/billing/meter/client.go +++ b/billing/meter/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new billing meter. +// Creates a billing meter func New(params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { return getC().New(params) } -// New creates a new billing meter. +// Creates a billing meter func (c Client) New(params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { meter := &stripe.BillingMeter{} err := c.B.Call(http.MethodPost, "/v1/billing/meters", c.Key, params, meter) return meter, err } -// Get returns the details of a billing meter. +// Retrieves a billing meter given an ID func Get(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { return getC().Get(id, params) } -// Get returns the details of a billing meter. +// Retrieves a billing meter given an ID func (c Client) Get(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s", id) meter := &stripe.BillingMeter{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.BillingMeterParams) (*stripe.Billi return meter, err } -// Update updates a billing meter's properties. +// Updates a billing meter func Update(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { return getC().Update(id, params) } -// Update updates a billing meter's properties. +// Updates a billing meter func (c Client) Update(id string, params *stripe.BillingMeterParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s", id) meter := &stripe.BillingMeter{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.BillingMeterParams) (*stripe.Bi return meter, err } -// Deactivate is the method for the `POST /v1/billing/meters/{id}/deactivate` API. +// Deactivates a billing meter func Deactivate(id string, params *stripe.BillingMeterDeactivateParams) (*stripe.BillingMeter, error) { return getC().Deactivate(id, params) } -// Deactivate is the method for the `POST /v1/billing/meters/{id}/deactivate` API. +// Deactivates a billing meter func (c Client) Deactivate(id string, params *stripe.BillingMeterDeactivateParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s/deactivate", id) meter := &stripe.BillingMeter{} @@ -71,12 +71,12 @@ func (c Client) Deactivate(id string, params *stripe.BillingMeterDeactivateParam return meter, err } -// Reactivate is the method for the `POST /v1/billing/meters/{id}/reactivate` API. +// Reactivates a billing meter func Reactivate(id string, params *stripe.BillingMeterReactivateParams) (*stripe.BillingMeter, error) { return getC().Reactivate(id, params) } -// Reactivate is the method for the `POST /v1/billing/meters/{id}/reactivate` API. +// Reactivates a billing meter func (c Client) Reactivate(id string, params *stripe.BillingMeterReactivateParams) (*stripe.BillingMeter, error) { path := stripe.FormatURLPath("/v1/billing/meters/%s/reactivate", id) meter := &stripe.BillingMeter{} @@ -84,12 +84,12 @@ func (c Client) Reactivate(id string, params *stripe.BillingMeterReactivateParam return meter, err } -// List returns a list of billing meters. +// Retrieve a list of billing meters. func List(params *stripe.BillingMeterListParams) *Iter { return getC().List(params) } -// List returns a list of billing meters. +// Retrieve a list of billing meters. func (c Client) List(listParams *stripe.BillingMeterListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/billing/meterevent/client.go b/billing/meterevent/client.go index b51d877382..a99594b9a4 100644 --- a/billing/meterevent/client.go +++ b/billing/meterevent/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new billing meter event. +// Creates a billing meter event func New(params *stripe.BillingMeterEventParams) (*stripe.BillingMeterEvent, error) { return getC().New(params) } -// New creates a new billing meter event. +// Creates a billing meter event func (c Client) New(params *stripe.BillingMeterEventParams) (*stripe.BillingMeterEvent, error) { meterevent := &stripe.BillingMeterEvent{} err := c.B.Call( diff --git a/billing/metereventadjustment/client.go b/billing/metereventadjustment/client.go index 3db0c17513..625ef3d649 100644 --- a/billing/metereventadjustment/client.go +++ b/billing/metereventadjustment/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new billing meter event adjustment. +// Creates a billing meter event adjustment func New(params *stripe.BillingMeterEventAdjustmentParams) (*stripe.BillingMeterEventAdjustment, error) { return getC().New(params) } -// New creates a new billing meter event adjustment. +// Creates a billing meter event adjustment func (c Client) New(params *stripe.BillingMeterEventAdjustmentParams) (*stripe.BillingMeterEventAdjustment, error) { metereventadjustment := &stripe.BillingMeterEventAdjustment{} err := c.B.Call( diff --git a/billing/metereventsummary/client.go b/billing/metereventsummary/client.go index faa46aee6c..368170b150 100644 --- a/billing/metereventsummary/client.go +++ b/billing/metereventsummary/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// List returns a list of billing meter event summaries. +// Retrieve a list of billing meter event summaries. func List(params *stripe.BillingMeterEventSummaryListParams) *Iter { return getC().List(params) } -// List returns a list of billing meter event summaries. +// Retrieve a list of billing meter event summaries. func (c Client) List(listParams *stripe.BillingMeterEventSummaryListParams) *Iter { path := stripe.FormatURLPath( "/v1/billing/meters/%s/event_summaries", diff --git a/billingportal/configuration/client.go b/billingportal/configuration/client.go index 4adfc6eb6d..7554b59ce7 100644 --- a/billingportal/configuration/client.go +++ b/billingportal/configuration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new billing portal configuration. +// Creates a configuration that describes the functionality and behavior of a PortalSession func New(params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { return getC().New(params) } -// New creates a new billing portal configuration. +// Creates a configuration that describes the functionality and behavior of a PortalSession func (c Client) New(params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { configuration := &stripe.BillingPortalConfiguration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.BillingPortalConfigurationParams) (*stripe.Bi return configuration, err } -// Get returns the details of a billing portal configuration. +// Retrieves a configuration that describes the functionality of the customer portal. func Get(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { return getC().Get(id, params) } -// Get returns the details of a billing portal configuration. +// Retrieves a configuration that describes the functionality of the customer portal. func (c Client) Get(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { path := stripe.FormatURLPath("/v1/billing_portal/configurations/%s", id) configuration := &stripe.BillingPortalConfiguration{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.BillingPortalConfigurationParams) return configuration, err } -// Update updates a billing portal configuration's properties. +// Updates a configuration that describes the functionality of the customer portal. func Update(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { return getC().Update(id, params) } -// Update updates a billing portal configuration's properties. +// Updates a configuration that describes the functionality of the customer portal. func (c Client) Update(id string, params *stripe.BillingPortalConfigurationParams) (*stripe.BillingPortalConfiguration, error) { path := stripe.FormatURLPath("/v1/billing_portal/configurations/%s", id) configuration := &stripe.BillingPortalConfiguration{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.BillingPortalConfigurationParam return configuration, err } -// List returns a list of billing portal configurations. +// Returns a list of configurations that describe the functionality of the customer portal. func List(params *stripe.BillingPortalConfigurationListParams) *Iter { return getC().List(params) } -// List returns a list of billing portal configurations. +// Returns a list of configurations that describe the functionality of the customer portal. func (c Client) List(listParams *stripe.BillingPortalConfigurationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/billingportal/session/client.go b/billingportal/session/client.go index 3fa5000448..a7d4ee9555 100644 --- a/billingportal/session/client.go +++ b/billingportal/session/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new billing portal session. +// Creates a session of the customer portal. func New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSession, error) { return getC().New(params) } -// New creates a new billing portal session. +// Creates a session of the customer portal. func (c Client) New(params *stripe.BillingPortalSessionParams) (*stripe.BillingPortalSession, error) { session := &stripe.BillingPortalSession{} err := c.B.Call( diff --git a/capability/client.go b/capability/client.go index 5379094140..03ee6027b8 100644 --- a/capability/client.go +++ b/capability/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// Get returns the details of a capability. +// Retrieves information about the specified Account Capability. func Get(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { return getC().Get(id, params) } -// Get returns the details of a capability. +// Retrieves information about the specified Account Capability. func (c Client) Get(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { if params == nil { return nil, fmt.Errorf( @@ -43,12 +43,12 @@ func (c Client) Get(id string, params *stripe.CapabilityParams) (*stripe.Capabil return capability, err } -// Update updates a capability's properties. +// Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. func Update(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { return getC().Update(id, params) } -// Update updates a capability's properties. +// Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. func (c Client) Update(id string, params *stripe.CapabilityParams) (*stripe.Capability, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/capabilities/%s", @@ -60,12 +60,12 @@ func (c Client) Update(id string, params *stripe.CapabilityParams) (*stripe.Capa return capability, err } -// List returns a list of capabilities. +// Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. func List(params *stripe.CapabilityListParams) *Iter { return getC().List(params) } -// List returns a list of capabilities. +// Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. func (c Client) List(listParams *stripe.CapabilityListParams) *Iter { path := stripe.FormatURLPath( "/v1/accounts/%s/capabilities", diff --git a/capital/financingoffer/client.go b/capital/financingoffer/client.go index dd7ea16701..30264b57db 100644 --- a/capital/financingoffer/client.go +++ b/capital/financingoffer/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a capital financing offer. +// Get the details of the financing offer func Get(id string, params *stripe.CapitalFinancingOfferParams) (*stripe.CapitalFinancingOffer, error) { return getC().Get(id, params) } -// Get returns the details of a capital financing offer. +// Get the details of the financing offer func (c Client) Get(id string, params *stripe.CapitalFinancingOfferParams) (*stripe.CapitalFinancingOffer, error) { path := stripe.FormatURLPath("/v1/capital/financing_offers/%s", id) financingoffer := &stripe.CapitalFinancingOffer{} @@ -33,12 +33,14 @@ func (c Client) Get(id string, params *stripe.CapitalFinancingOfferParams) (*str return financingoffer, err } -// MarkDelivered is the method for the `POST /v1/capital/financing_offers/{financing_offer}/mark_delivered` API. +// Acknowledges that platform has received and delivered the financing_offer to +// the intended merchant recipient. func MarkDelivered(id string, params *stripe.CapitalFinancingOfferMarkDeliveredParams) (*stripe.CapitalFinancingOffer, error) { return getC().MarkDelivered(id, params) } -// MarkDelivered is the method for the `POST /v1/capital/financing_offers/{financing_offer}/mark_delivered` API. +// Acknowledges that platform has received and delivered the financing_offer to +// the intended merchant recipient. func (c Client) MarkDelivered(id string, params *stripe.CapitalFinancingOfferMarkDeliveredParams) (*stripe.CapitalFinancingOffer, error) { path := stripe.FormatURLPath( "/v1/capital/financing_offers/%s/mark_delivered", @@ -49,12 +51,12 @@ func (c Client) MarkDelivered(id string, params *stripe.CapitalFinancingOfferMar return financingoffer, err } -// List returns a list of capital financing offers. +// Retrieves the financing offers available for Connected accounts that belong to your platform. func List(params *stripe.CapitalFinancingOfferListParams) *Iter { return getC().List(params) } -// List returns a list of capital financing offers. +// Retrieves the financing offers available for Connected accounts that belong to your platform. func (c Client) List(listParams *stripe.CapitalFinancingOfferListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/capital/financingsummary/client.go b/capital/financingsummary/client.go index 83729392b6..3565c2472c 100644 --- a/capital/financingsummary/client.go +++ b/capital/financingsummary/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Get returns the details of a capital financing summary. +// Retrieve the financing state for the account that was authenticated in the request. func Get(params *stripe.CapitalFinancingSummaryParams) (*stripe.CapitalFinancingSummary, error) { return getC().Get(params) } -// Get returns the details of a capital financing summary. +// Retrieve the financing state for the account that was authenticated in the request. func (c Client) Get(params *stripe.CapitalFinancingSummaryParams) (*stripe.CapitalFinancingSummary, error) { financingsummary := &stripe.CapitalFinancingSummary{} err := c.B.Call( diff --git a/capital/financingtransaction/client.go b/capital/financingtransaction/client.go index bb4e1ff38d..7790eb93ce 100644 --- a/capital/financingtransaction/client.go +++ b/capital/financingtransaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a capital financing transaction. +// Retrieves a financing transaction for a financing offer. func Get(id string, params *stripe.CapitalFinancingTransactionParams) (*stripe.CapitalFinancingTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a capital financing transaction. +// Retrieves a financing transaction for a financing offer. func (c Client) Get(id string, params *stripe.CapitalFinancingTransactionParams) (*stripe.CapitalFinancingTransaction, error) { path := stripe.FormatURLPath("/v1/capital/financing_transactions/%s", id) financingtransaction := &stripe.CapitalFinancingTransaction{} @@ -33,12 +33,14 @@ func (c Client) Get(id string, params *stripe.CapitalFinancingTransactionParams) return financingtransaction, err } -// List returns a list of capital financing transactions. +// Returns a list of financing transactions. The transactions are returned in sorted order, +// with the most recent transactions appearing first. func List(params *stripe.CapitalFinancingTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of capital financing transactions. +// Returns a list of financing transactions. The transactions are returned in sorted order, +// with the most recent transactions appearing first. func (c Client) List(listParams *stripe.CapitalFinancingTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/card/client.go b/card/client.go index 87163b2d1d..90415a41e8 100644 --- a/card/client.go +++ b/card/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new card. +// New creates a new card func New(params *stripe.CardParams) (*stripe.Card, error) { return getC().New(params) } -// New creates a new card. +// New creates a new card func (c Client) New(params *stripe.CardParams) (*stripe.Card, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -81,12 +81,12 @@ func (c Client) Get(id string, params *stripe.CardParams) (*stripe.Card, error) return card, err } -// Update updates a card's properties. +// Update a specified source for a given customer. func Update(id string, params *stripe.CardParams) (*stripe.Card, error) { return getC().Update(id, params) } -// Update updates a card's properties. +// Update a specified source for a given customer. func (c Client) Update(id string, params *stripe.CardParams) (*stripe.Card, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -106,12 +106,12 @@ func (c Client) Update(id string, params *stripe.CardParams) (*stripe.Card, erro return card, err } -// Del removes a card. +// Delete a specified source for a given customer. func Del(id string, params *stripe.CardParams) (*stripe.Card, error) { return getC().Del(id, params) } -// Del removes a card. +// Delete a specified source for a given customer. func (c Client) Del(id string, params *stripe.CardParams) (*stripe.Card, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -130,13 +130,10 @@ func (c Client) Del(id string, params *stripe.CardParams) (*stripe.Card, error) err := c.B.Call(http.MethodDelete, path, c.Key, params, card) return card, err } - -// List returns a list of cards. func List(params *stripe.CardListParams) *Iter { return getC().List(params) } -// List returns a list of cards. func (c Client) List(listParams *stripe.CardListParams) *Iter { var path string var outerErr error diff --git a/cashbalance/client.go b/cashbalance/client.go index a5927aa28e..b63970acae 100644 --- a/cashbalance/client.go +++ b/cashbalance/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a cash balance. +// Retrieves a customer's cash balance. func Get(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { return getC().Get(params) } -// Get returns the details of a cash balance. +// Retrieves a customer's cash balance. func (c Client) Get(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { if params == nil || params.Customer == nil { return nil, fmt.Errorf( @@ -41,12 +41,12 @@ func (c Client) Get(params *stripe.CashBalanceParams) (*stripe.CashBalance, erro return cashbalance, err } -// Update updates a cash balance's properties. +// Changes the settings on a customer's cash balance. func Update(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { return getC().Update(params) } -// Update updates a cash balance's properties. +// Changes the settings on a customer's cash balance. func (c Client) Update(params *stripe.CashBalanceParams) (*stripe.CashBalance, error) { if params == nil || params.Customer == nil { return nil, fmt.Errorf( diff --git a/charge/client.go b/charge/client.go index 441b55e6fd..17aa0f08a5 100644 --- a/charge/client.go +++ b/charge/client.go @@ -20,24 +20,28 @@ type Client struct { Key string } -// New creates a new charge. +// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) +// to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge +// object used to request payment. func New(params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().New(params) } -// New creates a new charge. +// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) +// to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge +// object used to request payment. func (c Client) New(params *stripe.ChargeParams) (*stripe.Charge, error) { charge := &stripe.Charge{} err := c.B.Call(http.MethodPost, "/v1/charges", c.Key, params, charge) return charge, err } -// Get returns the details of a charge. +// Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. func Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().Get(id, params) } -// Get returns the details of a charge. +// Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. func (c Client) Get(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { path := stripe.FormatURLPath("/v1/charges/%s", id) charge := &stripe.Charge{} @@ -45,12 +49,12 @@ func (c Client) Get(id string, params *stripe.ChargeParams) (*stripe.Charge, err return charge, err } -// Update updates a charge's properties. +// Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { return getC().Update(id, params) } -// Update updates a charge's properties. +// Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.ChargeParams) (*stripe.Charge, error) { path := stripe.FormatURLPath("/v1/charges/%s", id) charge := &stripe.Charge{} @@ -58,12 +62,20 @@ func (c Client) Update(id string, params *stripe.ChargeParams) (*stripe.Charge, return charge, err } -// Capture is the method for the `POST /v1/charges/{charge}/capture` API. +// Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. +// +// Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. +// +// Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). func Capture(id string, params *stripe.ChargeCaptureParams) (*stripe.Charge, error) { return getC().Capture(id, params) } -// Capture is the method for the `POST /v1/charges/{charge}/capture` API. +// Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. +// +// Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. +// +// Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). func (c Client) Capture(id string, params *stripe.ChargeCaptureParams) (*stripe.Charge, error) { path := stripe.FormatURLPath("/v1/charges/%s/capture", id) charge := &stripe.Charge{} @@ -71,12 +83,12 @@ func (c Client) Capture(id string, params *stripe.ChargeCaptureParams) (*stripe. return charge, err } -// List returns a list of charges. +// Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. func List(params *stripe.ChargeListParams) *Iter { return getC().List(params) } -// List returns a list of charges. +// Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. func (c Client) List(listParams *stripe.ChargeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -110,12 +122,18 @@ func (i *Iter) ChargeList() *stripe.ChargeList { return i.List().(*stripe.ChargeList) } -// Search returns a search result containing charges. +// Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.ChargeSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing charges. +// Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.ChargeSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/checkout/session/client.go b/checkout/session/client.go index d88ddbc110..e727403d3e 100644 --- a/checkout/session/client.go +++ b/checkout/session/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new checkout session. +// Creates a Session object. func New(params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { return getC().New(params) } -// New creates a new checkout session. +// Creates a Session object. func (c Client) New(params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { session := &stripe.CheckoutSession{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.CheckoutSessionParams) (*stripe.CheckoutSessi return session, err } -// Get returns the details of a checkout session. +// Retrieves a Session object. func Get(id string, params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { return getC().Get(id, params) } -// Get returns the details of a checkout session. +// Retrieves a Session object. func (c Client) Get(id string, params *stripe.CheckoutSessionParams) (*stripe.CheckoutSession, error) { path := stripe.FormatURLPath("/v1/checkout/sessions/%s", id) session := &stripe.CheckoutSession{} @@ -51,12 +51,16 @@ func (c Client) Get(id string, params *stripe.CheckoutSessionParams) (*stripe.Ch return session, err } -// Expire is the method for the `POST /v1/checkout/sessions/{session}/expire` API. +// A Session can be expired when it is in one of these statuses: open +// +// After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. func Expire(id string, params *stripe.CheckoutSessionExpireParams) (*stripe.CheckoutSession, error) { return getC().Expire(id, params) } -// Expire is the method for the `POST /v1/checkout/sessions/{session}/expire` API. +// A Session can be expired when it is in one of these statuses: open +// +// After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. func (c Client) Expire(id string, params *stripe.CheckoutSessionExpireParams) (*stripe.CheckoutSession, error) { path := stripe.FormatURLPath("/v1/checkout/sessions/%s/expire", id) session := &stripe.CheckoutSession{} @@ -64,12 +68,12 @@ func (c Client) Expire(id string, params *stripe.CheckoutSessionExpireParams) (* return session, err } -// List returns a list of checkout sessions. +// Returns a list of Checkout Sessions. func List(params *stripe.CheckoutSessionListParams) *Iter { return getC().List(params) } -// List returns a list of checkout sessions. +// Returns a list of Checkout Sessions. func (c Client) List(listParams *stripe.CheckoutSessionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -103,12 +107,12 @@ func (i *Iter) CheckoutSessionList() *stripe.CheckoutSessionList { return i.List().(*stripe.CheckoutSessionList) } -// ListLineItems is the method for the `GET /v1/checkout/sessions/{session}/line_items` API. +// When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.CheckoutSessionListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/checkout/sessions/{session}/line_items` API. +// When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.CheckoutSessionListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/checkout/sessions/%s/line_items", diff --git a/climate/order/client.go b/climate/order/client.go index d55c5b8087..52454e5c1d 100644 --- a/climate/order/client.go +++ b/climate/order/client.go @@ -20,24 +20,26 @@ type Client struct { Key string } -// New creates a new climate order. +// Creates a Climate order object for a given Climate product. The order will be processed immediately +// after creation and payment will be deducted your Stripe balance. func New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { return getC().New(params) } -// New creates a new climate order. +// Creates a Climate order object for a given Climate product. The order will be processed immediately +// after creation and payment will be deducted your Stripe balance. func (c Client) New(params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { order := &stripe.ClimateOrder{} err := c.B.Call(http.MethodPost, "/v1/climate/orders", c.Key, params, order) return order, err } -// Get returns the details of a climate order. +// Retrieves the details of a Climate order object with the given ID. func Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { return getC().Get(id, params) } -// Get returns the details of a climate order. +// Retrieves the details of a Climate order object with the given ID. func (c Client) Get(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { path := stripe.FormatURLPath("/v1/climate/orders/%s", id) order := &stripe.ClimateOrder{} @@ -45,12 +47,12 @@ func (c Client) Get(id string, params *stripe.ClimateOrderParams) (*stripe.Clima return order, err } -// Update updates a climate order's properties. +// Updates the specified order by setting the values of the parameters passed. func Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { return getC().Update(id, params) } -// Update updates a climate order's properties. +// Updates the specified order by setting the values of the parameters passed. func (c Client) Update(id string, params *stripe.ClimateOrderParams) (*stripe.ClimateOrder, error) { path := stripe.FormatURLPath("/v1/climate/orders/%s", id) order := &stripe.ClimateOrder{} @@ -58,12 +60,18 @@ func (c Client) Update(id string, params *stripe.ClimateOrderParams) (*stripe.Cl return order, err } -// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API. +// Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the +// reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier +// might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe +// provides 90 days advance notice and refunds the amount_total. func Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/climate/orders/{order}/cancel` API. +// Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the +// reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier +// might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe +// provides 90 days advance notice and refunds the amount_total. func (c Client) Cancel(id string, params *stripe.ClimateOrderCancelParams) (*stripe.ClimateOrder, error) { path := stripe.FormatURLPath("/v1/climate/orders/%s/cancel", id) order := &stripe.ClimateOrder{} @@ -71,12 +79,14 @@ func (c Client) Cancel(id string, params *stripe.ClimateOrderCancelParams) (*str return order, err } -// List returns a list of climate orders. +// Lists all Climate order objects. The orders are returned sorted by creation date, with the +// most recently created orders appearing first. func List(params *stripe.ClimateOrderListParams) *Iter { return getC().List(params) } -// List returns a list of climate orders. +// Lists all Climate order objects. The orders are returned sorted by creation date, with the +// most recently created orders appearing first. func (c Client) List(listParams *stripe.ClimateOrderListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/climate/product/client.go b/climate/product/client.go index 90d25395dd..adb5173e8f 100644 --- a/climate/product/client.go +++ b/climate/product/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a climate product. +// Retrieves the details of a Climate product with the given ID. func Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) { return getC().Get(id, params) } -// Get returns the details of a climate product. +// Retrieves the details of a Climate product with the given ID. func (c Client) Get(id string, params *stripe.ClimateProductParams) (*stripe.ClimateProduct, error) { path := stripe.FormatURLPath("/v1/climate/products/%s", id) product := &stripe.ClimateProduct{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ClimateProductParams) (*stripe.Cli return product, err } -// List returns a list of climate products. +// Lists all available Climate product objects. func List(params *stripe.ClimateProductListParams) *Iter { return getC().List(params) } -// List returns a list of climate products. +// Lists all available Climate product objects. func (c Client) List(listParams *stripe.ClimateProductListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/climate/supplier/client.go b/climate/supplier/client.go index c9cc98d623..cb3d48b601 100644 --- a/climate/supplier/client.go +++ b/climate/supplier/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a climate supplier. +// Retrieves a Climate supplier object. func Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) { return getC().Get(id, params) } -// Get returns the details of a climate supplier. +// Retrieves a Climate supplier object. func (c Client) Get(id string, params *stripe.ClimateSupplierParams) (*stripe.ClimateSupplier, error) { path := stripe.FormatURLPath("/v1/climate/suppliers/%s", id) supplier := &stripe.ClimateSupplier{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ClimateSupplierParams) (*stripe.Cl return supplier, err } -// List returns a list of climate suppliers. +// Lists all available Climate supplier objects. func List(params *stripe.ClimateSupplierListParams) *Iter { return getC().List(params) } -// List returns a list of climate suppliers. +// Lists all available Climate supplier objects. func (c Client) List(listParams *stripe.ClimateSupplierListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/confirmationtoken/client.go b/confirmationtoken/client.go index 72ea9f98ce..f076be962e 100644 --- a/confirmationtoken/client.go +++ b/confirmationtoken/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Get returns the details of a confirmation token. +// Retrieves an existing ConfirmationToken object func Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { return getC().Get(id, params) } -// Get returns the details of a confirmation token. +// Retrieves an existing ConfirmationToken object func (c Client) Get(id string, params *stripe.ConfirmationTokenParams) (*stripe.ConfirmationToken, error) { path := stripe.FormatURLPath("/v1/confirmation_tokens/%s", id) confirmationtoken := &stripe.ConfirmationToken{} diff --git a/countryspec/client.go b/countryspec/client.go index 841bea87fd..f408fc765d 100644 --- a/countryspec/client.go +++ b/countryspec/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a country spec. +// Returns a Country Spec for a given Country code. func Get(id string, params *stripe.CountrySpecParams) (*stripe.CountrySpec, error) { return getC().Get(id, params) } -// Get returns the details of a country spec. +// Returns a Country Spec for a given Country code. func (c Client) Get(id string, params *stripe.CountrySpecParams) (*stripe.CountrySpec, error) { path := stripe.FormatURLPath("/v1/country_specs/%s", id) countryspec := &stripe.CountrySpec{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.CountrySpecParams) (*stripe.Countr return countryspec, err } -// List returns a list of country specs. +// Lists all Country Spec objects available in the API. func List(params *stripe.CountrySpecListParams) *Iter { return getC().List(params) } -// List returns a list of country specs. +// Lists all Country Spec objects available in the API. func (c Client) List(listParams *stripe.CountrySpecListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/coupon/client.go b/coupon/client.go index a800622403..bd4690b4fc 100644 --- a/coupon/client.go +++ b/coupon/client.go @@ -20,24 +20,28 @@ type Client struct { Key string } -// New creates a new coupon. +// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. +// +// A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. func New(params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().New(params) } -// New creates a new coupon. +// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. +// +// A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. func (c Client) New(params *stripe.CouponParams) (*stripe.Coupon, error) { coupon := &stripe.Coupon{} err := c.B.Call(http.MethodPost, "/v1/coupons", c.Key, params, coupon) return coupon, err } -// Get returns the details of a coupon. +// Retrieves the coupon with the given ID. func Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().Get(id, params) } -// Get returns the details of a coupon. +// Retrieves the coupon with the given ID. func (c Client) Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { path := stripe.FormatURLPath("/v1/coupons/%s", id) coupon := &stripe.Coupon{} @@ -45,12 +49,12 @@ func (c Client) Get(id string, params *stripe.CouponParams) (*stripe.Coupon, err return coupon, err } -// Update updates a coupon's properties. +// Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. func Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().Update(id, params) } -// Update updates a coupon's properties. +// Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. func (c Client) Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { path := stripe.FormatURLPath("/v1/coupons/%s", id) coupon := &stripe.Coupon{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.CouponParams) (*stripe.Coupon, return coupon, err } -// Del removes a coupon. +// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. func Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { return getC().Del(id, params) } -// Del removes a coupon. +// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. func (c Client) Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error) { path := stripe.FormatURLPath("/v1/coupons/%s", id) coupon := &stripe.Coupon{} @@ -71,12 +75,12 @@ func (c Client) Del(id string, params *stripe.CouponParams) (*stripe.Coupon, err return coupon, err } -// List returns a list of coupons. +// Returns a list of your coupons. func List(params *stripe.CouponListParams) *Iter { return getC().List(params) } -// List returns a list of coupons. +// Returns a list of your coupons. func (c Client) List(listParams *stripe.CouponListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/creditnote/client.go b/creditnote/client.go index ba9aa9c60c..548da732c9 100644 --- a/creditnote/client.go +++ b/creditnote/client.go @@ -20,12 +20,34 @@ type Client struct { Key string } -// New creates a new credit note. +// Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces +// its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result +// in any combination of the following: +// +// Refund: create a new refund (using refund_amount) or link an existing refund (using refund). +// Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. +// Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). +// +// For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. +// +// You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount +// or post_payment_credit_notes_amount depending on its status at the time of credit note creation. func New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { return getC().New(params) } -// New creates a new credit note. +// Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces +// its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result +// in any combination of the following: +// +// Refund: create a new refund (using refund_amount) or link an existing refund (using refund). +// Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. +// Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). +// +// For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. +// +// You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount +// or post_payment_credit_notes_amount depending on its status at the time of credit note creation. func (c Client) New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { creditnote := &stripe.CreditNote{} err := c.B.Call( @@ -38,12 +60,12 @@ func (c Client) New(params *stripe.CreditNoteParams) (*stripe.CreditNote, error) return creditnote, err } -// Get returns the details of a credit note. +// Retrieves the credit note object with the given identifier. func Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { return getC().Get(id, params) } -// Get returns the details of a credit note. +// Retrieves the credit note object with the given identifier. func (c Client) Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { path := stripe.FormatURLPath("/v1/credit_notes/%s", id) creditnote := &stripe.CreditNote{} @@ -51,12 +73,12 @@ func (c Client) Get(id string, params *stripe.CreditNoteParams) (*stripe.CreditN return creditnote, err } -// Update updates a credit note's properties. +// Updates an existing credit note. func Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { return getC().Update(id, params) } -// Update updates a credit note's properties. +// Updates an existing credit note. func (c Client) Update(id string, params *stripe.CreditNoteParams) (*stripe.CreditNote, error) { path := stripe.FormatURLPath("/v1/credit_notes/%s", id) creditnote := &stripe.CreditNote{} @@ -64,12 +86,12 @@ func (c Client) Update(id string, params *stripe.CreditNoteParams) (*stripe.Cred return creditnote, err } -// Preview is the method for the `GET /v1/credit_notes/preview` API. +// Get a preview of a credit note without creating it. func Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error) { return getC().Preview(params) } -// Preview is the method for the `GET /v1/credit_notes/preview` API. +// Get a preview of a credit note without creating it. func (c Client) Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditNote, error) { creditnote := &stripe.CreditNote{} err := c.B.Call( @@ -82,12 +104,12 @@ func (c Client) Preview(params *stripe.CreditNotePreviewParams) (*stripe.CreditN return creditnote, err } -// VoidCreditNote is the method for the `POST /v1/credit_notes/{id}/void` API. +// Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). func VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error) { return getC().VoidCreditNote(id, params) } -// VoidCreditNote is the method for the `POST /v1/credit_notes/{id}/void` API. +// Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). func (c Client) VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNoteParams) (*stripe.CreditNote, error) { path := stripe.FormatURLPath("/v1/credit_notes/%s/void", id) creditnote := &stripe.CreditNote{} @@ -95,12 +117,12 @@ func (c Client) VoidCreditNote(id string, params *stripe.CreditNoteVoidCreditNot return creditnote, err } -// List returns a list of credit notes. +// Returns a list of credit notes. func List(params *stripe.CreditNoteListParams) *Iter { return getC().List(params) } -// List returns a list of credit notes. +// Returns a list of credit notes. func (c Client) List(listParams *stripe.CreditNoteListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -134,12 +156,12 @@ func (i *Iter) CreditNoteList() *stripe.CreditNoteList { return i.List().(*stripe.CreditNoteList) } -// ListLines is the method for the `GET /v1/credit_notes/{credit_note}/lines` API. +// When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLines(params *stripe.CreditNoteListLinesParams) *LineItemIter { return getC().ListLines(params) } -// ListLines is the method for the `GET /v1/credit_notes/{credit_note}/lines` API. +// When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLines(listParams *stripe.CreditNoteListLinesParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/credit_notes/%s/lines", @@ -160,12 +182,12 @@ func (c Client) ListLines(listParams *stripe.CreditNoteListLinesParams) *LineIte } } -// PreviewLines is the method for the `GET /v1/credit_notes/preview/lines` API. +// When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. func PreviewLines(params *stripe.CreditNotePreviewLinesParams) *LineItemIter { return getC().PreviewLines(params) } -// PreviewLines is the method for the `GET /v1/credit_notes/preview/lines` API. +// When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. func (c Client) PreviewLines(listParams *stripe.CreditNotePreviewLinesParams) *LineItemIter { return &LineItemIter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/customer/client.go b/customer/client.go index b2f2bba68e..7479fb3e18 100644 --- a/customer/client.go +++ b/customer/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new customer. +// Creates a new customer object. func New(params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().New(params) } -// New creates a new customer. +// Creates a new customer object. func (c Client) New(params *stripe.CustomerParams) (*stripe.Customer, error) { customer := &stripe.Customer{} err := c.B.Call(http.MethodPost, "/v1/customers", c.Key, params, customer) return customer, err } -// Get returns the details of a customer. +// Retrieves a Customer object. func Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Get(id, params) } -// Get returns the details of a customer. +// Retrieves a Customer object. func (c Client) Get(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) customer := &stripe.Customer{} @@ -45,12 +45,16 @@ func (c Client) Get(id string, params *stripe.CustomerParams) (*stripe.Customer, return customer, err } -// Update updates a customer's properties. +// Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. +// +// This request accepts mostly the same arguments as the customer creation call. func Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Update(id, params) } -// Update updates a customer's properties. +// Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. +// +// This request accepts mostly the same arguments as the customer creation call. func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) customer := &stripe.Customer{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.CustomerParams) (*stripe.Custom return customer, err } -// Del removes a customer. +// Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. func Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { return getC().Del(id, params) } -// Del removes a customer. +// Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. func (c Client) Del(id string, params *stripe.CustomerParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s", id) customer := &stripe.Customer{} @@ -71,12 +75,16 @@ func (c Client) Del(id string, params *stripe.CustomerParams) (*stripe.Customer, return customer, err } -// CreateFundingInstructions is the method for the `POST /v1/customers/{customer}/funding_instructions` API. +// Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new +// funding instructions will be created. If funding instructions have already been created for a given customer, the same +// funding instructions will be retrieved. In other words, we will return the same funding instructions each time. func CreateFundingInstructions(id string, params *stripe.CustomerCreateFundingInstructionsParams) (*stripe.FundingInstructions, error) { return getC().CreateFundingInstructions(id, params) } -// CreateFundingInstructions is the method for the `POST /v1/customers/{customer}/funding_instructions` API. +// Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new +// funding instructions will be created. If funding instructions have already been created for a given customer, the same +// funding instructions will be retrieved. In other words, we will return the same funding instructions each time. func (c Client) CreateFundingInstructions(id string, params *stripe.CustomerCreateFundingInstructionsParams) (*stripe.FundingInstructions, error) { path := stripe.FormatURLPath("/v1/customers/%s/funding_instructions", id) fundinginstructions := &stripe.FundingInstructions{} @@ -84,12 +92,12 @@ func (c Client) CreateFundingInstructions(id string, params *stripe.CustomerCrea return fundinginstructions, err } -// DeleteDiscount is the method for the `DELETE /v1/customers/{customer}/discount` API. +// Removes the currently applied discount on a customer. func DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountParams) (*stripe.Customer, error) { return getC().DeleteDiscount(id, params) } -// DeleteDiscount is the method for the `DELETE /v1/customers/{customer}/discount` API. +// Removes the currently applied discount on a customer. func (c Client) DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountParams) (*stripe.Customer, error) { path := stripe.FormatURLPath("/v1/customers/%s/discount", id) customer := &stripe.Customer{} @@ -97,12 +105,12 @@ func (c Client) DeleteDiscount(id string, params *stripe.CustomerDeleteDiscountP return customer, err } -// RetrievePaymentMethod is the method for the `GET /v1/customers/{customer}/payment_methods/{payment_method}` API. +// Retrieves a PaymentMethod object for a given Customer. func RetrievePaymentMethod(id string, params *stripe.CustomerRetrievePaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().RetrievePaymentMethod(id, params) } -// RetrievePaymentMethod is the method for the `GET /v1/customers/{customer}/payment_methods/{payment_method}` API. +// Retrieves a PaymentMethod object for a given Customer. func (c Client) RetrievePaymentMethod(id string, params *stripe.CustomerRetrievePaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath( "/v1/customers/%s/payment_methods/%s", @@ -114,12 +122,12 @@ func (c Client) RetrievePaymentMethod(id string, params *stripe.CustomerRetrieve return paymentmethod, err } -// List returns a list of customers. +// Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. func List(params *stripe.CustomerListParams) *Iter { return getC().List(params) } -// List returns a list of customers. +// Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. func (c Client) List(listParams *stripe.CustomerListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -153,12 +161,12 @@ func (i *Iter) CustomerList() *stripe.CustomerList { return i.List().(*stripe.CustomerList) } -// ListPaymentMethods is the method for the `GET /v1/customers/{customer}/payment_methods` API. +// Returns a list of PaymentMethods for a given Customer func ListPaymentMethods(params *stripe.CustomerListPaymentMethodsParams) *PaymentMethodIter { return getC().ListPaymentMethods(params) } -// ListPaymentMethods is the method for the `GET /v1/customers/{customer}/payment_methods` API. +// Returns a list of PaymentMethods for a given Customer func (c Client) ListPaymentMethods(listParams *stripe.CustomerListPaymentMethodsParams) *PaymentMethodIter { path := stripe.FormatURLPath( "/v1/customers/%s/payment_methods", @@ -196,12 +204,18 @@ func (i *PaymentMethodIter) PaymentMethodList() *stripe.PaymentMethodList { return i.List().(*stripe.PaymentMethodList) } -// Search returns a search result containing customers. +// Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.CustomerSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing customers. +// Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.CustomerSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/customerbalancetransaction/client.go b/customerbalancetransaction/client.go index af77120999..c2ac1df806 100644 --- a/customerbalancetransaction/client.go +++ b/customerbalancetransaction/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new customer balance transaction. +// Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). func New(params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { return getC().New(params) } -// New creates a new customer balance transaction. +// Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). func (c Client) New(params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { if params == nil { return nil, fmt.Errorf( @@ -48,12 +48,12 @@ func (c Client) New(params *stripe.CustomerBalanceTransactionParams) (*stripe.Cu return customerbalancetransaction, err } -// Get returns the details of a customer balance transaction. +// Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func Get(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a customer balance transaction. +// Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func (c Client) Get(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { if params == nil { return nil, fmt.Errorf( @@ -76,12 +76,12 @@ func (c Client) Get(id string, params *stripe.CustomerBalanceTransactionParams) return customerbalancetransaction, err } -// Update updates a customer balance transaction's properties. +// Most credit balance transaction fields are immutable, but you may update its description and metadata. func Update(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { return getC().Update(id, params) } -// Update updates a customer balance transaction's properties. +// Most credit balance transaction fields are immutable, but you may update its description and metadata. func (c Client) Update(id string, params *stripe.CustomerBalanceTransactionParams) (*stripe.CustomerBalanceTransaction, error) { path := stripe.FormatURLPath( "/v1/customers/%s/balance_transactions/%s", @@ -99,12 +99,12 @@ func (c Client) Update(id string, params *stripe.CustomerBalanceTransactionParam return customerbalancetransaction, err } -// List returns a list of customer balance transactions. +// Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func List(params *stripe.CustomerBalanceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of customer balance transactions. +// Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). func (c Client) List(listParams *stripe.CustomerBalanceTransactionListParams) *Iter { path := stripe.FormatURLPath( "/v1/customers/%s/balance_transactions", diff --git a/customercashbalancetransaction/client.go b/customercashbalancetransaction/client.go index 381c47ad5a..6cf9929598 100644 --- a/customercashbalancetransaction/client.go +++ b/customercashbalancetransaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a customer cash balance transaction. +// Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func Get(id string, params *stripe.CustomerCashBalanceTransactionParams) (*stripe.CustomerCashBalanceTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a customer cash balance transaction. +// Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func (c Client) Get(id string, params *stripe.CustomerCashBalanceTransactionParams) (*stripe.CustomerCashBalanceTransaction, error) { path := stripe.FormatURLPath( "/v1/customers/%s/cash_balance_transactions/%s", @@ -43,12 +43,12 @@ func (c Client) Get(id string, params *stripe.CustomerCashBalanceTransactionPara return customercashbalancetransaction, err } -// List returns a list of customer cash balance transactions. +// Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func List(params *stripe.CustomerCashBalanceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of customer cash balance transactions. +// Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). func (c Client) List(listParams *stripe.CustomerCashBalanceTransactionListParams) *Iter { path := stripe.FormatURLPath( "/v1/customers/%s/cash_balance_transactions", diff --git a/customersession/client.go b/customersession/client.go index e3ba90a9e0..67c3ac035e 100644 --- a/customersession/client.go +++ b/customersession/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new customer session. +// Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. func New(params *stripe.CustomerSessionParams) (*stripe.CustomerSession, error) { return getC().New(params) } -// New creates a new customer session. +// Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. func (c Client) New(params *stripe.CustomerSessionParams) (*stripe.CustomerSession, error) { customersession := &stripe.CustomerSession{} err := c.B.Call( diff --git a/dispute/client.go b/dispute/client.go index 68af454c96..d1d2dc7713 100644 --- a/dispute/client.go +++ b/dispute/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a dispute. +// Retrieves the dispute with the given ID. func Get(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { return getC().Get(id, params) } -// Get returns the details of a dispute. +// Retrieves the dispute with the given ID. func (c Client) Get(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { path := stripe.FormatURLPath("/v1/disputes/%s", id) dispute := &stripe.Dispute{} @@ -33,12 +33,16 @@ func (c Client) Get(id string, params *stripe.DisputeParams) (*stripe.Dispute, e return dispute, err } -// Update updates a dispute's properties. +// When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. +// +// Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). func Update(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { return getC().Update(id, params) } -// Update updates a dispute's properties. +// When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. +// +// Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). func (c Client) Update(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { path := stripe.FormatURLPath("/v1/disputes/%s", id) dispute := &stripe.Dispute{} @@ -46,12 +50,16 @@ func (c Client) Update(id string, params *stripe.DisputeParams) (*stripe.Dispute return dispute, err } -// Close is the method for the `POST /v1/disputes/{dispute}/close` API. +// Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. +// +// The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. func Close(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { return getC().Close(id, params) } -// Close is the method for the `POST /v1/disputes/{dispute}/close` API. +// Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. +// +// The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. func (c Client) Close(id string, params *stripe.DisputeParams) (*stripe.Dispute, error) { path := stripe.FormatURLPath("/v1/disputes/%s/close", id) dispute := &stripe.Dispute{} @@ -59,12 +67,12 @@ func (c Client) Close(id string, params *stripe.DisputeParams) (*stripe.Dispute, return dispute, err } -// List returns a list of disputes. +// Returns a list of your disputes. func List(params *stripe.DisputeListParams) *Iter { return getC().List(params) } -// List returns a list of disputes. +// Returns a list of your disputes. func (c Client) List(listParams *stripe.DisputeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/entitlements/activeentitlement/client.go b/entitlements/activeentitlement/client.go index e0b9606f5a..5a79927095 100644 --- a/entitlements/activeentitlement/client.go +++ b/entitlements/activeentitlement/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an entitlements active entitlement. +// Retrieve an active entitlement func Get(id string, params *stripe.EntitlementsActiveEntitlementParams) (*stripe.EntitlementsActiveEntitlement, error) { return getC().Get(id, params) } -// Get returns the details of an entitlements active entitlement. +// Retrieve an active entitlement func (c Client) Get(id string, params *stripe.EntitlementsActiveEntitlementParams) (*stripe.EntitlementsActiveEntitlement, error) { path := stripe.FormatURLPath("/v1/entitlements/active_entitlements/%s", id) activeentitlement := &stripe.EntitlementsActiveEntitlement{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.EntitlementsActiveEntitlementParam return activeentitlement, err } -// List returns a list of entitlements active entitlements. +// Retrieve a list of active entitlements for a customer func List(params *stripe.EntitlementsActiveEntitlementListParams) *Iter { return getC().List(params) } -// List returns a list of entitlements active entitlements. +// Retrieve a list of active entitlements for a customer func (c Client) List(listParams *stripe.EntitlementsActiveEntitlementListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/entitlements/feature/client.go b/entitlements/feature/client.go index ba6f549853..929115ba3d 100644 --- a/entitlements/feature/client.go +++ b/entitlements/feature/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new entitlements feature. +// Creates a feature func New(params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { return getC().New(params) } -// New creates a new entitlements feature. +// Creates a feature func (c Client) New(params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { feature := &stripe.EntitlementsFeature{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.EntitlementsFeatureParams) (*stripe.Entitleme return feature, err } -// Get returns the details of an entitlements feature. +// Retrieves a feature func Get(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { return getC().Get(id, params) } -// Get returns the details of an entitlements feature. +// Retrieves a feature func (c Client) Get(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { path := stripe.FormatURLPath("/v1/entitlements/features/%s", id) feature := &stripe.EntitlementsFeature{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.EntitlementsFeatureParams) (*strip return feature, err } -// Update updates an entitlements feature's properties. +// Update a feature's metadata or permanently deactivate it. func Update(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { return getC().Update(id, params) } -// Update updates an entitlements feature's properties. +// Update a feature's metadata or permanently deactivate it. func (c Client) Update(id string, params *stripe.EntitlementsFeatureParams) (*stripe.EntitlementsFeature, error) { path := stripe.FormatURLPath("/v1/entitlements/features/%s", id) feature := &stripe.EntitlementsFeature{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.EntitlementsFeatureParams) (*st return feature, err } -// List returns a list of entitlements features. +// Retrieve a list of features func List(params *stripe.EntitlementsFeatureListParams) *Iter { return getC().List(params) } -// List returns a list of entitlements features. +// Retrieve a list of features func (c Client) List(listParams *stripe.EntitlementsFeatureListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/ephemeralkey/client.go b/ephemeralkey/client.go index a723063f72..0c21e5585d 100644 --- a/ephemeralkey/client.go +++ b/ephemeralkey/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new ephemeral key. +// Creates a short-lived API key for a given resource. func New(params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { return getC().New(params) } -// New creates a new ephemeral key. +// Creates a short-lived API key for a given resource. func (c Client) New(params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { if params.StripeVersion == nil || len(stripe.StringValue(params.StripeVersion)) == 0 { return nil, fmt.Errorf("params.StripeVersion must be specified") @@ -47,12 +47,12 @@ func (c Client) New(params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, er return ephemeralkey, err } -// Del removes an ephemeral key. +// Invalidates a short-lived API key for a given resource. func Del(id string, params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { return getC().Del(id, params) } -// Del removes an ephemeral key. +// Invalidates a short-lived API key for a given resource. func (c Client) Del(id string, params *stripe.EphemeralKeyParams) (*stripe.EphemeralKey, error) { path := stripe.FormatURLPath("/v1/ephemeral_keys/%s", id) ephemeralkey := &stripe.EphemeralKey{} diff --git a/event/client.go b/event/client.go index 0bda8d3010..433bbdc2c2 100644 --- a/event/client.go +++ b/event/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an event. +// Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. func Get(id string, params *stripe.EventParams) (*stripe.Event, error) { return getC().Get(id, params) } -// Get returns the details of an event. +// Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. func (c Client) Get(id string, params *stripe.EventParams) (*stripe.Event, error) { path := stripe.FormatURLPath("/v1/events/%s", id) event := &stripe.Event{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.EventParams) (*stripe.Event, error return event, err } -// List returns a list of events. +// 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://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). func List(params *stripe.EventListParams) *Iter { return getC().List(params) } -// List returns a list of events. +// 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://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). func (c Client) List(listParams *stripe.EventListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/feerefund/client.go b/feerefund/client.go index 31c53ba837..cd2e1d3d0e 100644 --- a/feerefund/client.go +++ b/feerefund/client.go @@ -21,12 +21,28 @@ type Client struct { Key string } -// New creates a new fee refund. +// Refunds an application fee that has previously been collected but not yet refunded. +// Funds will be refunded to the Stripe account from which the fee was originally collected. +// +// You can optionally refund only part of an application fee. +// You can do so multiple times, until the entire fee has been refunded. +// +// Once entirely refunded, an application fee can't be refunded again. +// This method will raise an error when called on an already-refunded application fee, +// or when trying to refund more money than is left on an application fee. func New(params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return getC().New(params) } -// New creates a new fee refund. +// Refunds an application fee that has previously been collected but not yet refunded. +// Funds will be refunded to the Stripe account from which the fee was originally collected. +// +// You can optionally refund only part of an application fee. +// You can do so multiple times, until the entire fee has been refunded. +// +// Once entirely refunded, an application fee can't be refunded again. +// This method will raise an error when called on an already-refunded application fee, +// or when trying to refund more money than is left on an application fee. func (c Client) New(params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil") @@ -43,12 +59,12 @@ func (c Client) New(params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return feerefund, err } -// Get returns the details of a fee refund. +// By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. func Get(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return getC().Get(id, params) } -// Get returns the details of a fee refund. +// By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. func (c Client) Get(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil") @@ -66,12 +82,16 @@ func (c Client) Get(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefun return feerefund, err } -// Update updates a fee refund's properties. +// Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata as an argument. func Update(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { return getC().Update(id, params) } -// Update updates a fee refund's properties. +// Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata as an argument. func (c Client) Update(id string, params *stripe.FeeRefundParams) (*stripe.FeeRefund, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil") @@ -89,12 +109,12 @@ func (c Client) Update(id string, params *stripe.FeeRefundParams) (*stripe.FeeRe return feerefund, err } -// List returns a list of fee refunds. +// You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. func List(params *stripe.FeeRefundListParams) *Iter { return getC().List(params) } -// List returns a list of fee refunds. +// You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. func (c Client) List(listParams *stripe.FeeRefundListParams) *Iter { path := stripe.FormatURLPath( "/v1/application_fees/%s/refunds", diff --git a/file/client.go b/file/client.go index f20ca6857e..b1d1791fe6 100644 --- a/file/client.go +++ b/file/client.go @@ -22,12 +22,16 @@ type Client struct { Key string } -// New creates a new file. +// To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. +// +// All of Stripe's officially supported Client libraries support sending multipart/form-data. func New(params *stripe.FileParams) (*stripe.File, error) { return getC().New(params) } -// New creates a new file. +// To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. +// +// All of Stripe's officially supported Client libraries support sending multipart/form-data. func (c Client) New(params *stripe.FileParams) (*stripe.File, error) { if params == nil { return nil, fmt.Errorf( @@ -46,12 +50,12 @@ func (c Client) New(params *stripe.FileParams) (*stripe.File, error) { return file, err } -// Get returns the details of a file. +// Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). func Get(id string, params *stripe.FileParams) (*stripe.File, error) { return getC().Get(id, params) } -// Get returns the details of a file. +// Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). func (c Client) Get(id string, params *stripe.FileParams) (*stripe.File, error) { path := stripe.FormatURLPath("/v1/files/%s", id) file := &stripe.File{} @@ -59,12 +63,12 @@ func (c Client) Get(id string, params *stripe.FileParams) (*stripe.File, error) return file, err } -// List returns a list of files. +// Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. func List(params *stripe.FileListParams) *Iter { return getC().List(params) } -// List returns a list of files. +// Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. func (c Client) List(listParams *stripe.FileListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/filelink/client.go b/filelink/client.go index 4300f4e7e0..05bf459b01 100644 --- a/filelink/client.go +++ b/filelink/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new file link. +// Creates a new file link object. func New(params *stripe.FileLinkParams) (*stripe.FileLink, error) { return getC().New(params) } -// New creates a new file link. +// Creates a new file link object. func (c Client) New(params *stripe.FileLinkParams) (*stripe.FileLink, error) { filelink := &stripe.FileLink{} err := c.B.Call(http.MethodPost, "/v1/file_links", c.Key, params, filelink) return filelink, err } -// Get returns the details of a file link. +// Retrieves the file link with the given ID. func Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { return getC().Get(id, params) } -// Get returns the details of a file link. +// Retrieves the file link with the given ID. func (c Client) Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { path := stripe.FormatURLPath("/v1/file_links/%s", id) filelink := &stripe.FileLink{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.FileLinkParams) (*stripe.FileLink, return filelink, err } -// Update updates a file link's properties. +// Updates an existing file link object. Expired links can no longer be updated. func Update(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { return getC().Update(id, params) } -// Update updates a file link's properties. +// Updates an existing file link object. Expired links can no longer be updated. func (c Client) Update(id string, params *stripe.FileLinkParams) (*stripe.FileLink, error) { path := stripe.FormatURLPath("/v1/file_links/%s", id) filelink := &stripe.FileLink{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.FileLinkParams) (*stripe.FileLi return filelink, err } -// List returns a list of file links. +// Returns a list of file links. func List(params *stripe.FileLinkListParams) *Iter { return getC().List(params) } -// List returns a list of file links. +// Returns a list of file links. func (c Client) List(listParams *stripe.FileLinkListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/financialconnections/account/client.go b/financialconnections/account/client.go index 6aae0a61e0..2d27a6d9fc 100644 --- a/financialconnections/account/client.go +++ b/financialconnections/account/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// GetByID returns the details of a financial connections account. +// Retrieves the details of an Financial Connections Account. func GetByID(id string, params *stripe.FinancialConnectionsAccountParams) (*stripe.FinancialConnectionsAccount, error) { return getC().GetByID(id, params) } -// GetByID returns the details of a financial connections account. +// Retrieves the details of an Financial Connections Account. func (c Client) GetByID(id string, params *stripe.FinancialConnectionsAccountParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath("/v1/financial_connections/accounts/%s", id) account := &stripe.FinancialConnectionsAccount{} @@ -33,12 +33,12 @@ func (c Client) GetByID(id string, params *stripe.FinancialConnectionsAccountPar return account, err } -// Disconnect is the method for the `POST /v1/financial_connections/accounts/{account}/disconnect` API. +// Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). func Disconnect(id string, params *stripe.FinancialConnectionsAccountDisconnectParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Disconnect(id, params) } -// Disconnect is the method for the `POST /v1/financial_connections/accounts/{account}/disconnect` API. +// Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). func (c Client) Disconnect(id string, params *stripe.FinancialConnectionsAccountDisconnectParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/disconnect", @@ -49,12 +49,12 @@ func (c Client) Disconnect(id string, params *stripe.FinancialConnectionsAccount return account, err } -// Refresh is the method for the `POST /v1/financial_connections/accounts/{account}/refresh` API. +// Refreshes the data associated with a Financial Connections Account. func Refresh(id string, params *stripe.FinancialConnectionsAccountRefreshParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Refresh(id, params) } -// Refresh is the method for the `POST /v1/financial_connections/accounts/{account}/refresh` API. +// Refreshes the data associated with a Financial Connections Account. func (c Client) Refresh(id string, params *stripe.FinancialConnectionsAccountRefreshParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/refresh", @@ -65,12 +65,12 @@ func (c Client) Refresh(id string, params *stripe.FinancialConnectionsAccountRef return account, err } -// Subscribe is the method for the `POST /v1/financial_connections/accounts/{account}/subscribe` API. +// Subscribes to periodic refreshes of data associated with a Financial Connections Account. func Subscribe(id string, params *stripe.FinancialConnectionsAccountSubscribeParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Subscribe(id, params) } -// Subscribe is the method for the `POST /v1/financial_connections/accounts/{account}/subscribe` API. +// Subscribes to periodic refreshes of data associated with a Financial Connections Account. func (c Client) Subscribe(id string, params *stripe.FinancialConnectionsAccountSubscribeParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/subscribe", @@ -81,12 +81,12 @@ func (c Client) Subscribe(id string, params *stripe.FinancialConnectionsAccountS return account, err } -// Unsubscribe is the method for the `POST /v1/financial_connections/accounts/{account}/unsubscribe` API. +// Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. func Unsubscribe(id string, params *stripe.FinancialConnectionsAccountUnsubscribeParams) (*stripe.FinancialConnectionsAccount, error) { return getC().Unsubscribe(id, params) } -// Unsubscribe is the method for the `POST /v1/financial_connections/accounts/{account}/unsubscribe` API. +// Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. func (c Client) Unsubscribe(id string, params *stripe.FinancialConnectionsAccountUnsubscribeParams) (*stripe.FinancialConnectionsAccount, error) { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/unsubscribe", @@ -97,12 +97,12 @@ func (c Client) Unsubscribe(id string, params *stripe.FinancialConnectionsAccoun return account, err } -// List returns a list of financial connections accounts. +// Returns a list of Financial Connections Account objects. func List(params *stripe.FinancialConnectionsAccountListParams) *Iter { return getC().List(params) } -// List returns a list of financial connections accounts. +// Returns a list of Financial Connections Account objects. func (c Client) List(listParams *stripe.FinancialConnectionsAccountListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -136,12 +136,12 @@ func (i *Iter) FinancialConnectionsAccountList() *stripe.FinancialConnectionsAcc return i.List().(*stripe.FinancialConnectionsAccountList) } -// ListOwners is the method for the `GET /v1/financial_connections/accounts/{account}/owners` API. +// Lists all owners for a given Account func ListOwners(params *stripe.FinancialConnectionsAccountListOwnersParams) *OwnerIter { return getC().ListOwners(params) } -// ListOwners is the method for the `GET /v1/financial_connections/accounts/{account}/owners` API. +// Lists all owners for a given Account func (c Client) ListOwners(listParams *stripe.FinancialConnectionsAccountListOwnersParams) *OwnerIter { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/owners", diff --git a/financialconnections/accountinferredbalance/client.go b/financialconnections/accountinferredbalance/client.go index 51d06326bd..16a3be2b5a 100644 --- a/financialconnections/accountinferredbalance/client.go +++ b/financialconnections/accountinferredbalance/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// List returns a list of financial connections account inferred balances. +// Lists the recorded inferred balances for a Financial Connections Account. func List(params *stripe.FinancialConnectionsAccountInferredBalanceListParams) *Iter { return getC().List(params) } -// List returns a list of financial connections account inferred balances. +// Lists the recorded inferred balances for a Financial Connections Account. func (c Client) List(listParams *stripe.FinancialConnectionsAccountInferredBalanceListParams) *Iter { path := stripe.FormatURLPath( "/v1/financial_connections/accounts/%s/inferred_balances", diff --git a/financialconnections/session/client.go b/financialconnections/session/client.go index 11896dd16b..2c4a8bfd32 100644 --- a/financialconnections/session/client.go +++ b/financialconnections/session/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new financial connections session. +// To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. func New(params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { return getC().New(params) } -// New creates a new financial connections session. +// To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. func (c Client) New(params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { session := &stripe.FinancialConnectionsSession{} err := c.B.Call( @@ -37,12 +37,12 @@ func (c Client) New(params *stripe.FinancialConnectionsSessionParams) (*stripe.F return session, err } -// Get returns the details of a financial connections session. +// Retrieves the details of a Financial Connections Session func Get(id string, params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { return getC().Get(id, params) } -// Get returns the details of a financial connections session. +// Retrieves the details of a Financial Connections Session func (c Client) Get(id string, params *stripe.FinancialConnectionsSessionParams) (*stripe.FinancialConnectionsSession, error) { path := stripe.FormatURLPath("/v1/financial_connections/sessions/%s", id) session := &stripe.FinancialConnectionsSession{} diff --git a/financialconnections/transaction/client.go b/financialconnections/transaction/client.go index c2bde58571..b16c39ba26 100644 --- a/financialconnections/transaction/client.go +++ b/financialconnections/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a financial connections transaction. +// Retrieves the details of a Financial Connections Transaction func Get(id string, params *stripe.FinancialConnectionsTransactionParams) (*stripe.FinancialConnectionsTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a financial connections transaction. +// Retrieves the details of a Financial Connections Transaction func (c Client) Get(id string, params *stripe.FinancialConnectionsTransactionParams) (*stripe.FinancialConnectionsTransaction, error) { path := stripe.FormatURLPath("/v1/financial_connections/transactions/%s", id) transaction := &stripe.FinancialConnectionsTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.FinancialConnectionsTransactionPar return transaction, err } -// List returns a list of financial connections transactions. +// Returns a list of Financial Connections Transaction objects. func List(params *stripe.FinancialConnectionsTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of financial connections transactions. +// Returns a list of Financial Connections Transaction objects. func (c Client) List(listParams *stripe.FinancialConnectionsTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/forwarding/request/client.go b/forwarding/request/client.go index 07ccc68fbf..4e60a53945 100644 --- a/forwarding/request/client.go +++ b/forwarding/request/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new forwarding request. +// Creates a ForwardingRequest object. func New(params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { return getC().New(params) } -// New creates a new forwarding request. +// Creates a ForwardingRequest object. func (c Client) New(params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { request := &stripe.ForwardingRequest{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ForwardingRequestParams) (*stripe.ForwardingR return request, err } -// Get returns the details of a forwarding request. +// Retrieves a ForwardingRequest object. func Get(id string, params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { return getC().Get(id, params) } -// Get returns the details of a forwarding request. +// Retrieves a ForwardingRequest object. func (c Client) Get(id string, params *stripe.ForwardingRequestParams) (*stripe.ForwardingRequest, error) { path := stripe.FormatURLPath("/v1/forwarding/requests/%s", id) request := &stripe.ForwardingRequest{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ForwardingRequestParams) (*stripe. return request, err } -// List returns a list of forwarding requests. +// Lists all ForwardingRequest objects. func List(params *stripe.ForwardingRequestListParams) *Iter { return getC().List(params) } -// List returns a list of forwarding requests. +// Lists all ForwardingRequest objects. func (c Client) List(listParams *stripe.ForwardingRequestListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/giftcards/card/client.go b/giftcards/card/client.go index 840b96d4d8..2bd336adec 100644 --- a/giftcards/card/client.go +++ b/giftcards/card/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new gift cards card. +// Creates a new gift card object. func New(params *stripe.GiftCardsCardParams) (*stripe.GiftCardsCard, error) { return getC().New(params) } -// New creates a new gift cards card. +// Creates a new gift card object. func (c Client) New(params *stripe.GiftCardsCardParams) (*stripe.GiftCardsCard, error) { card := &stripe.GiftCardsCard{} err := c.B.Call(http.MethodPost, "/v1/gift_cards/cards", c.Key, params, card) return card, err } -// Get returns the details of a gift cards card. +// Retrieve a gift card by id func Get(id string, params *stripe.GiftCardsCardParams) (*stripe.GiftCardsCard, error) { return getC().Get(id, params) } -// Get returns the details of a gift cards card. +// Retrieve a gift card by id func (c Client) Get(id string, params *stripe.GiftCardsCardParams) (*stripe.GiftCardsCard, error) { path := stripe.FormatURLPath("/v1/gift_cards/cards/%s", id) card := &stripe.GiftCardsCard{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.GiftCardsCardParams) (*stripe.Gift return card, err } -// Update updates a gift cards card's properties. +// Update a gift card func Update(id string, params *stripe.GiftCardsCardParams) (*stripe.GiftCardsCard, error) { return getC().Update(id, params) } -// Update updates a gift cards card's properties. +// Update a gift card func (c Client) Update(id string, params *stripe.GiftCardsCardParams) (*stripe.GiftCardsCard, error) { path := stripe.FormatURLPath("/v1/gift_cards/cards/%s", id) card := &stripe.GiftCardsCard{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.GiftCardsCardParams) (*stripe.G return card, err } -// Validate is the method for the `POST /v1/gift_cards/cards/validate` API. +// Validates a gift card code, returning the matching gift card object if it exists. func Validate(params *stripe.GiftCardsCardValidateParams) (*stripe.GiftCardsCard, error) { return getC().Validate(params) } -// Validate is the method for the `POST /v1/gift_cards/cards/validate` API. +// Validates a gift card code, returning the matching gift card object if it exists. func (c Client) Validate(params *stripe.GiftCardsCardValidateParams) (*stripe.GiftCardsCard, error) { card := &stripe.GiftCardsCard{} err := c.B.Call( @@ -76,12 +76,12 @@ func (c Client) Validate(params *stripe.GiftCardsCardValidateParams) (*stripe.Gi return card, err } -// List returns a list of gift cards cards. +// List gift cards for an account func List(params *stripe.GiftCardsCardListParams) *Iter { return getC().List(params) } -// List returns a list of gift cards cards. +// List gift cards for an account func (c Client) List(listParams *stripe.GiftCardsCardListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/giftcards/transaction/client.go b/giftcards/transaction/client.go index 5b84a6c886..ef7057b84b 100644 --- a/giftcards/transaction/client.go +++ b/giftcards/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new gift cards transaction. +// Create a gift card transaction func New(params *stripe.GiftCardsTransactionParams) (*stripe.GiftCardsTransaction, error) { return getC().New(params) } -// New creates a new gift cards transaction. +// Create a gift card transaction func (c Client) New(params *stripe.GiftCardsTransactionParams) (*stripe.GiftCardsTransaction, error) { transaction := &stripe.GiftCardsTransaction{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.GiftCardsTransactionParams) (*stripe.GiftCard return transaction, err } -// Get returns the details of a gift cards transaction. +// Retrieves the gift card transaction. func Get(id string, params *stripe.GiftCardsTransactionParams) (*stripe.GiftCardsTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a gift cards transaction. +// Retrieves the gift card transaction. func (c Client) Get(id string, params *stripe.GiftCardsTransactionParams) (*stripe.GiftCardsTransaction, error) { path := stripe.FormatURLPath("/v1/gift_cards/transactions/%s", id) transaction := &stripe.GiftCardsTransaction{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.GiftCardsTransactionParams) (*stri return transaction, err } -// Update updates a gift cards transaction's properties. +// Update a gift card transaction func Update(id string, params *stripe.GiftCardsTransactionParams) (*stripe.GiftCardsTransaction, error) { return getC().Update(id, params) } -// Update updates a gift cards transaction's properties. +// Update a gift card transaction func (c Client) Update(id string, params *stripe.GiftCardsTransactionParams) (*stripe.GiftCardsTransaction, error) { path := stripe.FormatURLPath("/v1/gift_cards/transactions/%s", id) transaction := &stripe.GiftCardsTransaction{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.GiftCardsTransactionParams) (*s return transaction, err } -// Cancel is the method for the `POST /v1/gift_cards/transactions/{id}/cancel` API. +// Cancel a gift card transaction func Cancel(id string, params *stripe.GiftCardsTransactionCancelParams) (*stripe.GiftCardsTransaction, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/gift_cards/transactions/{id}/cancel` API. +// Cancel a gift card transaction func (c Client) Cancel(id string, params *stripe.GiftCardsTransactionCancelParams) (*stripe.GiftCardsTransaction, error) { path := stripe.FormatURLPath("/v1/gift_cards/transactions/%s/cancel", id) transaction := &stripe.GiftCardsTransaction{} @@ -77,12 +77,12 @@ func (c Client) Cancel(id string, params *stripe.GiftCardsTransactionCancelParam return transaction, err } -// Confirm is the method for the `POST /v1/gift_cards/transactions/{id}/confirm` API. +// Confirm a gift card transaction func Confirm(id string, params *stripe.GiftCardsTransactionConfirmParams) (*stripe.GiftCardsTransaction, error) { return getC().Confirm(id, params) } -// Confirm is the method for the `POST /v1/gift_cards/transactions/{id}/confirm` API. +// Confirm a gift card transaction func (c Client) Confirm(id string, params *stripe.GiftCardsTransactionConfirmParams) (*stripe.GiftCardsTransaction, error) { path := stripe.FormatURLPath("/v1/gift_cards/transactions/%s/confirm", id) transaction := &stripe.GiftCardsTransaction{} @@ -90,12 +90,12 @@ func (c Client) Confirm(id string, params *stripe.GiftCardsTransactionConfirmPar return transaction, err } -// List returns a list of gift cards transactions. +// List gift card transactions for a gift card func List(params *stripe.GiftCardsTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of gift cards transactions. +// List gift card transactions for a gift card func (c Client) List(listParams *stripe.GiftCardsTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/identity/verificationreport/client.go b/identity/verificationreport/client.go index fbbf25450a..df6aadd599 100644 --- a/identity/verificationreport/client.go +++ b/identity/verificationreport/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an identity verification report. +// Retrieves an existing VerificationReport func Get(id string, params *stripe.IdentityVerificationReportParams) (*stripe.IdentityVerificationReport, error) { return getC().Get(id, params) } -// Get returns the details of an identity verification report. +// Retrieves an existing VerificationReport func (c Client) Get(id string, params *stripe.IdentityVerificationReportParams) (*stripe.IdentityVerificationReport, error) { path := stripe.FormatURLPath("/v1/identity/verification_reports/%s", id) verificationreport := &stripe.IdentityVerificationReport{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IdentityVerificationReportParams) return verificationreport, err } -// List returns a list of identity verification reports. +// List all verification reports. func List(params *stripe.IdentityVerificationReportListParams) *Iter { return getC().List(params) } -// List returns a list of identity verification reports. +// List all verification reports. func (c Client) List(listParams *stripe.IdentityVerificationReportListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/identity/verificationsession/client.go b/identity/verificationsession/client.go index f8c93dbc30..24504b85a2 100644 --- a/identity/verificationsession/client.go +++ b/identity/verificationsession/client.go @@ -20,12 +20,24 @@ type Client struct { Key string } -// New creates a new identity verification session. +// Creates a VerificationSession object. +// +// After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. +// +// If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. +// +// Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) func New(params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { return getC().New(params) } -// New creates a new identity verification session. +// Creates a VerificationSession object. +// +// After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. +// +// If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. +// +// Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) func (c Client) New(params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { verificationsession := &stripe.IdentityVerificationSession{} err := c.B.Call( @@ -38,12 +50,18 @@ func (c Client) New(params *stripe.IdentityVerificationSessionParams) (*stripe.I return verificationsession, err } -// Get returns the details of an identity verification session. +// Retrieves the details of a VerificationSession that was previously created. +// +// When the session status is requires_input, you can use this method to retrieve a valid +// client_secret or url to allow re-submission. func Get(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { return getC().Get(id, params) } -// Get returns the details of an identity verification session. +// Retrieves the details of a VerificationSession that was previously created. +// +// When the session status is requires_input, you can use this method to retrieve a valid +// client_secret or url to allow re-submission. func (c Client) Get(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath("/v1/identity/verification_sessions/%s", id) verificationsession := &stripe.IdentityVerificationSession{} @@ -51,12 +69,18 @@ func (c Client) Get(id string, params *stripe.IdentityVerificationSessionParams) return verificationsession, err } -// Update updates an identity verification session's properties. +// Updates a VerificationSession object. +// +// When the session status is requires_input, you can use this method to update the +// verification check and options. func Update(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { return getC().Update(id, params) } -// Update updates an identity verification session's properties. +// Updates a VerificationSession object. +// +// When the session status is requires_input, you can use this method to update the +// verification check and options. func (c Client) Update(id string, params *stripe.IdentityVerificationSessionParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath("/v1/identity/verification_sessions/%s", id) verificationsession := &stripe.IdentityVerificationSession{} @@ -64,12 +88,16 @@ func (c Client) Update(id string, params *stripe.IdentityVerificationSessionPara return verificationsession, err } -// Cancel is the method for the `POST /v1/identity/verification_sessions/{session}/cancel` API. +// A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). +// +// Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). func Cancel(id string, params *stripe.IdentityVerificationSessionCancelParams) (*stripe.IdentityVerificationSession, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/identity/verification_sessions/{session}/cancel` API. +// A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). +// +// Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). func (c Client) Cancel(id string, params *stripe.IdentityVerificationSessionCancelParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath( "/v1/identity/verification_sessions/%s/cancel", @@ -80,12 +108,48 @@ func (c Client) Cancel(id string, params *stripe.IdentityVerificationSessionCanc return verificationsession, err } -// Redact is the method for the `POST /v1/identity/verification_sessions/{session}/redact` API. +// Redact a VerificationSession to remove all collected information from Stripe. This will redact +// the VerificationSession and all objects related to it, including VerificationReports, Events, +// request logs, etc. +// +// A VerificationSession object can be redacted when it is in requires_input or verified +// [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action +// state will automatically cancel it. +// +// The redaction process may take up to four days. When the redaction process is in progress, the +// VerificationSession's redaction.status field will be set to processing; when the process is +// finished, it will change to redacted and an identity.verification_session.redacted event +// will be emitted. +// +// Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the +// fields that contain personal data will be replaced by the string [redacted] or a similar +// placeholder. The metadata field will also be erased. Redacted objects cannot be updated or +// used for any purpose. +// +// [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). func Redact(id string, params *stripe.IdentityVerificationSessionRedactParams) (*stripe.IdentityVerificationSession, error) { return getC().Redact(id, params) } -// Redact is the method for the `POST /v1/identity/verification_sessions/{session}/redact` API. +// Redact a VerificationSession to remove all collected information from Stripe. This will redact +// the VerificationSession and all objects related to it, including VerificationReports, Events, +// request logs, etc. +// +// A VerificationSession object can be redacted when it is in requires_input or verified +// [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action +// state will automatically cancel it. +// +// The redaction process may take up to four days. When the redaction process is in progress, the +// VerificationSession's redaction.status field will be set to processing; when the process is +// finished, it will change to redacted and an identity.verification_session.redacted event +// will be emitted. +// +// Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the +// fields that contain personal data will be replaced by the string [redacted] or a similar +// placeholder. The metadata field will also be erased. Redacted objects cannot be updated or +// used for any purpose. +// +// [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). func (c Client) Redact(id string, params *stripe.IdentityVerificationSessionRedactParams) (*stripe.IdentityVerificationSession, error) { path := stripe.FormatURLPath( "/v1/identity/verification_sessions/%s/redact", @@ -96,12 +160,12 @@ func (c Client) Redact(id string, params *stripe.IdentityVerificationSessionReda return verificationsession, err } -// List returns a list of identity verification sessions. +// Returns a list of VerificationSessions func List(params *stripe.IdentityVerificationSessionListParams) *Iter { return getC().List(params) } -// List returns a list of identity verification sessions. +// Returns a list of VerificationSessions func (c Client) List(listParams *stripe.IdentityVerificationSessionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/invoice/client.go b/invoice/client.go index 4122df1038..5076e32d85 100644 --- a/invoice/client.go +++ b/invoice/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new invoice. +// 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. func New(params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().New(params) } -// New creates a new invoice. +// 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. func (c Client) New(params *stripe.InvoiceParams) (*stripe.Invoice, error) { invoice := &stripe.Invoice{} err := c.B.Call(http.MethodPost, "/v1/invoices", c.Key, params, invoice) return invoice, err } -// Get returns the details of an invoice. +// Retrieves the invoice with the given ID. func Get(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Get(id, params) } -// Get returns the details of an invoice. +// Retrieves the invoice with the given ID. func (c Client) Get(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s", id) invoice := &stripe.Invoice{} @@ -45,12 +45,22 @@ func (c Client) Get(id string, params *stripe.InvoiceParams) (*stripe.Invoice, e return invoice, err } -// Update updates an invoice's properties. +// Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), +// monetary values, as well as collection_method, become uneditable. +// +// If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, +// sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass +// auto_advance=false. func Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Update(id, params) } -// Update updates an invoice's properties. +// Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), +// monetary values, as well as collection_method, become uneditable. +// +// If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, +// sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass +// auto_advance=false. func (c Client) Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s", id) invoice := &stripe.Invoice{} @@ -58,12 +68,12 @@ func (c Client) Update(id string, params *stripe.InvoiceParams) (*stripe.Invoice return invoice, err } -// Del removes an invoice. +// Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). func Del(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { return getC().Del(id, params) } -// Del removes an invoice. +// Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). func (c Client) Del(id string, params *stripe.InvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s", id) invoice := &stripe.Invoice{} @@ -71,12 +81,12 @@ func (c Client) Del(id string, params *stripe.InvoiceParams) (*stripe.Invoice, e return invoice, err } -// AddLines is the method for the `POST /v1/invoices/{invoice}/add_lines` API. +// Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. func AddLines(id string, params *stripe.InvoiceAddLinesParams) (*stripe.Invoice, error) { return getC().AddLines(id, params) } -// AddLines is the method for the `POST /v1/invoices/{invoice}/add_lines` API. +// Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. func (c Client) AddLines(id string, params *stripe.InvoiceAddLinesParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/add_lines", id) invoice := &stripe.Invoice{} @@ -84,12 +94,28 @@ func (c Client) AddLines(id string, params *stripe.InvoiceAddLinesParams) (*stri return invoice, err } -// AttachPaymentIntent is the method for the `POST /v1/invoices/{invoice}/attach_payment_intent` API. +// Attaches a PaymentIntent to the invoice, adding it to the list of payments. +// When the PaymentIntent's status changes to succeeded, the payment is credited +// to the invoice, increasing its amount_paid. When the invoice is fully paid, the +// invoice's status becomes paid. +// +// If the PaymentIntent's status is already succeeded when it is attached, it is +// credited to the invoice immediately. +// +// Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) func AttachPaymentIntent(id string, params *stripe.InvoiceAttachPaymentIntentParams) (*stripe.Invoice, error) { return getC().AttachPaymentIntent(id, params) } -// AttachPaymentIntent is the method for the `POST /v1/invoices/{invoice}/attach_payment_intent` API. +// Attaches a PaymentIntent to the invoice, adding it to the list of payments. +// When the PaymentIntent's status changes to succeeded, the payment is credited +// to the invoice, increasing its amount_paid. When the invoice is fully paid, the +// invoice's status becomes paid. +// +// If the PaymentIntent's status is already succeeded when it is attached, it is +// credited to the invoice immediately. +// +// Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create) func (c Client) AttachPaymentIntent(id string, params *stripe.InvoiceAttachPaymentIntentParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/attach_payment_intent", id) invoice := &stripe.Invoice{} @@ -97,12 +123,24 @@ func (c Client) AttachPaymentIntent(id string, params *stripe.InvoiceAttachPayme return invoice, err } -// CreatePreview is the method for the `POST /v1/invoices/create_preview` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func CreatePreview(params *stripe.InvoiceCreatePreviewParams) (*stripe.Invoice, error) { return getC().CreatePreview(params) } -// CreatePreview is the method for the `POST /v1/invoices/create_preview` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func (c Client) CreatePreview(params *stripe.InvoiceCreatePreviewParams) (*stripe.Invoice, error) { invoice := &stripe.Invoice{} err := c.B.Call( @@ -115,12 +153,12 @@ func (c Client) CreatePreview(params *stripe.InvoiceCreatePreviewParams) (*strip return invoice, err } -// FinalizeInvoice is the method for the `POST /v1/invoices/{invoice}/finalize` API. +// Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. func FinalizeInvoice(id string, params *stripe.InvoiceFinalizeInvoiceParams) (*stripe.Invoice, error) { return getC().FinalizeInvoice(id, params) } -// FinalizeInvoice is the method for the `POST /v1/invoices/{invoice}/finalize` API. +// Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. func (c Client) FinalizeInvoice(id string, params *stripe.InvoiceFinalizeInvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/finalize", id) invoice := &stripe.Invoice{} @@ -128,12 +166,12 @@ func (c Client) FinalizeInvoice(id string, params *stripe.InvoiceFinalizeInvoice return invoice, err } -// MarkUncollectible is the method for the `POST /v1/invoices/{invoice}/mark_uncollectible` API. +// Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. func MarkUncollectible(id string, params *stripe.InvoiceMarkUncollectibleParams) (*stripe.Invoice, error) { return getC().MarkUncollectible(id, params) } -// MarkUncollectible is the method for the `POST /v1/invoices/{invoice}/mark_uncollectible` API. +// Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. func (c Client) MarkUncollectible(id string, params *stripe.InvoiceMarkUncollectibleParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/mark_uncollectible", id) invoice := &stripe.Invoice{} @@ -141,12 +179,12 @@ func (c Client) MarkUncollectible(id string, params *stripe.InvoiceMarkUncollect return invoice, err } -// Pay is the method for the `POST /v1/invoices/{invoice}/pay` API. +// Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. func Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice, error) { return getC().Pay(id, params) } -// Pay is the method for the `POST /v1/invoices/{invoice}/pay` API. +// Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. func (c Client) Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/pay", id) invoice := &stripe.Invoice{} @@ -154,12 +192,12 @@ func (c Client) Pay(id string, params *stripe.InvoicePayParams) (*stripe.Invoice return invoice, err } -// RemoveLines is the method for the `POST /v1/invoices/{invoice}/remove_lines` API. +// Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. func RemoveLines(id string, params *stripe.InvoiceRemoveLinesParams) (*stripe.Invoice, error) { return getC().RemoveLines(id, params) } -// RemoveLines is the method for the `POST /v1/invoices/{invoice}/remove_lines` API. +// Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. func (c Client) RemoveLines(id string, params *stripe.InvoiceRemoveLinesParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/remove_lines", id) invoice := &stripe.Invoice{} @@ -167,12 +205,16 @@ func (c Client) RemoveLines(id string, params *stripe.InvoiceRemoveLinesParams) return invoice, err } -// SendInvoice is the method for the `POST /v1/invoices/{invoice}/send` API. +// Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. +// +// Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. func SendInvoice(id string, params *stripe.InvoiceSendInvoiceParams) (*stripe.Invoice, error) { return getC().SendInvoice(id, params) } -// SendInvoice is the method for the `POST /v1/invoices/{invoice}/send` API. +// Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. +// +// Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. func (c Client) SendInvoice(id string, params *stripe.InvoiceSendInvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/send", id) invoice := &stripe.Invoice{} @@ -180,12 +222,24 @@ func (c Client) SendInvoice(id string, params *stripe.InvoiceSendInvoiceParams) return invoice, err } -// Upcoming is the method for the `GET /v1/invoices/upcoming` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func Upcoming(params *stripe.InvoiceUpcomingParams) (*stripe.Invoice, error) { return getC().Upcoming(params) } -// Upcoming is the method for the `GET /v1/invoices/upcoming` API. +// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. +// +// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. +// +// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. +// +// Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) func (c Client) Upcoming(params *stripe.InvoiceUpcomingParams) (*stripe.Invoice, error) { invoice := &stripe.Invoice{} err := c.B.Call( @@ -198,12 +252,12 @@ func (c Client) Upcoming(params *stripe.InvoiceUpcomingParams) (*stripe.Invoice, return invoice, err } -// UpdateLines is the method for the `POST /v1/invoices/{invoice}/update_lines` API. +// Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. func UpdateLines(id string, params *stripe.InvoiceUpdateLinesParams) (*stripe.Invoice, error) { return getC().UpdateLines(id, params) } -// UpdateLines is the method for the `POST /v1/invoices/{invoice}/update_lines` API. +// Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. func (c Client) UpdateLines(id string, params *stripe.InvoiceUpdateLinesParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/update_lines", id) invoice := &stripe.Invoice{} @@ -211,12 +265,16 @@ func (c Client) UpdateLines(id string, params *stripe.InvoiceUpdateLinesParams) return invoice, err } -// VoidInvoice is the method for the `POST /v1/invoices/{invoice}/void` API. +// Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. +// +// Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. func VoidInvoice(id string, params *stripe.InvoiceVoidInvoiceParams) (*stripe.Invoice, error) { return getC().VoidInvoice(id, params) } -// VoidInvoice is the method for the `POST /v1/invoices/{invoice}/void` API. +// Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. +// +// Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. func (c Client) VoidInvoice(id string, params *stripe.InvoiceVoidInvoiceParams) (*stripe.Invoice, error) { path := stripe.FormatURLPath("/v1/invoices/%s/void", id) invoice := &stripe.Invoice{} @@ -224,12 +282,12 @@ func (c Client) VoidInvoice(id string, params *stripe.InvoiceVoidInvoiceParams) return invoice, err } -// List returns a list of invoices. +// You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. func List(params *stripe.InvoiceListParams) *Iter { return getC().List(params) } -// List returns a list of invoices. +// You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. func (c Client) List(listParams *stripe.InvoiceListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -263,12 +321,12 @@ func (i *Iter) InvoiceList() *stripe.InvoiceList { return i.List().(*stripe.InvoiceList) } -// ListLines is the method for the `GET /v1/invoices/{invoice}/lines` API. +// When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLines(params *stripe.InvoiceListLinesParams) *LineItemIter { return getC().ListLines(params) } -// ListLines is the method for the `GET /v1/invoices/{invoice}/lines` API. +// When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLines(listParams *stripe.InvoiceListLinesParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/invoices/%s/lines", @@ -289,12 +347,12 @@ func (c Client) ListLines(listParams *stripe.InvoiceListLinesParams) *LineItemIt } } -// UpcomingLines is the method for the `GET /v1/invoices/upcoming/lines` API. +// When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func UpcomingLines(params *stripe.InvoiceUpcomingLinesParams) *LineItemIter { return getC().UpcomingLines(params) } -// UpcomingLines is the method for the `GET /v1/invoices/upcoming/lines` API. +// When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) UpcomingLines(listParams *stripe.InvoiceUpcomingLinesParams) *LineItemIter { return &LineItemIter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -328,12 +386,18 @@ func (i *LineItemIter) InvoiceLineItemList() *stripe.InvoiceLineItemList { return i.List().(*stripe.InvoiceLineItemList) } -// Search returns a search result containing invoices. +// Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.InvoiceSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing invoices. +// Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.InvoiceSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/invoiceitem/client.go b/invoiceitem/client.go index b69701c607..71495d2268 100644 --- a/invoiceitem/client.go +++ b/invoiceitem/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new invoice item. +// Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. func New(params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().New(params) } -// New creates a new invoice item. +// Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. func (c Client) New(params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { invoiceitem := &stripe.InvoiceItem{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, erro return invoiceitem, err } -// Get returns the details of an invoice item. +// Retrieves the invoice item with the given ID. func Get(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().Get(id, params) } -// Get returns the details of an invoice item. +// Retrieves the invoice item with the given ID. func (c Client) Get(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) invoiceitem := &stripe.InvoiceItem{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.InvoiceItemParams) (*stripe.Invoic return invoiceitem, err } -// Update updates an invoice item's properties. +// Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. func Update(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().Update(id, params) } -// Update updates an invoice item's properties. +// Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. func (c Client) Update(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) invoiceitem := &stripe.InvoiceItem{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.InvoiceItemParams) (*stripe.Inv return invoiceitem, err } -// Del removes an invoice item. +// Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. func Del(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { return getC().Del(id, params) } -// Del removes an invoice item. +// Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. func (c Client) Del(id string, params *stripe.InvoiceItemParams) (*stripe.InvoiceItem, error) { path := stripe.FormatURLPath("/v1/invoiceitems/%s", id) invoiceitem := &stripe.InvoiceItem{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.InvoiceItemParams) (*stripe.Invoic return invoiceitem, err } -// List returns a list of invoice items. +// Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. func List(params *stripe.InvoiceItemListParams) *Iter { return getC().List(params) } -// List returns a list of invoice items. +// Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. func (c Client) List(listParams *stripe.InvoiceItemListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/invoicelineitem/client.go b/invoicelineitem/client.go index 1ed7f58e96..3e08877c32 100644 --- a/invoicelineitem/client.go +++ b/invoicelineitem/client.go @@ -19,12 +19,18 @@ type Client struct { Key string } -// Update updates an invoice line item's properties. +// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, +// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice +// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. +// Updating an invoice's line item is only possible before the invoice is finalized. func Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { return getC().Update(id, params) } -// Update updates an invoice line item's properties. +// Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, +// so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice +// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. +// Updating an invoice's line item is only possible before the invoice is finalized. func (c Client) Update(id string, params *stripe.InvoiceLineItemParams) (*stripe.InvoiceLineItem, error) { path := stripe.FormatURLPath( "/v1/invoices/%s/lines/%s", diff --git a/invoicepayment/client.go b/invoicepayment/client.go index c1afb56e47..c9a208d9a0 100644 --- a/invoicepayment/client.go +++ b/invoicepayment/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an invoice payment. +// Retrieves the invoice payment with the given ID. func Get(id string, params *stripe.InvoicePaymentParams) (*stripe.InvoicePayment, error) { return getC().Get(id, params) } -// Get returns the details of an invoice payment. +// Retrieves the invoice payment with the given ID. func (c Client) Get(id string, params *stripe.InvoicePaymentParams) (*stripe.InvoicePayment, error) { path := stripe.FormatURLPath( "/v1/invoices/%s/payments/%s", @@ -37,12 +37,12 @@ func (c Client) Get(id string, params *stripe.InvoicePaymentParams) (*stripe.Inv return invoicepayment, err } -// List returns a list of invoice payments. +// When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. func List(params *stripe.InvoicePaymentListParams) *Iter { return getC().List(params) } -// List returns a list of invoice payments. +// When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments. func (c Client) List(listParams *stripe.InvoicePaymentListParams) *Iter { path := stripe.FormatURLPath( "/v1/invoices/%s/payments", diff --git a/issuing/authorization/client.go b/issuing/authorization/client.go index 64d6f567a9..7c89910042 100644 --- a/issuing/authorization/client.go +++ b/issuing/authorization/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing authorization. +// Retrieves an Issuing Authorization object. func Get(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().Get(id, params) } -// Get returns the details of an issuing authorization. +// Retrieves an Issuing Authorization object. func (c Client) Get(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s", id) authorization := &stripe.IssuingAuthorization{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingAuthorizationParams) (*stri return authorization, err } -// Update updates an issuing authorization's properties. +// Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().Update(id, params) } -// Update updates an issuing authorization's properties. +// Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s", id) authorization := &stripe.IssuingAuthorization{} @@ -46,13 +46,15 @@ func (c Client) Update(id string, params *stripe.IssuingAuthorizationParams) (*s return authorization, err } -// Approve is the method for the `POST /v1/issuing/authorizations/{authorization}/approve` API. +// [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func Approve(id string, params *stripe.IssuingAuthorizationApproveParams) (*stripe.IssuingAuthorization, error) { return getC().Approve(id, params) } -// Approve is the method for the `POST /v1/issuing/authorizations/{authorization}/approve` API. +// [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func (c Client) Approve(id string, params *stripe.IssuingAuthorizationApproveParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s/approve", id) @@ -61,13 +63,15 @@ func (c Client) Approve(id string, params *stripe.IssuingAuthorizationApprovePar return authorization, err } -// Decline is the method for the `POST /v1/issuing/authorizations/{authorization}/decline` API. +// [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func Decline(id string, params *stripe.IssuingAuthorizationDeclineParams) (*stripe.IssuingAuthorization, error) { return getC().Decline(id, params) } -// Decline is the method for the `POST /v1/issuing/authorizations/{authorization}/decline` API. +// [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. +// This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). // Deprecated: func (c Client) Decline(id string, params *stripe.IssuingAuthorizationDeclineParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s/decline", id) @@ -76,12 +80,12 @@ func (c Client) Decline(id string, params *stripe.IssuingAuthorizationDeclinePar return authorization, err } -// List returns a list of issuing authorizations. +// Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingAuthorizationListParams) *Iter { return getC().List(params) } -// List returns a list of issuing authorizations. +// Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingAuthorizationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/card/client.go b/issuing/card/client.go index 57f08913a0..f5f068758e 100644 --- a/issuing/card/client.go +++ b/issuing/card/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new issuing card. +// Creates an Issuing Card object. func New(params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { return getC().New(params) } -// New creates a new issuing card. +// Creates an Issuing Card object. func (c Client) New(params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { card := &stripe.IssuingCard{} err := c.B.Call(http.MethodPost, "/v1/issuing/cards", c.Key, params, card) return card, err } -// Get returns the details of an issuing card. +// Retrieves an Issuing Card object. func Get(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { return getC().Get(id, params) } -// Get returns the details of an issuing card. +// Retrieves an Issuing Card object. func (c Client) Get(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath("/v1/issuing/cards/%s", id) card := &stripe.IssuingCard{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.IssuingCardParams) (*stripe.Issuin return card, err } -// Update updates an issuing card's properties. +// Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { return getC().Update(id, params) } -// Update updates an issuing card's properties. +// Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath("/v1/issuing/cards/%s", id) card := &stripe.IssuingCard{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.IssuingCardParams) (*stripe.Iss return card, err } -// List returns a list of issuing cards. +// Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingCardListParams) *Iter { return getC().List(params) } -// List returns a list of issuing cards. +// Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingCardListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/cardholder/client.go b/issuing/cardholder/client.go index dee93f095b..20f8643ca3 100644 --- a/issuing/cardholder/client.go +++ b/issuing/cardholder/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new issuing cardholder. +// Creates a new Issuing Cardholder object that can be issued cards. func New(params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { return getC().New(params) } -// New creates a new issuing cardholder. +// Creates a new Issuing Cardholder object that can be issued cards. func (c Client) New(params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { cardholder := &stripe.IssuingCardholder{} err := c.B.Call( @@ -39,12 +39,12 @@ func (c Client) New(params *stripe.IssuingCardholderParams) (*stripe.IssuingCard return cardholder, err } -// Get returns the details of an issuing cardholder. +// Retrieves an Issuing Cardholder object. func Get(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { return getC().Get(id, params) } -// Get returns the details of an issuing cardholder. +// Retrieves an Issuing Cardholder object. func (c Client) Get(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { path := stripe.FormatURLPath("/v1/issuing/cardholders/%s", id) cardholder := &stripe.IssuingCardholder{} @@ -52,12 +52,12 @@ func (c Client) Get(id string, params *stripe.IssuingCardholderParams) (*stripe. return cardholder, err } -// Update updates an issuing cardholder's properties. +// Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { return getC().Update(id, params) } -// Update updates an issuing cardholder's properties. +// Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingCardholderParams) (*stripe.IssuingCardholder, error) { path := stripe.FormatURLPath("/v1/issuing/cardholders/%s", id) cardholder := &stripe.IssuingCardholder{} @@ -65,12 +65,12 @@ func (c Client) Update(id string, params *stripe.IssuingCardholderParams) (*stri return cardholder, err } -// List returns a list of issuing cardholders. +// Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingCardholderListParams) *Iter { return getC().List(params) } -// List returns a list of issuing cardholders. +// Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingCardholderListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/creditunderwritingrecord/client.go b/issuing/creditunderwritingrecord/client.go index 1555ee6044..e03946b080 100644 --- a/issuing/creditunderwritingrecord/client.go +++ b/issuing/creditunderwritingrecord/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing credit underwriting record. +// Retrieves a CreditUnderwritingRecord object. func Get(id string, params *stripe.IssuingCreditUnderwritingRecordParams) (*stripe.IssuingCreditUnderwritingRecord, error) { return getC().Get(id, params) } -// Get returns the details of an issuing credit underwriting record. +// Retrieves a CreditUnderwritingRecord object. func (c Client) Get(id string, params *stripe.IssuingCreditUnderwritingRecordParams) (*stripe.IssuingCreditUnderwritingRecord, error) { path := stripe.FormatURLPath("/v1/issuing/credit_underwriting_records/%s", id) creditunderwritingrecord := &stripe.IssuingCreditUnderwritingRecord{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingCreditUnderwritingRecordPar return creditunderwritingrecord, err } -// Correct is the method for the `POST /v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct` API. +// Update a CreditUnderwritingRecord object to correct mistakes. func Correct(id string, params *stripe.IssuingCreditUnderwritingRecordCorrectParams) (*stripe.IssuingCreditUnderwritingRecord, error) { return getC().Correct(id, params) } -// Correct is the method for the `POST /v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct` API. +// Update a CreditUnderwritingRecord object to correct mistakes. func (c Client) Correct(id string, params *stripe.IssuingCreditUnderwritingRecordCorrectParams) (*stripe.IssuingCreditUnderwritingRecord, error) { path := stripe.FormatURLPath( "/v1/issuing/credit_underwriting_records/%s/correct", @@ -55,12 +55,12 @@ func (c Client) Correct(id string, params *stripe.IssuingCreditUnderwritingRecor return creditunderwritingrecord, err } -// CreateFromApplication is the method for the `POST /v1/issuing/credit_underwriting_records/create_from_application` API. +// Creates a CreditUnderwritingRecord object with information about a credit application submission. func CreateFromApplication(params *stripe.IssuingCreditUnderwritingRecordCreateFromApplicationParams) (*stripe.IssuingCreditUnderwritingRecord, error) { return getC().CreateFromApplication(params) } -// CreateFromApplication is the method for the `POST /v1/issuing/credit_underwriting_records/create_from_application` API. +// Creates a CreditUnderwritingRecord object with information about a credit application submission. func (c Client) CreateFromApplication(params *stripe.IssuingCreditUnderwritingRecordCreateFromApplicationParams) (*stripe.IssuingCreditUnderwritingRecord, error) { creditunderwritingrecord := &stripe.IssuingCreditUnderwritingRecord{} err := c.B.Call( @@ -73,12 +73,12 @@ func (c Client) CreateFromApplication(params *stripe.IssuingCreditUnderwritingRe return creditunderwritingrecord, err } -// CreateFromProactiveReview is the method for the `POST /v1/issuing/credit_underwriting_records/create_from_proactive_review` API. +// Creates a CreditUnderwritingRecord object from an underwriting decision coming from a proactive review of an existing accountholder. func CreateFromProactiveReview(params *stripe.IssuingCreditUnderwritingRecordCreateFromProactiveReviewParams) (*stripe.IssuingCreditUnderwritingRecord, error) { return getC().CreateFromProactiveReview(params) } -// CreateFromProactiveReview is the method for the `POST /v1/issuing/credit_underwriting_records/create_from_proactive_review` API. +// Creates a CreditUnderwritingRecord object from an underwriting decision coming from a proactive review of an existing accountholder. func (c Client) CreateFromProactiveReview(params *stripe.IssuingCreditUnderwritingRecordCreateFromProactiveReviewParams) (*stripe.IssuingCreditUnderwritingRecord, error) { creditunderwritingrecord := &stripe.IssuingCreditUnderwritingRecord{} err := c.B.Call( @@ -91,12 +91,12 @@ func (c Client) CreateFromProactiveReview(params *stripe.IssuingCreditUnderwriti return creditunderwritingrecord, err } -// ReportDecision is the method for the `POST /v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision` API. +// Update a CreditUnderwritingRecord object from a decision made on a credit application. func ReportDecision(id string, params *stripe.IssuingCreditUnderwritingRecordReportDecisionParams) (*stripe.IssuingCreditUnderwritingRecord, error) { return getC().ReportDecision(id, params) } -// ReportDecision is the method for the `POST /v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision` API. +// Update a CreditUnderwritingRecord object from a decision made on a credit application. func (c Client) ReportDecision(id string, params *stripe.IssuingCreditUnderwritingRecordReportDecisionParams) (*stripe.IssuingCreditUnderwritingRecord, error) { path := stripe.FormatURLPath( "/v1/issuing/credit_underwriting_records/%s/report_decision", @@ -113,12 +113,12 @@ func (c Client) ReportDecision(id string, params *stripe.IssuingCreditUnderwriti return creditunderwritingrecord, err } -// List returns a list of issuing credit underwriting records. +// Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. func List(params *stripe.IssuingCreditUnderwritingRecordListParams) *Iter { return getC().List(params) } -// List returns a list of issuing credit underwriting records. +// Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. func (c Client) List(listParams *stripe.IssuingCreditUnderwritingRecordListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/dispute/client.go b/issuing/dispute/client.go index f29eb63a69..92f8218577 100644 --- a/issuing/dispute/client.go +++ b/issuing/dispute/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new issuing dispute. +// Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. func New(params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().New(params) } -// New creates a new issuing dispute. +// Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. func (c Client) New(params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { dispute := &stripe.IssuingDispute{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute return dispute, err } -// Get returns the details of an issuing dispute. +// Retrieves an Issuing Dispute object. func Get(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().Get(id, params) } -// Get returns the details of an issuing dispute. +// Retrieves an Issuing Dispute object. func (c Client) Get(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { path := stripe.FormatURLPath("/v1/issuing/disputes/%s", id) dispute := &stripe.IssuingDispute{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.IssuingDisputeParams) (*stripe.Iss return dispute, err } -// Update updates an issuing dispute's properties. +// Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. func Update(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { return getC().Update(id, params) } -// Update updates an issuing dispute's properties. +// Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. func (c Client) Update(id string, params *stripe.IssuingDisputeParams) (*stripe.IssuingDispute, error) { path := stripe.FormatURLPath("/v1/issuing/disputes/%s", id) dispute := &stripe.IssuingDispute{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.IssuingDisputeParams) (*stripe. return dispute, err } -// Submit is the method for the `POST /v1/issuing/disputes/{dispute}/submit` API. +// Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). func Submit(id string, params *stripe.IssuingDisputeSubmitParams) (*stripe.IssuingDispute, error) { return getC().Submit(id, params) } -// Submit is the method for the `POST /v1/issuing/disputes/{dispute}/submit` API. +// Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). func (c Client) Submit(id string, params *stripe.IssuingDisputeSubmitParams) (*stripe.IssuingDispute, error) { path := stripe.FormatURLPath("/v1/issuing/disputes/%s/submit", id) dispute := &stripe.IssuingDispute{} @@ -77,12 +77,12 @@ func (c Client) Submit(id string, params *stripe.IssuingDisputeSubmitParams) (*s return dispute, err } -// List returns a list of issuing disputes. +// Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingDisputeListParams) *Iter { return getC().List(params) } -// List returns a list of issuing disputes. +// Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingDisputeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/personalizationdesign/client.go b/issuing/personalizationdesign/client.go index 7b17ab85d4..f4a4cd83db 100644 --- a/issuing/personalizationdesign/client.go +++ b/issuing/personalizationdesign/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new issuing personalization design. +// Creates a personalization design object. func New(params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().New(params) } -// New creates a new issuing personalization design. +// Creates a personalization design object. func (c Client) New(params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { personalizationdesign := &stripe.IssuingPersonalizationDesign{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.IssuingPersonalizationDesignParams) (*stripe. return personalizationdesign, err } -// Get returns the details of an issuing personalization design. +// Retrieves a personalization design object. func Get(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Get(id, params) } -// Get returns the details of an issuing personalization design. +// Retrieves a personalization design object. func (c Client) Get(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath("/v1/issuing/personalization_designs/%s", id) personalizationdesign := &stripe.IssuingPersonalizationDesign{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.IssuingPersonalizationDesignParams return personalizationdesign, err } -// Update updates an issuing personalization design's properties. +// Updates a card personalization object. func Update(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Update(id, params) } -// Update updates an issuing personalization design's properties. +// Updates a card personalization object. func (c Client) Update(id string, params *stripe.IssuingPersonalizationDesignParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath("/v1/issuing/personalization_designs/%s", id) personalizationdesign := &stripe.IssuingPersonalizationDesign{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.IssuingPersonalizationDesignPar return personalizationdesign, err } -// List returns a list of issuing personalization designs. +// Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingPersonalizationDesignListParams) *Iter { return getC().List(params) } -// List returns a list of issuing personalization designs. +// Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingPersonalizationDesignListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/physicalbundle/client.go b/issuing/physicalbundle/client.go index a07a6d24f2..364bcb1cf2 100644 --- a/issuing/physicalbundle/client.go +++ b/issuing/physicalbundle/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing physical bundle. +// Retrieves a physical bundle object. func Get(id string, params *stripe.IssuingPhysicalBundleParams) (*stripe.IssuingPhysicalBundle, error) { return getC().Get(id, params) } -// Get returns the details of an issuing physical bundle. +// Retrieves a physical bundle object. func (c Client) Get(id string, params *stripe.IssuingPhysicalBundleParams) (*stripe.IssuingPhysicalBundle, error) { path := stripe.FormatURLPath("/v1/issuing/physical_bundles/%s", id) physicalbundle := &stripe.IssuingPhysicalBundle{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingPhysicalBundleParams) (*str return physicalbundle, err } -// List returns a list of issuing physical bundles. +// Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingPhysicalBundleListParams) *Iter { return getC().List(params) } -// List returns a list of issuing physical bundles. +// Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingPhysicalBundleListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/token/client.go b/issuing/token/client.go index bff28fd2b2..83354489cf 100644 --- a/issuing/token/client.go +++ b/issuing/token/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing token. +// Retrieves an Issuing Token object. func Get(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { return getC().Get(id, params) } -// Get returns the details of an issuing token. +// Retrieves an Issuing Token object. func (c Client) Get(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { path := stripe.FormatURLPath("/v1/issuing/tokens/%s", id) token := &stripe.IssuingToken{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingTokenParams) (*stripe.Issui return token, err } -// Update updates an issuing token's properties. +// Attempts to update the specified Issuing Token object to the status specified. func Update(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { return getC().Update(id, params) } -// Update updates an issuing token's properties. +// Attempts to update the specified Issuing Token object to the status specified. func (c Client) Update(id string, params *stripe.IssuingTokenParams) (*stripe.IssuingToken, error) { path := stripe.FormatURLPath("/v1/issuing/tokens/%s", id) token := &stripe.IssuingToken{} @@ -46,12 +46,12 @@ func (c Client) Update(id string, params *stripe.IssuingTokenParams) (*stripe.Is return token, err } -// List returns a list of issuing tokens. +// Lists all Issuing Token objects for a given card. func List(params *stripe.IssuingTokenListParams) *Iter { return getC().List(params) } -// List returns a list of issuing tokens. +// Lists all Issuing Token objects for a given card. func (c Client) List(listParams *stripe.IssuingTokenListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/issuing/transaction/client.go b/issuing/transaction/client.go index 82b76278d6..427878d1a6 100644 --- a/issuing/transaction/client.go +++ b/issuing/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of an issuing transaction. +// Retrieves an Issuing Transaction object. func Get(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { return getC().Get(id, params) } -// Get returns the details of an issuing transaction. +// Retrieves an Issuing Transaction object. func (c Client) Get(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath("/v1/issuing/transactions/%s", id) transaction := &stripe.IssuingTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.IssuingTransactionParams) (*stripe return transaction, err } -// Update updates an issuing transaction's properties. +// Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { return getC().Update(id, params) } -// Update updates an issuing transaction's properties. +// Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.IssuingTransactionParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath("/v1/issuing/transactions/%s", id) transaction := &stripe.IssuingTransaction{} @@ -46,12 +46,12 @@ func (c Client) Update(id string, params *stripe.IssuingTransactionParams) (*str return transaction, err } -// List returns a list of issuing transactions. +// Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.IssuingTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of issuing transactions. +// Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.IssuingTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/loginlink/client.go b/loginlink/client.go index 4f30566e55..a1682f98b6 100644 --- a/loginlink/client.go +++ b/loginlink/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// New creates a new login link. +// Creates a single-use login link for a connected account to access the Express Dashboard. +// +// You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. func New(params *stripe.LoginLinkParams) (*stripe.LoginLink, error) { return getC().New(params) } -// New creates a new login link. +// Creates a single-use login link for a connected account to access the Express Dashboard. +// +// You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. func (c Client) New(params *stripe.LoginLinkParams) (*stripe.LoginLink, error) { if params.Account == nil { return nil, fmt.Errorf("Invalid login link params: Account must be set") diff --git a/mandate/client.go b/mandate/client.go index 798f1a457a..7c2a5237a1 100644 --- a/mandate/client.go +++ b/mandate/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Get returns the details of a mandate. +// Retrieves a Mandate object. func Get(id string, params *stripe.MandateParams) (*stripe.Mandate, error) { return getC().Get(id, params) } -// Get returns the details of a mandate. +// Retrieves a Mandate object. func (c Client) Get(id string, params *stripe.MandateParams) (*stripe.Mandate, error) { path := stripe.FormatURLPath("/v1/mandates/%s", id) mandate := &stripe.Mandate{} diff --git a/margin/client.go b/margin/client.go index 78b1122ec0..30f3c29a18 100644 --- a/margin/client.go +++ b/margin/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new margin. +// Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item. func New(params *stripe.MarginParams) (*stripe.Margin, error) { return getC().New(params) } -// New creates a new margin. +// Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item. func (c Client) New(params *stripe.MarginParams) (*stripe.Margin, error) { margin := &stripe.Margin{} err := c.B.Call(http.MethodPost, "/v1/billing/margins", c.Key, params, margin) return margin, err } -// Get returns the details of a margin. +// Retrieve a margin object with the given ID. func Get(id string, params *stripe.MarginParams) (*stripe.Margin, error) { return getC().Get(id, params) } -// Get returns the details of a margin. +// Retrieve a margin object with the given ID. func (c Client) Get(id string, params *stripe.MarginParams) (*stripe.Margin, error) { path := stripe.FormatURLPath("/v1/billing/margins/%s", id) margin := &stripe.Margin{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.MarginParams) (*stripe.Margin, err return margin, err } -// Update updates a margin's properties. +// Update the specified margin object. Certain fields of the margin object are not editable. func Update(id string, params *stripe.MarginParams) (*stripe.Margin, error) { return getC().Update(id, params) } -// Update updates a margin's properties. +// Update the specified margin object. Certain fields of the margin object are not editable. func (c Client) Update(id string, params *stripe.MarginParams) (*stripe.Margin, error) { path := stripe.FormatURLPath("/v1/billing/margins/%s", id) margin := &stripe.Margin{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.MarginParams) (*stripe.Margin, return margin, err } -// List returns a list of margins. +// Retrieve a list of your margins. func List(params *stripe.MarginListParams) *Iter { return getC().List(params) } -// List returns a list of margins. +// Retrieve a list of your margins. func (c Client) List(listParams *stripe.MarginListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/order/client.go b/order/client.go index 847bcff195..da5ae3b9dc 100644 --- a/order/client.go +++ b/order/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new order. +// Creates a new open order object. func New(params *stripe.OrderParams) (*stripe.Order, error) { return getC().New(params) } -// New creates a new order. +// Creates a new open order object. func (c Client) New(params *stripe.OrderParams) (*stripe.Order, error) { order := &stripe.Order{} err := c.B.Call(http.MethodPost, "/v1/orders", c.Key, params, order) return order, err } -// Get returns the details of an order. +// Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. func Get(id string, params *stripe.OrderParams) (*stripe.Order, error) { return getC().Get(id, params) } -// Get returns the details of an order. +// Retrieves the details of an existing order. Supply the unique order ID from either an order creation request or the order list, and Stripe will return the corresponding order information. func (c Client) Get(id string, params *stripe.OrderParams) (*stripe.Order, error) { path := stripe.FormatURLPath("/v1/orders/%s", id) order := &stripe.Order{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.OrderParams) (*stripe.Order, error return order, err } -// Update updates an order's properties. +// Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.OrderParams) (*stripe.Order, error) { return getC().Update(id, params) } -// Update updates an order's properties. +// Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.OrderParams) (*stripe.Order, error) { path := stripe.FormatURLPath("/v1/orders/%s", id) order := &stripe.Order{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.OrderParams) (*stripe.Order, er return order, err } -// Cancel is the method for the `POST /v1/orders/{id}/cancel` API. +// Cancels the order as well as the payment intent if one is attached. func Cancel(id string, params *stripe.OrderCancelParams) (*stripe.Order, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/orders/{id}/cancel` API. +// Cancels the order as well as the payment intent if one is attached. func (c Client) Cancel(id string, params *stripe.OrderCancelParams) (*stripe.Order, error) { path := stripe.FormatURLPath("/v1/orders/%s/cancel", id) order := &stripe.Order{} @@ -71,12 +71,12 @@ func (c Client) Cancel(id string, params *stripe.OrderCancelParams) (*stripe.Ord return order, err } -// Reopen is the method for the `POST /v1/orders/{id}/reopen` API. +// Reopens a submitted order. func Reopen(id string, params *stripe.OrderReopenParams) (*stripe.Order, error) { return getC().Reopen(id, params) } -// Reopen is the method for the `POST /v1/orders/{id}/reopen` API. +// Reopens a submitted order. func (c Client) Reopen(id string, params *stripe.OrderReopenParams) (*stripe.Order, error) { path := stripe.FormatURLPath("/v1/orders/%s/reopen", id) order := &stripe.Order{} @@ -84,12 +84,12 @@ func (c Client) Reopen(id string, params *stripe.OrderReopenParams) (*stripe.Ord return order, err } -// Submit is the method for the `POST /v1/orders/{id}/submit` API. +// Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called. func Submit(id string, params *stripe.OrderSubmitParams) (*stripe.Order, error) { return getC().Submit(id, params) } -// Submit is the method for the `POST /v1/orders/{id}/submit` API. +// Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called. func (c Client) Submit(id string, params *stripe.OrderSubmitParams) (*stripe.Order, error) { path := stripe.FormatURLPath("/v1/orders/%s/submit", id) order := &stripe.Order{} @@ -97,12 +97,12 @@ func (c Client) Submit(id string, params *stripe.OrderSubmitParams) (*stripe.Ord return order, err } -// List returns a list of orders. +// Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. func List(params *stripe.OrderListParams) *Iter { return getC().List(params) } -// List returns a list of orders. +// Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first. func (c Client) List(listParams *stripe.OrderListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -136,12 +136,12 @@ func (i *Iter) OrderList() *stripe.OrderList { return i.List().(*stripe.OrderList) } -// ListLineItems is the method for the `GET /v1/orders/{id}/line_items` API. +// When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.OrderListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/orders/{id}/line_items` API. +// When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.OrderListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/orders/%s/line_items", diff --git a/paymentintent/client.go b/paymentintent/client.go index 13649c35cd..85fac511ab 100644 --- a/paymentintent/client.go +++ b/paymentintent/client.go @@ -20,12 +20,30 @@ type Client struct { Key string } -// New creates a new payment intent. +// 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. Learn more about the available payment flows +// with the Payment Intents API. +// +// 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. func New(params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { return getC().New(params) } -// New creates a new payment intent. +// 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. Learn more about the available payment flows +// with the Payment Intents API. +// +// 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. func (c Client) New(params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { paymentintent := &stripe.PaymentIntent{} err := c.B.Call( @@ -38,12 +56,20 @@ func (c Client) New(params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, return paymentintent, err } -// Get returns the details of a payment intent. +// Retrieves the details of a PaymentIntent that has previously been created. +// +// You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. +// +// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. func Get(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { return getC().Get(id, params) } -// Get returns the details of a payment intent. +// Retrieves the details of a PaymentIntent that has previously been created. +// +// You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. +// +// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. func (c Client) Get(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s", id) paymentintent := &stripe.PaymentIntent{} @@ -51,12 +77,24 @@ func (c Client) Get(id string, params *stripe.PaymentIntentParams) (*stripe.Paym return paymentintent, err } -// Update updates a payment intent's properties. +// Updates properties on a PaymentIntent object without confirming. +// +// Depending on which properties you update, you might need to confirm the +// PaymentIntent again. For example, updating the payment_method +// always requires you to confirm the PaymentIntent again. If you prefer to +// update and confirm at the same time, we recommend updating properties through +// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. func Update(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { return getC().Update(id, params) } -// Update updates a payment intent's properties. +// Updates properties on a PaymentIntent object without confirming. +// +// Depending on which properties you update, you might need to confirm the +// PaymentIntent again. For example, updating the payment_method +// always requires you to confirm the PaymentIntent again. If you prefer to +// update and confirm at the same time, we recommend updating properties through +// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. func (c Client) Update(id string, params *stripe.PaymentIntentParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s", id) paymentintent := &stripe.PaymentIntent{} @@ -64,12 +102,12 @@ func (c Client) Update(id string, params *stripe.PaymentIntentParams) (*stripe.P return paymentintent, err } -// ApplyCustomerBalance is the method for the `POST /v1/payment_intents/{intent}/apply_customer_balance` API. +// Manually reconcile the remaining amount for a customer_balance PaymentIntent. func ApplyCustomerBalance(id string, params *stripe.PaymentIntentApplyCustomerBalanceParams) (*stripe.PaymentIntent, error) { return getC().ApplyCustomerBalance(id, params) } -// ApplyCustomerBalance is the method for the `POST /v1/payment_intents/{intent}/apply_customer_balance` API. +// Manually reconcile the remaining amount for a customer_balance PaymentIntent. func (c Client) ApplyCustomerBalance(id string, params *stripe.PaymentIntentApplyCustomerBalanceParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath( "/v1/payment_intents/%s/apply_customer_balance", @@ -80,12 +118,20 @@ func (c Client) ApplyCustomerBalance(id string, params *stripe.PaymentIntentAppl return paymentintent, err } -// Cancel is the method for the `POST /v1/payment_intents/{intent}/cancel` API. +// 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. +// +// 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 can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. func Cancel(id string, params *stripe.PaymentIntentCancelParams) (*stripe.PaymentIntent, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/payment_intents/{intent}/cancel` API. +// 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. +// +// 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 can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. func (c Client) Cancel(id string, params *stripe.PaymentIntentCancelParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s/cancel", id) paymentintent := &stripe.PaymentIntent{} @@ -93,12 +139,20 @@ func (c Client) Cancel(id string, params *stripe.PaymentIntentCancelParams) (*st return paymentintent, err } -// Capture is the method for the `POST /v1/payment_intents/{intent}/capture` API. +// Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. +// +// 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). func Capture(id string, params *stripe.PaymentIntentCaptureParams) (*stripe.PaymentIntent, error) { return getC().Capture(id, params) } -// Capture is the method for the `POST /v1/payment_intents/{intent}/capture` API. +// Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. +// +// 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). func (c Client) Capture(id string, params *stripe.PaymentIntentCaptureParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s/capture", id) paymentintent := &stripe.PaymentIntent{} @@ -106,12 +160,54 @@ func (c Client) Capture(id string, params *stripe.PaymentIntentCaptureParams) (* return paymentintent, err } -// Confirm is the method for the `POST /v1/payment_intents/{intent}/confirm` API. +// Confirm that your customer intends to pay with current or provided +// payment method. Upon confirmation, the PaymentIntent will attempt to initiate +// a payment. +// If the selected payment method requires additional authentication steps, the +// PaymentIntent will transition to the requires_action status and +// suggest additional actions via next_action. If payment fails, +// the PaymentIntent transitions to the requires_payment_method status or the +// canceled status if the confirmation limit is reached. If +// payment succeeds, the PaymentIntent will transition to the succeeded +// status (or requires_capture, if capture_method is set to manual). +// If the confirmation_method is automatic, payment may be attempted +// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) +// and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). +// After next_actions are handled by the client, no additional +// confirmation is required to complete the payment. +// If the confirmation_method is manual, all payment attempts must be +// initiated using a secret key. +// If any actions are required for the payment, the PaymentIntent will +// return to the requires_confirmation state +// after those actions are completed. Your server needs to then +// explicitly re-confirm the PaymentIntent to initiate the next payment +// attempt. func Confirm(id string, params *stripe.PaymentIntentConfirmParams) (*stripe.PaymentIntent, error) { return getC().Confirm(id, params) } -// Confirm is the method for the `POST /v1/payment_intents/{intent}/confirm` API. +// Confirm that your customer intends to pay with current or provided +// payment method. Upon confirmation, the PaymentIntent will attempt to initiate +// a payment. +// If the selected payment method requires additional authentication steps, the +// PaymentIntent will transition to the requires_action status and +// suggest additional actions via next_action. If payment fails, +// the PaymentIntent transitions to the requires_payment_method status or the +// canceled status if the confirmation limit is reached. If +// payment succeeds, the PaymentIntent will transition to the succeeded +// status (or requires_capture, if capture_method is set to manual). +// If the confirmation_method is automatic, payment may be attempted +// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) +// and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). +// After next_actions are handled by the client, no additional +// confirmation is required to complete the payment. +// If the confirmation_method is manual, all payment attempts must be +// initiated using a secret key. +// If any actions are required for the payment, the PaymentIntent will +// return to the requires_confirmation state +// after those actions are completed. Your server needs to then +// explicitly re-confirm the PaymentIntent to initiate the next payment +// attempt. func (c Client) Confirm(id string, params *stripe.PaymentIntentConfirmParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath("/v1/payment_intents/%s/confirm", id) paymentintent := &stripe.PaymentIntent{} @@ -119,12 +215,42 @@ func (c Client) Confirm(id string, params *stripe.PaymentIntentConfirmParams) (* return paymentintent, err } -// DecrementAuthorization is the method for the `POST /v1/payment_intents/{intent}/decrement_authorization` API. +// Perform a decremental authorization on an eligible +// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the +// PaymentIntent's status must be requires_capture and +// [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) +// must be available. +// +// Decremental authorizations decrease the authorized amount on your customer's card +// to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. +// +// After decrement, the PaymentIntent object +// returns with the updated +// [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). +// The PaymentIntent will now be capturable up to the new authorized amount. +// +// Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. +// After it's fully captured, a PaymentIntent can no longer be decremented. func DecrementAuthorization(id string, params *stripe.PaymentIntentDecrementAuthorizationParams) (*stripe.PaymentIntent, error) { return getC().DecrementAuthorization(id, params) } -// DecrementAuthorization is the method for the `POST /v1/payment_intents/{intent}/decrement_authorization` API. +// Perform a decremental authorization on an eligible +// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the +// PaymentIntent's status must be requires_capture and +// [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization) +// must be available. +// +// Decremental authorizations decrease the authorized amount on your customer's card +// to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount. +// +// After decrement, the PaymentIntent object +// returns with the updated +// [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). +// The PaymentIntent will now be capturable up to the new authorized amount. +// +// Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines. +// After it's fully captured, a PaymentIntent can no longer be decremented. func (c Client) DecrementAuthorization(id string, params *stripe.PaymentIntentDecrementAuthorizationParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath( "/v1/payment_intents/%s/decrement_authorization", @@ -135,12 +261,58 @@ func (c Client) DecrementAuthorization(id string, params *stripe.PaymentIntentDe return paymentintent, err } -// IncrementAuthorization is the method for the `POST /v1/payment_intents/{intent}/increment_authorization` API. +// Perform an incremental authorization on an eligible +// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the +// PaymentIntent's status must be requires_capture and +// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) +// must be true. +// +// Incremental authorizations attempt to increase the authorized amount on +// 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 +// 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 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. +// After it's captured, a PaymentIntent can no longer be incremented. +// +// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). func IncrementAuthorization(id string, params *stripe.PaymentIntentIncrementAuthorizationParams) (*stripe.PaymentIntent, error) { return getC().IncrementAuthorization(id, params) } -// IncrementAuthorization is the method for the `POST /v1/payment_intents/{intent}/increment_authorization` API. +// Perform an incremental authorization on an eligible +// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the +// PaymentIntent's status must be requires_capture and +// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) +// must be true. +// +// Incremental authorizations attempt to increase the authorized amount on +// 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 +// 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 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. +// After it's captured, a PaymentIntent can no longer be incremented. +// +// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). func (c Client) IncrementAuthorization(id string, params *stripe.PaymentIntentIncrementAuthorizationParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath( "/v1/payment_intents/%s/increment_authorization", @@ -151,12 +323,12 @@ func (c Client) IncrementAuthorization(id string, params *stripe.PaymentIntentIn return paymentintent, err } -// VerifyMicrodeposits is the method for the `POST /v1/payment_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a PaymentIntent object. func VerifyMicrodeposits(id string, params *stripe.PaymentIntentVerifyMicrodepositsParams) (*stripe.PaymentIntent, error) { return getC().VerifyMicrodeposits(id, params) } -// VerifyMicrodeposits is the method for the `POST /v1/payment_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a PaymentIntent object. func (c Client) VerifyMicrodeposits(id string, params *stripe.PaymentIntentVerifyMicrodepositsParams) (*stripe.PaymentIntent, error) { path := stripe.FormatURLPath( "/v1/payment_intents/%s/verify_microdeposits", @@ -167,12 +339,12 @@ func (c Client) VerifyMicrodeposits(id string, params *stripe.PaymentIntentVerif return paymentintent, err } -// List returns a list of payment intents. +// Returns a list of PaymentIntents. func List(params *stripe.PaymentIntentListParams) *Iter { return getC().List(params) } -// List returns a list of payment intents. +// Returns a list of PaymentIntents. func (c Client) List(listParams *stripe.PaymentIntentListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -206,12 +378,18 @@ func (i *Iter) PaymentIntentList() *stripe.PaymentIntentList { return i.List().(*stripe.PaymentIntentList) } -// Search returns a search result containing payment intents. +// Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.PaymentIntentSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing payment intents. +// Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.PaymentIntentSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/paymentlink/client.go b/paymentlink/client.go index e7f8e65d53..8be4c21e6d 100644 --- a/paymentlink/client.go +++ b/paymentlink/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new payment link. +// Creates a payment link. func New(params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { return getC().New(params) } -// New creates a new payment link. +// Creates a payment link. func (c Client) New(params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { paymentlink := &stripe.PaymentLink{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PaymentLinkParams) (*stripe.PaymentLink, erro return paymentlink, err } -// Get returns the details of a payment link. +// Retrieve a payment link. func Get(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { return getC().Get(id, params) } -// Get returns the details of a payment link. +// Retrieve a payment link. func (c Client) Get(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { path := stripe.FormatURLPath("/v1/payment_links/%s", id) paymentlink := &stripe.PaymentLink{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.PaymentLinkParams) (*stripe.Paymen return paymentlink, err } -// Update updates a payment link's properties. +// Updates a payment link. func Update(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { return getC().Update(id, params) } -// Update updates a payment link's properties. +// Updates a payment link. func (c Client) Update(id string, params *stripe.PaymentLinkParams) (*stripe.PaymentLink, error) { path := stripe.FormatURLPath("/v1/payment_links/%s", id) paymentlink := &stripe.PaymentLink{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.PaymentLinkParams) (*stripe.Pay return paymentlink, err } -// List returns a list of payment links. +// Returns a list of your payment links. func List(params *stripe.PaymentLinkListParams) *Iter { return getC().List(params) } -// List returns a list of payment links. +// Returns a list of your payment links. func (c Client) List(listParams *stripe.PaymentLinkListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -103,12 +103,12 @@ func (i *Iter) PaymentLinkList() *stripe.PaymentLinkList { return i.List().(*stripe.PaymentLinkList) } -// ListLineItems is the method for the `GET /v1/payment_links/{payment_link}/line_items` API. +// When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.PaymentLinkListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/payment_links/{payment_link}/line_items` API. +// When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.PaymentLinkListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/payment_links/%s/line_items", diff --git a/paymentmethod/client.go b/paymentmethod/client.go index 24597e0ed4..87f5493524 100644 --- a/paymentmethod/client.go +++ b/paymentmethod/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// New creates a new payment method. +// Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. +// +// Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. func New(params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().New(params) } -// New creates a new payment method. +// Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. +// +// Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. func (c Client) New(params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { paymentmethod := &stripe.PaymentMethod{} err := c.B.Call( @@ -38,12 +42,12 @@ func (c Client) New(params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, return paymentmethod, err } -// Get returns the details of a payment method. +// Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) func Get(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().Get(id, params) } -// Get returns the details of a payment method. +// Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) func (c Client) Get(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s", id) paymentmethod := &stripe.PaymentMethod{} @@ -51,12 +55,12 @@ func (c Client) Get(id string, params *stripe.PaymentMethodParams) (*stripe.Paym return paymentmethod, err } -// Update updates a payment method's properties. +// Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. func Update(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { return getC().Update(id, params) } -// Update updates a payment method's properties. +// Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. func (c Client) Update(id string, params *stripe.PaymentMethodParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s", id) paymentmethod := &stripe.PaymentMethod{} @@ -64,12 +68,36 @@ func (c Client) Update(id string, params *stripe.PaymentMethodParams) (*stripe.P return paymentmethod, err } -// Attach is the method for the `POST /v1/payment_methods/{payment_method}/attach` API. +// Attaches a PaymentMethod object to a Customer. +// +// To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) +// or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). +// These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach +// endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for +// future use, which makes later declines and payment friction more likely. +// See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up +// future payments. +// +// To use this PaymentMethod as the default for invoice or subscription payments, +// set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), +// on the Customer to the PaymentMethod's ID. func Attach(id string, params *stripe.PaymentMethodAttachParams) (*stripe.PaymentMethod, error) { return getC().Attach(id, params) } -// Attach is the method for the `POST /v1/payment_methods/{payment_method}/attach` API. +// Attaches a PaymentMethod object to a Customer. +// +// To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) +// or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). +// These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach +// endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for +// future use, which makes later declines and payment friction more likely. +// See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up +// future payments. +// +// To use this PaymentMethod as the default for invoice or subscription payments, +// set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), +// on the Customer to the PaymentMethod's ID. func (c Client) Attach(id string, params *stripe.PaymentMethodAttachParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s/attach", id) paymentmethod := &stripe.PaymentMethod{} @@ -77,12 +105,12 @@ func (c Client) Attach(id string, params *stripe.PaymentMethodAttachParams) (*st return paymentmethod, err } -// Detach is the method for the `POST /v1/payment_methods/{payment_method}/detach` API. +// Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. func Detach(id string, params *stripe.PaymentMethodDetachParams) (*stripe.PaymentMethod, error) { return getC().Detach(id, params) } -// Detach is the method for the `POST /v1/payment_methods/{payment_method}/detach` API. +// Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. func (c Client) Detach(id string, params *stripe.PaymentMethodDetachParams) (*stripe.PaymentMethod, error) { path := stripe.FormatURLPath("/v1/payment_methods/%s/detach", id) paymentmethod := &stripe.PaymentMethod{} @@ -90,12 +118,12 @@ func (c Client) Detach(id string, params *stripe.PaymentMethodDetachParams) (*st return paymentmethod, err } -// List returns a list of payment methods. +// Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. func List(params *stripe.PaymentMethodListParams) *Iter { return getC().List(params) } -// List returns a list of payment methods. +// Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. func (c Client) List(listParams *stripe.PaymentMethodListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/paymentmethodconfiguration/client.go b/paymentmethodconfiguration/client.go index 5276b78e49..16f8b6d290 100644 --- a/paymentmethodconfiguration/client.go +++ b/paymentmethodconfiguration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new payment method configuration. +// Creates a payment method configuration func New(params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { return getC().New(params) } -// New creates a new payment method configuration. +// Creates a payment method configuration func (c Client) New(params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { paymentmethodconfiguration := &stripe.PaymentMethodConfiguration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PaymentMethodConfigurationParams) (*stripe.Pa return paymentmethodconfiguration, err } -// Get returns the details of a payment method configuration. +// Retrieve payment method configuration func Get(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { return getC().Get(id, params) } -// Get returns the details of a payment method configuration. +// Retrieve payment method configuration func (c Client) Get(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { path := stripe.FormatURLPath("/v1/payment_method_configurations/%s", id) paymentmethodconfiguration := &stripe.PaymentMethodConfiguration{} @@ -57,12 +57,12 @@ func (c Client) Get(id string, params *stripe.PaymentMethodConfigurationParams) return paymentmethodconfiguration, err } -// Update updates a payment method configuration's properties. +// Update payment method configuration func Update(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { return getC().Update(id, params) } -// Update updates a payment method configuration's properties. +// Update payment method configuration func (c Client) Update(id string, params *stripe.PaymentMethodConfigurationParams) (*stripe.PaymentMethodConfiguration, error) { path := stripe.FormatURLPath("/v1/payment_method_configurations/%s", id) paymentmethodconfiguration := &stripe.PaymentMethodConfiguration{} @@ -76,12 +76,12 @@ func (c Client) Update(id string, params *stripe.PaymentMethodConfigurationParam return paymentmethodconfiguration, err } -// List returns a list of payment method configurations. +// List payment method configurations func List(params *stripe.PaymentMethodConfigurationListParams) *Iter { return getC().List(params) } -// List returns a list of payment method configurations. +// List payment method configurations func (c Client) List(listParams *stripe.PaymentMethodConfigurationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/paymentmethoddomain/client.go b/paymentmethoddomain/client.go index 157df28a09..c95ee9188b 100644 --- a/paymentmethoddomain/client.go +++ b/paymentmethoddomain/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new payment method domain. +// Creates a payment method domain. func New(params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { return getC().New(params) } -// New creates a new payment method domain. +// Creates a payment method domain. func (c Client) New(params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { paymentmethoddomain := &stripe.PaymentMethodDomain{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMe return paymentmethoddomain, err } -// Get returns the details of a payment method domain. +// Retrieves the details of an existing payment method domain. func Get(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { return getC().Get(id, params) } -// Get returns the details of a payment method domain. +// Retrieves the details of an existing payment method domain. func (c Client) Get(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { path := stripe.FormatURLPath("/v1/payment_method_domains/%s", id) paymentmethoddomain := &stripe.PaymentMethodDomain{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.PaymentMethodDomainParams) (*strip return paymentmethoddomain, err } -// Update updates a payment method domain's properties. +// Updates an existing payment method domain. func Update(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { return getC().Update(id, params) } -// Update updates a payment method domain's properties. +// Updates an existing payment method domain. func (c Client) Update(id string, params *stripe.PaymentMethodDomainParams) (*stripe.PaymentMethodDomain, error) { path := stripe.FormatURLPath("/v1/payment_method_domains/%s", id) paymentmethoddomain := &stripe.PaymentMethodDomain{} @@ -64,12 +64,22 @@ func (c Client) Update(id string, params *stripe.PaymentMethodDomainParams) (*st return paymentmethoddomain, err } -// Validate is the method for the `POST /v1/payment_method_domains/{payment_method_domain}/validate` API. +// Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. +// The payment method doesn't appear in Elements for this domain until it is active. +// +// To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. +// +// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). func Validate(id string, params *stripe.PaymentMethodDomainValidateParams) (*stripe.PaymentMethodDomain, error) { return getC().Validate(id, params) } -// Validate is the method for the `POST /v1/payment_method_domains/{payment_method_domain}/validate` API. +// Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. +// The payment method doesn't appear in Elements for this domain until it is active. +// +// To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. +// +// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). func (c Client) Validate(id string, params *stripe.PaymentMethodDomainValidateParams) (*stripe.PaymentMethodDomain, error) { path := stripe.FormatURLPath("/v1/payment_method_domains/%s/validate", id) paymentmethoddomain := &stripe.PaymentMethodDomain{} @@ -77,12 +87,12 @@ func (c Client) Validate(id string, params *stripe.PaymentMethodDomainValidatePa return paymentmethoddomain, err } -// List returns a list of payment method domains. +// Lists the details of existing payment method domains. func List(params *stripe.PaymentMethodDomainListParams) *Iter { return getC().List(params) } -// List returns a list of payment method domains. +// Lists the details of existing payment method domains. func (c Client) List(listParams *stripe.PaymentMethodDomainListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/paymentsource/client.go b/paymentsource/client.go index a7cab3104b..b55cf8ce9f 100644 --- a/paymentsource/client.go +++ b/paymentsource/client.go @@ -21,12 +21,20 @@ type Client struct { Key string } -// New creates a new payment source. +// When you create a new credit card, you must specify a customer or recipient on which to create it. +// +// If the card's owner has no default card, then the new card will become the default. +// However, if the owner already has a default, then it will not change. +// To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. func New(params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().New(params) } -// New creates a new payment source. +// When you create a new credit card, you must specify a customer or recipient on which to create it. +// +// If the card's owner has no default card, then the new card will become the default. +// However, if the owner already has a default, then it will not change. +// To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. func (c Client) New(params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -43,12 +51,12 @@ func (c Client) New(params *stripe.PaymentSourceParams) (*stripe.PaymentSource, return paymentsource, err } -// Get returns the details of a payment source. +// Retrieve a specified source for a given customer. func Get(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().Get(id, params) } -// Get returns the details of a payment source. +// Retrieve a specified source for a given customer. func (c Client) Get(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -66,12 +74,12 @@ func (c Client) Get(id string, params *stripe.PaymentSourceParams) (*stripe.Paym return paymentsource, err } -// Update updates a payment source's properties. +// Update a specified source for a given customer. func Update(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().Update(id, params) } -// Update updates a payment source's properties. +// Update a specified source for a given customer. func (c Client) Update(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -89,12 +97,12 @@ func (c Client) Update(id string, params *stripe.PaymentSourceParams) (*stripe.P return paymentsource, err } -// Del removes a payment source. +// Delete a specified source for a given customer. func Del(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { return getC().Del(id, params) } -// Del removes a payment source. +// Delete a specified source for a given customer. func (c Client) Del(id string, params *stripe.PaymentSourceParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -113,11 +121,13 @@ func (c Client) Del(id string, params *stripe.PaymentSourceParams) (*stripe.Paym } // Verify verifies a source which is used for bank accounts. +// Verify a specified bank account for a given customer. func Verify(id string, params *stripe.PaymentSourceVerifyParams) (*stripe.PaymentSource, error) { return getC().Verify(id, params) } // Verify verifies a source which is used for bank accounts. +// Verify a specified bank account for a given customer. func (c Client) Verify(id string, params *stripe.PaymentSourceVerifyParams) (*stripe.PaymentSource, error) { if params == nil { return nil, fmt.Errorf("params should not be nil") @@ -138,12 +148,12 @@ func (c Client) Verify(id string, params *stripe.PaymentSourceVerifyParams) (*st return source, err } -// List returns a list of payment sources. +// List sources for a specified customer. func List(params *stripe.PaymentSourceListParams) *Iter { return getC().List(params) } -// List returns a list of payment sources. +// List sources for a specified customer. func (c Client) List(listParams *stripe.PaymentSourceListParams) *Iter { var outerErr error var path string diff --git a/payout/client.go b/payout/client.go index 6822726d6b..70f05ef6f4 100644 --- a/payout/client.go +++ b/payout/client.go @@ -20,24 +20,32 @@ type Client struct { Key string } -// New creates a new payout. +// To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. +// +// If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. +// +// If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. func New(params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().New(params) } -// New creates a new payout. +// To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. +// +// If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. +// +// If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. func (c Client) New(params *stripe.PayoutParams) (*stripe.Payout, error) { payout := &stripe.Payout{} err := c.B.Call(http.MethodPost, "/v1/payouts", c.Key, params, payout) return payout, err } -// Get returns the details of a payout. +// 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. func Get(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().Get(id, params) } -// Get returns the details of a payout. +// 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. func (c Client) Get(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s", id) payout := &stripe.Payout{} @@ -45,12 +53,12 @@ func (c Client) Get(id string, params *stripe.PayoutParams) (*stripe.Payout, err return payout, err } -// Update updates a payout's properties. +// Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. func Update(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().Update(id, params) } -// Update updates a payout's properties. +// Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. func (c Client) Update(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s", id) payout := &stripe.Payout{} @@ -58,12 +66,12 @@ func (c Client) Update(id string, params *stripe.PayoutParams) (*stripe.Payout, return payout, err } -// Cancel is the method for the `POST /v1/payouts/{payout}/cancel` API. +// You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. func Cancel(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/payouts/{payout}/cancel` API. +// You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. func (c Client) Cancel(id string, params *stripe.PayoutParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s/cancel", id) payout := &stripe.Payout{} @@ -71,12 +79,16 @@ func (c Client) Cancel(id string, params *stripe.PayoutParams) (*stripe.Payout, return payout, err } -// Reverse is the method for the `POST /v1/payouts/{payout}/reverse` API. +// 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 manual and in the pending status, use /v1/payouts/:id/cancel instead. +// +// 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. func Reverse(id string, params *stripe.PayoutReverseParams) (*stripe.Payout, error) { return getC().Reverse(id, params) } -// Reverse is the method for the `POST /v1/payouts/{payout}/reverse` API. +// 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 manual and in the pending status, use /v1/payouts/:id/cancel instead. +// +// 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. func (c Client) Reverse(id string, params *stripe.PayoutReverseParams) (*stripe.Payout, error) { path := stripe.FormatURLPath("/v1/payouts/%s/reverse", id) payout := &stripe.Payout{} @@ -84,12 +96,12 @@ func (c Client) Reverse(id string, params *stripe.PayoutReverseParams) (*stripe. return payout, err } -// List returns a list of payouts. +// 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. func List(params *stripe.PayoutListParams) *Iter { return getC().List(params) } -// List returns a list of payouts. +// 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. func (c Client) List(listParams *stripe.PayoutListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/person/client.go b/person/client.go index e458179914..f2ba2dd6ea 100644 --- a/person/client.go +++ b/person/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new person. +// Creates a new person. func New(params *stripe.PersonParams) (*stripe.Person, error) { return getC().New(params) } -// New creates a new person. +// Creates a new person. func (c Client) New(params *stripe.PersonParams) (*stripe.Person, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/persons", @@ -37,12 +37,12 @@ func (c Client) New(params *stripe.PersonParams) (*stripe.Person, error) { return person, err } -// Get returns the details of a person. +// Retrieves an existing person. func Get(id string, params *stripe.PersonParams) (*stripe.Person, error) { return getC().Get(id, params) } -// Get returns the details of a person. +// Retrieves an existing person. func (c Client) Get(id string, params *stripe.PersonParams) (*stripe.Person, error) { if params == nil { return nil, fmt.Errorf( @@ -59,12 +59,12 @@ func (c Client) Get(id string, params *stripe.PersonParams) (*stripe.Person, err return person, err } -// Update updates a person's properties. +// Updates an existing person. func Update(id string, params *stripe.PersonParams) (*stripe.Person, error) { return getC().Update(id, params) } -// Update updates a person's properties. +// Updates an existing person. func (c Client) Update(id string, params *stripe.PersonParams) (*stripe.Person, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/persons/%s", @@ -76,12 +76,12 @@ func (c Client) Update(id string, params *stripe.PersonParams) (*stripe.Person, return person, err } -// Del removes a person. +// Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. func Del(id string, params *stripe.PersonParams) (*stripe.Person, error) { return getC().Del(id, params) } -// Del removes a person. +// Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. func (c Client) Del(id string, params *stripe.PersonParams) (*stripe.Person, error) { path := stripe.FormatURLPath( "/v1/accounts/%s/persons/%s", @@ -93,12 +93,12 @@ func (c Client) Del(id string, params *stripe.PersonParams) (*stripe.Person, err return person, err } -// List returns a list of persons. +// Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. func List(params *stripe.PersonListParams) *Iter { return getC().List(params) } -// List returns a list of persons. +// Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. func (c Client) List(listParams *stripe.PersonListParams) *Iter { path := stripe.FormatURLPath( "/v1/accounts/%s/persons", diff --git a/plan/client.go b/plan/client.go index 650f99a81e..6159e5db3b 100644 --- a/plan/client.go +++ b/plan/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new plan. +// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. func New(params *stripe.PlanParams) (*stripe.Plan, error) { return getC().New(params) } -// New creates a new plan. +// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. func (c Client) New(params *stripe.PlanParams) (*stripe.Plan, error) { plan := &stripe.Plan{} err := c.B.Call(http.MethodPost, "/v1/plans", c.Key, params, plan) return plan, err } -// Get returns the details of a plan. +// Retrieves the plan with the given ID. func Get(id string, params *stripe.PlanParams) (*stripe.Plan, error) { return getC().Get(id, params) } -// Get returns the details of a plan. +// Retrieves the plan with the given ID. func (c Client) Get(id string, params *stripe.PlanParams) (*stripe.Plan, error) { path := stripe.FormatURLPath("/v1/plans/%s", id) plan := &stripe.Plan{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.PlanParams) (*stripe.Plan, error) return plan, err } -// Update updates a plan's properties. +// Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. func Update(id string, params *stripe.PlanParams) (*stripe.Plan, error) { return getC().Update(id, params) } -// Update updates a plan's properties. +// Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. func (c Client) Update(id string, params *stripe.PlanParams) (*stripe.Plan, error) { path := stripe.FormatURLPath("/v1/plans/%s", id) plan := &stripe.Plan{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.PlanParams) (*stripe.Plan, erro return plan, err } -// Del removes a plan. +// Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. func Del(id string, params *stripe.PlanParams) (*stripe.Plan, error) { return getC().Del(id, params) } -// Del removes a plan. +// Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. func (c Client) Del(id string, params *stripe.PlanParams) (*stripe.Plan, error) { path := stripe.FormatURLPath("/v1/plans/%s", id) plan := &stripe.Plan{} @@ -71,12 +71,12 @@ func (c Client) Del(id string, params *stripe.PlanParams) (*stripe.Plan, error) return plan, err } -// List returns a list of plans. +// Returns a list of your plans. func List(params *stripe.PlanListParams) *Iter { return getC().List(params) } -// List returns a list of plans. +// Returns a list of your plans. func (c Client) List(listParams *stripe.PlanListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/price/client.go b/price/client.go index 2ccd6d83ae..0d11800428 100644 --- a/price/client.go +++ b/price/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new price. +// Creates a new price for an existing product. The price can be recurring or one-time. func New(params *stripe.PriceParams) (*stripe.Price, error) { return getC().New(params) } -// New creates a new price. +// Creates a new price for an existing product. The price can be recurring or one-time. func (c Client) New(params *stripe.PriceParams) (*stripe.Price, error) { price := &stripe.Price{} err := c.B.Call(http.MethodPost, "/v1/prices", c.Key, params, price) return price, err } -// Get returns the details of a price. +// Retrieves the price with the given ID. func Get(id string, params *stripe.PriceParams) (*stripe.Price, error) { return getC().Get(id, params) } -// Get returns the details of a price. +// Retrieves the price with the given ID. func (c Client) Get(id string, params *stripe.PriceParams) (*stripe.Price, error) { path := stripe.FormatURLPath("/v1/prices/%s", id) price := &stripe.Price{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.PriceParams) (*stripe.Price, error return price, err } -// Update updates a price's properties. +// Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. func Update(id string, params *stripe.PriceParams) (*stripe.Price, error) { return getC().Update(id, params) } -// Update updates a price's properties. +// Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. func (c Client) Update(id string, params *stripe.PriceParams) (*stripe.Price, error) { path := stripe.FormatURLPath("/v1/prices/%s", id) price := &stripe.Price{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.PriceParams) (*stripe.Price, er return price, err } -// List returns a list of prices. +// Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. func List(params *stripe.PriceListParams) *Iter { return getC().List(params) } -// List returns a list of prices. +// Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. func (c Client) List(listParams *stripe.PriceListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -97,12 +97,18 @@ func (i *Iter) PriceList() *stripe.PriceList { return i.List().(*stripe.PriceList) } -// Search returns a search result containing prices. +// Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.PriceSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing prices. +// Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.PriceSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/product/client.go b/product/client.go index e485fc958f..231b2847fa 100644 --- a/product/client.go +++ b/product/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new product. +// Creates a new product object. func New(params *stripe.ProductParams) (*stripe.Product, error) { return getC().New(params) } -// New creates a new product. +// Creates a new product object. func (c Client) New(params *stripe.ProductParams) (*stripe.Product, error) { product := &stripe.Product{} err := c.B.Call(http.MethodPost, "/v1/products", c.Key, params, product) return product, err } -// Get returns the details of a product. +// Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. func Get(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Get(id, params) } -// Get returns the details of a product. +// Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. func (c Client) Get(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) product := &stripe.Product{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.ProductParams) (*stripe.Product, e return product, err } -// Update updates a product's properties. +// Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Update(id, params) } -// Update updates a product's properties. +// Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) product := &stripe.Product{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.ProductParams) (*stripe.Product return product, err } -// Del removes a product. +// Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. func Del(id string, params *stripe.ProductParams) (*stripe.Product, error) { return getC().Del(id, params) } -// Del removes a product. +// Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. func (c Client) Del(id string, params *stripe.ProductParams) (*stripe.Product, error) { path := stripe.FormatURLPath("/v1/products/%s", id) product := &stripe.Product{} @@ -71,12 +71,12 @@ func (c Client) Del(id string, params *stripe.ProductParams) (*stripe.Product, e return product, err } -// List returns a list of products. +// Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. func List(params *stripe.ProductListParams) *Iter { return getC().List(params) } -// List returns a list of products. +// Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. func (c Client) List(listParams *stripe.ProductListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -110,12 +110,18 @@ func (i *Iter) ProductList() *stripe.ProductList { return i.List().(*stripe.ProductList) } -// Search returns a search result containing products. +// Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.ProductSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing products. +// Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.ProductSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/productfeature/client.go b/productfeature/client.go index 3b4d8b53e0..d5770792ad 100644 --- a/productfeature/client.go +++ b/productfeature/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new product feature. +// Creates a product_feature, which represents a feature attachment to a product func New(params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { return getC().New(params) } -// New creates a new product feature. +// Creates a product_feature, which represents a feature attachment to a product func (c Client) New(params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { path := stripe.FormatURLPath( "/v1/products/%s/features", @@ -36,12 +36,12 @@ func (c Client) New(params *stripe.ProductFeatureParams) (*stripe.ProductFeature return productfeature, err } -// Get returns the details of a product feature. +// Retrieves a product_feature, which represents a feature attachment to a product func Get(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { return getC().Get(id, params) } -// Get returns the details of a product feature. +// Retrieves a product_feature, which represents a feature attachment to a product func (c Client) Get(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { path := stripe.FormatURLPath( "/v1/products/%s/features/%s", @@ -53,12 +53,12 @@ func (c Client) Get(id string, params *stripe.ProductFeatureParams) (*stripe.Pro return productfeature, err } -// Del removes a product feature. +// Deletes the feature attachment to a product func Del(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { return getC().Del(id, params) } -// Del removes a product feature. +// Deletes the feature attachment to a product func (c Client) Del(id string, params *stripe.ProductFeatureParams) (*stripe.ProductFeature, error) { path := stripe.FormatURLPath( "/v1/products/%s/features/%s", @@ -70,12 +70,12 @@ func (c Client) Del(id string, params *stripe.ProductFeatureParams) (*stripe.Pro return productfeature, err } -// List returns a list of product features. +// Retrieve a list of features for a product func List(params *stripe.ProductFeatureListParams) *Iter { return getC().List(params) } -// List returns a list of product features. +// Retrieve a list of features for a product func (c Client) List(listParams *stripe.ProductFeatureListParams) *Iter { path := stripe.FormatURLPath( "/v1/products/%s/features", diff --git a/promotioncode/client.go b/promotioncode/client.go index ff8acea206..510891fd3b 100644 --- a/promotioncode/client.go +++ b/promotioncode/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new promotion code. +// A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. func New(params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { return getC().New(params) } -// New creates a new promotion code. +// A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. func (c Client) New(params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { promotioncode := &stripe.PromotionCode{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.PromotionCodeParams) (*stripe.PromotionCode, return promotioncode, err } -// Get returns the details of a promotion code. +// Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. func Get(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { return getC().Get(id, params) } -// Get returns the details of a promotion code. +// Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. func (c Client) Get(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { path := stripe.FormatURLPath("/v1/promotion_codes/%s", id) promotioncode := &stripe.PromotionCode{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.PromotionCodeParams) (*stripe.Prom return promotioncode, err } -// Update updates a promotion code's properties. +// Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. func Update(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { return getC().Update(id, params) } -// Update updates a promotion code's properties. +// Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. func (c Client) Update(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error) { path := stripe.FormatURLPath("/v1/promotion_codes/%s", id) promotioncode := &stripe.PromotionCode{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.PromotionCodeParams) (*stripe.P return promotioncode, err } -// List returns a list of promotion codes. +// Returns a list of your promotion codes. func List(params *stripe.PromotionCodeListParams) *Iter { return getC().List(params) } -// List returns a list of promotion codes. +// Returns a list of your promotion codes. func (c Client) List(listParams *stripe.PromotionCodeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/quote/client.go b/quote/client.go index 350422fdfa..8683c5d8bc 100644 --- a/quote/client.go +++ b/quote/client.go @@ -21,24 +21,24 @@ type Client struct { Key string } -// New creates a new quote. +// A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). func New(params *stripe.QuoteParams) (*stripe.Quote, error) { return getC().New(params) } -// New creates a new quote. +// A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). func (c Client) New(params *stripe.QuoteParams) (*stripe.Quote, error) { quote := &stripe.Quote{} err := c.B.Call(http.MethodPost, "/v1/quotes", c.Key, params, quote) return quote, err } -// Get returns the details of a quote. +// Retrieves the quote with the given ID. func Get(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { return getC().Get(id, params) } -// Get returns the details of a quote. +// Retrieves the quote with the given ID. func (c Client) Get(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s", id) quote := &stripe.Quote{} @@ -46,12 +46,12 @@ func (c Client) Get(id string, params *stripe.QuoteParams) (*stripe.Quote, error return quote, err } -// Update updates a quote's properties. +// A quote models prices and services for a customer. func Update(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { return getC().Update(id, params) } -// Update updates a quote's properties. +// A quote models prices and services for a customer. func (c Client) Update(id string, params *stripe.QuoteParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s", id) quote := &stripe.Quote{} @@ -59,12 +59,12 @@ func (c Client) Update(id string, params *stripe.QuoteParams) (*stripe.Quote, er return quote, err } -// Accept is the method for the `POST /v1/quotes/{quote}/accept` API. +// Accepts the specified quote. func Accept(id string, params *stripe.QuoteAcceptParams) (*stripe.Quote, error) { return getC().Accept(id, params) } -// Accept is the method for the `POST /v1/quotes/{quote}/accept` API. +// Accepts the specified quote. func (c Client) Accept(id string, params *stripe.QuoteAcceptParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/accept", id) quote := &stripe.Quote{} @@ -72,12 +72,12 @@ func (c Client) Accept(id string, params *stripe.QuoteAcceptParams) (*stripe.Quo return quote, err } -// Cancel is the method for the `POST /v1/quotes/{quote}/cancel` API. +// Cancels the quote. func Cancel(id string, params *stripe.QuoteCancelParams) (*stripe.Quote, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/quotes/{quote}/cancel` API. +// Cancels the quote. func (c Client) Cancel(id string, params *stripe.QuoteCancelParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/cancel", id) quote := &stripe.Quote{} @@ -85,12 +85,12 @@ func (c Client) Cancel(id string, params *stripe.QuoteCancelParams) (*stripe.Quo return quote, err } -// FinalizeQuote is the method for the `POST /v1/quotes/{quote}/finalize` API. +// Finalizes the quote. func FinalizeQuote(id string, params *stripe.QuoteFinalizeQuoteParams) (*stripe.Quote, error) { return getC().FinalizeQuote(id, params) } -// FinalizeQuote is the method for the `POST /v1/quotes/{quote}/finalize` API. +// Finalizes the quote. func (c Client) FinalizeQuote(id string, params *stripe.QuoteFinalizeQuoteParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/finalize", id) quote := &stripe.Quote{} @@ -98,12 +98,12 @@ func (c Client) FinalizeQuote(id string, params *stripe.QuoteFinalizeQuoteParams return quote, err } -// MarkDraft is the method for the `POST /v1/quotes/{quote}/mark_draft` API. +// Converts a stale quote to draft. func MarkDraft(id string, params *stripe.QuoteMarkDraftParams) (*stripe.Quote, error) { return getC().MarkDraft(id, params) } -// MarkDraft is the method for the `POST /v1/quotes/{quote}/mark_draft` API. +// Converts a stale quote to draft. func (c Client) MarkDraft(id string, params *stripe.QuoteMarkDraftParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/mark_draft", id) quote := &stripe.Quote{} @@ -111,12 +111,12 @@ func (c Client) MarkDraft(id string, params *stripe.QuoteMarkDraftParams) (*stri return quote, err } -// MarkStale is the method for the `POST /v1/quotes/{quote}/mark_stale` API. +// Converts a draft or open quote to stale. func MarkStale(id string, params *stripe.QuoteMarkStaleParams) (*stripe.Quote, error) { return getC().MarkStale(id, params) } -// MarkStale is the method for the `POST /v1/quotes/{quote}/mark_stale` API. +// Converts a draft or open quote to stale. func (c Client) MarkStale(id string, params *stripe.QuoteMarkStaleParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/mark_stale", id) quote := &stripe.Quote{} @@ -124,12 +124,12 @@ func (c Client) MarkStale(id string, params *stripe.QuoteMarkStaleParams) (*stri return quote, err } -// PDF is the method for the `GET /v1/quotes/{quote}/pdf` API. +// Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) func PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { return getC().PDF(id, params) } -// PDF is the method for the `GET /v1/quotes/{quote}/pdf` API. +// Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) func (c Client) PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream, error) { path := stripe.FormatURLPath("/v1/quotes/%s/pdf", id) stream := &stripe.APIStream{} @@ -137,12 +137,12 @@ func (c Client) PDF(id string, params *stripe.QuotePDFParams) (*stripe.APIStream return stream, err } -// Reestimate is the method for the `POST /v1/quotes/{quote}/reestimate` API. +// Recompute the upcoming invoice estimate for the quote. func Reestimate(id string, params *stripe.QuoteReestimateParams) (*stripe.Quote, error) { return getC().Reestimate(id, params) } -// Reestimate is the method for the `POST /v1/quotes/{quote}/reestimate` API. +// Recompute the upcoming invoice estimate for the quote. func (c Client) Reestimate(id string, params *stripe.QuoteReestimateParams) (*stripe.Quote, error) { path := stripe.FormatURLPath("/v1/quotes/%s/reestimate", id) quote := &stripe.Quote{} @@ -150,12 +150,12 @@ func (c Client) Reestimate(id string, params *stripe.QuoteReestimateParams) (*st return quote, err } -// List returns a list of quotes. +// Returns a list of your quotes. func List(params *stripe.QuoteListParams) *Iter { return getC().List(params) } -// List returns a list of quotes. +// Returns a list of your quotes. func (c Client) List(listParams *stripe.QuoteListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -189,12 +189,12 @@ func (i *Iter) QuoteList() *stripe.QuoteList { return i.List().(*stripe.QuoteList) } -// ListComputedUpfrontLineItems is the method for the `GET /v1/quotes/{quote}/computed_upfront_line_items` API. +// When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. func ListComputedUpfrontLineItems(params *stripe.QuoteListComputedUpfrontLineItemsParams) *LineItemIter { return getC().ListComputedUpfrontLineItems(params) } -// ListComputedUpfrontLineItems is the method for the `GET /v1/quotes/{quote}/computed_upfront_line_items` API. +// When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. func (c Client) ListComputedUpfrontLineItems(listParams *stripe.QuoteListComputedUpfrontLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/quotes/%s/computed_upfront_line_items", @@ -232,12 +232,12 @@ func (i *LineItemIter) LineItemList() *stripe.LineItemList { return i.List().(*stripe.LineItemList) } -// ListLineItems is the method for the `GET /v1/quotes/{quote}/line_items` API. +// When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.QuoteListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/quotes/{quote}/line_items` API. +// When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.QuoteListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/quotes/%s/line_items", @@ -258,12 +258,12 @@ func (c Client) ListLineItems(listParams *stripe.QuoteListLineItemsParams) *Line } } -// ListLines is the method for the `GET /v1/quotes/{quote}/lines` API. +// Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. func ListLines(params *stripe.QuoteListLinesParams) *LineIter { return getC().ListLines(params) } -// ListLines is the method for the `GET /v1/quotes/{quote}/lines` API. +// Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. func (c Client) ListLines(listParams *stripe.QuoteListLinesParams) *LineIter { path := stripe.FormatURLPath( "/v1/quotes/%s/lines", @@ -301,12 +301,12 @@ func (i *LineIter) QuoteLineList() *stripe.QuoteLineList { return i.List().(*stripe.QuoteLineList) } -// ListPreviewInvoiceLines is the method for the `GET /v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines` API. +// Preview the invoice line items that would be generated by accepting the quote. func ListPreviewInvoiceLines(params *stripe.QuoteListPreviewInvoiceLinesParams) *InvoiceLineItemIter { return getC().ListPreviewInvoiceLines(params) } -// ListPreviewInvoiceLines is the method for the `GET /v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines` API. +// Preview the invoice line items that would be generated by accepting the quote. func (c Client) ListPreviewInvoiceLines(listParams *stripe.QuoteListPreviewInvoiceLinesParams) *InvoiceLineItemIter { path := stripe.FormatURLPath( "/v1/quotes/%s/preview_invoices/%s/lines", diff --git a/quotephase/client.go b/quotephase/client.go index 45463bbf39..b877ef7382 100644 --- a/quotephase/client.go +++ b/quotephase/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a quote phase. +// Retrieves the quote phase with the given ID. func Get(id string, params *stripe.QuotePhaseParams) (*stripe.QuotePhase, error) { return getC().Get(id, params) } -// Get returns the details of a quote phase. +// Retrieves the quote phase with the given ID. func (c Client) Get(id string, params *stripe.QuotePhaseParams) (*stripe.QuotePhase, error) { path := stripe.FormatURLPath("/v1/quote_phases/%s", id) quotephase := &stripe.QuotePhase{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.QuotePhaseParams) (*stripe.QuotePh return quotephase, err } -// List returns a list of quote phases. +// Returns a list of quote phases. func List(params *stripe.QuotePhaseListParams) *Iter { return getC().List(params) } -// List returns a list of quote phases. +// Returns a list of quote phases. func (c Client) List(listParams *stripe.QuotePhaseListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -72,12 +72,12 @@ func (i *Iter) QuotePhaseList() *stripe.QuotePhaseList { return i.List().(*stripe.QuotePhaseList) } -// ListLineItems is the method for the `GET /v1/quote_phases/{quote_phase}/line_items` API. +// When retrieving a quote phase, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLineItems(params *stripe.QuotePhaseListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/quote_phases/{quote_phase}/line_items` API. +// When retrieving a quote phase, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLineItems(listParams *stripe.QuotePhaseListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/quote_phases/%s/line_items", diff --git a/quotepreviewinvoice/client.go b/quotepreviewinvoice/client.go index 941bd2e89d..c50a8b50aa 100644 --- a/quotepreviewinvoice/client.go +++ b/quotepreviewinvoice/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// List returns a list of quote preview invoices. +// Preview the invoices that would be generated by accepting the quote. func List(params *stripe.QuotePreviewInvoiceListParams) *Iter { return getC().List(params) } -// List returns a list of quote preview invoices. +// Preview the invoices that would be generated by accepting the quote. func (c Client) List(listParams *stripe.QuotePreviewInvoiceListParams) *Iter { path := stripe.FormatURLPath( "/v1/quotes/%s/preview_invoices", diff --git a/quotepreviewsubscriptionschedule/client.go b/quotepreviewsubscriptionschedule/client.go index 95a63a5f4d..02d38558e1 100644 --- a/quotepreviewsubscriptionschedule/client.go +++ b/quotepreviewsubscriptionschedule/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// List returns a list of quote preview subscription schedules. +// Preview the schedules that would be generated by accepting the quote func List(params *stripe.QuotePreviewSubscriptionScheduleListParams) *Iter { return getC().List(params) } -// List returns a list of quote preview subscription schedules. +// Preview the schedules that would be generated by accepting the quote func (c Client) List(listParams *stripe.QuotePreviewSubscriptionScheduleListParams) *Iter { path := stripe.FormatURLPath( "/v1/quotes/%s/preview_subscription_schedules", diff --git a/radar/earlyfraudwarning/client.go b/radar/earlyfraudwarning/client.go index 37c725c96a..8274e63bf1 100644 --- a/radar/earlyfraudwarning/client.go +++ b/radar/earlyfraudwarning/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// Get returns the details of a radar early fraud warning. +// Retrieves the details of an early fraud warning that has previously been created. +// +// Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. func Get(id string, params *stripe.RadarEarlyFraudWarningParams) (*stripe.RadarEarlyFraudWarning, error) { return getC().Get(id, params) } -// Get returns the details of a radar early fraud warning. +// Retrieves the details of an early fraud warning that has previously been created. +// +// Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. func (c Client) Get(id string, params *stripe.RadarEarlyFraudWarningParams) (*stripe.RadarEarlyFraudWarning, error) { path := stripe.FormatURLPath("/v1/radar/early_fraud_warnings/%s", id) earlyfraudwarning := &stripe.RadarEarlyFraudWarning{} @@ -33,12 +37,12 @@ func (c Client) Get(id string, params *stripe.RadarEarlyFraudWarningParams) (*st return earlyfraudwarning, err } -// List returns a list of radar early fraud warnings. +// Returns a list of early fraud warnings. func List(params *stripe.RadarEarlyFraudWarningListParams) *Iter { return getC().List(params) } -// List returns a list of radar early fraud warnings. +// Returns a list of early fraud warnings. func (c Client) List(listParams *stripe.RadarEarlyFraudWarningListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/radar/valuelist/client.go b/radar/valuelist/client.go index 7b7577bc99..f47e74e584 100644 --- a/radar/valuelist/client.go +++ b/radar/valuelist/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new radar value list. +// Creates a new ValueList object, which can then be referenced in rules. func New(params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().New(params) } -// New creates a new radar value list. +// Creates a new ValueList object, which can then be referenced in rules. func (c Client) New(params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { valuelist := &stripe.RadarValueList{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.RadarValueListParams) (*stripe.RadarValueList return valuelist, err } -// Get returns the details of a radar value list. +// Retrieves a ValueList object. func Get(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().Get(id, params) } -// Get returns the details of a radar value list. +// Retrieves a ValueList object. func (c Client) Get(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { path := stripe.FormatURLPath("/v1/radar/value_lists/%s", id) valuelist := &stripe.RadarValueList{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.RadarValueListParams) (*stripe.Rad return valuelist, err } -// Update updates a radar value list's properties. +// Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. func Update(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().Update(id, params) } -// Update updates a radar value list's properties. +// Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. func (c Client) Update(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { path := stripe.FormatURLPath("/v1/radar/value_lists/%s", id) valuelist := &stripe.RadarValueList{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.RadarValueListParams) (*stripe. return valuelist, err } -// Del removes a radar value list. +// Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. func Del(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { return getC().Del(id, params) } -// Del removes a radar value list. +// Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. func (c Client) Del(id string, params *stripe.RadarValueListParams) (*stripe.RadarValueList, error) { path := stripe.FormatURLPath("/v1/radar/value_lists/%s", id) valuelist := &stripe.RadarValueList{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.RadarValueListParams) (*stripe.Rad return valuelist, err } -// List returns a list of radar value lists. +// Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.RadarValueListListParams) *Iter { return getC().List(params) } -// List returns a list of radar value lists. +// Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.RadarValueListListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/radar/valuelistitem/client.go b/radar/valuelistitem/client.go index 339802f33a..f444f2ec6e 100644 --- a/radar/valuelistitem/client.go +++ b/radar/valuelistitem/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// New creates a new radar value list item. +// Creates a new ValueListItem object, which is added to the specified parent value list. func New(params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { return getC().New(params) } -// New creates a new radar value list item. +// Creates a new ValueListItem object, which is added to the specified parent value list. func (c Client) New(params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { valuelistitem := &stripe.RadarValueListItem{} err := c.B.Call( @@ -39,12 +39,12 @@ func (c Client) New(params *stripe.RadarValueListItemParams) (*stripe.RadarValue return valuelistitem, err } -// Get returns the details of a radar value list item. +// Retrieves a ValueListItem object. func Get(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { return getC().Get(id, params) } -// Get returns the details of a radar value list item. +// Retrieves a ValueListItem object. func (c Client) Get(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { path := stripe.FormatURLPath("/v1/radar/value_list_items/%s", id) valuelistitem := &stripe.RadarValueListItem{} @@ -52,12 +52,12 @@ func (c Client) Get(id string, params *stripe.RadarValueListItemParams) (*stripe return valuelistitem, err } -// Del removes a radar value list item. +// Deletes a ValueListItem object, removing it from its parent value list. func Del(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { return getC().Del(id, params) } -// Del removes a radar value list item. +// Deletes a ValueListItem object, removing it from its parent value list. func (c Client) Del(id string, params *stripe.RadarValueListItemParams) (*stripe.RadarValueListItem, error) { path := stripe.FormatURLPath("/v1/radar/value_list_items/%s", id) valuelistitem := &stripe.RadarValueListItem{} @@ -65,12 +65,12 @@ func (c Client) Del(id string, params *stripe.RadarValueListItemParams) (*stripe return valuelistitem, err } -// List returns a list of radar value list items. +// Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.RadarValueListItemListParams) *Iter { return getC().List(params) } -// List returns a list of radar value list items. +// Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.RadarValueListItemListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/refund/client.go b/refund/client.go index 7e243ce78d..aa847786d9 100644 --- a/refund/client.go +++ b/refund/client.go @@ -20,24 +20,44 @@ type Client struct { Key string } -// New creates a new 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. func New(params *stripe.RefundParams) (*stripe.Refund, error) { return getC().New(params) } -// New creates a new 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. func (c Client) New(params *stripe.RefundParams) (*stripe.Refund, error) { refund := &stripe.Refund{} err := c.B.Call(http.MethodPost, "/v1/refunds", c.Key, params, refund) return refund, err } -// Get returns the details of a refund. +// Retrieves the details of an existing refund. func Get(id string, params *stripe.RefundParams) (*stripe.Refund, error) { return getC().Get(id, params) } -// Get returns the details of a refund. +// Retrieves the details of an existing refund. func (c Client) Get(id string, params *stripe.RefundParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s", id) refund := &stripe.Refund{} @@ -45,12 +65,16 @@ func (c Client) Get(id string, params *stripe.RefundParams) (*stripe.Refund, err return refund, err } -// Update updates a refund's properties. +// Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. +// +// This request only accepts metadata as an argument. func Update(id string, params *stripe.RefundParams) (*stripe.Refund, error) { return getC().Update(id, params) } -// Update updates a refund's properties. +// Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. +// +// This request only accepts metadata as an argument. func (c Client) Update(id string, params *stripe.RefundParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s", id) refund := &stripe.Refund{} @@ -58,12 +82,16 @@ func (c Client) Update(id string, params *stripe.RefundParams) (*stripe.Refund, return refund, err } -// Cancel is the method for the `POST /v1/refunds/{refund}/cancel` API. +// Cancels a refund with a status of requires_action. +// +// You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. func Cancel(id string, params *stripe.RefundCancelParams) (*stripe.Refund, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/refunds/{refund}/cancel` API. +// Cancels a refund with a status of requires_action. +// +// You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. func (c Client) Cancel(id string, params *stripe.RefundCancelParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/refunds/%s/cancel", id) refund := &stripe.Refund{} @@ -71,12 +99,12 @@ func (c Client) Cancel(id string, params *stripe.RefundCancelParams) (*stripe.Re return refund, err } -// List returns a list of refunds. +// 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. func List(params *stripe.RefundListParams) *Iter { return getC().List(params) } -// List returns a list of refunds. +// 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. func (c Client) List(listParams *stripe.RefundListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/reporting/reportrun/client.go b/reporting/reportrun/client.go index 01dcb8a115..f23eb78a41 100644 --- a/reporting/reportrun/client.go +++ b/reporting/reportrun/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new reporting report run. +// Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func New(params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { return getC().New(params) } -// New creates a new reporting report run. +// Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func (c Client) New(params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { reportrun := &stripe.ReportingReportRun{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ReportingReportRunParams) (*stripe.ReportingR return reportrun, err } -// Get returns the details of a reporting report run. +// Retrieves the details of an existing Report Run. func Get(id string, params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { return getC().Get(id, params) } -// Get returns the details of a reporting report run. +// Retrieves the details of an existing Report Run. func (c Client) Get(id string, params *stripe.ReportingReportRunParams) (*stripe.ReportingReportRun, error) { path := stripe.FormatURLPath("/v1/reporting/report_runs/%s", id) reportrun := &stripe.ReportingReportRun{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ReportingReportRunParams) (*stripe return reportrun, err } -// List returns a list of reporting report runs. +// Returns a list of Report Runs, with the most recent appearing first. func List(params *stripe.ReportingReportRunListParams) *Iter { return getC().List(params) } -// List returns a list of reporting report runs. +// Returns a list of Report Runs, with the most recent appearing first. func (c Client) List(listParams *stripe.ReportingReportRunListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/reporting/reporttype/client.go b/reporting/reporttype/client.go index 25881aab05..ebda1a2372 100644 --- a/reporting/reporttype/client.go +++ b/reporting/reporttype/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a reporting report type. +// Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func Get(id string, params *stripe.ReportingReportTypeParams) (*stripe.ReportingReportType, error) { return getC().Get(id, params) } -// Get returns the details of a reporting report type. +// Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) func (c Client) Get(id string, params *stripe.ReportingReportTypeParams) (*stripe.ReportingReportType, error) { path := stripe.FormatURLPath("/v1/reporting/report_types/%s", id) reporttype := &stripe.ReportingReportType{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ReportingReportTypeParams) (*strip return reporttype, err } -// List returns a list of reporting report types. +// Returns a full list of Report Types. func List(params *stripe.ReportingReportTypeListParams) *Iter { return getC().List(params) } -// List returns a list of reporting report types. +// Returns a full list of Report Types. func (c Client) List(listParams *stripe.ReportingReportTypeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/review/client.go b/review/client.go index 9cf4c12136..6781b244d6 100644 --- a/review/client.go +++ b/review/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a review. +// Retrieves a Review object. func Get(id string, params *stripe.ReviewParams) (*stripe.Review, error) { return getC().Get(id, params) } -// Get returns the details of a review. +// Retrieves a Review object. func (c Client) Get(id string, params *stripe.ReviewParams) (*stripe.Review, error) { path := stripe.FormatURLPath("/v1/reviews/%s", id) review := &stripe.Review{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.ReviewParams) (*stripe.Review, err return review, err } -// Approve is the method for the `POST /v1/reviews/{review}/approve` API. +// Approves a Review object, closing it and removing it from the list of reviews. func Approve(id string, params *stripe.ReviewApproveParams) (*stripe.Review, error) { return getC().Approve(id, params) } -// Approve is the method for the `POST /v1/reviews/{review}/approve` API. +// Approves a Review object, closing it and removing it from the list of reviews. func (c Client) Approve(id string, params *stripe.ReviewApproveParams) (*stripe.Review, error) { path := stripe.FormatURLPath("/v1/reviews/%s/approve", id) review := &stripe.Review{} @@ -46,12 +46,12 @@ func (c Client) Approve(id string, params *stripe.ReviewApproveParams) (*stripe. return review, err } -// List returns a list of reviews. +// Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func List(params *stripe.ReviewListParams) *Iter { return getC().List(params) } -// List returns a list of reviews. +// Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. func (c Client) List(listParams *stripe.ReviewListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/setupattempt/client.go b/setupattempt/client.go index 5f61a23701..fd4cea77e9 100644 --- a/setupattempt/client.go +++ b/setupattempt/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// List returns a list of setup attempts. +// Returns a list of SetupAttempts that associate with a provided SetupIntent. func List(params *stripe.SetupAttemptListParams) *Iter { return getC().List(params) } -// List returns a list of setup attempts. +// Returns a list of SetupAttempts that associate with a provided SetupIntent. func (c Client) List(listParams *stripe.SetupAttemptListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/setupintent/client.go b/setupintent/client.go index 421f5cb6fb..c9baad4ce8 100644 --- a/setupintent/client.go +++ b/setupintent/client.go @@ -20,12 +20,18 @@ type Client struct { Key string } -// New creates a new setup intent. +// Creates a SetupIntent object. +// +// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) +// it to collect any required permissions to charge the payment method later. func New(params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { return getC().New(params) } -// New creates a new setup intent. +// Creates a SetupIntent object. +// +// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) +// it to collect any required permissions to charge the payment method later. func (c Client) New(params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { setupintent := &stripe.SetupIntent{} err := c.B.Call( @@ -38,12 +44,20 @@ func (c Client) New(params *stripe.SetupIntentParams) (*stripe.SetupIntent, erro return setupintent, err } -// Get returns the details of a setup intent. +// Retrieves the details of a SetupIntent that has previously been created. +// +// Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. +// +// When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. func Get(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { return getC().Get(id, params) } -// Get returns the details of a setup intent. +// Retrieves the details of a SetupIntent that has previously been created. +// +// Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. +// +// When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. func (c Client) Get(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s", id) setupintent := &stripe.SetupIntent{} @@ -51,12 +65,12 @@ func (c Client) Get(id string, params *stripe.SetupIntentParams) (*stripe.SetupI return setupintent, err } -// Update updates a setup intent's properties. +// Updates a SetupIntent object. func Update(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { return getC().Update(id, params) } -// Update updates a setup intent's properties. +// Updates a SetupIntent object. func (c Client) Update(id string, params *stripe.SetupIntentParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s", id) setupintent := &stripe.SetupIntent{} @@ -64,12 +78,16 @@ func (c Client) Update(id string, params *stripe.SetupIntentParams) (*stripe.Set return setupintent, err } -// Cancel is the method for the `POST /v1/setup_intents/{intent}/cancel` API. +// You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. +// +// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. func Cancel(id string, params *stripe.SetupIntentCancelParams) (*stripe.SetupIntent, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/setup_intents/{intent}/cancel` API. +// You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. +// +// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. func (c Client) Cancel(id string, params *stripe.SetupIntentCancelParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s/cancel", id) setupintent := &stripe.SetupIntent{} @@ -77,12 +95,38 @@ func (c Client) Cancel(id string, params *stripe.SetupIntentCancelParams) (*stri return setupintent, err } -// Confirm is the method for the `POST /v1/setup_intents/{intent}/confirm` API. +// Confirm that your customer intends to set up the current or +// provided payment method. For example, you would confirm a SetupIntent +// when a customer hits the “Save” button on a payment method management +// page on your website. +// +// If the selected payment method does not require any additional +// steps from the customer, the SetupIntent will transition to the +// succeeded status. +// +// Otherwise, it will transition to the requires_action status and +// suggest additional actions via next_action. If setup fails, +// the SetupIntent will transition to the +// requires_payment_method status or the canceled status if the +// confirmation limit is reached. func Confirm(id string, params *stripe.SetupIntentConfirmParams) (*stripe.SetupIntent, error) { return getC().Confirm(id, params) } -// Confirm is the method for the `POST /v1/setup_intents/{intent}/confirm` API. +// Confirm that your customer intends to set up the current or +// provided payment method. For example, you would confirm a SetupIntent +// when a customer hits the “Save” button on a payment method management +// page on your website. +// +// If the selected payment method does not require any additional +// steps from the customer, the SetupIntent will transition to the +// succeeded status. +// +// Otherwise, it will transition to the requires_action status and +// suggest additional actions via next_action. If setup fails, +// the SetupIntent will transition to the +// requires_payment_method status or the canceled status if the +// confirmation limit is reached. func (c Client) Confirm(id string, params *stripe.SetupIntentConfirmParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s/confirm", id) setupintent := &stripe.SetupIntent{} @@ -90,12 +134,12 @@ func (c Client) Confirm(id string, params *stripe.SetupIntentConfirmParams) (*st return setupintent, err } -// VerifyMicrodeposits is the method for the `POST /v1/setup_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a SetupIntent object. func VerifyMicrodeposits(id string, params *stripe.SetupIntentVerifyMicrodepositsParams) (*stripe.SetupIntent, error) { return getC().VerifyMicrodeposits(id, params) } -// VerifyMicrodeposits is the method for the `POST /v1/setup_intents/{intent}/verify_microdeposits` API. +// Verifies microdeposits on a SetupIntent object. func (c Client) VerifyMicrodeposits(id string, params *stripe.SetupIntentVerifyMicrodepositsParams) (*stripe.SetupIntent, error) { path := stripe.FormatURLPath("/v1/setup_intents/%s/verify_microdeposits", id) setupintent := &stripe.SetupIntent{} @@ -103,12 +147,12 @@ func (c Client) VerifyMicrodeposits(id string, params *stripe.SetupIntentVerifyM return setupintent, err } -// List returns a list of setup intents. +// Returns a list of SetupIntents. func List(params *stripe.SetupIntentListParams) *Iter { return getC().List(params) } -// List returns a list of setup intents. +// Returns a list of SetupIntents. func (c Client) List(listParams *stripe.SetupIntentListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/shippingrate/client.go b/shippingrate/client.go index 275feea3a8..9ec05de13e 100644 --- a/shippingrate/client.go +++ b/shippingrate/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new shipping rate. +// Creates a new shipping rate object. func New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { return getC().New(params) } -// New creates a new shipping rate. +// Creates a new shipping rate object. func (c Client) New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { shippingrate := &stripe.ShippingRate{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.ShippingRateParams) (*stripe.ShippingRate, er return shippingrate, err } -// Get returns the details of a shipping rate. +// Returns the shipping rate object with the given ID. func Get(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { return getC().Get(id, params) } -// Get returns the details of a shipping rate. +// Returns the shipping rate object with the given ID. func (c Client) Get(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { path := stripe.FormatURLPath("/v1/shipping_rates/%s", id) shippingrate := &stripe.ShippingRate{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.ShippingRateParams) (*stripe.Shipp return shippingrate, err } -// Update updates a shipping rate's properties. +// Updates an existing shipping rate object. func Update(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { return getC().Update(id, params) } -// Update updates a shipping rate's properties. +// Updates an existing shipping rate object. func (c Client) Update(id string, params *stripe.ShippingRateParams) (*stripe.ShippingRate, error) { path := stripe.FormatURLPath("/v1/shipping_rates/%s", id) shippingrate := &stripe.ShippingRate{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.ShippingRateParams) (*stripe.Sh return shippingrate, err } -// List returns a list of shipping rates. +// Returns a list of your shipping rates. func List(params *stripe.ShippingRateListParams) *Iter { return getC().List(params) } -// List returns a list of shipping rates. +// Returns a list of your shipping rates. func (c Client) List(listParams *stripe.ShippingRateListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/sigma/scheduledqueryrun/client.go b/sigma/scheduledqueryrun/client.go index df3b796b2e..f3de28f846 100644 --- a/sigma/scheduledqueryrun/client.go +++ b/sigma/scheduledqueryrun/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// Get returns the details of a sigma scheduled query run. +// Retrieves the details of an scheduled query run. func Get(id string, params *stripe.SigmaScheduledQueryRunParams) (*stripe.SigmaScheduledQueryRun, error) { return getC().Get(id, params) } -// Get returns the details of a sigma scheduled query run. +// Retrieves the details of an scheduled query run. func (c Client) Get(id string, params *stripe.SigmaScheduledQueryRunParams) (*stripe.SigmaScheduledQueryRun, error) { path := stripe.FormatURLPath("/v1/sigma/scheduled_query_runs/%s", id) scheduledqueryrun := &stripe.SigmaScheduledQueryRun{} @@ -34,12 +34,12 @@ func (c Client) Get(id string, params *stripe.SigmaScheduledQueryRunParams) (*st return scheduledqueryrun, err } -// List returns a list of sigma scheduled query runs. +// Returns a list of scheduled query runs. func List(params *stripe.SigmaScheduledQueryRunListParams) *Iter { return getC().List(params) } -// List returns a list of sigma scheduled query runs. +// Returns a list of scheduled query runs. func (c Client) List(listParams *stripe.SigmaScheduledQueryRunListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/source/client.go b/source/client.go index 96e68cc981..168e781c00 100644 --- a/source/client.go +++ b/source/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new source. +// Creates a new source object. func New(params *stripe.SourceParams) (*stripe.Source, error) { return getC().New(params) } -// New creates a new source. +// Creates a new source object. func (c Client) New(params *stripe.SourceParams) (*stripe.Source, error) { source := &stripe.Source{} err := c.B.Call(http.MethodPost, "/v1/sources", c.Key, params, source) return source, err } -// Get returns the details of a source. +// Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. func Get(id string, params *stripe.SourceParams) (*stripe.Source, error) { return getC().Get(id, params) } -// Get returns the details of a source. +// Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. func (c Client) Get(id string, params *stripe.SourceParams) (*stripe.Source, error) { path := stripe.FormatURLPath("/v1/sources/%s", id) source := &stripe.Source{} @@ -45,12 +45,16 @@ func (c Client) Get(id string, params *stripe.SourceParams) (*stripe.Source, err return source, err } -// Update updates a source's properties. +// Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. func Update(id string, params *stripe.SourceParams) (*stripe.Source, error) { return getC().Update(id, params) } -// Update updates a source's properties. +// Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. func (c Client) Update(id string, params *stripe.SourceParams) (*stripe.Source, error) { path := stripe.FormatURLPath("/v1/sources/%s", id) source := &stripe.Source{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.SourceParams) (*stripe.Source, return source, err } -// Detach is the method for the `DELETE /v1/customers/{customer}/sources/{id}` API. +// Delete a specified source for a given customer. func Detach(id string, params *stripe.SourceDetachParams) (*stripe.Source, error) { return getC().Detach(id, params) } -// Detach is the method for the `DELETE /v1/customers/{customer}/sources/{id}` API. +// Delete a specified source for a given customer. func (c Client) Detach(id string, params *stripe.SourceDetachParams) (*stripe.Source, error) { if params.Customer == nil { return nil, fmt.Errorf( diff --git a/sourcetransaction/client.go b/sourcetransaction/client.go index 56f8261867..b7f13858cd 100644 --- a/sourcetransaction/client.go +++ b/sourcetransaction/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// List returns a list of source transactions. +// List source transactions for a given source. func List(params *stripe.SourceTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of source transactions. +// List source transactions for a given source. func (c Client) List(listParams *stripe.SourceTransactionListParams) *Iter { if listParams == nil || listParams.Source == nil { return &Iter{ diff --git a/subscription/client.go b/subscription/client.go index dd00b0cf0d..5d43918ab3 100644 --- a/subscription/client.go +++ b/subscription/client.go @@ -20,12 +20,24 @@ type Client struct { Key string } -// New creates a new subscription. +// Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. +// +// When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. +// The payment_behavior parameter determines the exact behavior of the initial payment. +// +// To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. +// Schedules provide the flexibility to model more complex billing configurations that change over time. func New(params *stripe.SubscriptionParams) (*stripe.Subscription, error) { return getC().New(params) } -// New creates a new subscription. +// Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. +// +// When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. +// The payment_behavior parameter determines the exact behavior of the initial payment. +// +// To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. +// Schedules provide the flexibility to model more complex billing configurations that change over time. func (c Client) New(params *stripe.SubscriptionParams) (*stripe.Subscription, error) { subscription := &stripe.Subscription{} err := c.B.Call( @@ -38,12 +50,12 @@ func (c Client) New(params *stripe.SubscriptionParams) (*stripe.Subscription, er return subscription, err } -// Get returns the details of a subscription. +// Retrieves the subscription with the given ID. func Get(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { return getC().Get(id, params) } -// Get returns the details of a subscription. +// Retrieves the subscription with the given ID. func (c Client) Get(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s", id) subscription := &stripe.Subscription{} @@ -51,12 +63,48 @@ func (c Client) Get(id string, params *stripe.SubscriptionParams) (*stripe.Subsc return subscription, err } -// Update updates a subscription's properties. +// Updates an existing subscription to match the specified parameters. +// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. +// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. +// +// By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. +// +// Switching prices does not normally change the billing date or generate an immediate charge unless: +// +// The billing interval is changed (for example, from monthly to yearly). +// The subscription moves from free to paid, or paid to free. +// A trial starts or ends. +// +// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. +// +// If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). +// +// If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. +// +// Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. func Update(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { return getC().Update(id, params) } -// Update updates a subscription's properties. +// Updates an existing subscription to match the specified parameters. +// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. +// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. +// +// By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. +// +// Switching prices does not normally change the billing date or generate an immediate charge unless: +// +// The billing interval is changed (for example, from monthly to yearly). +// The subscription moves from free to paid, or paid to free. +// A trial starts or ends. +// +// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. +// +// If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). +// +// If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. +// +// Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. func (c Client) Update(id string, params *stripe.SubscriptionParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s", id) subscription := &stripe.Subscription{} @@ -64,12 +112,20 @@ func (c Client) Update(id string, params *stripe.SubscriptionParams) (*stripe.Su return subscription, err } -// Cancel is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}` API. +// Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. +// +// Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. +// +// By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. func Cancel(id string, params *stripe.SubscriptionCancelParams) (*stripe.Subscription, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}` API. +// Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. +// +// Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. +// +// By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. func (c Client) Cancel(id string, params *stripe.SubscriptionCancelParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s", id) subscription := &stripe.Subscription{} @@ -77,12 +133,12 @@ func (c Client) Cancel(id string, params *stripe.SubscriptionCancelParams) (*str return subscription, err } -// DeleteDiscount is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}/discount` API. +// Removes the currently applied discount on a subscription. func DeleteDiscount(id string, params *stripe.SubscriptionDeleteDiscountParams) (*stripe.Subscription, error) { return getC().DeleteDiscount(id, params) } -// DeleteDiscount is the method for the `DELETE /v1/subscriptions/{subscription_exposed_id}/discount` API. +// Removes the currently applied discount on a subscription. func (c Client) DeleteDiscount(id string, params *stripe.SubscriptionDeleteDiscountParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s/discount", id) subscription := &stripe.Subscription{} @@ -90,12 +146,12 @@ func (c Client) DeleteDiscount(id string, params *stripe.SubscriptionDeleteDisco return subscription, err } -// Resume is the method for the `POST /v1/subscriptions/{subscription}/resume` API. +// Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. func Resume(id string, params *stripe.SubscriptionResumeParams) (*stripe.Subscription, error) { return getC().Resume(id, params) } -// Resume is the method for the `POST /v1/subscriptions/{subscription}/resume` API. +// Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. func (c Client) Resume(id string, params *stripe.SubscriptionResumeParams) (*stripe.Subscription, error) { path := stripe.FormatURLPath("/v1/subscriptions/%s/resume", id) subscription := &stripe.Subscription{} @@ -103,12 +159,12 @@ func (c Client) Resume(id string, params *stripe.SubscriptionResumeParams) (*str return subscription, err } -// List returns a list of subscriptions. +// By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. func List(params *stripe.SubscriptionListParams) *Iter { return getC().List(params) } -// List returns a list of subscriptions. +// By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. func (c Client) List(listParams *stripe.SubscriptionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -142,12 +198,18 @@ func (i *Iter) SubscriptionList() *stripe.SubscriptionList { return i.List().(*stripe.SubscriptionList) } -// Search returns a search result containing subscriptions. +// Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func Search(params *stripe.SubscriptionSearchParams) *SearchIter { return getC().Search(params) } -// Search returns a search result containing subscriptions. +// Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). +// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating +// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up +// to an hour behind during outages. Search functionality is not available to merchants in India. func (c Client) Search(params *stripe.SubscriptionSearchParams) *SearchIter { return &SearchIter{ SearchIter: stripe.GetSearchIter(params, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.SearchContainer, error) { diff --git a/subscriptionitem/client.go b/subscriptionitem/client.go index a946de3824..e937f72b9f 100644 --- a/subscriptionitem/client.go +++ b/subscriptionitem/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new subscription item. +// Adds a new item to an existing subscription. No existing items will be changed or replaced. func New(params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().New(params) } -// New creates a new subscription item. +// Adds a new item to an existing subscription. No existing items will be changed or replaced. func (c Client) New(params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { subscriptionitem := &stripe.SubscriptionItem{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.SubscriptionItemParams) (*stripe.Subscription return subscriptionitem, err } -// Get returns the details of a subscription item. +// Retrieves the subscription item with the given ID. func Get(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().Get(id, params) } -// Get returns the details of a subscription item. +// Retrieves the subscription item with the given ID. func (c Client) Get(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { path := stripe.FormatURLPath("/v1/subscription_items/%s", id) subscriptionitem := &stripe.SubscriptionItem{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.SubscriptionItemParams) (*stripe.S return subscriptionitem, err } -// Update updates a subscription item's properties. +// Updates the plan or quantity of an item on a current subscription. func Update(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().Update(id, params) } -// Update updates a subscription item's properties. +// Updates the plan or quantity of an item on a current subscription. func (c Client) Update(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { path := stripe.FormatURLPath("/v1/subscription_items/%s", id) subscriptionitem := &stripe.SubscriptionItem{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.SubscriptionItemParams) (*strip return subscriptionitem, err } -// Del removes a subscription item. +// Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. func Del(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { return getC().Del(id, params) } -// Del removes a subscription item. +// Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. func (c Client) Del(id string, params *stripe.SubscriptionItemParams) (*stripe.SubscriptionItem, error) { path := stripe.FormatURLPath("/v1/subscription_items/%s", id) subscriptionitem := &stripe.SubscriptionItem{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.SubscriptionItemParams) (*stripe.S return subscriptionitem, err } -// List returns a list of subscription items. +// Returns a list of your subscription items for a given subscription. func List(params *stripe.SubscriptionItemListParams) *Iter { return getC().List(params) } -// List returns a list of subscription items. +// Returns a list of your subscription items for a given subscription. func (c Client) List(listParams *stripe.SubscriptionItemListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { @@ -116,12 +116,16 @@ func (i *Iter) SubscriptionItemList() *stripe.SubscriptionItemList { return i.List().(*stripe.SubscriptionItemList) } -// UsageRecordSummaries is the method for the `GET /v1/subscription_items/{subscription_item}/usage_record_summaries` API. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func UsageRecordSummaries(params *stripe.SubscriptionItemUsageRecordSummariesParams) *UsageRecordSummaryIter { return getC().UsageRecordSummaries(params) } -// UsageRecordSummaries is the method for the `GET /v1/subscription_items/{subscription_item}/usage_record_summaries` API. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func (c Client) UsageRecordSummaries(listParams *stripe.SubscriptionItemUsageRecordSummariesParams) *UsageRecordSummaryIter { path := stripe.FormatURLPath( "/v1/subscription_items/%s/usage_record_summaries", diff --git a/subscriptionschedule/client.go b/subscriptionschedule/client.go index 3f9ee6ac7b..10be51ed1f 100644 --- a/subscriptionschedule/client.go +++ b/subscriptionschedule/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new subscription schedule. +// Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. func New(params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().New(params) } -// New creates a new subscription schedule. +// Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. func (c Client) New(params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { subscriptionschedule := &stripe.SubscriptionSchedule{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.SubscriptionScheduleParams) (*stripe.Subscrip return subscriptionschedule, err } -// Get returns the details of a subscription schedule. +// Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. func Get(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().Get(id, params) } -// Get returns the details of a subscription schedule. +// Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. func (c Client) Get(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.SubscriptionScheduleParams) (*stri return subscriptionschedule, err } -// Update updates a subscription schedule's properties. +// Updates an existing subscription schedule. func Update(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { return getC().Update(id, params) } -// Update updates a subscription schedule's properties. +// Updates an existing subscription schedule. func (c Client) Update(id string, params *stripe.SubscriptionScheduleParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.SubscriptionScheduleParams) (*s return subscriptionschedule, err } -// Amend is the method for the `POST /v1/subscription_schedules/{schedule}/amend` API. +// Amends an existing subscription schedule. func Amend(id string, params *stripe.SubscriptionScheduleAmendParams) (*stripe.SubscriptionSchedule, error) { return getC().Amend(id, params) } -// Amend is the method for the `POST /v1/subscription_schedules/{schedule}/amend` API. +// Amends an existing subscription schedule. func (c Client) Amend(id string, params *stripe.SubscriptionScheduleAmendParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s/amend", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -77,12 +77,12 @@ func (c Client) Amend(id string, params *stripe.SubscriptionScheduleAmendParams) return subscriptionschedule, err } -// Cancel is the method for the `POST /v1/subscription_schedules/{schedule}/cancel` API. +// Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. func Cancel(id string, params *stripe.SubscriptionScheduleCancelParams) (*stripe.SubscriptionSchedule, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/subscription_schedules/{schedule}/cancel` API. +// Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. func (c Client) Cancel(id string, params *stripe.SubscriptionScheduleCancelParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s/cancel", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -90,12 +90,12 @@ func (c Client) Cancel(id string, params *stripe.SubscriptionScheduleCancelParam return subscriptionschedule, err } -// Release is the method for the `POST /v1/subscription_schedules/{schedule}/release` API. +// Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. func Release(id string, params *stripe.SubscriptionScheduleReleaseParams) (*stripe.SubscriptionSchedule, error) { return getC().Release(id, params) } -// Release is the method for the `POST /v1/subscription_schedules/{schedule}/release` API. +// Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. func (c Client) Release(id string, params *stripe.SubscriptionScheduleReleaseParams) (*stripe.SubscriptionSchedule, error) { path := stripe.FormatURLPath("/v1/subscription_schedules/%s/release", id) subscriptionschedule := &stripe.SubscriptionSchedule{} @@ -103,12 +103,12 @@ func (c Client) Release(id string, params *stripe.SubscriptionScheduleReleasePar return subscriptionschedule, err } -// List returns a list of subscription schedules. +// Retrieves the list of your subscription schedules. func List(params *stripe.SubscriptionScheduleListParams) *Iter { return getC().List(params) } -// List returns a list of subscription schedules. +// Retrieves the list of your subscription schedules. func (c Client) List(listParams *stripe.SubscriptionScheduleListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/tax/calculation/client.go b/tax/calculation/client.go index 4f326f99b7..d9201aa7f8 100644 --- a/tax/calculation/client.go +++ b/tax/calculation/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new tax calculation. +// Calculates tax based on input and returns a Tax Calculation object. func New(params *stripe.TaxCalculationParams) (*stripe.TaxCalculation, error) { return getC().New(params) } -// New creates a new tax calculation. +// Calculates tax based on input and returns a Tax Calculation object. func (c Client) New(params *stripe.TaxCalculationParams) (*stripe.TaxCalculation, error) { calculation := &stripe.TaxCalculation{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TaxCalculationParams) (*stripe.TaxCalculation return calculation, err } -// ListLineItems is the method for the `GET /v1/tax/calculations/{calculation}/line_items` API. +// Retrieves the line items of a persisted tax calculation as a collection. func ListLineItems(params *stripe.TaxCalculationListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/tax/calculations/{calculation}/line_items` API. +// Retrieves the line items of a persisted tax calculation as a collection. func (c Client) ListLineItems(listParams *stripe.TaxCalculationListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/tax/calculations/%s/line_items", diff --git a/tax/form/client.go b/tax/form/client.go index e5e3737699..bb2ce37f72 100644 --- a/tax/form/client.go +++ b/tax/form/client.go @@ -21,12 +21,12 @@ type Client struct { Key string } -// Get returns the details of a tax form. +// Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information. func Get(id string, params *stripe.TaxFormParams) (*stripe.TaxForm, error) { return getC().Get(id, params) } -// Get returns the details of a tax form. +// Retrieves the details of a tax form that has previously been created. Supply the unique tax form ID that was returned from your previous request, and Stripe will return the corresponding tax form information. func (c Client) Get(id string, params *stripe.TaxFormParams) (*stripe.TaxForm, error) { path := stripe.FormatURLPath("/v1/tax/forms/%s", id) form := &stripe.TaxForm{} @@ -34,12 +34,12 @@ func (c Client) Get(id string, params *stripe.TaxFormParams) (*stripe.TaxForm, e return form, err } -// PDF is the method for the `GET /v1/tax/forms/{id}/pdf` API. +// Download the PDF for a tax form. func PDF(id string, params *stripe.TaxFormPDFParams) (*stripe.APIStream, error) { return getC().PDF(id, params) } -// PDF is the method for the `GET /v1/tax/forms/{id}/pdf` API. +// Download the PDF for a tax form. func (c Client) PDF(id string, params *stripe.TaxFormPDFParams) (*stripe.APIStream, error) { path := stripe.FormatURLPath("/v1/tax/forms/%s/pdf", id) stream := &stripe.APIStream{} @@ -47,12 +47,12 @@ func (c Client) PDF(id string, params *stripe.TaxFormPDFParams) (*stripe.APIStre return stream, err } -// List returns a list of tax forms. +// Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first. func List(params *stripe.TaxFormListParams) *Iter { return getC().List(params) } -// List returns a list of tax forms. +// Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first. func (c Client) List(listParams *stripe.TaxFormListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/tax/registration/client.go b/tax/registration/client.go index f2af0e91ba..316dfab503 100644 --- a/tax/registration/client.go +++ b/tax/registration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new tax registration. +// Creates a new Tax Registration object. func New(params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { return getC().New(params) } -// New creates a new tax registration. +// Creates a new Tax Registration object. func (c Client) New(params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { registration := &stripe.TaxRegistration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TaxRegistrationParams) (*stripe.TaxRegistrati return registration, err } -// Get returns the details of a tax registration. +// Returns a Tax Registration object. func Get(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { return getC().Get(id, params) } -// Get returns the details of a tax registration. +// Returns a Tax Registration object. func (c Client) Get(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { path := stripe.FormatURLPath("/v1/tax/registrations/%s", id) registration := &stripe.TaxRegistration{} @@ -51,12 +51,16 @@ func (c Client) Get(id string, params *stripe.TaxRegistrationParams) (*stripe.Ta return registration, err } -// Update updates a tax registration's properties. +// Updates an existing Tax Registration object. +// +// A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. func Update(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { return getC().Update(id, params) } -// Update updates a tax registration's properties. +// Updates an existing Tax Registration object. +// +// A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. func (c Client) Update(id string, params *stripe.TaxRegistrationParams) (*stripe.TaxRegistration, error) { path := stripe.FormatURLPath("/v1/tax/registrations/%s", id) registration := &stripe.TaxRegistration{} @@ -64,12 +68,12 @@ func (c Client) Update(id string, params *stripe.TaxRegistrationParams) (*stripe return registration, err } -// List returns a list of tax registrations. +// Returns a list of Tax Registration objects. func List(params *stripe.TaxRegistrationListParams) *Iter { return getC().List(params) } -// List returns a list of tax registrations. +// Returns a list of Tax Registration objects. func (c Client) List(listParams *stripe.TaxRegistrationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/tax/settings/client.go b/tax/settings/client.go index a773446387..755b259695 100644 --- a/tax/settings/client.go +++ b/tax/settings/client.go @@ -19,24 +19,24 @@ type Client struct { Key string } -// Get returns the details of a tax settings. +// Retrieves Tax Settings for a merchant. func Get(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { return getC().Get(params) } -// Get returns the details of a tax settings. +// Retrieves Tax Settings for a merchant. func (c Client) Get(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { settings := &stripe.TaxSettings{} err := c.B.Call(http.MethodGet, "/v1/tax/settings", c.Key, params, settings) return settings, err } -// Update updates a tax settings's properties. +// Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. func Update(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { return getC().Update(params) } -// Update updates a tax settings's properties. +// Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. func (c Client) Update(params *stripe.TaxSettingsParams) (*stripe.TaxSettings, error) { settings := &stripe.TaxSettings{} err := c.B.Call(http.MethodPost, "/v1/tax/settings", c.Key, params, settings) diff --git a/tax/transaction/client.go b/tax/transaction/client.go index a3848bbd65..bf54bca4a1 100644 --- a/tax/transaction/client.go +++ b/tax/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a tax transaction. +// Retrieves a Tax Transaction object. func Get(id string, params *stripe.TaxTransactionParams) (*stripe.TaxTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a tax transaction. +// Retrieves a Tax Transaction object. func (c Client) Get(id string, params *stripe.TaxTransactionParams) (*stripe.TaxTransaction, error) { path := stripe.FormatURLPath("/v1/tax/transactions/%s", id) transaction := &stripe.TaxTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TaxTransactionParams) (*stripe.Tax return transaction, err } -// CreateFromCalculation is the method for the `POST /v1/tax/transactions/create_from_calculation` API. +// Creates a Tax Transaction from a calculation. func CreateFromCalculation(params *stripe.TaxTransactionCreateFromCalculationParams) (*stripe.TaxTransaction, error) { return getC().CreateFromCalculation(params) } -// CreateFromCalculation is the method for the `POST /v1/tax/transactions/create_from_calculation` API. +// Creates a Tax Transaction from a calculation. func (c Client) CreateFromCalculation(params *stripe.TaxTransactionCreateFromCalculationParams) (*stripe.TaxTransaction, error) { transaction := &stripe.TaxTransaction{} err := c.B.Call( @@ -51,12 +51,12 @@ func (c Client) CreateFromCalculation(params *stripe.TaxTransactionCreateFromCal return transaction, err } -// CreateReversal is the method for the `POST /v1/tax/transactions/create_reversal` API. +// Partially or fully reverses a previously created Transaction. func CreateReversal(params *stripe.TaxTransactionCreateReversalParams) (*stripe.TaxTransaction, error) { return getC().CreateReversal(params) } -// CreateReversal is the method for the `POST /v1/tax/transactions/create_reversal` API. +// Partially or fully reverses a previously created Transaction. func (c Client) CreateReversal(params *stripe.TaxTransactionCreateReversalParams) (*stripe.TaxTransaction, error) { transaction := &stripe.TaxTransaction{} err := c.B.Call( @@ -69,12 +69,12 @@ func (c Client) CreateReversal(params *stripe.TaxTransactionCreateReversalParams return transaction, err } -// ListLineItems is the method for the `GET /v1/tax/transactions/{transaction}/line_items` API. +// Retrieves the line items of a committed standalone transaction as a collection. func ListLineItems(params *stripe.TaxTransactionListLineItemsParams) *LineItemIter { return getC().ListLineItems(params) } -// ListLineItems is the method for the `GET /v1/tax/transactions/{transaction}/line_items` API. +// Retrieves the line items of a committed standalone transaction as a collection. func (c Client) ListLineItems(listParams *stripe.TaxTransactionListLineItemsParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/tax/transactions/%s/line_items", diff --git a/taxcode/client.go b/taxcode/client.go index b450705658..284da8e338 100644 --- a/taxcode/client.go +++ b/taxcode/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a tax code. +// Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. func Get(id string, params *stripe.TaxCodeParams) (*stripe.TaxCode, error) { return getC().Get(id, params) } -// Get returns the details of a tax code. +// Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. func (c Client) Get(id string, params *stripe.TaxCodeParams) (*stripe.TaxCode, error) { path := stripe.FormatURLPath("/v1/tax_codes/%s", id) taxcode := &stripe.TaxCode{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TaxCodeParams) (*stripe.TaxCode, e return taxcode, err } -// List returns a list of tax codes. +// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. func List(params *stripe.TaxCodeListParams) *Iter { return getC().List(params) } -// List returns a list of tax codes. +// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. func (c Client) List(listParams *stripe.TaxCodeListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/taxid/client.go b/taxid/client.go index f6a345d200..9cd8e2826e 100644 --- a/taxid/client.go +++ b/taxid/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new tax id. +// Creates a new tax_id object for a customer. func New(params *stripe.TaxIDParams) (*stripe.TaxID, error) { return getC().New(params) } -// New creates a new tax id. +// Creates a new tax_id object for a customer. func (c Client) New(params *stripe.TaxIDParams) (*stripe.TaxID, error) { path := "/v1/tax_ids" if params.Customer != nil { @@ -39,12 +39,12 @@ func (c Client) New(params *stripe.TaxIDParams) (*stripe.TaxID, error) { return taxid, err } -// Get returns the details of a tax id. +// Retrieves the tax_id object with the given identifier. func Get(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { return getC().Get(id, params) } -// Get returns the details of a tax id. +// Retrieves the tax_id object with the given identifier. func (c Client) Get(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { path := stripe.FormatURLPath( "/v1/tax_ids/%s", @@ -62,12 +62,12 @@ func (c Client) Get(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error return taxid, err } -// Del removes a tax id. +// Deletes an existing tax_id object. func Del(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { return getC().Del(id, params) } -// Del removes a tax id. +// Deletes an existing tax_id object. func (c Client) Del(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error) { path := stripe.FormatURLPath( "/v1/tax_ids/%s", @@ -85,12 +85,12 @@ func (c Client) Del(id string, params *stripe.TaxIDParams) (*stripe.TaxID, error return taxid, err } -// List returns a list of tax ids. +// Returns a list of tax IDs for a customer. func List(params *stripe.TaxIDListParams) *Iter { return getC().List(params) } -// List returns a list of tax ids. +// Returns a list of tax IDs for a customer. func (c Client) List(listParams *stripe.TaxIDListParams) *Iter { path := "/v1/tax_ids" if listParams != nil && listParams.Customer != nil { diff --git a/taxrate/client.go b/taxrate/client.go index 6137eb560f..8763af721a 100644 --- a/taxrate/client.go +++ b/taxrate/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new tax rate. +// Creates a new tax rate. func New(params *stripe.TaxRateParams) (*stripe.TaxRate, error) { return getC().New(params) } -// New creates a new tax rate. +// Creates a new tax rate. func (c Client) New(params *stripe.TaxRateParams) (*stripe.TaxRate, error) { taxrate := &stripe.TaxRate{} err := c.B.Call(http.MethodPost, "/v1/tax_rates", c.Key, params, taxrate) return taxrate, err } -// Get returns the details of a tax rate. +// Retrieves a tax rate with the given ID func Get(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { return getC().Get(id, params) } -// Get returns the details of a tax rate. +// Retrieves a tax rate with the given ID func (c Client) Get(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { path := stripe.FormatURLPath("/v1/tax_rates/%s", id) taxrate := &stripe.TaxRate{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, e return taxrate, err } -// Update updates a tax rate's properties. +// Updates an existing tax rate. func Update(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { return getC().Update(id, params) } -// Update updates a tax rate's properties. +// Updates an existing tax rate. func (c Client) Update(id string, params *stripe.TaxRateParams) (*stripe.TaxRate, error) { path := stripe.FormatURLPath("/v1/tax_rates/%s", id) taxrate := &stripe.TaxRate{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.TaxRateParams) (*stripe.TaxRate return taxrate, err } -// List returns a list of tax rates. +// Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. func List(params *stripe.TaxRateListParams) *Iter { return getC().List(params) } -// List returns a list of tax rates. +// Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. func (c Client) List(listParams *stripe.TaxRateListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/terminal/configuration/client.go b/terminal/configuration/client.go index fc7d680299..29319f42bc 100644 --- a/terminal/configuration/client.go +++ b/terminal/configuration/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new terminal configuration. +// Creates a new Configuration object. func New(params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().New(params) } -// New creates a new terminal configuration. +// Creates a new Configuration object. func (c Client) New(params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { configuration := &stripe.TerminalConfiguration{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TerminalConfigurationParams) (*stripe.Termina return configuration, err } -// Get returns the details of a terminal configuration. +// Retrieves a Configuration object. func Get(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().Get(id, params) } -// Get returns the details of a terminal configuration. +// Retrieves a Configuration object. func (c Client) Get(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { path := stripe.FormatURLPath("/v1/terminal/configurations/%s", id) configuration := &stripe.TerminalConfiguration{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TerminalConfigurationParams) (*str return configuration, err } -// Update updates a terminal configuration's properties. +// Updates a new Configuration object. func Update(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().Update(id, params) } -// Update updates a terminal configuration's properties. +// Updates a new Configuration object. func (c Client) Update(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { path := stripe.FormatURLPath("/v1/terminal/configurations/%s", id) configuration := &stripe.TerminalConfiguration{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.TerminalConfigurationParams) (* return configuration, err } -// Del removes a terminal configuration. +// Deletes a Configuration object. func Del(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { return getC().Del(id, params) } -// Del removes a terminal configuration. +// Deletes a Configuration object. func (c Client) Del(id string, params *stripe.TerminalConfigurationParams) (*stripe.TerminalConfiguration, error) { path := stripe.FormatURLPath("/v1/terminal/configurations/%s", id) configuration := &stripe.TerminalConfiguration{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.TerminalConfigurationParams) (*str return configuration, err } -// List returns a list of terminal configurations. +// Returns a list of Configuration objects. func List(params *stripe.TerminalConfigurationListParams) *Iter { return getC().List(params) } -// List returns a list of terminal configurations. +// Returns a list of Configuration objects. func (c Client) List(listParams *stripe.TerminalConfigurationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/terminal/connectiontoken/client.go b/terminal/connectiontoken/client.go index 7cbcf6ee43..7e6aa816bc 100644 --- a/terminal/connectiontoken/client.go +++ b/terminal/connectiontoken/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new terminal connection token. +// To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. func New(params *stripe.TerminalConnectionTokenParams) (*stripe.TerminalConnectionToken, error) { return getC().New(params) } -// New creates a new terminal connection token. +// To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. func (c Client) New(params *stripe.TerminalConnectionTokenParams) (*stripe.TerminalConnectionToken, error) { connectiontoken := &stripe.TerminalConnectionToken{} err := c.B.Call( diff --git a/terminal/location/client.go b/terminal/location/client.go index 01c9a3ea0b..c16363ad01 100644 --- a/terminal/location/client.go +++ b/terminal/location/client.go @@ -20,12 +20,14 @@ type Client struct { Key string } -// New creates a new terminal location. +// Creates a new Location object. +// For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. func New(params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().New(params) } -// New creates a new terminal location. +// Creates a new Location object. +// For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. func (c Client) New(params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { location := &stripe.TerminalLocation{} err := c.B.Call( @@ -38,12 +40,12 @@ func (c Client) New(params *stripe.TerminalLocationParams) (*stripe.TerminalLoca return location, err } -// Get returns the details of a terminal location. +// Retrieves a Location object. func Get(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Get(id, params) } -// Get returns the details of a terminal location. +// Retrieves a Location object. func (c Client) Get(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} @@ -51,12 +53,12 @@ func (c Client) Get(id string, params *stripe.TerminalLocationParams) (*stripe.T return location, err } -// Update updates a terminal location's properties. +// Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Update(id, params) } -// Update updates a terminal location's properties. +// Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} @@ -64,12 +66,12 @@ func (c Client) Update(id string, params *stripe.TerminalLocationParams) (*strip return location, err } -// Del removes a terminal location. +// Deletes a Location object. func Del(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { return getC().Del(id, params) } -// Del removes a terminal location. +// Deletes a Location object. func (c Client) Del(id string, params *stripe.TerminalLocationParams) (*stripe.TerminalLocation, error) { path := stripe.FormatURLPath("/v1/terminal/locations/%s", id) location := &stripe.TerminalLocation{} @@ -77,12 +79,12 @@ func (c Client) Del(id string, params *stripe.TerminalLocationParams) (*stripe.T return location, err } -// List returns a list of terminal locations. +// Returns a list of Location objects. func List(params *stripe.TerminalLocationListParams) *Iter { return getC().List(params) } -// List returns a list of terminal locations. +// Returns a list of Location objects. func (c Client) List(listParams *stripe.TerminalLocationListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/terminal/reader/client.go b/terminal/reader/client.go index fa4b3dc5cd..297467f4c7 100644 --- a/terminal/reader/client.go +++ b/terminal/reader/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new terminal reader. +// Creates a new Reader object. func New(params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().New(params) } -// New creates a new terminal reader. +// Creates a new Reader object. func (c Client) New(params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { reader := &stripe.TerminalReader{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TerminalReaderParams) (*stripe.TerminalReader return reader, err } -// Get returns the details of a terminal reader. +// Retrieves a Reader object. func Get(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().Get(id, params) } -// Get returns the details of a terminal reader. +// Retrieves a Reader object. func (c Client) Get(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s", id) reader := &stripe.TerminalReader{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TerminalReaderParams) (*stripe.Ter return reader, err } -// Update updates a terminal reader's properties. +// Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func Update(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().Update(id, params) } -// Update updates a terminal reader's properties. +// Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. func (c Client) Update(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s", id) reader := &stripe.TerminalReader{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.TerminalReaderParams) (*stripe. return reader, err } -// Del removes a terminal reader. +// Deletes a Reader object. func Del(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { return getC().Del(id, params) } -// Del removes a terminal reader. +// Deletes a Reader object. func (c Client) Del(id string, params *stripe.TerminalReaderParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s", id) reader := &stripe.TerminalReader{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.TerminalReaderParams) (*stripe.Ter return reader, err } -// CancelAction is the method for the `POST /v1/terminal/readers/{reader}/cancel_action` API. +// Cancels the current reader action. func CancelAction(id string, params *stripe.TerminalReaderCancelActionParams) (*stripe.TerminalReader, error) { return getC().CancelAction(id, params) } -// CancelAction is the method for the `POST /v1/terminal/readers/{reader}/cancel_action` API. +// Cancels the current reader action. func (c Client) CancelAction(id string, params *stripe.TerminalReaderCancelActionParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s/cancel_action", id) reader := &stripe.TerminalReader{} @@ -90,12 +90,12 @@ func (c Client) CancelAction(id string, params *stripe.TerminalReaderCancelActio return reader, err } -// CollectInputs is the method for the `POST /v1/terminal/readers/{reader}/collect_inputs` API. +// Initiates an input collection flow on a Reader. func CollectInputs(id string, params *stripe.TerminalReaderCollectInputsParams) (*stripe.TerminalReader, error) { return getC().CollectInputs(id, params) } -// CollectInputs is the method for the `POST /v1/terminal/readers/{reader}/collect_inputs` API. +// Initiates an input collection flow on a Reader. func (c Client) CollectInputs(id string, params *stripe.TerminalReaderCollectInputsParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s/collect_inputs", id) reader := &stripe.TerminalReader{} @@ -103,12 +103,12 @@ func (c Client) CollectInputs(id string, params *stripe.TerminalReaderCollectInp return reader, err } -// CollectPaymentMethod is the method for the `POST /v1/terminal/readers/{reader}/collect_payment_method` API. +// Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. func CollectPaymentMethod(id string, params *stripe.TerminalReaderCollectPaymentMethodParams) (*stripe.TerminalReader, error) { return getC().CollectPaymentMethod(id, params) } -// CollectPaymentMethod is the method for the `POST /v1/terminal/readers/{reader}/collect_payment_method` API. +// Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. func (c Client) CollectPaymentMethod(id string, params *stripe.TerminalReaderCollectPaymentMethodParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/terminal/readers/%s/collect_payment_method", @@ -119,12 +119,12 @@ func (c Client) CollectPaymentMethod(id string, params *stripe.TerminalReaderCol return reader, err } -// ConfirmPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/confirm_payment_intent` API. +// Finalizes a payment on a Reader. func ConfirmPaymentIntent(id string, params *stripe.TerminalReaderConfirmPaymentIntentParams) (*stripe.TerminalReader, error) { return getC().ConfirmPaymentIntent(id, params) } -// ConfirmPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/confirm_payment_intent` API. +// Finalizes a payment on a Reader. func (c Client) ConfirmPaymentIntent(id string, params *stripe.TerminalReaderConfirmPaymentIntentParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/terminal/readers/%s/confirm_payment_intent", @@ -135,12 +135,12 @@ func (c Client) ConfirmPaymentIntent(id string, params *stripe.TerminalReaderCon return reader, err } -// ProcessPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/process_payment_intent` API. +// Initiates a payment flow on a Reader. func ProcessPaymentIntent(id string, params *stripe.TerminalReaderProcessPaymentIntentParams) (*stripe.TerminalReader, error) { return getC().ProcessPaymentIntent(id, params) } -// ProcessPaymentIntent is the method for the `POST /v1/terminal/readers/{reader}/process_payment_intent` API. +// Initiates a payment flow on a Reader. func (c Client) ProcessPaymentIntent(id string, params *stripe.TerminalReaderProcessPaymentIntentParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/terminal/readers/%s/process_payment_intent", @@ -151,12 +151,12 @@ func (c Client) ProcessPaymentIntent(id string, params *stripe.TerminalReaderPro return reader, err } -// ProcessSetupIntent is the method for the `POST /v1/terminal/readers/{reader}/process_setup_intent` API. +// Initiates a setup intent flow on a Reader. func ProcessSetupIntent(id string, params *stripe.TerminalReaderProcessSetupIntentParams) (*stripe.TerminalReader, error) { return getC().ProcessSetupIntent(id, params) } -// ProcessSetupIntent is the method for the `POST /v1/terminal/readers/{reader}/process_setup_intent` API. +// Initiates a setup intent flow on a Reader. func (c Client) ProcessSetupIntent(id string, params *stripe.TerminalReaderProcessSetupIntentParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/terminal/readers/%s/process_setup_intent", @@ -167,12 +167,12 @@ func (c Client) ProcessSetupIntent(id string, params *stripe.TerminalReaderProce return reader, err } -// RefundPayment is the method for the `POST /v1/terminal/readers/{reader}/refund_payment` API. +// Initiates a refund on a Reader func RefundPayment(id string, params *stripe.TerminalReaderRefundPaymentParams) (*stripe.TerminalReader, error) { return getC().RefundPayment(id, params) } -// RefundPayment is the method for the `POST /v1/terminal/readers/{reader}/refund_payment` API. +// Initiates a refund on a Reader func (c Client) RefundPayment(id string, params *stripe.TerminalReaderRefundPaymentParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s/refund_payment", id) reader := &stripe.TerminalReader{} @@ -180,12 +180,12 @@ func (c Client) RefundPayment(id string, params *stripe.TerminalReaderRefundPaym return reader, err } -// SetReaderDisplay is the method for the `POST /v1/terminal/readers/{reader}/set_reader_display` API. +// Sets reader display to show cart details. func SetReaderDisplay(id string, params *stripe.TerminalReaderSetReaderDisplayParams) (*stripe.TerminalReader, error) { return getC().SetReaderDisplay(id, params) } -// SetReaderDisplay is the method for the `POST /v1/terminal/readers/{reader}/set_reader_display` API. +// Sets reader display to show cart details. func (c Client) SetReaderDisplay(id string, params *stripe.TerminalReaderSetReaderDisplayParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath("/v1/terminal/readers/%s/set_reader_display", id) reader := &stripe.TerminalReader{} @@ -193,12 +193,12 @@ func (c Client) SetReaderDisplay(id string, params *stripe.TerminalReaderSetRead return reader, err } -// List returns a list of terminal readers. +// Returns a list of Reader objects. func List(params *stripe.TerminalReaderListParams) *Iter { return getC().List(params) } -// List returns a list of terminal readers. +// Returns a list of Reader objects. func (c Client) List(listParams *stripe.TerminalReaderListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/testhelpers/confirmationtoken/client.go b/testhelpers/confirmationtoken/client.go index 35c903026f..be286b23c1 100644 --- a/testhelpers/confirmationtoken/client.go +++ b/testhelpers/confirmationtoken/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new confirmation token. +// Creates a test mode Confirmation Token server side for your integration tests. func New(params *stripe.TestHelpersConfirmationTokenParams) (*stripe.ConfirmationToken, error) { return getC().New(params) } -// New creates a new confirmation token. +// Creates a test mode Confirmation Token server side for your integration tests. func (c Client) New(params *stripe.TestHelpersConfirmationTokenParams) (*stripe.ConfirmationToken, error) { confirmationtoken := &stripe.ConfirmationToken{} err := c.B.Call( diff --git a/testhelpers/customer/client.go b/testhelpers/customer/client.go index c0d321cea6..98a996e526 100644 --- a/testhelpers/customer/client.go +++ b/testhelpers/customer/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// FundCashBalance is the method for the `POST /v1/test_helpers/customers/{customer}/fund_cash_balance` API. +// Create an incoming testmode bank transfer func FundCashBalance(id string, params *stripe.TestHelpersCustomerFundCashBalanceParams) (*stripe.CustomerCashBalanceTransaction, error) { return getC().FundCashBalance(id, params) } -// FundCashBalance is the method for the `POST /v1/test_helpers/customers/{customer}/fund_cash_balance` API. +// Create an incoming testmode bank transfer func (c Client) FundCashBalance(id string, params *stripe.TestHelpersCustomerFundCashBalanceParams) (*stripe.CustomerCashBalanceTransaction, error) { path := stripe.FormatURLPath( "/v1/test_helpers/customers/%s/fund_cash_balance", diff --git a/testhelpers/issuing/authorization/client.go b/testhelpers/issuing/authorization/client.go index 6ebfeb5fc5..3de0d332b6 100644 --- a/testhelpers/issuing/authorization/client.go +++ b/testhelpers/issuing/authorization/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new issuing authorization. +// Create a test-mode authorization. func New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { return getC().New(params) } -// New creates a new issuing authorization. +// Create a test-mode authorization. func (c Client) New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { authorization := &stripe.IssuingAuthorization{} err := c.B.Call( @@ -37,12 +37,12 @@ func (c Client) New(params *stripe.TestHelpersIssuingAuthorizationParams) (*stri return authorization, err } -// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API. +// Capture a test-mode authorization. func Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) { return getC().Capture(id, params) } -// Capture is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/capture` API. +// Capture a test-mode authorization. func (c Client) Capture(id string, params *stripe.TestHelpersIssuingAuthorizationCaptureParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/capture", @@ -53,12 +53,12 @@ func (c Client) Capture(id string, params *stripe.TestHelpersIssuingAuthorizatio return authorization, err } -// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API. +// Expire a test-mode Authorization. func Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) { return getC().Expire(id, params) } -// Expire is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/expire` API. +// Expire a test-mode Authorization. func (c Client) Expire(id string, params *stripe.TestHelpersIssuingAuthorizationExpireParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/expire", @@ -69,12 +69,12 @@ func (c Client) Expire(id string, params *stripe.TestHelpersIssuingAuthorization return authorization, err } -// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API. +// Increment a test-mode Authorization. func Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) { return getC().Increment(id, params) } -// Increment is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/increment` API. +// Increment a test-mode Authorization. func (c Client) Increment(id string, params *stripe.TestHelpersIssuingAuthorizationIncrementParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/increment", @@ -85,12 +85,12 @@ func (c Client) Increment(id string, params *stripe.TestHelpersIssuingAuthorizat return authorization, err } -// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API. +// Reverse a test-mode Authorization. func Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) { return getC().Reverse(id, params) } -// Reverse is the method for the `POST /v1/test_helpers/issuing/authorizations/{authorization}/reverse` API. +// Reverse a test-mode Authorization. func (c Client) Reverse(id string, params *stripe.TestHelpersIssuingAuthorizationReverseParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/authorizations/%s/reverse", diff --git a/testhelpers/issuing/card/client.go b/testhelpers/issuing/card/client.go index b889d3d06d..edabfdeaec 100644 --- a/testhelpers/issuing/card/client.go +++ b/testhelpers/issuing/card/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// DeliverCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/deliver` API. +// Updates the shipping status of the specified Issuing Card object to delivered. func DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeliverCardParams) (*stripe.IssuingCard, error) { return getC().DeliverCard(id, params) } -// DeliverCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/deliver` API. +// Updates the shipping status of the specified Issuing Card object to delivered. func (c Client) DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeliverCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/deliver", @@ -35,12 +35,12 @@ func (c Client) DeliverCard(id string, params *stripe.TestHelpersIssuingCardDeli return card, err } -// FailCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/fail` API. +// Updates the shipping status of the specified Issuing Card object to failure. func FailCard(id string, params *stripe.TestHelpersIssuingCardFailCardParams) (*stripe.IssuingCard, error) { return getC().FailCard(id, params) } -// FailCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/fail` API. +// Updates the shipping status of the specified Issuing Card object to failure. func (c Client) FailCard(id string, params *stripe.TestHelpersIssuingCardFailCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/fail", @@ -51,12 +51,12 @@ func (c Client) FailCard(id string, params *stripe.TestHelpersIssuingCardFailCar return card, err } -// ReturnCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/return` API. +// Updates the shipping status of the specified Issuing Card object to returned. func ReturnCard(id string, params *stripe.TestHelpersIssuingCardReturnCardParams) (*stripe.IssuingCard, error) { return getC().ReturnCard(id, params) } -// ReturnCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/return` API. +// Updates the shipping status of the specified Issuing Card object to returned. func (c Client) ReturnCard(id string, params *stripe.TestHelpersIssuingCardReturnCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/return", @@ -67,12 +67,12 @@ func (c Client) ReturnCard(id string, params *stripe.TestHelpersIssuingCardRetur return card, err } -// ShipCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/ship` API. +// Updates the shipping status of the specified Issuing Card object to shipped. func ShipCard(id string, params *stripe.TestHelpersIssuingCardShipCardParams) (*stripe.IssuingCard, error) { return getC().ShipCard(id, params) } -// ShipCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/ship` API. +// Updates the shipping status of the specified Issuing Card object to shipped. func (c Client) ShipCard(id string, params *stripe.TestHelpersIssuingCardShipCardParams) (*stripe.IssuingCard, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/cards/%s/shipping/ship", diff --git a/testhelpers/issuing/personalizationdesign/client.go b/testhelpers/issuing/personalizationdesign/client.go index 09c95a8c3b..a1a7da3d87 100644 --- a/testhelpers/issuing/personalizationdesign/client.go +++ b/testhelpers/issuing/personalizationdesign/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Activate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate` API. +// Updates the status of the specified testmode personalization design object to active. func Activate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignActivateParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Activate(id, params) } -// Activate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate` API. +// Updates the status of the specified testmode personalization design object to active. func (c Client) Activate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignActivateParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/personalization_designs/%s/activate", @@ -35,12 +35,12 @@ func (c Client) Activate(id string, params *stripe.TestHelpersIssuingPersonaliza return personalizationdesign, err } -// Deactivate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate` API. +// Updates the status of the specified testmode personalization design object to inactive. func Deactivate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignDeactivateParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Deactivate(id, params) } -// Deactivate is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate` API. +// Updates the status of the specified testmode personalization design object to inactive. func (c Client) Deactivate(id string, params *stripe.TestHelpersIssuingPersonalizationDesignDeactivateParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/personalization_designs/%s/deactivate", @@ -51,12 +51,12 @@ func (c Client) Deactivate(id string, params *stripe.TestHelpersIssuingPersonali return personalizationdesign, err } -// Reject is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject` API. +// Updates the status of the specified testmode personalization design object to rejected. func Reject(id string, params *stripe.TestHelpersIssuingPersonalizationDesignRejectParams) (*stripe.IssuingPersonalizationDesign, error) { return getC().Reject(id, params) } -// Reject is the method for the `POST /v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject` API. +// Updates the status of the specified testmode personalization design object to rejected. func (c Client) Reject(id string, params *stripe.TestHelpersIssuingPersonalizationDesignRejectParams) (*stripe.IssuingPersonalizationDesign, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/personalization_designs/%s/reject", diff --git a/testhelpers/issuing/transaction/client.go b/testhelpers/issuing/transaction/client.go index e13d5ac6d8..0d2dd043f4 100644 --- a/testhelpers/issuing/transaction/client.go +++ b/testhelpers/issuing/transaction/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API. +// Allows the user to capture an arbitrary amount, also known as a forced capture. func CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) { return getC().CreateForceCapture(params) } -// CreateForceCapture is the method for the `POST /v1/test_helpers/issuing/transactions/create_force_capture` API. +// Allows the user to capture an arbitrary amount, also known as a forced capture. func (c Client) CreateForceCapture(params *stripe.TestHelpersIssuingTransactionCreateForceCaptureParams) (*stripe.IssuingTransaction, error) { transaction := &stripe.IssuingTransaction{} err := c.B.Call( @@ -37,12 +37,12 @@ func (c Client) CreateForceCapture(params *stripe.TestHelpersIssuingTransactionC return transaction, err } -// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API. +// Allows the user to refund an arbitrary amount, also known as a unlinked refund. func CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) { return getC().CreateUnlinkedRefund(params) } -// CreateUnlinkedRefund is the method for the `POST /v1/test_helpers/issuing/transactions/create_unlinked_refund` API. +// Allows the user to refund an arbitrary amount, also known as a unlinked refund. func (c Client) CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactionCreateUnlinkedRefundParams) (*stripe.IssuingTransaction, error) { transaction := &stripe.IssuingTransaction{} err := c.B.Call( @@ -55,12 +55,12 @@ func (c Client) CreateUnlinkedRefund(params *stripe.TestHelpersIssuingTransactio return transaction, err } -// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API. +// Refund a test-mode Transaction. func Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) { return getC().Refund(id, params) } -// Refund is the method for the `POST /v1/test_helpers/issuing/transactions/{transaction}/refund` API. +// Refund a test-mode Transaction. func (c Client) Refund(id string, params *stripe.TestHelpersIssuingTransactionRefundParams) (*stripe.IssuingTransaction, error) { path := stripe.FormatURLPath( "/v1/test_helpers/issuing/transactions/%s/refund", diff --git a/testhelpers/refund/client.go b/testhelpers/refund/client.go index ef7f8d4d77..82b83fbbab 100644 --- a/testhelpers/refund/client.go +++ b/testhelpers/refund/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Expire is the method for the `POST /v1/test_helpers/refunds/{refund}/expire` API. +// Expire a refund with a status of requires_action. func Expire(id string, params *stripe.TestHelpersRefundExpireParams) (*stripe.Refund, error) { return getC().Expire(id, params) } -// Expire is the method for the `POST /v1/test_helpers/refunds/{refund}/expire` API. +// Expire a refund with a status of requires_action. func (c Client) Expire(id string, params *stripe.TestHelpersRefundExpireParams) (*stripe.Refund, error) { path := stripe.FormatURLPath("/v1/test_helpers/refunds/%s/expire", id) refund := &stripe.Refund{} diff --git a/testhelpers/terminal/reader/client.go b/testhelpers/terminal/reader/client.go index 311467481e..8865eddf54 100644 --- a/testhelpers/terminal/reader/client.go +++ b/testhelpers/terminal/reader/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// PresentPaymentMethod is the method for the `POST /v1/test_helpers/terminal/readers/{reader}/present_payment_method` API. +// Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. func PresentPaymentMethod(id string, params *stripe.TestHelpersTerminalReaderPresentPaymentMethodParams) (*stripe.TerminalReader, error) { return getC().PresentPaymentMethod(id, params) } -// PresentPaymentMethod is the method for the `POST /v1/test_helpers/terminal/readers/{reader}/present_payment_method` API. +// Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. func (c Client) PresentPaymentMethod(id string, params *stripe.TestHelpersTerminalReaderPresentPaymentMethodParams) (*stripe.TerminalReader, error) { path := stripe.FormatURLPath( "/v1/test_helpers/terminal/readers/%s/present_payment_method", diff --git a/testhelpers/testclock/client.go b/testhelpers/testclock/client.go index c68481cc3c..09ccb2bb0e 100644 --- a/testhelpers/testclock/client.go +++ b/testhelpers/testclock/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new test helpers test clock. +// Creates a new test clock that can be attached to new customers and quotes. func New(params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { return getC().New(params) } -// New creates a new test helpers test clock. +// Creates a new test clock that can be attached to new customers and quotes. func (c Client) New(params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { testclock := &stripe.TestHelpersTestClock{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TestHelpersTestClockParams) (*stripe.TestHelp return testclock, err } -// Get returns the details of a test helpers test clock. +// Retrieves a test clock. func Get(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { return getC().Get(id, params) } -// Get returns the details of a test helpers test clock. +// Retrieves a test clock. func (c Client) Get(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { path := stripe.FormatURLPath("/v1/test_helpers/test_clocks/%s", id) testclock := &stripe.TestHelpersTestClock{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TestHelpersTestClockParams) (*stri return testclock, err } -// Del removes a test helpers test clock. +// Deletes a test clock. func Del(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { return getC().Del(id, params) } -// Del removes a test helpers test clock. +// Deletes a test clock. func (c Client) Del(id string, params *stripe.TestHelpersTestClockParams) (*stripe.TestHelpersTestClock, error) { path := stripe.FormatURLPath("/v1/test_helpers/test_clocks/%s", id) testclock := &stripe.TestHelpersTestClock{} @@ -64,12 +64,12 @@ func (c Client) Del(id string, params *stripe.TestHelpersTestClockParams) (*stri return testclock, err } -// Advance is the method for the `POST /v1/test_helpers/test_clocks/{test_clock}/advance` API. +// Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. func Advance(id string, params *stripe.TestHelpersTestClockAdvanceParams) (*stripe.TestHelpersTestClock, error) { return getC().Advance(id, params) } -// Advance is the method for the `POST /v1/test_helpers/test_clocks/{test_clock}/advance` API. +// Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. func (c Client) Advance(id string, params *stripe.TestHelpersTestClockAdvanceParams) (*stripe.TestHelpersTestClock, error) { path := stripe.FormatURLPath("/v1/test_helpers/test_clocks/%s/advance", id) testclock := &stripe.TestHelpersTestClock{} @@ -77,12 +77,12 @@ func (c Client) Advance(id string, params *stripe.TestHelpersTestClockAdvancePar return testclock, err } -// List returns a list of test helpers test clocks. +// Returns a list of your test clocks. func List(params *stripe.TestHelpersTestClockListParams) *Iter { return getC().List(params) } -// List returns a list of test helpers test clocks. +// Returns a list of your test clocks. func (c Client) List(listParams *stripe.TestHelpersTestClockListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/testhelpers/treasury/inboundtransfer/client.go b/testhelpers/treasury/inboundtransfer/client.go index c45e93c95a..1a60afdf00 100644 --- a/testhelpers/treasury/inboundtransfer/client.go +++ b/testhelpers/treasury/inboundtransfer/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Fail is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/fail` API. +// Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. func Fail(id string, params *stripe.TestHelpersTreasuryInboundTransferFailParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Fail(id, params) } -// Fail is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/fail` API. +// Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryInboundTransferFailParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/inbound_transfers/%s/fail", @@ -35,12 +35,12 @@ func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryInboundTransfe return inboundtransfer, err } -// ReturnInboundTransfer is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/return` API. +// Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. func ReturnInboundTransfer(id string, params *stripe.TestHelpersTreasuryInboundTransferReturnInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { return getC().ReturnInboundTransfer(id, params) } -// ReturnInboundTransfer is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/return` API. +// Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. func (c Client) ReturnInboundTransfer(id string, params *stripe.TestHelpersTreasuryInboundTransferReturnInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/inbound_transfers/%s/return", @@ -51,12 +51,12 @@ func (c Client) ReturnInboundTransfer(id string, params *stripe.TestHelpersTreas return inboundtransfer, err } -// Succeed is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/succeed` API. +// Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. func Succeed(id string, params *stripe.TestHelpersTreasuryInboundTransferSucceedParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Succeed(id, params) } -// Succeed is the method for the `POST /v1/test_helpers/treasury/inbound_transfers/{id}/succeed` API. +// Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. func (c Client) Succeed(id string, params *stripe.TestHelpersTreasuryInboundTransferSucceedParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/inbound_transfers/%s/succeed", diff --git a/testhelpers/treasury/outboundpayment/client.go b/testhelpers/treasury/outboundpayment/client.go index 029342c120..16002e9879 100644 --- a/testhelpers/treasury/outboundpayment/client.go +++ b/testhelpers/treasury/outboundpayment/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Update updates a treasury outbound payment's properties. +// Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. func Update(id string, params *stripe.TestHelpersTreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Update(id, params) } -// Update updates a treasury outbound payment's properties. +// Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. func (c Client) Update(id string, params *stripe.TestHelpersTreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_payments/%s", @@ -35,12 +35,12 @@ func (c Client) Update(id string, params *stripe.TestHelpersTreasuryOutboundPaym return outboundpayment, err } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/fail` API. +// Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. func Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymentFailParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Fail(id, params) } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/fail` API. +// Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymentFailParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_payments/%s/fail", @@ -51,12 +51,12 @@ func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymen return outboundpayment, err } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/post` API. +// Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. func Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymentPostParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Post(id, params) } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/post` API. +// Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymentPostParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_payments/%s/post", @@ -67,12 +67,12 @@ func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymen return outboundpayment, err } -// ReturnOutboundPayment is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/return` API. +// Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. func ReturnOutboundPayment(id string, params *stripe.TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { return getC().ReturnOutboundPayment(id, params) } -// ReturnOutboundPayment is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/return` API. +// Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. func (c Client) ReturnOutboundPayment(id string, params *stripe.TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_payments/%s/return", diff --git a/testhelpers/treasury/outboundtransfer/client.go b/testhelpers/treasury/outboundtransfer/client.go index 3ab17bb0c1..0640921d40 100644 --- a/testhelpers/treasury/outboundtransfer/client.go +++ b/testhelpers/treasury/outboundtransfer/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// Update updates a treasury outbound transfer's properties. +// Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. func Update(id string, params *stripe.TestHelpersTreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Update(id, params) } -// Update updates a treasury outbound transfer's properties. +// Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. func (c Client) Update(id string, params *stripe.TestHelpersTreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_transfers/%s", @@ -35,12 +35,12 @@ func (c Client) Update(id string, params *stripe.TestHelpersTreasuryOutboundTran return outboundtransfer, err } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail` API. +// Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. func Fail(id string, params *stripe.TestHelpersTreasuryOutboundTransferFailParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Fail(id, params) } -// Fail is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail` API. +// Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundTransferFailParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_transfers/%s/fail", @@ -51,12 +51,12 @@ func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundTransf return outboundtransfer, err } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post` API. +// Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. func Post(id string, params *stripe.TestHelpersTreasuryOutboundTransferPostParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Post(id, params) } -// Post is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post` API. +// Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundTransferPostParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_transfers/%s/post", @@ -67,12 +67,12 @@ func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundTransf return outboundtransfer, err } -// ReturnOutboundTransfer is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return` API. +// Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. func ReturnOutboundTransfer(id string, params *stripe.TestHelpersTreasuryOutboundTransferReturnOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().ReturnOutboundTransfer(id, params) } -// ReturnOutboundTransfer is the method for the `POST /v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return` API. +// Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. func (c Client) ReturnOutboundTransfer(id string, params *stripe.TestHelpersTreasuryOutboundTransferReturnOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath( "/v1/test_helpers/treasury/outbound_transfers/%s/return", diff --git a/testhelpers/treasury/receivedcredit/client.go b/testhelpers/treasury/receivedcredit/client.go index 5d5629f846..b7386d898d 100644 --- a/testhelpers/treasury/receivedcredit/client.go +++ b/testhelpers/treasury/receivedcredit/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new treasury received credit. +// Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. func New(params *stripe.TestHelpersTreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { return getC().New(params) } -// New creates a new treasury received credit. +// Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. func (c Client) New(params *stripe.TestHelpersTreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { receivedcredit := &stripe.TreasuryReceivedCredit{} err := c.B.Call( diff --git a/testhelpers/treasury/receiveddebit/client.go b/testhelpers/treasury/receiveddebit/client.go index 0f60f586cc..e7160a436c 100644 --- a/testhelpers/treasury/receiveddebit/client.go +++ b/testhelpers/treasury/receiveddebit/client.go @@ -19,12 +19,12 @@ type Client struct { Key string } -// New creates a new treasury received debit. +// Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. func New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { return getC().New(params) } -// New creates a new treasury received debit. +// Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. func (c Client) New(params *stripe.TestHelpersTreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { receiveddebit := &stripe.TreasuryReceivedDebit{} err := c.B.Call( diff --git a/token/client.go b/token/client.go index 4a2a6d86af..fcaaa9368e 100644 --- a/token/client.go +++ b/token/client.go @@ -19,24 +19,26 @@ type Client struct { Key string } -// New creates a new token. +// Creates a single-use token that represents a bank account's details. +// You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. func New(params *stripe.TokenParams) (*stripe.Token, error) { return getC().New(params) } -// New creates a new token. +// Creates a single-use token that represents a bank account's details. +// You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. func (c Client) New(params *stripe.TokenParams) (*stripe.Token, error) { token := &stripe.Token{} err := c.B.Call(http.MethodPost, "/v1/tokens", c.Key, params, token) return token, err } -// Get returns the details of a token. +// Retrieves the token with the given ID. func Get(id string, params *stripe.TokenParams) (*stripe.Token, error) { return getC().Get(id, params) } -// Get returns the details of a token. +// Retrieves the token with the given ID. func (c Client) Get(id string, params *stripe.TokenParams) (*stripe.Token, error) { path := stripe.FormatURLPath("/v1/tokens/%s", id) token := &stripe.Token{} diff --git a/topup/client.go b/topup/client.go index 6cb9a3a5c0..5ead7d55cf 100644 --- a/topup/client.go +++ b/topup/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new topup. +// Top up the balance of an account func New(params *stripe.TopupParams) (*stripe.Topup, error) { return getC().New(params) } -// New creates a new topup. +// Top up the balance of an account func (c Client) New(params *stripe.TopupParams) (*stripe.Topup, error) { topup := &stripe.Topup{} err := c.B.Call(http.MethodPost, "/v1/topups", c.Key, params, topup) return topup, err } -// Get returns the details of a topup. +// Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. func Get(id string, params *stripe.TopupParams) (*stripe.Topup, error) { return getC().Get(id, params) } -// Get returns the details of a topup. +// Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. func (c Client) Get(id string, params *stripe.TopupParams) (*stripe.Topup, error) { path := stripe.FormatURLPath("/v1/topups/%s", id) topup := &stripe.Topup{} @@ -45,12 +45,12 @@ func (c Client) Get(id string, params *stripe.TopupParams) (*stripe.Topup, error return topup, err } -// Update updates a topup's properties. +// Updates the metadata of a top-up. Other top-up details are not editable by design. func Update(id string, params *stripe.TopupParams) (*stripe.Topup, error) { return getC().Update(id, params) } -// Update updates a topup's properties. +// Updates the metadata of a top-up. Other top-up details are not editable by design. func (c Client) Update(id string, params *stripe.TopupParams) (*stripe.Topup, error) { path := stripe.FormatURLPath("/v1/topups/%s", id) topup := &stripe.Topup{} @@ -58,12 +58,12 @@ func (c Client) Update(id string, params *stripe.TopupParams) (*stripe.Topup, er return topup, err } -// Cancel is the method for the `POST /v1/topups/{topup}/cancel` API. +// Cancels a top-up. Only pending top-ups can be canceled. func Cancel(id string, params *stripe.TopupParams) (*stripe.Topup, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/topups/{topup}/cancel` API. +// Cancels a top-up. Only pending top-ups can be canceled. func (c Client) Cancel(id string, params *stripe.TopupParams) (*stripe.Topup, error) { path := stripe.FormatURLPath("/v1/topups/%s/cancel", id) topup := &stripe.Topup{} @@ -71,12 +71,12 @@ func (c Client) Cancel(id string, params *stripe.TopupParams) (*stripe.Topup, er return topup, err } -// List returns a list of topups. +// Returns a list of top-ups. func List(params *stripe.TopupListParams) *Iter { return getC().List(params) } -// List returns a list of topups. +// Returns a list of top-ups. func (c Client) List(listParams *stripe.TopupListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/transfer/client.go b/transfer/client.go index 56bd1184d1..75a9fd3df1 100644 --- a/transfer/client.go +++ b/transfer/client.go @@ -20,24 +20,24 @@ type Client struct { Key string } -// New creates a new transfer. +// To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. func New(params *stripe.TransferParams) (*stripe.Transfer, error) { return getC().New(params) } -// New creates a new transfer. +// To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. func (c Client) New(params *stripe.TransferParams) (*stripe.Transfer, error) { transfer := &stripe.Transfer{} err := c.B.Call(http.MethodPost, "/v1/transfers", c.Key, params, transfer) return transfer, err } -// Get returns the details of a transfer. +// Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. func Get(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { return getC().Get(id, params) } -// Get returns the details of a transfer. +// Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. func (c Client) Get(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { path := stripe.FormatURLPath("/v1/transfers/%s", id) transfer := &stripe.Transfer{} @@ -45,12 +45,16 @@ func (c Client) Get(id string, params *stripe.TransferParams) (*stripe.Transfer, return transfer, err } -// Update updates a transfer's properties. +// Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts only metadata as an argument. func Update(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { return getC().Update(id, params) } -// Update updates a transfer's properties. +// Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request accepts only metadata as an argument. func (c Client) Update(id string, params *stripe.TransferParams) (*stripe.Transfer, error) { path := stripe.FormatURLPath("/v1/transfers/%s", id) transfer := &stripe.Transfer{} @@ -58,12 +62,12 @@ func (c Client) Update(id string, params *stripe.TransferParams) (*stripe.Transf return transfer, err } -// List returns a list of transfers. +// Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. func List(params *stripe.TransferListParams) *Iter { return getC().List(params) } -// List returns a list of transfers. +// Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. func (c Client) List(listParams *stripe.TransferListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/transferreversal/client.go b/transferreversal/client.go index df54859577..b11b7966a5 100644 --- a/transferreversal/client.go +++ b/transferreversal/client.go @@ -21,12 +21,20 @@ type Client struct { Key string } -// New creates a new transfer reversal. +// When you create a new reversal, you must specify a transfer to create it on. +// +// When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. +// +// Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. func New(params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { return getC().New(params) } -// New creates a new transfer reversal. +// When you create a new reversal, you must specify a transfer to create it on. +// +// When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. +// +// Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. func (c Client) New(params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { path := stripe.FormatURLPath( "/v1/transfers/%s/reversals", @@ -37,12 +45,12 @@ func (c Client) New(params *stripe.TransferReversalParams) (*stripe.TransferReve return transferreversal, err } -// Get returns the details of a transfer reversal. +// By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. func Get(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { return getC().Get(id, params) } -// Get returns the details of a transfer reversal. +// By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. func (c Client) Get(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { if params == nil { return nil, fmt.Errorf( @@ -59,12 +67,16 @@ func (c Client) Get(id string, params *stripe.TransferReversalParams) (*stripe.T return transferreversal, err } -// Update updates a transfer reversal's properties. +// Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata and description as arguments. func Update(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { return getC().Update(id, params) } -// Update updates a transfer reversal's properties. +// Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. +// +// This request only accepts metadata and description as arguments. func (c Client) Update(id string, params *stripe.TransferReversalParams) (*stripe.TransferReversal, error) { path := stripe.FormatURLPath( "/v1/transfers/%s/reversals/%s", @@ -76,12 +88,12 @@ func (c Client) Update(id string, params *stripe.TransferReversalParams) (*strip return transferreversal, err } -// List returns a list of transfer reversals. +// You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. func List(params *stripe.TransferReversalListParams) *Iter { return getC().List(params) } -// List returns a list of transfer reversals. +// You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. func (c Client) List(listParams *stripe.TransferReversalListParams) *Iter { path := stripe.FormatURLPath( "/v1/transfers/%s/reversals", diff --git a/treasury/creditreversal/client.go b/treasury/creditreversal/client.go index d0b457b6b0..92b002bfac 100644 --- a/treasury/creditreversal/client.go +++ b/treasury/creditreversal/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury credit reversal. +// Reverses a ReceivedCredit and creates a CreditReversal object. func New(params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { return getC().New(params) } -// New creates a new treasury credit reversal. +// Reverses a ReceivedCredit and creates a CreditReversal object. func (c Client) New(params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { creditreversal := &stripe.TreasuryCreditReversal{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryCreditReversalParams) (*stripe.Treasu return creditreversal, err } -// Get returns the details of a treasury credit reversal. +// Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list func Get(id string, params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { return getC().Get(id, params) } -// Get returns the details of a treasury credit reversal. +// Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list func (c Client) Get(id string, params *stripe.TreasuryCreditReversalParams) (*stripe.TreasuryCreditReversal, error) { path := stripe.FormatURLPath("/v1/treasury/credit_reversals/%s", id) creditreversal := &stripe.TreasuryCreditReversal{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryCreditReversalParams) (*st return creditreversal, err } -// List returns a list of treasury credit reversals. +// Returns a list of CreditReversals. func List(params *stripe.TreasuryCreditReversalListParams) *Iter { return getC().List(params) } -// List returns a list of treasury credit reversals. +// Returns a list of CreditReversals. func (c Client) List(listParams *stripe.TreasuryCreditReversalListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/debitreversal/client.go b/treasury/debitreversal/client.go index 2edac59f27..6adc2688a5 100644 --- a/treasury/debitreversal/client.go +++ b/treasury/debitreversal/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury debit reversal. +// Reverses a ReceivedDebit and creates a DebitReversal object. func New(params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { return getC().New(params) } -// New creates a new treasury debit reversal. +// Reverses a ReceivedDebit and creates a DebitReversal object. func (c Client) New(params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { debitreversal := &stripe.TreasuryDebitReversal{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryDebitReversalParams) (*stripe.Treasur return debitreversal, err } -// Get returns the details of a treasury debit reversal. +// Retrieves a DebitReversal object. func Get(id string, params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { return getC().Get(id, params) } -// Get returns the details of a treasury debit reversal. +// Retrieves a DebitReversal object. func (c Client) Get(id string, params *stripe.TreasuryDebitReversalParams) (*stripe.TreasuryDebitReversal, error) { path := stripe.FormatURLPath("/v1/treasury/debit_reversals/%s", id) debitreversal := &stripe.TreasuryDebitReversal{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryDebitReversalParams) (*str return debitreversal, err } -// List returns a list of treasury debit reversals. +// Returns a list of DebitReversals. func List(params *stripe.TreasuryDebitReversalListParams) *Iter { return getC().List(params) } -// List returns a list of treasury debit reversals. +// Returns a list of DebitReversals. func (c Client) List(listParams *stripe.TreasuryDebitReversalListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/financialaccount/client.go b/treasury/financialaccount/client.go index ff930909ec..cb783db773 100644 --- a/treasury/financialaccount/client.go +++ b/treasury/financialaccount/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury financial account. +// Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. func New(params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { return getC().New(params) } -// New creates a new treasury financial account. +// Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. func (c Client) New(params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { financialaccount := &stripe.TreasuryFinancialAccount{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryFinancialAccountParams) (*stripe.Trea return financialaccount, err } -// Get returns the details of a treasury financial account. +// Retrieves the details of a FinancialAccount. func Get(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { return getC().Get(id, params) } -// Get returns the details of a treasury financial account. +// Retrieves the details of a FinancialAccount. func (c Client) Get(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { path := stripe.FormatURLPath("/v1/treasury/financial_accounts/%s", id) financialaccount := &stripe.TreasuryFinancialAccount{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryFinancialAccountParams) (* return financialaccount, err } -// Update updates a treasury financial account's properties. +// Updates the details of a FinancialAccount. func Update(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { return getC().Update(id, params) } -// Update updates a treasury financial account's properties. +// Updates the details of a FinancialAccount. func (c Client) Update(id string, params *stripe.TreasuryFinancialAccountParams) (*stripe.TreasuryFinancialAccount, error) { path := stripe.FormatURLPath("/v1/treasury/financial_accounts/%s", id) financialaccount := &stripe.TreasuryFinancialAccount{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.TreasuryFinancialAccountParams) return financialaccount, err } -// RetrieveFeatures is the method for the `GET /v1/treasury/financial_accounts/{financial_account}/features` API. +// Retrieves Features information associated with the FinancialAccount. func RetrieveFeatures(id string, params *stripe.TreasuryFinancialAccountRetrieveFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { return getC().RetrieveFeatures(id, params) } -// RetrieveFeatures is the method for the `GET /v1/treasury/financial_accounts/{financial_account}/features` API. +// Retrieves Features information associated with the FinancialAccount. func (c Client) RetrieveFeatures(id string, params *stripe.TreasuryFinancialAccountRetrieveFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { path := stripe.FormatURLPath( "/v1/treasury/financial_accounts/%s/features", @@ -80,12 +80,12 @@ func (c Client) RetrieveFeatures(id string, params *stripe.TreasuryFinancialAcco return financialaccountfeatures, err } -// UpdateFeatures is the method for the `POST /v1/treasury/financial_accounts/{financial_account}/features` API. +// Updates the Features associated with a FinancialAccount. func UpdateFeatures(id string, params *stripe.TreasuryFinancialAccountUpdateFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { return getC().UpdateFeatures(id, params) } -// UpdateFeatures is the method for the `POST /v1/treasury/financial_accounts/{financial_account}/features` API. +// Updates the Features associated with a FinancialAccount. func (c Client) UpdateFeatures(id string, params *stripe.TreasuryFinancialAccountUpdateFeaturesParams) (*stripe.TreasuryFinancialAccountFeatures, error) { path := stripe.FormatURLPath( "/v1/treasury/financial_accounts/%s/features", @@ -102,12 +102,12 @@ func (c Client) UpdateFeatures(id string, params *stripe.TreasuryFinancialAccoun return financialaccountfeatures, err } -// List returns a list of treasury financial accounts. +// Returns a list of FinancialAccounts. func List(params *stripe.TreasuryFinancialAccountListParams) *Iter { return getC().List(params) } -// List returns a list of treasury financial accounts. +// Returns a list of FinancialAccounts. func (c Client) List(listParams *stripe.TreasuryFinancialAccountListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/inboundtransfer/client.go b/treasury/inboundtransfer/client.go index e6728c4418..bba052372d 100644 --- a/treasury/inboundtransfer/client.go +++ b/treasury/inboundtransfer/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury inbound transfer. +// Creates an InboundTransfer. func New(params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { return getC().New(params) } -// New creates a new treasury inbound transfer. +// Creates an InboundTransfer. func (c Client) New(params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { inboundtransfer := &stripe.TreasuryInboundTransfer{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryInboundTransferParams) (*stripe.Treas return inboundtransfer, err } -// Get returns the details of a treasury inbound transfer. +// Retrieves the details of an existing InboundTransfer. func Get(id string, params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Get(id, params) } -// Get returns the details of a treasury inbound transfer. +// Retrieves the details of an existing InboundTransfer. func (c Client) Get(id string, params *stripe.TreasuryInboundTransferParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/inbound_transfers/%s", id) inboundtransfer := &stripe.TreasuryInboundTransfer{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryInboundTransferParams) (*s return inboundtransfer, err } -// Cancel is the method for the `POST /v1/treasury/inbound_transfers/{inbound_transfer}/cancel` API. +// Cancels an InboundTransfer. func Cancel(id string, params *stripe.TreasuryInboundTransferCancelParams) (*stripe.TreasuryInboundTransfer, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/treasury/inbound_transfers/{inbound_transfer}/cancel` API. +// Cancels an InboundTransfer. func (c Client) Cancel(id string, params *stripe.TreasuryInboundTransferCancelParams) (*stripe.TreasuryInboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/inbound_transfers/%s/cancel", id) inboundtransfer := &stripe.TreasuryInboundTransfer{} @@ -64,12 +64,12 @@ func (c Client) Cancel(id string, params *stripe.TreasuryInboundTransferCancelPa return inboundtransfer, err } -// List returns a list of treasury inbound transfers. +// Returns a list of InboundTransfers sent from the specified FinancialAccount. func List(params *stripe.TreasuryInboundTransferListParams) *Iter { return getC().List(params) } -// List returns a list of treasury inbound transfers. +// Returns a list of InboundTransfers sent from the specified FinancialAccount. func (c Client) List(listParams *stripe.TreasuryInboundTransferListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/outboundpayment/client.go b/treasury/outboundpayment/client.go index 6b93f2856e..b2cd130862 100644 --- a/treasury/outboundpayment/client.go +++ b/treasury/outboundpayment/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury outbound payment. +// Creates an OutboundPayment. func New(params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { return getC().New(params) } -// New creates a new treasury outbound payment. +// Creates an OutboundPayment. func (c Client) New(params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { outboundpayment := &stripe.TreasuryOutboundPayment{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryOutboundPaymentParams) (*stripe.Treas return outboundpayment, err } -// Get returns the details of a treasury outbound payment. +// Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. func Get(id string, params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Get(id, params) } -// Get returns the details of a treasury outbound payment. +// Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. func (c Client) Get(id string, params *stripe.TreasuryOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_payments/%s", id) outboundpayment := &stripe.TreasuryOutboundPayment{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryOutboundPaymentParams) (*s return outboundpayment, err } -// Cancel is the method for the `POST /v1/treasury/outbound_payments/{id}/cancel` API. +// Cancel an OutboundPayment. func Cancel(id string, params *stripe.TreasuryOutboundPaymentCancelParams) (*stripe.TreasuryOutboundPayment, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/treasury/outbound_payments/{id}/cancel` API. +// Cancel an OutboundPayment. func (c Client) Cancel(id string, params *stripe.TreasuryOutboundPaymentCancelParams) (*stripe.TreasuryOutboundPayment, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_payments/%s/cancel", id) outboundpayment := &stripe.TreasuryOutboundPayment{} @@ -64,12 +64,12 @@ func (c Client) Cancel(id string, params *stripe.TreasuryOutboundPaymentCancelPa return outboundpayment, err } -// List returns a list of treasury outbound payments. +// Returns a list of OutboundPayments sent from the specified FinancialAccount. func List(params *stripe.TreasuryOutboundPaymentListParams) *Iter { return getC().List(params) } -// List returns a list of treasury outbound payments. +// Returns a list of OutboundPayments sent from the specified FinancialAccount. func (c Client) List(listParams *stripe.TreasuryOutboundPaymentListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/outboundtransfer/client.go b/treasury/outboundtransfer/client.go index 2795b2009a..3119218a20 100644 --- a/treasury/outboundtransfer/client.go +++ b/treasury/outboundtransfer/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new treasury outbound transfer. +// Creates an OutboundTransfer. func New(params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().New(params) } -// New creates a new treasury outbound transfer. +// Creates an OutboundTransfer. func (c Client) New(params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { outboundtransfer := &stripe.TreasuryOutboundTransfer{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.TreasuryOutboundTransferParams) (*stripe.Trea return outboundtransfer, err } -// Get returns the details of a treasury outbound transfer. +// Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. func Get(id string, params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Get(id, params) } -// Get returns the details of a treasury outbound transfer. +// Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. func (c Client) Get(id string, params *stripe.TreasuryOutboundTransferParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_transfers/%s", id) outboundtransfer := &stripe.TreasuryOutboundTransfer{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.TreasuryOutboundTransferParams) (* return outboundtransfer, err } -// Cancel is the method for the `POST /v1/treasury/outbound_transfers/{outbound_transfer}/cancel` API. +// An OutboundTransfer can be canceled if the funds have not yet been paid out. func Cancel(id string, params *stripe.TreasuryOutboundTransferCancelParams) (*stripe.TreasuryOutboundTransfer, error) { return getC().Cancel(id, params) } -// Cancel is the method for the `POST /v1/treasury/outbound_transfers/{outbound_transfer}/cancel` API. +// An OutboundTransfer can be canceled if the funds have not yet been paid out. func (c Client) Cancel(id string, params *stripe.TreasuryOutboundTransferCancelParams) (*stripe.TreasuryOutboundTransfer, error) { path := stripe.FormatURLPath("/v1/treasury/outbound_transfers/%s/cancel", id) outboundtransfer := &stripe.TreasuryOutboundTransfer{} @@ -64,12 +64,12 @@ func (c Client) Cancel(id string, params *stripe.TreasuryOutboundTransferCancelP return outboundtransfer, err } -// List returns a list of treasury outbound transfers. +// Returns a list of OutboundTransfers sent from the specified FinancialAccount. func List(params *stripe.TreasuryOutboundTransferListParams) *Iter { return getC().List(params) } -// List returns a list of treasury outbound transfers. +// Returns a list of OutboundTransfers sent from the specified FinancialAccount. func (c Client) List(listParams *stripe.TreasuryOutboundTransferListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/receivedcredit/client.go b/treasury/receivedcredit/client.go index 9bb2deaee8..e5b5d4e523 100644 --- a/treasury/receivedcredit/client.go +++ b/treasury/receivedcredit/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury received credit. +// Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. func Get(id string, params *stripe.TreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { return getC().Get(id, params) } -// Get returns the details of a treasury received credit. +// Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. func (c Client) Get(id string, params *stripe.TreasuryReceivedCreditParams) (*stripe.TreasuryReceivedCredit, error) { path := stripe.FormatURLPath("/v1/treasury/received_credits/%s", id) receivedcredit := &stripe.TreasuryReceivedCredit{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryReceivedCreditParams) (*st return receivedcredit, err } -// List returns a list of treasury received credits. +// Returns a list of ReceivedCredits. func List(params *stripe.TreasuryReceivedCreditListParams) *Iter { return getC().List(params) } -// List returns a list of treasury received credits. +// Returns a list of ReceivedCredits. func (c Client) List(listParams *stripe.TreasuryReceivedCreditListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/receiveddebit/client.go b/treasury/receiveddebit/client.go index 022af73f23..2f868a7829 100644 --- a/treasury/receiveddebit/client.go +++ b/treasury/receiveddebit/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury received debit. +// Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list func Get(id string, params *stripe.TreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { return getC().Get(id, params) } -// Get returns the details of a treasury received debit. +// Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list func (c Client) Get(id string, params *stripe.TreasuryReceivedDebitParams) (*stripe.TreasuryReceivedDebit, error) { path := stripe.FormatURLPath("/v1/treasury/received_debits/%s", id) receiveddebit := &stripe.TreasuryReceivedDebit{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryReceivedDebitParams) (*str return receiveddebit, err } -// List returns a list of treasury received debits. +// Returns a list of ReceivedDebits. func List(params *stripe.TreasuryReceivedDebitListParams) *Iter { return getC().List(params) } -// List returns a list of treasury received debits. +// Returns a list of ReceivedDebits. func (c Client) List(listParams *stripe.TreasuryReceivedDebitListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/transaction/client.go b/treasury/transaction/client.go index 4e0ddb3b33..a77eb0978d 100644 --- a/treasury/transaction/client.go +++ b/treasury/transaction/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury transaction. +// Retrieves the details of an existing Transaction. func Get(id string, params *stripe.TreasuryTransactionParams) (*stripe.TreasuryTransaction, error) { return getC().Get(id, params) } -// Get returns the details of a treasury transaction. +// Retrieves the details of an existing Transaction. func (c Client) Get(id string, params *stripe.TreasuryTransactionParams) (*stripe.TreasuryTransaction, error) { path := stripe.FormatURLPath("/v1/treasury/transactions/%s", id) transaction := &stripe.TreasuryTransaction{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryTransactionParams) (*strip return transaction, err } -// List returns a list of treasury transactions. +// Retrieves a list of Transaction objects. func List(params *stripe.TreasuryTransactionListParams) *Iter { return getC().List(params) } -// List returns a list of treasury transactions. +// Retrieves a list of Transaction objects. func (c Client) List(listParams *stripe.TreasuryTransactionListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/treasury/transactionentry/client.go b/treasury/transactionentry/client.go index 051ea8c4b9..4eb43de285 100644 --- a/treasury/transactionentry/client.go +++ b/treasury/transactionentry/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// Get returns the details of a treasury transaction entry. +// Retrieves a TransactionEntry object. func Get(id string, params *stripe.TreasuryTransactionEntryParams) (*stripe.TreasuryTransactionEntry, error) { return getC().Get(id, params) } -// Get returns the details of a treasury transaction entry. +// Retrieves a TransactionEntry object. func (c Client) Get(id string, params *stripe.TreasuryTransactionEntryParams) (*stripe.TreasuryTransactionEntry, error) { path := stripe.FormatURLPath("/v1/treasury/transaction_entries/%s", id) transactionentry := &stripe.TreasuryTransactionEntry{} @@ -33,12 +33,12 @@ func (c Client) Get(id string, params *stripe.TreasuryTransactionEntryParams) (* return transactionentry, err } -// List returns a list of treasury transaction entries. +// Retrieves a list of TransactionEntry objects. func List(params *stripe.TreasuryTransactionEntryListParams) *Iter { return getC().List(params) } -// List returns a list of treasury transaction entries. +// Retrieves a list of TransactionEntry objects. func (c Client) List(listParams *stripe.TreasuryTransactionEntryListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { diff --git a/usagerecord/client.go b/usagerecord/client.go index 1cd0fb5a8f..cf08fdb77c 100644 --- a/usagerecord/client.go +++ b/usagerecord/client.go @@ -19,12 +19,24 @@ type Client struct { Key string } -// New creates a new usage record. +// Creates a usage record for a specified subscription item and date, and fills it with a quantity. +// +// Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. +// +// The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. +// +// The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. func New(params *stripe.UsageRecordParams) (*stripe.UsageRecord, error) { return getC().New(params) } -// New creates a new usage record. +// Creates a usage record for a specified subscription item and date, and fills it with a quantity. +// +// Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. +// +// The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. +// +// The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. func (c Client) New(params *stripe.UsageRecordParams) (*stripe.UsageRecord, error) { path := stripe.FormatURLPath( "/v1/subscription_items/%s/usage_records", diff --git a/usagerecordsummary/client.go b/usagerecordsummary/client.go index 9a65ed0602..c8ce3c4a23 100644 --- a/usagerecordsummary/client.go +++ b/usagerecordsummary/client.go @@ -20,12 +20,16 @@ type Client struct { Key string } -// List returns a list of usage record summaries. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func List(params *stripe.UsageRecordSummaryListParams) *Iter { return getC().List(params) } -// List returns a list of usage record summaries. +// For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). +// +// The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. func (c Client) List(listParams *stripe.UsageRecordSummaryListParams) *Iter { path := stripe.FormatURLPath( "/v1/subscription_items/%s/usage_record_summaries", diff --git a/webhookendpoint/client.go b/webhookendpoint/client.go index 985a5d84fb..d5b6ce281c 100644 --- a/webhookendpoint/client.go +++ b/webhookendpoint/client.go @@ -20,12 +20,12 @@ type Client struct { Key string } -// New creates a new webhook endpoint. +// A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. func New(params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().New(params) } -// New creates a new webhook endpoint. +// A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. func (c Client) New(params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { webhookendpoint := &stripe.WebhookEndpoint{} err := c.B.Call( @@ -38,12 +38,12 @@ func (c Client) New(params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoi return webhookendpoint, err } -// Get returns the details of a webhook endpoint. +// Retrieves the webhook endpoint with the given ID. func Get(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().Get(id, params) } -// Get returns the details of a webhook endpoint. +// Retrieves the webhook endpoint with the given ID. func (c Client) Get(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { path := stripe.FormatURLPath("/v1/webhook_endpoints/%s", id) webhookendpoint := &stripe.WebhookEndpoint{} @@ -51,12 +51,12 @@ func (c Client) Get(id string, params *stripe.WebhookEndpointParams) (*stripe.We return webhookendpoint, err } -// Update updates a webhook endpoint's properties. +// Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. func Update(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().Update(id, params) } -// Update updates a webhook endpoint's properties. +// Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. func (c Client) Update(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { path := stripe.FormatURLPath("/v1/webhook_endpoints/%s", id) webhookendpoint := &stripe.WebhookEndpoint{} @@ -64,12 +64,12 @@ func (c Client) Update(id string, params *stripe.WebhookEndpointParams) (*stripe return webhookendpoint, err } -// Del removes a webhook endpoint. +// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. func Del(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { return getC().Del(id, params) } -// Del removes a webhook endpoint. +// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. func (c Client) Del(id string, params *stripe.WebhookEndpointParams) (*stripe.WebhookEndpoint, error) { path := stripe.FormatURLPath("/v1/webhook_endpoints/%s", id) webhookendpoint := &stripe.WebhookEndpoint{} @@ -77,12 +77,12 @@ func (c Client) Del(id string, params *stripe.WebhookEndpointParams) (*stripe.We return webhookendpoint, err } -// List returns a list of webhook endpoints. +// Returns a list of your webhook endpoints. func List(params *stripe.WebhookEndpointListParams) *Iter { return getC().List(params) } -// List returns a list of webhook endpoints. +// Returns a list of your webhook endpoints. func (c Client) List(listParams *stripe.WebhookEndpointListParams) *Iter { return &Iter{ Iter: stripe.GetIter(listParams, func(p *stripe.Params, b *form.Values) ([]interface{}, stripe.ListContainer, error) { From c4a61bb8d30f7c0a741fabe137527c7e184ec127 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 20:33:15 +0000 Subject: [PATCH 06/12] Update generated code for v1012 --- OPENAPI_VERSION | 2 +- confirmationtoken.go | 82 +++++++++++++++++++++++++------------------- paymentmethod.go | 32 +++++++++++------ 3 files changed, 70 insertions(+), 46 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0e632c42d4..e950385900 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1011 \ No newline at end of file +v1012 \ No newline at end of file diff --git a/confirmationtoken.go b/confirmationtoken.go index 93770e2311..84f3e9a1d7 100644 --- a/confirmationtoken.go +++ b/confirmationtoken.go @@ -6,6 +6,16 @@ package stripe +// This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. +type ConfirmationTokenPaymentMethodPreviewAllowRedisplay string + +// List of values that ConfirmationTokenPaymentMethodPreviewAllowRedisplay can take +const ( + ConfirmationTokenPaymentMethodPreviewAllowRedisplayAlways ConfirmationTokenPaymentMethodPreviewAllowRedisplay = "always" + ConfirmationTokenPaymentMethodPreviewAllowRedisplayLimited ConfirmationTokenPaymentMethodPreviewAllowRedisplay = "limited" + ConfirmationTokenPaymentMethodPreviewAllowRedisplayUnspecified ConfirmationTokenPaymentMethodPreviewAllowRedisplay = "unspecified" +) + // The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. type ConfirmationTokenPaymentMethodPreviewCardWalletType string @@ -751,41 +761,43 @@ type ConfirmationTokenPaymentMethodPreview struct { Affirm *ConfirmationTokenPaymentMethodPreviewAffirm `json:"affirm"` AfterpayClearpay *ConfirmationTokenPaymentMethodPreviewAfterpayClearpay `json:"afterpay_clearpay"` Alipay *ConfirmationTokenPaymentMethodPreviewAlipay `json:"alipay"` - AmazonPay *ConfirmationTokenPaymentMethodPreviewAmazonPay `json:"amazon_pay"` - AUBECSDebit *ConfirmationTokenPaymentMethodPreviewAUBECSDebit `json:"au_becs_debit"` - BACSDebit *ConfirmationTokenPaymentMethodPreviewBACSDebit `json:"bacs_debit"` - Bancontact *ConfirmationTokenPaymentMethodPreviewBancontact `json:"bancontact"` - BillingDetails *ConfirmationTokenPaymentMethodPreviewBillingDetails `json:"billing_details"` - BLIK *ConfirmationTokenPaymentMethodPreviewBLIK `json:"blik"` - Boleto *ConfirmationTokenPaymentMethodPreviewBoleto `json:"boleto"` - Card *ConfirmationTokenPaymentMethodPreviewCard `json:"card"` - CardPresent *ConfirmationTokenPaymentMethodPreviewCardPresent `json:"card_present"` - CashApp *ConfirmationTokenPaymentMethodPreviewCashApp `json:"cashapp"` - CustomerBalance *ConfirmationTokenPaymentMethodPreviewCustomerBalance `json:"customer_balance"` - EPS *ConfirmationTokenPaymentMethodPreviewEPS `json:"eps"` - FPX *ConfirmationTokenPaymentMethodPreviewFPX `json:"fpx"` - Giropay *ConfirmationTokenPaymentMethodPreviewGiropay `json:"giropay"` - Grabpay *ConfirmationTokenPaymentMethodPreviewGrabpay `json:"grabpay"` - IDEAL *ConfirmationTokenPaymentMethodPreviewIDEAL `json:"ideal"` - InteracPresent *ConfirmationTokenPaymentMethodPreviewInteracPresent `json:"interac_present"` - Klarna *ConfirmationTokenPaymentMethodPreviewKlarna `json:"klarna"` - Konbini *ConfirmationTokenPaymentMethodPreviewKonbini `json:"konbini"` - Link *ConfirmationTokenPaymentMethodPreviewLink `json:"link"` - Mobilepay *ConfirmationTokenPaymentMethodPreviewMobilepay `json:"mobilepay"` - Multibanco *ConfirmationTokenPaymentMethodPreviewMultibanco `json:"multibanco"` - OXXO *ConfirmationTokenPaymentMethodPreviewOXXO `json:"oxxo"` - P24 *ConfirmationTokenPaymentMethodPreviewP24 `json:"p24"` - PayNow *ConfirmationTokenPaymentMethodPreviewPayNow `json:"paynow"` - Paypal *ConfirmationTokenPaymentMethodPreviewPaypal `json:"paypal"` - Payto *ConfirmationTokenPaymentMethodPreviewPayto `json:"payto"` - Pix *ConfirmationTokenPaymentMethodPreviewPix `json:"pix"` - PromptPay *ConfirmationTokenPaymentMethodPreviewPromptPay `json:"promptpay"` - Rechnung *ConfirmationTokenPaymentMethodPreviewRechnung `json:"rechnung"` - RevolutPay *ConfirmationTokenPaymentMethodPreviewRevolutPay `json:"revolut_pay"` - SEPADebit *ConfirmationTokenPaymentMethodPreviewSEPADebit `json:"sepa_debit"` - Sofort *ConfirmationTokenPaymentMethodPreviewSofort `json:"sofort"` - Swish *ConfirmationTokenPaymentMethodPreviewSwish `json:"swish"` - TWINT *ConfirmationTokenPaymentMethodPreviewTWINT `json:"twint"` + // This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + AllowRedisplay ConfirmationTokenPaymentMethodPreviewAllowRedisplay `json:"allow_redisplay"` + AmazonPay *ConfirmationTokenPaymentMethodPreviewAmazonPay `json:"amazon_pay"` + AUBECSDebit *ConfirmationTokenPaymentMethodPreviewAUBECSDebit `json:"au_becs_debit"` + BACSDebit *ConfirmationTokenPaymentMethodPreviewBACSDebit `json:"bacs_debit"` + Bancontact *ConfirmationTokenPaymentMethodPreviewBancontact `json:"bancontact"` + BillingDetails *ConfirmationTokenPaymentMethodPreviewBillingDetails `json:"billing_details"` + BLIK *ConfirmationTokenPaymentMethodPreviewBLIK `json:"blik"` + Boleto *ConfirmationTokenPaymentMethodPreviewBoleto `json:"boleto"` + Card *ConfirmationTokenPaymentMethodPreviewCard `json:"card"` + CardPresent *ConfirmationTokenPaymentMethodPreviewCardPresent `json:"card_present"` + CashApp *ConfirmationTokenPaymentMethodPreviewCashApp `json:"cashapp"` + CustomerBalance *ConfirmationTokenPaymentMethodPreviewCustomerBalance `json:"customer_balance"` + EPS *ConfirmationTokenPaymentMethodPreviewEPS `json:"eps"` + FPX *ConfirmationTokenPaymentMethodPreviewFPX `json:"fpx"` + Giropay *ConfirmationTokenPaymentMethodPreviewGiropay `json:"giropay"` + Grabpay *ConfirmationTokenPaymentMethodPreviewGrabpay `json:"grabpay"` + IDEAL *ConfirmationTokenPaymentMethodPreviewIDEAL `json:"ideal"` + InteracPresent *ConfirmationTokenPaymentMethodPreviewInteracPresent `json:"interac_present"` + Klarna *ConfirmationTokenPaymentMethodPreviewKlarna `json:"klarna"` + Konbini *ConfirmationTokenPaymentMethodPreviewKonbini `json:"konbini"` + Link *ConfirmationTokenPaymentMethodPreviewLink `json:"link"` + Mobilepay *ConfirmationTokenPaymentMethodPreviewMobilepay `json:"mobilepay"` + Multibanco *ConfirmationTokenPaymentMethodPreviewMultibanco `json:"multibanco"` + OXXO *ConfirmationTokenPaymentMethodPreviewOXXO `json:"oxxo"` + P24 *ConfirmationTokenPaymentMethodPreviewP24 `json:"p24"` + PayNow *ConfirmationTokenPaymentMethodPreviewPayNow `json:"paynow"` + Paypal *ConfirmationTokenPaymentMethodPreviewPaypal `json:"paypal"` + Payto *ConfirmationTokenPaymentMethodPreviewPayto `json:"payto"` + Pix *ConfirmationTokenPaymentMethodPreviewPix `json:"pix"` + PromptPay *ConfirmationTokenPaymentMethodPreviewPromptPay `json:"promptpay"` + Rechnung *ConfirmationTokenPaymentMethodPreviewRechnung `json:"rechnung"` + RevolutPay *ConfirmationTokenPaymentMethodPreviewRevolutPay `json:"revolut_pay"` + SEPADebit *ConfirmationTokenPaymentMethodPreviewSEPADebit `json:"sepa_debit"` + Sofort *ConfirmationTokenPaymentMethodPreviewSofort `json:"sofort"` + Swish *ConfirmationTokenPaymentMethodPreviewSwish `json:"swish"` + TWINT *ConfirmationTokenPaymentMethodPreviewTWINT `json:"twint"` // The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Type ConfirmationTokenPaymentMethodPreviewType `json:"type"` USBankAccount *ConfirmationTokenPaymentMethodPreviewUSBankAccount `json:"us_bank_account"` diff --git a/paymentmethod.go b/paymentmethod.go index 3edeab868b..4720cbfced 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -8,6 +8,16 @@ package stripe import "encoding/json" +// This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. +type PaymentMethodAllowRedisplay string + +// List of values that PaymentMethodAllowRedisplay can take +const ( + PaymentMethodAllowRedisplayAlways PaymentMethodAllowRedisplay = "always" + PaymentMethodAllowRedisplayLimited PaymentMethodAllowRedisplay = "limited" + PaymentMethodAllowRedisplayUnspecified PaymentMethodAllowRedisplay = "unspecified" +) + // Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. type PaymentMethodCardBrand string @@ -1061,16 +1071,18 @@ type PaymentMethod struct { Affirm *PaymentMethodAffirm `json:"affirm"` AfterpayClearpay *PaymentMethodAfterpayClearpay `json:"afterpay_clearpay"` Alipay *PaymentMethodAlipay `json:"alipay"` - AmazonPay *PaymentMethodAmazonPay `json:"amazon_pay"` - AUBECSDebit *PaymentMethodAUBECSDebit `json:"au_becs_debit"` - BACSDebit *PaymentMethodBACSDebit `json:"bacs_debit"` - Bancontact *PaymentMethodBancontact `json:"bancontact"` - BillingDetails *PaymentMethodBillingDetails `json:"billing_details"` - BLIK *PaymentMethodBLIK `json:"blik"` - Boleto *PaymentMethodBoleto `json:"boleto"` - Card *PaymentMethodCard `json:"card"` - CardPresent *PaymentMethodCardPresent `json:"card_present"` - CashApp *PaymentMethodCashApp `json:"cashapp"` + // This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + AllowRedisplay PaymentMethodAllowRedisplay `json:"allow_redisplay"` + AmazonPay *PaymentMethodAmazonPay `json:"amazon_pay"` + AUBECSDebit *PaymentMethodAUBECSDebit `json:"au_becs_debit"` + BACSDebit *PaymentMethodBACSDebit `json:"bacs_debit"` + Bancontact *PaymentMethodBancontact `json:"bancontact"` + BillingDetails *PaymentMethodBillingDetails `json:"billing_details"` + BLIK *PaymentMethodBLIK `json:"blik"` + Boleto *PaymentMethodBoleto `json:"boleto"` + Card *PaymentMethodCard `json:"card"` + CardPresent *PaymentMethodCardPresent `json:"card_present"` + CashApp *PaymentMethodCashApp `json:"cashapp"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` // The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. From 90b461dd0c2e362c414097e64a8e6a362e232555 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 17:28:26 +0000 Subject: [PATCH 07/12] Update generated code for v1013 --- OPENAPI_VERSION | 2 +- subscription.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e950385900..ec0c8a4a49 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1012 \ No newline at end of file +v1013 \ No newline at end of file diff --git a/subscription.go b/subscription.go index 73ebc23e61..41b1de9049 100644 --- a/subscription.go +++ b/subscription.go @@ -364,6 +364,8 @@ type SubscriptionParams struct { PaymentSettings *SubscriptionPaymentSettingsParams `form:"payment_settings"` // Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. PendingInvoiceItemInterval *SubscriptionPendingInvoiceItemIntervalParams `form:"pending_invoice_item_interval"` + // How to handle a customer's pending invoice items if an invoice will be generated. Defaults to `include` if the parameter is omitted. + PendingInvoiceItemsBehavior *string `form:"pending_invoice_items_behavior"` // If specified, the invoicing for the given billing cycle iterations will be processed now. Prebilling *SubscriptionPrebillingParams `form:"prebilling"` // The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. From b1404dbe3cf6aba6863d80a9c3b1c6cbe8d39522 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 18:54:42 +0000 Subject: [PATCH 08/12] Update generated code for v1014 --- OPENAPI_VERSION | 2 +- account.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ec0c8a4a49..2bb7f1b34a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1013 \ No newline at end of file +v1014 \ No newline at end of file diff --git a/account.go b/account.go index 7781b6f71f..1a122b3d30 100644 --- a/account.go +++ b/account.go @@ -1634,7 +1634,7 @@ type Account struct { // Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). DefaultCurrency Currency `json:"default_currency"` Deleted bool `json:"deleted"` - // Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. + // Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](https://stripe.com/connect/onboarding) to finish submitting account details. DetailsSubmitted bool `json:"details_submitted"` // An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. Email string `json:"email"` From c6fb97af3393edff5c6b4717b0a91bab4c137b43 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 00:54:32 +0000 Subject: [PATCH 09/12] Update generated code for v1015 --- OPENAPI_VERSION | 2 +- capital_financingsummary.go | 2 +- creditnote.go | 2 +- creditnote/client.go | 4 ++-- testhelperstreasury_outboundpayment.go | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2bb7f1b34a..8ac6a0165d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1014 \ No newline at end of file +v1015 \ No newline at end of file diff --git a/capital_financingsummary.go b/capital_financingsummary.go index 4657f6ba6b..196302c7f1 100644 --- a/capital_financingsummary.go +++ b/capital_financingsummary.go @@ -45,7 +45,7 @@ type CapitalFinancingSummaryDetailsCurrentRepaymentInterval struct { type CapitalFinancingSummaryDetails struct { // Amount of financing offered, in minor units. AdvanceAmount int64 `json:"advance_amount"` - // The time at which the funds were paid out the the Connected account's Stripe balance. Given in milliseconds since unix epoch. + // The time at which the funds were paid out to the connected account's Stripe balance. Given in milliseconds since unix epoch. AdvancePaidOutAt int64 `json:"advance_paid_out_at"` // Currency that the financing offer is transacted in. For example, `usd`. Currency Currency `json:"currency"` diff --git a/creditnote.go b/creditnote.go index e8ef3f26e6..122f94da07 100644 --- a/creditnote.go +++ b/creditnote.go @@ -403,7 +403,7 @@ func (p *CreditNoteVoidCreditNoteParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. +// When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. type CreditNoteListLinesParams struct { ListParams `form:"*"` CreditNote *string `form:"-"` // Included in URL diff --git a/creditnote/client.go b/creditnote/client.go index 548da732c9..69edefd4bb 100644 --- a/creditnote/client.go +++ b/creditnote/client.go @@ -156,12 +156,12 @@ func (i *Iter) CreditNoteList() *stripe.CreditNoteList { return i.List().(*stripe.CreditNoteList) } -// When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. +// When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func ListLines(params *stripe.CreditNoteListLinesParams) *LineItemIter { return getC().ListLines(params) } -// When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. +// When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. func (c Client) ListLines(listParams *stripe.CreditNoteListLinesParams) *LineItemIter { path := stripe.FormatURLPath( "/v1/credit_notes/%s/lines", diff --git a/testhelperstreasury_outboundpayment.go b/testhelperstreasury_outboundpayment.go index ea0e5b08dc..7094060dad 100644 --- a/testhelperstreasury_outboundpayment.go +++ b/testhelperstreasury_outboundpayment.go @@ -68,7 +68,7 @@ func (p *TestHelpersTreasuryOutboundPaymentPostParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } -// Optional hash to set the the return code. +// Optional hash to set the return code. type TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentReturnedDetailsParams struct { // The return code to be set on the OutboundPayment object. Code *string `form:"code"` @@ -79,7 +79,7 @@ type TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentParams struct { Params `form:"*"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` - // Optional hash to set the the return code. + // Optional hash to set the return code. ReturnedDetails *TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentReturnedDetailsParams `form:"returned_details"` } From 5464413671c3ee6903fddc5da409e7a217f18d53 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 14:08:00 +0000 Subject: [PATCH 10/12] Update generated code for v1017 --- OPENAPI_VERSION | 2 +- invoiceitem.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8ac6a0165d..7c1244c9d7 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1015 \ No newline at end of file +v1017 \ No newline at end of file diff --git a/invoiceitem.go b/invoiceitem.go index 664109dc2c..c9e3dcfedf 100644 --- a/invoiceitem.go +++ b/invoiceitem.go @@ -39,7 +39,7 @@ type InvoiceItemParams struct { PriceData *InvoiceItemPriceDataParams `form:"price_data"` // Non-negative integer. The quantity of units for the invoice item. Quantity *int64 `form:"quantity"` - // The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. + // The ID of a subscription to add this invoice item to. When left blank, the invoice item is added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. Subscription *string `form:"subscription"` // Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. TaxBehavior *string `form:"tax_behavior"` From dfadbd14cacba55523408dc57113a1d918960293 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 17:58:09 +0000 Subject: [PATCH 11/12] Update generated code for v1019 --- OPENAPI_VERSION | 2 +- checkout_session.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7c1244c9d7..ff5c9a6c8f 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1017 \ No newline at end of file +v1019 \ No newline at end of file diff --git a/checkout_session.go b/checkout_session.go index 0724154bfd..65d3582949 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -768,7 +768,7 @@ const ( CheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilterUnspecified CheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilter = "unspecified" ) -// Enable customers to choose if they wish to save their payment method for future use. +// Enable customers to choose if they wish to save their payment method for future use. Disabled by default. type CheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave string // List of values that CheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave can take @@ -1769,7 +1769,7 @@ type CheckoutSessionPhoneNumberCollectionParams struct { type CheckoutSessionSavedPaymentMethodOptionsParams struct { // Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. AllowRedisplayFilters []*string `form:"allow_redisplay_filters"` - // Enable customers to choose if they wish to save their payment method for future use. + // Enable customers to choose if they wish to save their payment method for future use. Disabled by default. PaymentMethodSave *string `form:"payment_method_save"` } @@ -2744,7 +2744,7 @@ type CheckoutSessionPhoneNumberCollection struct { type CheckoutSessionSavedPaymentMethodOptions struct { // Controls which payment methods are eligible to be redisplayed to returning customers. Corresponds to `allow_redisplay` on the payment method. AllowRedisplayFilters []CheckoutSessionSavedPaymentMethodOptionsAllowRedisplayFilter `json:"allow_redisplay_filters"` - // Enable customers to choose if they wish to save their payment method for future use. + // Enable customers to choose if they wish to save their payment method for future use. Disabled by default. PaymentMethodSave CheckoutSessionSavedPaymentMethodOptionsPaymentMethodSave `json:"payment_method_save"` } From efce9957262dab11df9cf66a0abfe5f71622d4e0 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 19:15:01 +0000 Subject: [PATCH 12/12] Update generated code for v1020 --- OPENAPI_VERSION | 2 +- subscription.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ff5c9a6c8f..280e945f82 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1019 \ No newline at end of file +v1020 \ No newline at end of file diff --git a/subscription.go b/subscription.go index 41b1de9049..73ebc23e61 100644 --- a/subscription.go +++ b/subscription.go @@ -364,8 +364,6 @@ type SubscriptionParams struct { PaymentSettings *SubscriptionPaymentSettingsParams `form:"payment_settings"` // Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. PendingInvoiceItemInterval *SubscriptionPendingInvoiceItemIntervalParams `form:"pending_invoice_item_interval"` - // How to handle a customer's pending invoice items if an invoice will be generated. Defaults to `include` if the parameter is omitted. - PendingInvoiceItemsBehavior *string `form:"pending_invoice_items_behavior"` // If specified, the invoicing for the given billing cycle iterations will be processed now. Prebilling *SubscriptionPrebillingParams `form:"prebilling"` // The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.