diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 78b0e479e8..fff14d8c4a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v149 \ No newline at end of file +v150 \ No newline at end of file diff --git a/charge.go b/charge.go index ebf6854607..f50928121e 100644 --- a/charge.go +++ b/charge.go @@ -184,6 +184,12 @@ type DestinationParams struct { Amount *int64 `form:"amount"` } +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type ChargeRadarOptionsParams struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session *string `form:"session"` +} + // An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. type ChargeTransferDataParams struct { // The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. @@ -215,7 +221,7 @@ type ChargeParams struct { // 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 `form:"amount"` ApplicationFee *int64 `form:"application_fee"` - // A fee in %s that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). + // A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). ApplicationFeeAmount *int64 `form:"application_fee_amount"` // Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. Capture *bool `form:"capture"` @@ -232,6 +238,8 @@ type ChargeParams struct { Level3 *ChargeLevel3Params `form:"level3"` // The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/charges-transfers#on-behalf-of). OnBehalfOf *string `form:"on_behalf_of"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *ChargeRadarOptionsParams `form:"radar_options"` // This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. ReceiptEmail *string `form:"receipt_email"` // Shipping information for the charge. Helps prevent fraud on charges for physical goods. @@ -736,7 +744,7 @@ type ChargePaymentMethodDetailsKlarna struct { // Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` PaymentMethodCategory ChargePaymentMethodDetailsKlarnaPaymentMethodCategory `json:"payment_method_category"` // Preferred language of the Klarna authorization page that the customer is redirected to. - // Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, or `en-FR` + // Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `en-AU`, or `en-NZ` PreferredLocale string `json:"preferred_locale"` } @@ -882,6 +890,12 @@ type ChargePaymentMethodDetails struct { WechatPay *ChargePaymentMethodDetailsWechatPay `json:"wechat_pay"` } +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type ChargeRadarOptions struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session string `json:"session"` +} + // An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. type ChargeTransferData struct { // The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. @@ -965,6 +979,8 @@ type Charge struct { PaymentMethod string `json:"payment_method"` // Details about the payment method at the time of the transaction. PaymentMethodDetails *ChargePaymentMethodDetails `json:"payment_method_details"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *ChargeRadarOptions `json:"radar_options"` // This is the email address that the receipt for this charge was sent to. ReceiptEmail string `json:"receipt_email"` // This is the transaction number that appears on email receipts sent for this charge. This attribute will be `null` until a receipt has been sent. diff --git a/checkout_session.go b/checkout_session.go index 5bbd06fb06..e3779ccaa1 100644 --- a/checkout_session.go +++ b/checkout_session.go @@ -329,9 +329,9 @@ type CheckoutSessionLineItemPriceDataParams struct { Recurring *CheckoutSessionLineItemPriceDataRecurringParams `form:"recurring"` // 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"` - // A non-negative integer in %s representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + // A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } diff --git a/creditnote.go b/creditnote.go index 5cde8eae54..bcfdd31408 100644 --- a/creditnote.go +++ b/creditnote.go @@ -51,9 +51,9 @@ type CreditNoteLineParams struct { TaxRates []*string `form:"tax_rates"` // Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` Type *string `form:"type"` - // The integer unit amount in %s of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. + // The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } @@ -73,9 +73,9 @@ type CreditNoteLineParams struct { // or post_payment_credit_notes_amount depending on its status at the time of credit note creation. type CreditNoteParams struct { Params `form:"*"` - // The integer amount in %s representing the total amount of the credit note. + // The integer amount in cents (or local equivalent) representing the total amount of the credit note. Amount *int64 `form:"amount"` - // The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + // The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. CreditAmount *int64 `form:"credit_amount"` // ID of the invoice. Invoice *string `form:"invoice"` @@ -83,13 +83,13 @@ type CreditNoteParams struct { Lines []*CreditNoteLineParams `form:"lines"` // Credit note memo. Memo *string `form:"memo"` - // The integer amount in %s representing the amount that is credited outside of Stripe. + // The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. OutOfBandAmount *int64 `form:"out_of_band_amount"` // Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` Reason *string `form:"reason"` // ID of an existing refund to link this credit note to. Refund *string `form:"refund"` - // The integer amount in %s representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + // The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. RefundAmount *int64 `form:"refund_amount"` } @@ -105,9 +105,9 @@ type CreditNoteListParams struct { // Get a preview of a credit note without creating it. type CreditNotePreviewParams struct { Params `form:"*"` - // The integer amount in %s representing the total amount of the credit note. + // The integer amount in cents (or local equivalent) representing the total amount of the credit note. Amount *int64 `form:"amount"` - // The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + // The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. CreditAmount *int64 `form:"credit_amount"` // ID of the invoice. Invoice *string `form:"invoice"` @@ -115,13 +115,13 @@ type CreditNotePreviewParams struct { Lines []*CreditNoteLineParams `form:"lines"` // The credit note's memo appears on the credit note PDF. Memo *string `form:"memo"` - // The integer amount in %s representing the amount that is credited outside of Stripe. + // The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. OutOfBandAmount *int64 `form:"out_of_band_amount"` // Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` Reason *string `form:"reason"` // ID of an existing refund to link this credit note to. Refund *string `form:"refund"` - // The integer amount in %s representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + // The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. RefundAmount *int64 `form:"refund_amount"` } @@ -133,9 +133,9 @@ type CreditNoteVoidParams struct { // 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. type CreditNoteLineItemListPreviewParams struct { ListParams `form:"*"` - // The integer amount in %s representing the total amount of the credit note. + // The integer amount in cents (or local equivalent) representing the total amount of the credit note. Amount *int64 `form:"amount"` - // The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + // The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. CreditAmount *int64 `form:"credit_amount"` // ID of the invoice. Invoice *string `form:"invoice"` @@ -143,13 +143,13 @@ type CreditNoteLineItemListPreviewParams struct { Lines []*CreditNoteLineParams `form:"lines"` // The credit note's memo appears on the credit note PDF. Memo *string `form:"memo"` - // The integer amount in %s representing the amount that is credited outside of Stripe. + // The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. OutOfBandAmount *int64 `form:"out_of_band_amount"` // Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` Reason *string `form:"reason"` // ID of an existing refund to link this credit note to. Refund *string `form:"refund"` - // The integer amount in %s representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. + // The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. RefundAmount *int64 `form:"refund_amount"` } diff --git a/customer.go b/customer.go index 5603040f33..8653c52f1f 100644 --- a/customer.go +++ b/customer.go @@ -137,7 +137,7 @@ type CustomerParams struct { Params `form:"*"` // The customer's address. Address *AddressParams `form:"address"` - // An integer amount in %s that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + // An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. Balance *int64 `form:"balance"` // Balance information and default balance settings for this customer. CashBalance *CustomerCashBalanceParams `form:"cash_balance"` diff --git a/customerbalancetransaction.go b/customerbalancetransaction.go index 2f7b3e064c..407e1c79df 100644 --- a/customerbalancetransaction.go +++ b/customerbalancetransaction.go @@ -28,7 +28,7 @@ const ( type CustomerBalanceTransactionParams struct { Params `form:"*"` Customer *string `form:"-"` // Included in URL - // The integer amount in **%s** to apply to the customer's credit balance. + // The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. Amount *int64 `form:"amount"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). If the customer's [`currency`](https://stripe.com/docs/api/customers/object#customer_object-currency) is set, this value must match it. If the customer's `currency` is not set, it will be updated to this value. Currency *string `form:"currency"` diff --git a/feerefund.go b/feerefund.go index 867e00b35f..58c8560b6c 100644 --- a/feerefund.go +++ b/feerefund.go @@ -20,7 +20,7 @@ import "encoding/json" type FeeRefundParams struct { Params `form:"*"` ApplicationFee *string `form:"-"` // Included in URL - // A positive integer, in _%s_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. + // A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. Amount *int64 `form:"amount"` } diff --git a/fundinginstructions.go b/fundinginstructions.go index 4286567d07..eb39e18ffd 100644 --- a/fundinginstructions.go +++ b/fundinginstructions.go @@ -42,7 +42,22 @@ const ( ) // Zengin Records contain Japan bank account details per the Zengin format. -type FundingInstructionsBankTransferFinancialAddressZengin struct{} +type FundingInstructionsBankTransferFinancialAddressZengin struct { + // The account holder name + AccountHolderName string `json:"account_holder_name"` + // The account number + AccountNumber string `json:"account_number"` + // The bank account type. In Japan, this can only be `futsu` or `toza`. + AccountType string `json:"account_type"` + // The bank code of the account + BankCode string `json:"bank_code"` + // The bank name of the account + BankName string `json:"bank_name"` + // The branch code of the account + BranchCode string `json:"branch_code"` + // The branch name of the account + BranchName string `json:"branch_name"` +} // A list of financial addresses that can be used to fund a particular balance type FundingInstructionsBankTransferFinancialAddress struct { diff --git a/invoice.go b/invoice.go index 547d859197..c540961b82 100644 --- a/invoice.go +++ b/invoice.go @@ -220,7 +220,7 @@ type InvoicePaymentSettingsPaymentMethodOptionsCardParams struct { // Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferParams struct { - // The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. Type *string `form:"type"` } @@ -286,7 +286,7 @@ type InvoiceParams struct { Params `form:"*"` // The account tax IDs associated with the invoice. Only editable when the invoice is a draft. AccountTaxIDs []*string `form:"account_tax_ids"` - // A fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + // A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). ApplicationFeeAmount *int64 `form:"application_fee_amount"` // Controls whether Stripe will perform [automatic collection](https://stripe.com/docs/billing/invoices/workflow/#auto_advance) of the invoice. AutoAdvance *bool `form:"auto_advance"` @@ -434,7 +434,7 @@ type InvoiceUpcomingInvoiceItemPeriodParams struct { // List of invoice items to add or update in the upcoming invoice preview. type InvoiceUpcomingInvoiceItemParams struct { - // The integer amount in %s of previewed invoice item. + // The integer amount in cents (or local equivalent) of previewed invoice item. Amount *int64 `form:"amount"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items. Currency *string `form:"currency"` @@ -459,9 +459,9 @@ type InvoiceUpcomingInvoiceItemParams struct { Schedule *string `form:"schedule"` // The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. TaxRates []*string `form:"tax_rates"` - // The integer unit amount in %s of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + // The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } @@ -560,7 +560,7 @@ type InvoicePaymentSettingsPaymentMethodOptionsCard struct { RequestThreeDSecure InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer struct { - // The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. Type string `json:"type"` } diff --git a/invoiceitem.go b/invoiceitem.go index 3ca8014eda..4d47e8b8a6 100644 --- a/invoiceitem.go +++ b/invoiceitem.go @@ -45,16 +45,16 @@ type InvoiceItemPriceDataParams struct { Product *string `form:"product"` // 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"` - // A positive integer in %s (or 0 for a free price) representing how much to charge. + // A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } // 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. type InvoiceItemParams struct { Params `form:"*"` - // The integer amount in %s of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. + // The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. Amount *int64 `form:"amount"` // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Currency *string `form:"currency"` @@ -80,9 +80,9 @@ type InvoiceItemParams struct { Subscription *string `form:"subscription"` // The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. TaxRates []*string `form:"tax_rates"` - // The integer unit amount in %s of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. + // The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } diff --git a/paymentintent.go b/paymentintent.go index 1e5b04a264..4d86020b61 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -332,23 +332,12 @@ const ( PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypeZengin PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType = "zengin" ) -// The bank transfer type that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType string // List of values that PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType can take const ( - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeEUBankAccount PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "eu_bank_account" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeEUBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "eu_bank_transfer" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeGBBankAccount PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "gb_bank_account" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeGBBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "gb_bank_transfer" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeIDBankAccount PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "id_bank_account" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeIDBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "id_bank_transfer" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeJPBankAccount PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "jp_bank_account" PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeJPBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "jp_bank_transfer" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeMXBankAccount PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "mx_bank_account" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeMXBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "mx_bank_transfer" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeUSBankAccount PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "us_bank_account" - PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferTypeUSBankTransfer PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType = "us_bank_transfer" ) // The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. @@ -698,6 +687,12 @@ type PaymentIntentPaymentMethodDataLinkParams struct{} // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. type PaymentIntentPaymentMethodDataPayNowParams struct{} +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type PaymentIntentPaymentMethodDataRadarOptionsParams struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session *string `form:"session"` +} + // If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. type PaymentIntentPaymentMethodDataUSBankAccountParams struct { // Account holder type: individual or company. @@ -763,6 +758,8 @@ type PaymentIntentPaymentMethodDataParams struct { P24 *PaymentMethodP24Params `form:"p24"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *PaymentIntentPaymentMethodDataPayNowParams `form:"paynow"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *PaymentIntentPaymentMethodDataRadarOptionsParams `form:"radar_options"` // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. @@ -1003,7 +1000,7 @@ type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferParams struct { // // Permitted values include: `zengin`. RequestedAddressTypes []*string `form:"requested_address_types"` - // The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + // The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. Type *string `form:"type"` } @@ -1323,6 +1320,12 @@ type PaymentIntentPaymentMethodOptionsParams struct { WechatPay *PaymentIntentPaymentMethodOptionsWechatPayParams `form:"wechat_pay"` } +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type PaymentIntentRadarOptionsParams struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session *string `form:"session"` +} + // The parameters used to automatically create a Transfer when the payment succeeds. // For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). type PaymentIntentTransferDataParams struct { @@ -1386,6 +1389,8 @@ type PaymentIntentParams struct { PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"` // The list of payment method types (e.g. card) that this PaymentIntent is allowed to 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. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *PaymentIntentRadarOptionsParams `form:"radar_options"` // Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). ReceiptEmail *string `form:"receipt_email"` // The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). @@ -1428,6 +1433,12 @@ type PaymentIntentListParams struct { Customer *string `form:"customer"` } +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type PaymentIntentConfirmRadarOptionsParams struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session *string `form:"session"` +} + // Confirm that your customer intends to pay with current or provided // payment method. Upon confirmation, the PaymentIntent will attempt to initiate // a payment. @@ -1472,6 +1483,8 @@ type PaymentIntentConfirmParams struct { // Payment-method-specific configuration for this PaymentIntent. PaymentMethodOptions *PaymentIntentPaymentMethodOptionsParams `form:"payment_method_options"` PaymentMethodTypes []*string `form:"payment_method_types"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *PaymentIntentConfirmRadarOptionsParams `form:"radar_options"` // Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). ReceiptEmail *string `form:"receipt_email"` // The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. @@ -1633,7 +1646,22 @@ type PaymentIntentNextActionCardAwaitNotification struct { } // Zengin Records contain Japan bank account details per the Zengin format. -type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressZengin struct{} +type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressZengin struct { + // The account holder name + AccountHolderName string `json:"account_holder_name"` + // The account number + AccountNumber string `json:"account_number"` + // The bank account type. In Japan, this can only be `futsu` or `toza`. + AccountType string `json:"account_type"` + // The bank code of the account + BankCode string `json:"bank_code"` + // The bank name of the account + BankName string `json:"bank_name"` + // The branch code of the account + BranchCode string `json:"branch_code"` + // The branch name of the account + BranchName string `json:"branch_name"` +} // A list of financial addresses that can be used to fund the customer balance type PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddress struct { @@ -1957,7 +1985,7 @@ type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer struct { // // Permitted values include: `zengin`. RequestedAddressTypes []PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressType `json:"requested_address_types"` - // The bank transfer type that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + // The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `jp_bank_transfer`. Type PaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType `json:"type"` } type PaymentIntentPaymentMethodOptionsCustomerBalance struct { diff --git a/paymentmethod.go b/paymentmethod.go index 4aa70e3561..2a7cd88724 100644 --- a/paymentmethod.go +++ b/paymentmethod.go @@ -258,6 +258,12 @@ type PaymentMethodP24Params struct { // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. type PaymentMethodPayNowParams struct{} +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type PaymentMethodRadarOptionsParams struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session *string `form:"session"` +} + // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. type PaymentMethodSepaDebitParams struct { // IBAN of the bank account. @@ -338,6 +344,8 @@ type PaymentMethodParams struct { P24 *PaymentMethodP24Params `form:"p24"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *PaymentMethodPayNowParams `form:"paynow"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *PaymentMethodRadarOptionsParams `form:"radar_options"` // This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys. SepaDebit *PaymentMethodSepaDebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. @@ -577,6 +585,12 @@ type PaymentMethodP24 struct { } type PaymentMethodPayNow struct{} +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type PaymentMethodRadarOptions struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session string `json:"session"` +} + // Information about the object that generated this PaymentMethod. type PaymentMethodSepaDebitGeneratedFrom struct { // The ID of the Charge that generated this PaymentMethod, if any. @@ -669,12 +683,14 @@ type PaymentMethod struct { // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Metadata map[string]string `json:"metadata"` // String representing the object's type. Objects of the same type share the same value. - Object string `json:"object"` - OXXO *PaymentMethodOXXO `json:"oxxo"` - P24 *PaymentMethodP24 `json:"p24"` - PayNow *PaymentMethodPayNow `json:"paynow"` - SepaDebit *PaymentMethodSepaDebit `json:"sepa_debit"` - Sofort *PaymentMethodSofort `json:"sofort"` + Object string `json:"object"` + OXXO *PaymentMethodOXXO `json:"oxxo"` + P24 *PaymentMethodP24 `json:"p24"` + PayNow *PaymentMethodPayNow `json:"paynow"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *PaymentMethodRadarOptions `json:"radar_options"` + SepaDebit *PaymentMethodSepaDebit `json:"sepa_debit"` + Sofort *PaymentMethodSofort `json:"sofort"` // 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 PaymentMethodType `json:"type"` USBankAccount *PaymentMethodUSBankAccount `json:"us_bank_account"` diff --git a/plan.go b/plan.go index 7004f7a428..ff600fba11 100644 --- a/plan.go +++ b/plan.go @@ -112,7 +112,7 @@ type PlanTierParams struct { FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision"` // The per unit billing amount for each individual unit for which this tier applies. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` // Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. UpTo *int64 `form:"-"` // See custom AppendTo @@ -146,7 +146,7 @@ type PlanParams struct { Active *bool `form:"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 *string `form:"aggregate_usage"` - // A positive integer in %s (or 0 for a free plan) representing how much to charge on a recurring basis. + // A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. Amount *int64 `form:"amount"` // Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. AmountDecimal *float64 `form:"amount_decimal,high_precision"` diff --git a/price.go b/price.go index 2a59b50ddf..22b34f9dea 100644 --- a/price.go +++ b/price.go @@ -169,7 +169,7 @@ type PriceTierParams struct { FlatAmountDecimal *float64 `form:"flat_amount_decimal,high_precision"` // The per unit billing amount for each individual unit for which this tier applies. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` // Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. UpTo *int64 `form:"up_to"` @@ -220,9 +220,9 @@ type PriceParams struct { TransferLookupKey *bool `form:"transfer_lookup_key"` // Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. TransformQuantity *PriceTransformQuantityParams `form:"transform_quantity"` - // A positive integer in %s (or 0 for a free price) representing how much to charge. + // A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } diff --git a/product.go b/product.go index 08f8634cac..3be57e6ad3 100644 --- a/product.go +++ b/product.go @@ -43,9 +43,9 @@ type ProductDefaultPriceDataParams struct { Recurring *ProductDefaultPriceDataRecurringParams `form:"recurring"` // 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"` - // A positive integer in %s (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. + // A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } diff --git a/quote.go b/quote.go index 8edd3cca97..3942fd010d 100644 --- a/quote.go +++ b/quote.go @@ -131,9 +131,9 @@ type QuoteLineItemPriceDataParams struct { Recurring *QuoteLineItemPriceDataRecurringParams `form:"recurring"` // 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"` - // A positive integer in %s (or 0 for a free price) representing how much to charge. + // A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } diff --git a/reversal.go b/reversal.go index e5b18c4181..a1f61c6e4e 100644 --- a/reversal.go +++ b/reversal.go @@ -16,7 +16,7 @@ import "encoding/json" type ReversalParams struct { Params `form:"*"` Transfer *string `form:"-"` // Included in URL - // A positive integer in %s representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. + // A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. Amount *int64 `form:"amount"` // An arbitrary string which you can attach to a reversal object. It is displayed alongside the reversal in the Dashboard. This will be unset if you POST an empty value. Description *string `form:"description"` diff --git a/setupintent.go b/setupintent.go index d239a608f8..1e8e06cbea 100644 --- a/setupintent.go +++ b/setupintent.go @@ -124,6 +124,23 @@ const ( SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypeIndia SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedType = "india" ) +// Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. +type SetupIntentPaymentMethodOptionsCardNetwork string + +// List of values that SetupIntentPaymentMethodOptionsCardNetwork can take +const ( + SetupIntentPaymentMethodOptionsCardNetworkAmex SetupIntentPaymentMethodOptionsCardNetwork = "amex" + SetupIntentPaymentMethodOptionsCardNetworkCartesBancaires SetupIntentPaymentMethodOptionsCardNetwork = "cartes_bancaires" + SetupIntentPaymentMethodOptionsCardNetworkDiners SetupIntentPaymentMethodOptionsCardNetwork = "diners" + SetupIntentPaymentMethodOptionsCardNetworkDiscover SetupIntentPaymentMethodOptionsCardNetwork = "discover" + SetupIntentPaymentMethodOptionsCardNetworkInterac SetupIntentPaymentMethodOptionsCardNetwork = "interac" + SetupIntentPaymentMethodOptionsCardNetworkJCB SetupIntentPaymentMethodOptionsCardNetwork = "jcb" + SetupIntentPaymentMethodOptionsCardNetworkMastercard SetupIntentPaymentMethodOptionsCardNetwork = "mastercard" + SetupIntentPaymentMethodOptionsCardNetworkUnionpay SetupIntentPaymentMethodOptionsCardNetwork = "unionpay" + SetupIntentPaymentMethodOptionsCardNetworkUnknown SetupIntentPaymentMethodOptionsCardNetwork = "unknown" + SetupIntentPaymentMethodOptionsCardNetworkVisa SetupIntentPaymentMethodOptionsCardNetwork = "visa" +) + // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. type SetupIntentPaymentMethodOptionsCardRequestThreeDSecure string @@ -330,6 +347,12 @@ type SetupIntentPaymentMethodDataP24Params struct { // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. type SetupIntentPaymentMethodDataPayNowParams struct{} +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type SetupIntentPaymentMethodDataRadarOptionsParams struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session *string `form:"session"` +} + // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. type SetupIntentPaymentMethodDataSepaDebitParams struct { // IBAN of the bank account. @@ -408,6 +431,8 @@ type SetupIntentPaymentMethodDataParams struct { P24 *SetupIntentPaymentMethodDataP24Params `form:"p24"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *SetupIntentPaymentMethodDataPayNowParams `form:"paynow"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *SetupIntentPaymentMethodDataRadarOptionsParams `form:"radar_options"` // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. SepaDebit *SetupIntentPaymentMethodDataSepaDebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. @@ -715,6 +740,12 @@ type SetupIntentConfirmPaymentMethodDataP24Params struct { // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. type SetupIntentConfirmPaymentMethodDataPayNowParams struct{} +// Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +type SetupIntentConfirmPaymentMethodDataRadarOptionsParams struct { + // A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + Session *string `form:"session"` +} + // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. type SetupIntentConfirmPaymentMethodDataSepaDebitParams struct { // IBAN of the bank account. @@ -793,6 +824,8 @@ type SetupIntentConfirmPaymentMethodDataParams struct { P24 *SetupIntentConfirmPaymentMethodDataP24Params `form:"p24"` // If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. PayNow *SetupIntentConfirmPaymentMethodDataPayNowParams `form:"paynow"` + // Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + RadarOptions *SetupIntentConfirmPaymentMethodDataRadarOptionsParams `form:"radar_options"` // If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. SepaDebit *SetupIntentConfirmPaymentMethodDataSepaDebitParams `form:"sepa_debit"` // If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. @@ -925,6 +958,8 @@ type SetupIntentPaymentMethodOptionsCardMandateOptions struct { type SetupIntentPaymentMethodOptionsCard struct { // Configuration options for setting up an eMandate for cards issued in India. MandateOptions *SetupIntentPaymentMethodOptionsCardMandateOptions `json:"mandate_options"` + // Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. + Network SetupIntentPaymentMethodOptionsCardNetwork `json:"network"` // We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. RequestThreeDSecure SetupIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } diff --git a/sub.go b/sub.go index 1cf7f104fe..ba02ec866a 100644 --- a/sub.go +++ b/sub.go @@ -311,7 +311,7 @@ type SubscriptionPaymentSettingsPaymentMethodOptionsCardParams struct { // Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. type SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferParams struct { - // The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. Type *string `form:"type"` } @@ -554,7 +554,7 @@ type SubscriptionPaymentSettingsPaymentMethodOptionsCard struct { RequestThreeDSecure SubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` } type SubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer struct { - // The bank transfer type that can be used for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + // The bank transfer type that can be used for funding. Permitted values include: `jp_bank_transfer`. Type string `json:"type"` } diff --git a/subitem.go b/subitem.go index 146a48d5e9..a367ea4395 100644 --- a/subitem.go +++ b/subitem.go @@ -37,9 +37,9 @@ type SubscriptionItemPriceDataParams struct { Recurring *SubscriptionItemPriceDataRecurringParams `form:"recurring"` // 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"` - // A positive integer in %s (or 0 for a free price) representing how much to charge. + // A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. UnitAmount *int64 `form:"unit_amount"` - // Same as `unit_amount`, but accepts a decimal value in %s with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. + // Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"` } diff --git a/terminal_reader.go b/terminal_reader.go index 877ac7e2c2..793b69622e 100644 --- a/terminal_reader.go +++ b/terminal_reader.go @@ -34,16 +34,17 @@ const ( TerminalReaderActionTypeSetReaderDisplay TerminalReaderActionType = "set_reader_display" ) -// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, or `verifone_P400`. +// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. type TerminalReaderDeviceType string // List of values that TerminalReaderDeviceType can take const ( - TerminalReaderDeviceTypeBBPOSChipper2X TerminalReaderDeviceType = "bbpos_chipper2x" - TerminalReaderDeviceTypeBBPOSWisePad3 TerminalReaderDeviceType = "bbpos_wisepad3" - TerminalReaderDeviceTypeBBPOSWisePOSE TerminalReaderDeviceType = "bbpos_wisepos_e" - TerminalReaderDeviceTypeStripeM2 TerminalReaderDeviceType = "stripe_m2" - TerminalReaderDeviceTypeVerifoneP400 TerminalReaderDeviceType = "verifone_P400" + TerminalReaderDeviceTypeBBPOSChipper2X TerminalReaderDeviceType = "bbpos_chipper2x" + TerminalReaderDeviceTypeBBPOSWisePad3 TerminalReaderDeviceType = "bbpos_wisepad3" + TerminalReaderDeviceTypeBBPOSWisePOSE TerminalReaderDeviceType = "bbpos_wisepos_e" + TerminalReaderDeviceTypeSimulatedWisePOSE TerminalReaderDeviceType = "simulated_wisepos_e" + TerminalReaderDeviceTypeStripeM2 TerminalReaderDeviceType = "stripe_m2" + TerminalReaderDeviceTypeVerifoneP400 TerminalReaderDeviceType = "verifone_P400" ) // Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -204,7 +205,7 @@ type TerminalReader struct { Deleted bool `json:"deleted"` // The current software version of the reader. DeviceSwVersion string `json:"device_sw_version"` - // Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, or `verifone_P400`. + // Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. DeviceType TerminalReaderDeviceType `json:"device_type"` // Unique identifier for the object. ID string `json:"id"` diff --git a/transfer.go b/transfer.go index 6748c6c970..381eae9139 100644 --- a/transfer.go +++ b/transfer.go @@ -21,7 +21,7 @@ const ( // 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. type TransferParams struct { Params `form:"*"` - // A positive integer in %s representing how much to transfer. + // A positive integer in cents (or local equivalent) representing how much to transfer. Amount *int64 `form:"amount"` // 3-letter [ISO code for currency](https://stripe.com/docs/payouts). Currency *string `form:"currency"`