diff --git a/CHANGELOG.md b/CHANGELOG.md index f7dddc05c2..866fbad7c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ * Add support for new value `ro_tin` on enum `OrderTaxDetailsTaxIdsType` * Add support for new values `email`, `numeric`, `phone`, and `text` on enum `TerminalReaderActionCollectInputsInputsType` +## 74.28.0 - 2023-07-28 +* [#1693](https://github.com/stripe/stripe-go/pull/1693) Update generated code + * Add support for `MonthlyEstimatedRevenue` on `AccountBusinessProfileParams` and `AccountBusinessProfile` + * Add support for `SubscriptionDetails` on `Invoice` + ## 74.27.0 - 2023-07-20 * [#1691](https://github.com/stripe/stripe-go/pull/1691) Update generated code * Add support for new value `ro_tin` on enums `CheckoutSessionCustomerDetailsTaxIdsType`, `InvoiceCustomerTaxIdsType`, `TaxCalculationCustomerDetailsTaxIdsType`, and `TaxTransactionCustomerDetailsTaxIdsType` diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e3059d5b46..dae9a81fbb 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v434 \ No newline at end of file +v446 \ No newline at end of file diff --git a/applicationfee.go b/applicationfee.go index bc7c5bcd94..10f18bef29 100644 --- a/applicationfee.go +++ b/applicationfee.go @@ -25,9 +25,9 @@ type ApplicationFee struct { APIResource // ID of the Stripe account this fee was taken from. Account *Account `json:"account"` - // Amount earned, in %s. + // Amount earned, in cents (or local equivalent). Amount int64 `json:"amount"` - // Amount in %s refunded (can be less than the amount attribute on the fee if a partial refund was issued) + // Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued) AmountRefunded int64 `json:"amount_refunded"` // ID of the Connect application that earned the fee. Application *Application `json:"application"` diff --git a/balancetransaction.go b/balancetransaction.go index 5bfa3b0e56..76efd8e4ae 100644 --- a/balancetransaction.go +++ b/balancetransaction.go @@ -136,7 +136,7 @@ type BalanceTransactionParams struct { Params `form:"*"` } -// Detailed breakdown of fees (in %s) paid for this transaction. +// Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. type BalanceTransactionFeeDetail struct { // Amount of the fee, in cents. Amount int64 `json:"amount"` @@ -156,7 +156,7 @@ type BalanceTransactionFeeDetail struct { // Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types) type BalanceTransaction struct { APIResource - // Gross amount of the transaction, in %s. + // Gross amount of the transaction, in cents (or local equivalent). Amount int64 `json:"amount"` // The date the transaction's net funds will become available in the Stripe balance. AvailableOn int64 `json:"available_on"` @@ -168,13 +168,13 @@ type BalanceTransaction struct { Description string `json:"description"` // The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the `amount` in currency A, times `exchange_rate`, would be the `amount` in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's `amount` would be `1000` and `currency` would be `eur`. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's `amount` would be `1234`, `currency` would be `usd`, and `exchange_rate` would be `1.234`. ExchangeRate float64 `json:"exchange_rate"` - // Fees (in %s) paid for this transaction. + // Fees (in cents (or local equivalent)) paid for this transaction. Fee int64 `json:"fee"` - // Detailed breakdown of fees (in %s) paid for this transaction. + // Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. FeeDetails []*BalanceTransactionFeeDetail `json:"fee_details"` // Unique identifier for the object. ID string `json:"id"` - // Net amount of the transaction, in %s. + // Net amount of the transaction, in cents (or local equivalent). Net int64 `json:"net"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` diff --git a/charge.go b/charge.go index 78c7b1029a..55a994240c 100644 --- a/charge.go +++ b/charge.go @@ -1337,9 +1337,9 @@ type Charge struct { APIResource // Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). Amount int64 `json:"amount"` - // Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). + // Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). AmountCaptured int64 `json:"amount_captured"` - // Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). + // Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). AmountRefunded int64 `json:"amount_refunded"` // ID of the Connect application that created the charge. Application *Application `json:"application"` diff --git a/checkout_session.go b/checkout_session.go index 9e01b6e387..a002b189e8 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -1555,7 +1555,7 @@ type CheckoutSessionShippingOptionParams struct { // If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. type CheckoutSessionSubscriptionDataTransferDataParams struct { - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. AmountPercent *float64 `form:"amount_percent"` // ID of an existing, connected Stripe account. Destination *string `form:"destination"` @@ -1575,7 +1575,7 @@ type CheckoutSessionSubscriptionDataTrialSettingsParams struct { // A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. type CheckoutSessionSubscriptionDataParams struct { - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). ApplicationFeePercent *float64 `form:"application_fee_percent"` // A future timestamp to anchor the subscription's billing cycle for new subscriptions. BillingCycleAnchor *int64 `form:"billing_cycle_anchor"` @@ -1587,7 +1587,7 @@ type CheckoutSessionSubscriptionDataParams struct { DefaultTaxRates []*string `form:"default_tax_rates"` // The subscription's description, meant to be displayable to the customer. // Use this field to optionally store an explanation of the subscription - // for rendering in Stripe hosted surfaces. + // for rendering in the [customer portal](https://stripe.com/docs/customer-management). Description *string `form:"description"` // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata map[string]string `form:"metadata"` @@ -2274,7 +2274,7 @@ type CheckoutSessionShippingCostTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason CheckoutSessionShippingCostTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } @@ -2325,7 +2325,7 @@ type CheckoutSessionTotalDetailsBreakdownTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason CheckoutSessionTotalDetailsBreakdownTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } type CheckoutSessionTotalDetailsBreakdown struct { diff --git a/connectcollectiontransfer.go b/connectcollectiontransfer.go index 4ddc2bcf51..4a550012ba 100644 --- a/connectcollectiontransfer.go +++ b/connectcollectiontransfer.go @@ -9,7 +9,7 @@ package stripe import "encoding/json" type ConnectCollectionTransfer struct { - // Amount transferred, in %s. + // Amount transferred, in cents (or local equivalent). Amount int64 `json:"amount"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency Currency `json:"currency"` diff --git a/coupon.go b/coupon.go index 0181dd677a..1965e58659 100644 --- a/coupon.go +++ b/coupon.go @@ -110,7 +110,7 @@ type Coupon struct { Name string `json:"name"` // String representing the object's type. Objects of the same type share the same value. Object string `json:"object"` - // Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead. + // Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. PercentOff float64 `json:"percent_off"` // Date after which the coupon can no longer be redeemed. RedeemBy int64 `json:"redeem_by"` diff --git a/creditnote.go b/creditnote.go index 592605331e..4533796de5 100644 --- a/creditnote.go +++ b/creditnote.go @@ -274,9 +274,9 @@ type CreditNoteListLinesParams struct { CreditNote *string `form:"-"` // Included in URL } -// The integer amount in %s representing the total amount of discount that was credited. +// The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. type CreditNoteDiscountAmount struct { - // The amount, in %s, of the discount. + // The amount, in cents (or local equivalent), of the discount. Amount int64 `json:"amount"` // The discount that was applied to get this discount amount. Discount *Discount `json:"discount"` @@ -292,7 +292,7 @@ type CreditNoteShippingCostTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason CreditNoteShippingCostTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } @@ -312,13 +312,13 @@ type CreditNoteShippingCost struct { // The aggregate amounts calculated per tax rate for all line items. type CreditNoteTaxAmount struct { - // The amount, in %s, of the tax. + // The amount, in cents (or local equivalent), of the tax. Amount int64 `json:"amount"` // Whether this tax amount is inclusive or exclusive. Inclusive bool `json:"inclusive"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason CreditNoteTaxAmountTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` // The tax rate that was applied to get this tax amount. TaxRate *TaxRate `json:"tax_rate"` @@ -329,7 +329,7 @@ type CreditNoteTaxAmount struct { // Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes) type CreditNote struct { APIResource - // The integer amount in %s representing the total amount of the credit note, including tax. + // The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. Amount int64 `json:"amount"` // This is the sum of all the shipping amounts. AmountShipping int64 `json:"amount_shipping"` @@ -341,7 +341,7 @@ type CreditNote struct { Customer *Customer `json:"customer"` // Customer balance transaction related to this credit note. CustomerBalanceTransaction *CustomerBalanceTransaction `json:"customer_balance_transaction"` - // The integer amount in %s representing the total amount of discount that was credited. + // The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. DiscountAmount int64 `json:"discount_amount"` // The aggregate amounts calculated per discount for all line items. DiscountAmounts []*CreditNoteDiscountAmount `json:"discount_amounts"` @@ -375,15 +375,15 @@ type CreditNote struct { ShippingCost *CreditNoteShippingCost `json:"shipping_cost"` // Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). Status CreditNoteStatus `json:"status"` - // The integer amount in %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts. + // The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. Subtotal int64 `json:"subtotal"` - // The integer amount in %s representing the amount of the credit note, excluding all tax and invoice level discounts. + // The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. SubtotalExcludingTax int64 `json:"subtotal_excluding_tax"` // The aggregate amounts calculated per tax rate for all line items. TaxAmounts []*CreditNoteTaxAmount `json:"tax_amounts"` - // The integer amount in %s representing the total amount of the credit note, including tax and all discount. + // The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. Total int64 `json:"total"` - // The integer amount in %s representing the total amount of the credit note, excluding tax, but including discounts. + // The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. TotalExcludingTax int64 `json:"total_excluding_tax"` // Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid. Type CreditNoteType `json:"type"` diff --git a/creditnotelineitem.go b/creditnotelineitem.go index 1fe93f8d68..f5b7ba4a1a 100644 --- a/creditnotelineitem.go +++ b/creditnotelineitem.go @@ -15,9 +15,9 @@ const ( CreditNoteLineItemTypeInvoiceLineItem CreditNoteLineItemType = "invoice_line_item" ) -// The integer amount in %s representing the discount being credited for this line item. +// The integer amount in cents (or local equivalent) representing the discount being credited for this line item. type CreditNoteLineItemDiscountAmount struct { - // The amount, in %s, of the discount. + // The amount, in cents (or local equivalent), of the discount. Amount int64 `json:"amount"` // The discount that was applied to get this discount amount. Discount *Discount `json:"discount"` @@ -26,13 +26,13 @@ type CreditNoteLineItemDiscountAmount struct { // CreditNoteLineItem is the resource representing a Stripe credit note line item. // For more details see https://stripe.com/docs/api/credit_notes/line_item type CreditNoteLineItem struct { - // The integer amount in %s representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. + // The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. Amount int64 `json:"amount"` - // The integer amount in %s representing the amount being credited for this line item, excluding all tax and discounts. + // The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. AmountExcludingTax int64 `json:"amount_excluding_tax"` // Description of the item being credited. Description string `json:"description"` - // The integer amount in %s representing the discount being credited for this line item. + // The integer amount in cents (or local equivalent) representing the discount being credited for this line item. DiscountAmount int64 `json:"discount_amount"` // The amount of discount calculated per discount for this line item DiscountAmounts []*CreditNoteLineItemDiscountAmount `json:"discount_amounts"` @@ -56,7 +56,7 @@ type CreditNoteLineItem struct { UnitAmount int64 `json:"unit_amount"` // Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. UnitAmountDecimal float64 `json:"unit_amount_decimal,string"` - // The amount in %s representing the unit amount being credited for this line item, excluding all tax and discounts. + // The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. UnitAmountExcludingTax float64 `json:"unit_amount_excluding_tax,string"` } diff --git a/feerefund.go b/feerefund.go index d2f7593ff9..01bc5a6624 100644 --- a/feerefund.go +++ b/feerefund.go @@ -38,7 +38,7 @@ type FeeRefundListParams struct { // Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee) type FeeRefund struct { APIResource - // Amount, in %s. + // Amount, in cents (or local equivalent). Amount int64 `json:"amount"` // Balance transaction that describes the impact on your account balance. BalanceTransaction *BalanceTransaction `json:"balance_transaction"` diff --git a/financialconnections_transaction.go b/financialconnections_transaction.go index 0829df320c..d9bf128743 100644 --- a/financialconnections_transaction.go +++ b/financialconnections_transaction.go @@ -45,7 +45,7 @@ type FinancialConnectionsTransactionStatusTransitions struct { type FinancialConnectionsTransaction struct { // The ID of the Financial Connections Account this transaction belongs to. Account string `json:"account"` - // The amount of this transaction, in %s. + // The amount of this transaction, in cents (or local equivalent). Amount int64 `json:"amount"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency Currency `json:"currency"` diff --git a/invoice.go b/invoice.go index a0492ef1d5..1542e4459d 100644 --- a/invoice.go +++ b/invoice.go @@ -266,7 +266,7 @@ type InvoiceUpcomingCustomerDetailsTaxIDParams struct { Value *string `form:"value"` } -// Details about the customer you want to invoice or overrides for an existing customer. +// Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. type InvoiceUpcomingCustomerDetailsParams struct { // The customer's address. Address *AddressParams `form:"address"` @@ -373,9 +373,9 @@ type InvoiceUpcomingParams struct { Coupon *string `form:"coupon"` // The currency to preview this invoice in. Defaults to that of `customer` if not specified. Currency *string `form:"currency"` - // The identifier of the customer whose upcoming invoice you'd like to retrieve. + // The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. Customer *string `form:"customer"` - // Details about the customer you want to invoice or overrides for an existing customer. + // Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. CustomerDetails *InvoiceUpcomingCustomerDetailsParams `form:"customer_details"` // The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. Discounts []*InvoiceDiscountParams `form:"discounts"` @@ -769,7 +769,7 @@ type InvoiceUpcomingLinesCustomerDetailsTaxIDParams struct { Value *string `form:"value"` } -// Details about the customer you want to invoice or overrides for an existing customer. +// Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. type InvoiceUpcomingLinesCustomerDetailsParams struct { // The customer's address. Address *AddressParams `form:"address"` @@ -996,9 +996,9 @@ type InvoiceUpcomingLinesParams struct { Coupon *string `form:"coupon"` // The currency to preview this invoice in. Defaults to that of `customer` if not specified. Currency *string `form:"currency"` - // The identifier of the customer whose upcoming invoice you'd like to retrieve. + // The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. Customer *string `form:"customer"` - // Details about the customer you want to invoice or overrides for an existing customer. + // Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. CustomerDetails *InvoiceUpcomingLinesCustomerDetailsParams `form:"customer_details"` // The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use the `coupon` parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. Discounts []*InvoiceUpcomingLinesDiscountParams `form:"discounts"` @@ -1245,7 +1245,7 @@ type InvoiceShippingCostTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason InvoiceShippingCostTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } @@ -1305,7 +1305,7 @@ type InvoiceThresholdReason struct { // The aggregate amounts calculated per discount across all line items. type InvoiceTotalDiscountAmount struct { - // The amount, in %s, of the discount. + // The amount, in cents (or local equivalent), of the discount. Amount int64 `json:"amount"` // The discount that was applied to get this discount amount. Discount *Discount `json:"discount"` @@ -1313,13 +1313,13 @@ type InvoiceTotalDiscountAmount struct { // The aggregate amounts calculated per tax rate for all line items. type InvoiceTotalTaxAmount struct { - // The amount, in %s, of the tax. + // The amount, in cents (or local equivalent), of the tax. Amount int64 `json:"amount"` // Whether this tax amount is inclusive or exclusive. Inclusive bool `json:"inclusive"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason InvoiceTotalTaxAmountTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` // The tax rate that was applied to get this tax amount. TaxRate *TaxRate `json:"tax_rate"` @@ -1327,7 +1327,7 @@ type InvoiceTotalTaxAmount struct { // The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. type InvoiceTransferData struct { - // The amount in %s that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + // The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. Amount int64 `json:"amount"` // The account where funds from the payment will be transferred to upon payment success. Destination *Account `json:"destination"` @@ -1375,15 +1375,15 @@ type Invoice struct { AccountTaxIDs []*TaxID `json:"account_tax_ids"` // Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. AmountDue int64 `json:"amount_due"` - // The amount, in %s, that was paid. + // The amount, in cents (or local equivalent), that was paid. AmountPaid int64 `json:"amount_paid"` - // The difference between amount_due and amount_paid, in %s. + // The difference between amount_due and amount_paid, in cents (or local equivalent). AmountRemaining int64 `json:"amount_remaining"` // This is the sum of all the shipping amounts. AmountShipping int64 `json:"amount_shipping"` // ID of the Connect Application that created the invoice. Application *Application `json:"application"` - // The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + // The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. ApplicationFeeAmount int64 `json:"application_fee_amount"` AppliesTo *InvoiceAppliesTo `json:"applies_to"` // Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. @@ -1508,7 +1508,7 @@ type Invoice struct { SubscriptionProrationDate int64 `json:"subscription_proration_date"` // Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated Subtotal int64 `json:"subtotal"` - // The integer amount in %s representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + // The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated SubtotalExcludingTax int64 `json:"subtotal_excluding_tax"` // The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. Tax int64 `json:"tax"` @@ -1519,7 +1519,7 @@ type Invoice struct { Total int64 `json:"total"` // The aggregate amounts calculated per discount across all line items. TotalDiscountAmounts []*InvoiceTotalDiscountAmount `json:"total_discount_amounts"` - // The integer amount in %s representing the total amount of the invoice including all discounts but excluding all tax. + // The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. TotalExcludingTax int64 `json:"total_excluding_tax"` // The aggregate amounts calculated per tax rate for all line items. TotalTaxAmounts []*InvoiceTotalTaxAmount `json:"total_tax_amounts"` diff --git a/invoicelineitem.go b/invoicelineitem.go index c8c1e1c463..e3e5f5bb64 100644 --- a/invoicelineitem.go +++ b/invoicelineitem.go @@ -17,7 +17,7 @@ const ( // The amount of discount calculated per discount for this line item. type InvoiceLineItemDiscountAmount struct { - // The amount, in %s, of the discount. + // The amount, in cents (or local equivalent), of the discount. Amount int64 `json:"amount"` // The discount that was applied to get this discount amount. Discount *Discount `json:"discount"` @@ -37,9 +37,9 @@ type InvoiceLineItemProrationDetails struct { CreditedItems *InvoiceLineItemProrationDetailsCreditedItems `json:"credited_items"` } type InvoiceLineItem struct { - // The amount, in %s. + // The amount, in cents (or local equivalent). Amount int64 `json:"amount"` - // The integer amount in %s representing the amount for this line item, excluding all tax and discounts. + // The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. AmountExcludingTax int64 `json:"amount_excluding_tax"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency Currency `json:"currency"` @@ -82,7 +82,7 @@ type InvoiceLineItem struct { TaxRates []*TaxRate `json:"tax_rates"` // A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. Type InvoiceLineItemType `json:"type"` - // The amount in %s representing the unit amount for this line item, excluding all tax and discounts. + // The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. UnitAmountExcludingTax float64 `json:"unit_amount_excluding_tax,string"` } diff --git a/issuing_card.go b/issuing_card.go index 26ca82785e..efc1935a47 100644 --- a/issuing_card.go +++ b/issuing_card.go @@ -29,6 +29,26 @@ const ( IssuingCardReplacementReasonStolen IssuingCardReplacementReason = "stolen" ) +// The address validation capabilities to use. +type IssuingCardShippingAddressValidationMode string + +// List of values that IssuingCardShippingAddressValidationMode can take +const ( + IssuingCardShippingAddressValidationModeDisabled IssuingCardShippingAddressValidationMode = "disabled" + IssuingCardShippingAddressValidationModeNormalizationOnly IssuingCardShippingAddressValidationMode = "normalization_only" + IssuingCardShippingAddressValidationModeValidationAndNormalization IssuingCardShippingAddressValidationMode = "validation_and_normalization" +) + +// The validation result for the shipping address. +type IssuingCardShippingAddressValidationResult string + +// List of values that IssuingCardShippingAddressValidationResult can take +const ( + IssuingCardShippingAddressValidationResultIndeterminate IssuingCardShippingAddressValidationResult = "indeterminate" + IssuingCardShippingAddressValidationResultLikelyDeliverable IssuingCardShippingAddressValidationResult = "likely_deliverable" + IssuingCardShippingAddressValidationResultLikelyUndeliverable IssuingCardShippingAddressValidationResult = "likely_undeliverable" +) + // The delivery company that shipped a card. type IssuingCardShippingCarrier string @@ -61,6 +81,7 @@ const ( IssuingCardShippingStatusPending IssuingCardShippingStatus = "pending" IssuingCardShippingStatusReturned IssuingCardShippingStatus = "returned" IssuingCardShippingStatusShipped IssuingCardShippingStatus = "shipped" + IssuingCardShippingStatusSubmitted IssuingCardShippingStatus = "submitted" ) // Packaging options. @@ -145,6 +166,12 @@ type IssuingCardListParams struct { Type *string `form:"type"` } +// Address validation settings. +type IssuingCardShippingAddressValidationParams struct { + // The address validation capabilities to use. + Mode *string `form:"mode"` +} + // Customs information for the shipment. type IssuingCardShippingCustomsParams struct { // The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. @@ -155,6 +182,8 @@ type IssuingCardShippingCustomsParams struct { type IssuingCardShippingParams struct { // The address that the card is shipped to. Address *AddressParams `form:"address"` + // Address validation settings. + AddressValidation *IssuingCardShippingAddressValidationParams `form:"address_validation"` // Customs information for the shipment. Customs *IssuingCardShippingCustomsParams `form:"customs"` // The name printed on the shipping label when shipping the card. @@ -205,7 +234,7 @@ type IssuingCardParams struct { ReplacementFor *string `form:"replacement_for"` // If `replacement_for` is specified, this should indicate why that card is being replaced. ReplacementReason *string `form:"replacement_reason"` - // The address where the card will be shipped. + // Updated shipping information for the card. Shipping *IssuingCardShippingParams `form:"shipping"` // Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. SpendingControls *IssuingCardSpendingControlsParams `form:"spending_controls"` @@ -224,6 +253,16 @@ type IssuingCardPINParams struct { EncryptedNumber *string `form:"encrypted_number"` } +// Address validation details for the shipment. +type IssuingCardShippingAddressValidation struct { + // The address validation capabilities to use. + Mode IssuingCardShippingAddressValidationMode `json:"mode"` + // The normalized shipping address. + NormalizedAddress *Address `json:"normalized_address"` + // The validation result for the shipping address. + Result IssuingCardShippingAddressValidationResult `json:"result"` +} + // Additional information that may be required for clearing customs. type IssuingCardShippingCustoms struct { // A registration number used for customs in Europe. See [https://www.gov.uk/eori](https://www.gov.uk/eori) for the UK and [https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. @@ -233,6 +272,8 @@ type IssuingCardShippingCustoms struct { // Where and how the card will be shipped. type IssuingCardShipping struct { Address *Address `json:"address"` + // Address validation details for the shipment. + AddressValidation *IssuingCardShippingAddressValidation `json:"address_validation"` // The delivery company that shipped a card. Carrier IssuingCardShippingCarrier `json:"carrier"` // Additional information that may be required for clearing customs. diff --git a/issuing_cardholder.go b/issuing_cardholder.go index e929c82101..a15212fcc5 100644 --- a/issuing_cardholder.go +++ b/issuing_cardholder.go @@ -110,7 +110,7 @@ type IssuingCardholderIndividualCardIssuingParams struct { UserTermsAcceptance *IssuingCardholderIndividualCardIssuingUserTermsAcceptanceParams `form:"user_terms_acceptance"` } -// The date of birth of this cardholder. +// The date of birth of this cardholder. Cardholders must be older than 13 years old. type IssuingCardholderIndividualDOBParams struct { // The day of birth, between 1 and 31. Day *int64 `form:"day"` @@ -138,7 +138,7 @@ type IssuingCardholderIndividualVerificationParams struct { type IssuingCardholderIndividualParams struct { // Information related to the card_issuing program for this cardholder. CardIssuing *IssuingCardholderIndividualCardIssuingParams `form:"card_issuing"` - // The date of birth of this cardholder. + // The date of birth of this cardholder. Cardholders must be older than 13 years old. DOB *IssuingCardholderIndividualDOBParams `form:"dob"` // The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. FirstName *string `form:"first_name"` diff --git a/lineitem.go b/lineitem.go index ccdfa7bf73..19cb526b61 100644 --- a/lineitem.go +++ b/lineitem.go @@ -52,7 +52,7 @@ type LineItemTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason LineItemTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } diff --git a/order.go b/order.go index d0c2a62597..e65dae427c 100644 --- a/order.go +++ b/order.go @@ -1487,7 +1487,7 @@ type OrderShippingCostTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason OrderShippingCostTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } @@ -1550,7 +1550,7 @@ type OrderTotalDetailsBreakdownTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason OrderTotalDetailsBreakdownTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } type OrderTotalDetailsBreakdown struct { diff --git a/paymentintent.go b/paymentintent.go index 5e473e4f86..3bf9f777f5 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -699,6 +699,15 @@ const ( PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchTransactions PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "transactions" ) +// Preferred transaction settlement speed +type PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed string + +// List of values that PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed can take +const ( + PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeedFastest PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed = "fastest" + PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeedStandard PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed = "standard" +) + // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. @@ -1677,6 +1686,8 @@ type PaymentIntentPaymentMethodOptionsUSBankAccountParams struct { FinancialConnections *PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnectionsParams `form:"financial_connections"` // Additional fields for network related functions Networks *PaymentIntentPaymentMethodOptionsUSBankAccountNetworksParams `form:"networks"` + // Preferred transaction settlement speed + PreferredSettlementSpeed *string `form:"preferred_settlement_speed"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. @@ -3043,6 +3054,8 @@ type PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnections struct { } type PaymentIntentPaymentMethodOptionsUSBankAccount struct { FinancialConnections *PaymentIntentPaymentMethodOptionsUSBankAccountFinancialConnections `json:"financial_connections"` + // Preferred transaction settlement speed + PreferredSettlementSpeed PaymentIntentPaymentMethodOptionsUSBankAccountPreferredSettlementSpeed `json:"preferred_settlement_speed"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // // Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. diff --git a/paymentlink.go b/paymentlink.go index ae031f876a..084af1c6a0 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -402,7 +402,7 @@ type PaymentLinkParams struct { AllowPromotionCodes *bool `form:"allow_promotion_codes"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. ApplicationFeeAmount *int64 `form:"application_fee_amount"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. ApplicationFeePercent *float64 `form:"application_fee_percent"` // Configuration for automatic tax collection. AutomaticTax *PaymentLinkAutomaticTaxParams `form:"automatic_tax"` @@ -633,7 +633,7 @@ type PaymentLinkTaxIDCollection struct { // The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. type PaymentLinkTransferData struct { - // The amount in %s that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + // The amount in cents (or local equivalent) that will be transferred to the destination account. By default, the entire amount is transferred to the destination. Amount int64 `json:"amount"` // The connected account receiving the transfer. Destination *Account `json:"destination"` @@ -653,7 +653,7 @@ type PaymentLink struct { AllowPromotionCodes bool `json:"allow_promotion_codes"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. ApplicationFeeAmount int64 `json:"application_fee_amount"` - // This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. + // This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. ApplicationFeePercent float64 `json:"application_fee_percent"` AutomaticTax *PaymentLinkAutomaticTax `json:"automatic_tax"` // Configuration for collecting the customer's billing address. diff --git a/paymentmethodconfiguration.go b/paymentmethodconfiguration.go index 9d6fe4b63b..a3b8cfbf04 100644 --- a/paymentmethodconfiguration.go +++ b/paymentmethodconfiguration.go @@ -943,7 +943,7 @@ type PaymentMethodConfigurationJCBDisplayPreferenceParams struct { Preference *string `form:"preference"` } -// JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, and New Zealand, and available in private beta to businesses in the UK and IE. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. +// JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, New Zealand, UK, and Ireland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. type PaymentMethodConfigurationJCBParams struct { // Whether or not the payment method should be displayed. DisplayPreference *PaymentMethodConfigurationJCBDisplayPreferenceParams `form:"display_preference"` @@ -1126,7 +1126,7 @@ type PaymentMethodConfigurationParams struct { Grabpay *PaymentMethodConfigurationGrabpayParams `form:"grabpay"` // iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. IDEAL *PaymentMethodConfigurationIDEALParams `form:"ideal"` - // JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, and New Zealand, and available in private beta to businesses in the UK and IE. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. + // JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, New Zealand, UK, and Ireland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. JCB *PaymentMethodConfigurationJCBParams `form:"jcb"` // Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. Available payment options vary depending on the customer's billing address and the transaction amount. These payment options make it convenient for customers to purchase items in all price ranges. Check this [page](https://stripe.com/docs/payments/klarna) for more details. Klarna *PaymentMethodConfigurationKlarnaParams `form:"klarna"` diff --git a/payout.go b/payout.go index 3ce40612c4..72d8537ac0 100644 --- a/payout.go +++ b/payout.go @@ -137,7 +137,7 @@ type PayoutReverseParams struct { // Related guide: [Receiving payouts](https://stripe.com/docs/payouts) type Payout struct { APIResource - // Amount (in %s) to be transferred to your bank account or debit card. + // Amount (in cents (or local equivalent)) to be transferred to your bank account or debit card. Amount int64 `json:"amount"` // Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays. ArrivalDate int64 `json:"arrival_date"` diff --git a/plan.go b/plan.go index 1df6c33820..094ec198e8 100644 --- a/plan.go +++ b/plan.go @@ -211,9 +211,9 @@ type Plan struct { Active bool `json:"active"` // Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. AggregateUsage PlanAggregateUsage `json:"aggregate_usage"` - // The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + // The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. Amount int64 `json:"amount"` - // The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + // The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. AmountDecimal float64 `json:"amount_decimal,string"` // Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. BillingScheme PlanBillingScheme `json:"billing_scheme"` diff --git a/price.go b/price.go index f3158dab47..0a49ae767f 100644 --- a/price.go +++ b/price.go @@ -352,9 +352,9 @@ type PriceCurrencyOptions struct { TaxBehavior PriceCurrencyOptionsTaxBehavior `json:"tax_behavior"` // Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. Tiers []*PriceCurrencyOptionsTier `json:"tiers"` - // The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + // The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. UnitAmount int64 `json:"unit_amount"` - // The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + // The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. UnitAmountDecimal float64 `json:"unit_amount_decimal,string"` } @@ -463,9 +463,9 @@ type Price struct { TransformQuantity *PriceTransformQuantity `json:"transform_quantity"` // One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. Type PriceType `json:"type"` - // The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + // The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. UnitAmount int64 `json:"unit_amount"` - // The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + // The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. UnitAmountDecimal float64 `json:"unit_amount_decimal,string"` } diff --git a/quote.go b/quote.go index 2adcb39be2..bbb125e6cb 100644 --- a/quote.go +++ b/quote.go @@ -314,7 +314,7 @@ type QuoteParams struct { Params `form:"*"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. ApplicationFeeAmount *int64 `form:"application_fee_amount"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. ApplicationFeePercent *float64 `form:"application_fee_percent"` // Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. AutomaticTax *QuoteAutomaticTaxParams `form:"automatic_tax"` @@ -1036,7 +1036,7 @@ type QuoteSubscriptionDataOverrideParams struct { type QuoteTransferDataParams struct { // The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. Amount *int64 `form:"amount"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. AmountPercent *float64 `form:"amount_percent"` // ID of an existing, connected Stripe account. Destination *string `form:"destination"` @@ -1093,6 +1093,8 @@ type QuoteDraftQuoteParams struct { // Converts a draft or open quote to stale. type QuoteMarkStaleQuoteParams struct { Params `form:"*"` + // Reason the Quote is being marked stale. + Reason *string `form:"reason"` } // 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. @@ -1164,7 +1166,7 @@ type QuoteComputedRecurringTotalDetailsBreakdownTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason QuoteComputedRecurringTotalDetailsBreakdownTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } type QuoteComputedRecurringTotalDetailsBreakdown struct { @@ -1217,7 +1219,7 @@ type QuoteComputedUpfrontTotalDetailsBreakdownTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason QuoteComputedUpfrontTotalDetailsBreakdownTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } type QuoteComputedUpfrontTotalDetailsBreakdown struct { @@ -1284,10 +1286,12 @@ type QuoteStatusDetailsStaleLastReasonSubscriptionScheduleChanged struct { type QuoteStatusDetailsStaleLastReason struct { // The ID of the line that is invalid if the stale reason type is `line_invalid`. LineInvalid string `json:"line_invalid"` + // The user supplied mark stale reason. + MarkedStale string `json:"marked_stale"` // The ID of the subscription that was canceled. SubscriptionCanceled string `json:"subscription_canceled"` SubscriptionChanged *QuoteStatusDetailsStaleLastReasonSubscriptionChanged `json:"subscription_changed"` - // The ID of the subscription that was expired + // The ID of the subscription that was expired. SubscriptionExpired string `json:"subscription_expired"` // The ID of the subscription schedule that was canceled. SubscriptionScheduleCanceled string `json:"subscription_schedule_canceled"` @@ -1518,7 +1522,7 @@ type QuoteTotalDetailsBreakdownTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason QuoteTotalDetailsBreakdownTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } type QuoteTotalDetailsBreakdown struct { @@ -1539,9 +1543,9 @@ type QuoteTotalDetails struct { // The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. type QuoteTransferData struct { - // The amount in %s that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + // The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. Amount int64 `json:"amount"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount will be transferred to the destination. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount will be transferred to the destination. AmountPercent float64 `json:"amount_percent"` // The account where funds from the payment will be transferred to upon payment success. Destination *Account `json:"destination"` @@ -1559,7 +1563,7 @@ type Quote struct { Application *Application `json:"application"` // The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. ApplicationFeeAmount int64 `json:"application_fee_amount"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. ApplicationFeePercent float64 `json:"application_fee_percent"` AutomaticTax *QuoteAutomaticTax `json:"automatic_tax"` // Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. diff --git a/quotephase.go b/quotephase.go index 25fdd6e189..eae963ca96 100644 --- a/quotephase.go +++ b/quotephase.go @@ -100,7 +100,7 @@ type QuotePhaseTotalDetailsBreakdownTax struct { Rate *TaxRate `json:"rate"` // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. TaxabilityReason QuotePhaseTotalDetailsBreakdownTaxTaxabilityReason `json:"taxability_reason"` - // The amount on which tax is calculated, in %s. + // The amount on which tax is calculated, in cents (or local equivalent). TaxableAmount int64 `json:"taxable_amount"` } type QuotePhaseTotalDetailsBreakdown struct { diff --git a/radar_valuelist.go b/radar_valuelist.go index de35cd5aa7..4521fba97d 100644 --- a/radar_valuelist.go +++ b/radar_valuelist.go @@ -6,19 +6,21 @@ package stripe -// The type of items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. +// The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. type RadarValueListItemType string // List of values that RadarValueListItemType can take const ( - RadarValueListItemTypeCardBin RadarValueListItemType = "card_bin" - RadarValueListItemTypeCardFingerprint RadarValueListItemType = "card_fingerprint" - RadarValueListItemTypeCaseSensitiveString RadarValueListItemType = "case_sensitive_string" - RadarValueListItemTypeCountry RadarValueListItemType = "country" - RadarValueListItemTypeCustomerID RadarValueListItemType = "customer_id" - RadarValueListItemTypeEmail RadarValueListItemType = "email" - RadarValueListItemTypeIPAddress RadarValueListItemType = "ip_address" - RadarValueListItemTypeString RadarValueListItemType = "string" + RadarValueListItemTypeCardBin RadarValueListItemType = "card_bin" + RadarValueListItemTypeCardFingerprint RadarValueListItemType = "card_fingerprint" + RadarValueListItemTypeCaseSensitiveString RadarValueListItemType = "case_sensitive_string" + RadarValueListItemTypeCountry RadarValueListItemType = "country" + RadarValueListItemTypeCustomerID RadarValueListItemType = "customer_id" + RadarValueListItemTypeEmail RadarValueListItemType = "email" + RadarValueListItemTypeIPAddress RadarValueListItemType = "ip_address" + RadarValueListItemTypeSEPADebitFingerprint RadarValueListItemType = "sepa_debit_fingerprint" + RadarValueListItemTypeString RadarValueListItemType = "string" + RadarValueListItemTypeUSBankAccountFingerprint RadarValueListItemType = "us_bank_account_fingerprint" ) // Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -37,7 +39,7 @@ type RadarValueListParams struct { Params `form:"*"` // The name of the value list for use in rules. Alias *string `form:"alias"` - // Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. + // Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. ItemType *string `form:"item_type"` // The human-readable name of the value list. Name *string `form:"name"` @@ -57,7 +59,7 @@ type RadarValueList struct { Deleted bool `json:"deleted"` // Unique identifier for the object. ID string `json:"id"` - // The type of items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + // The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. ItemType RadarValueListItemType `json:"item_type"` // List of items contained within this value list. ListItems *RadarValueListItemList `json:"list_items"` diff --git a/refund.go b/refund.go index 3ceebfe45e..ed02050d1f 100644 --- a/refund.go +++ b/refund.go @@ -105,7 +105,7 @@ type RefundNextAction struct { // Related guide: [Refunds](https://stripe.com/docs/refunds) type Refund struct { APIResource - // Amount, in %s. + // Amount, in cents (or local equivalent). Amount int64 `json:"amount"` // Balance transaction that describes the impact on your account balance. BalanceTransaction *BalanceTransaction `json:"balance_transaction"` diff --git a/subscription.go b/subscription.go index ebfb825e42..cbad064b3c 100644 --- a/subscription.go +++ b/subscription.go @@ -522,7 +522,7 @@ type SubscriptionPrebillingParams struct { // If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. type SubscriptionTransferDataParams struct { - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. AmountPercent *float64 `form:"amount_percent"` // ID of an existing, connected Stripe account. Destination *string `form:"destination"` @@ -551,7 +551,7 @@ type SubscriptionParams struct { Params `form:"*"` // A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. AddInvoiceItems []*SubscriptionAddInvoiceItemParams `form:"add_invoice_items"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). ApplicationFeePercent *float64 `form:"application_fee_percent"` // Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. AutomaticTax *SubscriptionAutomaticTaxParams `form:"automatic_tax"` @@ -858,7 +858,7 @@ type SubscriptionPrebilling struct { // The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. type SubscriptionTransferData struct { - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. AmountPercent float64 `json:"amount_percent"` // The account where funds from the payment will be transferred to upon payment success. Destination *Account `json:"destination"` @@ -883,7 +883,7 @@ type Subscription struct { APIResource // ID of the Connect Application that created the subscription. Application *Application `json:"application"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. ApplicationFeePercent float64 `json:"application_fee_percent"` AutomaticTax *SubscriptionAutomaticTax `json:"automatic_tax"` // Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. diff --git a/subscriptionschedule.go b/subscriptionschedule.go index 0431d4a1e8..77f944bbb3 100644 --- a/subscriptionschedule.go +++ b/subscriptionschedule.go @@ -183,7 +183,7 @@ type SubscriptionScheduleDefaultSettingsInvoiceSettingsParams struct { // Object representing the subscription schedule's default settings. type SubscriptionScheduleDefaultSettingsParams struct { Params `form:"*"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). ApplicationFeePercent *float64 `form:"application_fee_percent,high_precision"` // Default settings for automatic tax computation. AutomaticTax *SubscriptionAutomaticTaxParams `form:"automatic_tax"` @@ -367,7 +367,7 @@ type SubscriptionSchedulePhaseTrialSettingsParams struct { type SubscriptionSchedulePhaseParams struct { // A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. AddInvoiceItems []*SubscriptionSchedulePhaseAddInvoiceItemParams `form:"add_invoice_items"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). ApplicationFeePercent *float64 `form:"application_fee_percent"` // Automatic tax settings for this phase. AutomaticTax *SubscriptionSchedulePhaseAutomaticTaxParams `form:"automatic_tax"` @@ -866,7 +866,7 @@ type SubscriptionScheduleDefaultSettingsInvoiceSettings struct { DaysUntilDue int64 `json:"days_until_due"` } type SubscriptionScheduleDefaultSettings struct { - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account during this phase of the schedule. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. ApplicationFeePercent float64 `json:"application_fee_percent"` AutomaticTax *SubscriptionAutomaticTax `json:"automatic_tax"` // Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). @@ -1008,7 +1008,7 @@ type SubscriptionSchedulePhaseTrialSettings struct { type SubscriptionSchedulePhase struct { // A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. AddInvoiceItems []*SubscriptionSchedulePhaseAddInvoiceItem `json:"add_invoice_items"` - // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account during this phase of the schedule. + // A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. ApplicationFeePercent float64 `json:"application_fee_percent"` AutomaticTax *SubscriptionAutomaticTax `json:"automatic_tax"` // Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). diff --git a/terminal_reader.go b/terminal_reader.go index de56d1ab3f..afc06448fc 100644 --- a/terminal_reader.go +++ b/terminal_reader.go @@ -86,7 +86,7 @@ const ( // Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. type TerminalReaderParams struct { Params `form:"*"` - // Custom label given to the reader for easier identification. If no label is specified, the registration code will be used. + // The new label of the reader. Label *string `form:"label"` // The location to assign the reader to. Location *string `form:"location"` diff --git a/testhelpers/issuing/card/client.go b/testhelpers/issuing/card/client.go index d02c6aed02..d696c68e1b 100644 --- a/testhelpers/issuing/card/client.go +++ b/testhelpers/issuing/card/client.go @@ -83,6 +83,22 @@ func (c Client) ShipCard(id string, params *stripe.TestHelpersIssuingCardShipCar return card, err } +// SubmitCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/submit` API. +func SubmitCard(id string, params *stripe.TestHelpersIssuingCardSubmitCardParams) (*stripe.IssuingCard, error) { + return getC().SubmitCard(id, params) +} + +// SubmitCard is the method for the `POST /v1/test_helpers/issuing/cards/{card}/shipping/submit` API. +func (c Client) SubmitCard(id string, params *stripe.TestHelpersIssuingCardSubmitCardParams) (*stripe.IssuingCard, error) { + path := stripe.FormatURLPath( + "/v1/test_helpers/issuing/cards/%s/shipping/submit", + id, + ) + card := &stripe.IssuingCard{} + err := c.B.Call(http.MethodPost, path, c.Key, params, card) + return card, err +} + func getC() Client { return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key} } diff --git a/testhelpersissuing_card.go b/testhelpersissuing_card.go index 783cfbb98c..f34a20ae16 100644 --- a/testhelpersissuing_card.go +++ b/testhelpersissuing_card.go @@ -25,3 +25,8 @@ type TestHelpersIssuingCardReturnCardParams struct { type TestHelpersIssuingCardFailCardParams struct { Params `form:"*"` } + +// Updates the shipping status of the specified Issuing Card object to submitted. +type TestHelpersIssuingCardSubmitCardParams struct { + Params `form:"*"` +} diff --git a/transfer.go b/transfer.go index c4393246e4..7568acc61b 100644 --- a/transfer.go +++ b/transfer.go @@ -60,9 +60,9 @@ type TransferListParams struct { // Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) type Transfer struct { APIResource - // Amount in %s to be transferred. + // Amount in cents (or local equivalent) to be transferred. Amount int64 `json:"amount"` - // Amount in %s reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + // Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). AmountReversed int64 `json:"amount_reversed"` // Balance transaction that describes the impact of this transfer on your account balance. BalanceTransaction *BalanceTransaction `json:"balance_transaction"` diff --git a/transferreversal.go b/transferreversal.go index 9e3b0bedf2..63b3a380b3 100644 --- a/transferreversal.go +++ b/transferreversal.go @@ -45,7 +45,7 @@ type TransferReversalListParams struct { // Related guide: [Reversing transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reversing-transfers) type TransferReversal struct { APIResource - // Amount, in %s. + // Amount, in cents (or local equivalent). Amount int64 `json:"amount"` // Balance transaction that describes the impact on your account balance. BalanceTransaction *BalanceTransaction `json:"balance_transaction"`