diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 794622303c..55d0a33c44 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v691 \ No newline at end of file +v704 \ No newline at end of file diff --git a/accountsession.go b/accountsession.go index c6c458d376..cecb8be715 100644 --- a/accountsession.go +++ b/accountsession.go @@ -6,16 +6,74 @@ package stripe +// The list of features enabled in the embedded component. +type AccountSessionComponentsAccountOnboardingFeaturesParams struct{} + // Configuration for the account onboarding embedded component. type AccountSessionComponentsAccountOnboardingParams struct { // Whether the embedded component is enabled. Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsAccountOnboardingFeaturesParams `form:"features"` +} + +// The list of features enabled in the embedded component. +type AccountSessionComponentsPaymentDetailsFeaturesParams struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments *bool `form:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement *bool `form:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement *bool `form:"refund_management"` +} + +// Configuration for the payment details embedded component. +type AccountSessionComponentsPaymentDetailsParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsPaymentDetailsFeaturesParams `form:"features"` +} + +// The list of features enabled in the embedded component. +type AccountSessionComponentsPaymentsFeaturesParams struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments *bool `form:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement *bool `form:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement *bool `form:"refund_management"` +} + +// Configuration for the payments embedded component. +type AccountSessionComponentsPaymentsParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsPaymentsFeaturesParams `form:"features"` +} + +// The list of features enabled in the embedded component. +type AccountSessionComponentsPayoutsFeaturesParams struct{} + +// Configuration for the payouts embedded component. +type AccountSessionComponentsPayoutsParams struct { + // Whether the embedded component is enabled. + Enabled *bool `form:"enabled"` + // The list of features enabled in the embedded component. + Features *AccountSessionComponentsPayoutsFeaturesParams `form:"features"` } // Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not). type AccountSessionComponentsParams struct { // Configuration for the account onboarding embedded component. AccountOnboarding *AccountSessionComponentsAccountOnboardingParams `form:"account_onboarding"` + // Configuration for the payment details embedded component. + PaymentDetails *AccountSessionComponentsPaymentDetailsParams `form:"payment_details"` + // Configuration for the payments embedded component. + Payments *AccountSessionComponentsPaymentsParams `form:"payments"` + // Configuration for the payouts embedded component. + Payouts *AccountSessionComponentsPayoutsParams `form:"payouts"` } // Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. @@ -34,12 +92,49 @@ func (p *AccountSessionParams) AddExpand(f string) { p.Expand = append(p.Expand, &f) } +type AccountSessionComponentsAccountOnboardingFeatures struct{} type AccountSessionComponentsAccountOnboarding struct { // Whether the embedded component is enabled. - Enabled bool `json:"enabled"` + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsAccountOnboardingFeatures `json:"features"` +} +type AccountSessionComponentsPaymentDetailsFeatures struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments bool `json:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement bool `json:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement bool `json:"refund_management"` +} +type AccountSessionComponentsPaymentDetails struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsPaymentDetailsFeatures `json:"features"` +} +type AccountSessionComponentsPaymentsFeatures struct { + // Whether to allow capturing and cancelling payment intents. This is `true` by default. + CapturePayments bool `json:"capture_payments"` + // Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + DisputeManagement bool `json:"dispute_management"` + // Whether to allow sending refunds. This is `true` by default. + RefundManagement bool `json:"refund_management"` +} +type AccountSessionComponentsPayments struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsPaymentsFeatures `json:"features"` +} +type AccountSessionComponentsPayoutsFeatures struct{} +type AccountSessionComponentsPayouts struct { + // Whether the embedded component is enabled. + Enabled bool `json:"enabled"` + Features *AccountSessionComponentsPayoutsFeatures `json:"features"` } type AccountSessionComponents struct { AccountOnboarding *AccountSessionComponentsAccountOnboarding `json:"account_onboarding"` + PaymentDetails *AccountSessionComponentsPaymentDetails `json:"payment_details"` + Payments *AccountSessionComponentsPayments `json:"payments"` + Payouts *AccountSessionComponentsPayouts `json:"payouts"` } // An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components. diff --git a/balancetransaction.go b/balancetransaction.go index a71474374c..8b0fec3d34 100644 --- a/balancetransaction.go +++ b/balancetransaction.go @@ -73,53 +73,55 @@ const ( BalanceTransactionStatusPending BalanceTransactionStatus = "pending" ) -// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. +// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. type BalanceTransactionType string // List of values that BalanceTransactionType can take const ( - BalanceTransactionTypeAdjustment BalanceTransactionType = "adjustment" - BalanceTransactionTypeAdvance BalanceTransactionType = "advance" - BalanceTransactionTypeAdvanceFunding BalanceTransactionType = "advance_funding" - BalanceTransactionTypeAnticipationRepayment BalanceTransactionType = "anticipation_repayment" - BalanceTransactionTypeApplicationFee BalanceTransactionType = "application_fee" - BalanceTransactionTypeApplicationFeeRefund BalanceTransactionType = "application_fee_refund" - BalanceTransactionTypeCharge BalanceTransactionType = "charge" - BalanceTransactionTypeClimateOrderPurchase BalanceTransactionType = "climate_order_purchase" - BalanceTransactionTypeClimateOrderRefund BalanceTransactionType = "climate_order_refund" - BalanceTransactionTypeConnectCollectionTransfer BalanceTransactionType = "connect_collection_transfer" - BalanceTransactionTypeContribution BalanceTransactionType = "contribution" - BalanceTransactionTypeIssuingAuthorizationHold BalanceTransactionType = "issuing_authorization_hold" - BalanceTransactionTypeIssuingAuthorizationRelease BalanceTransactionType = "issuing_authorization_release" - BalanceTransactionTypeIssuingDispute BalanceTransactionType = "issuing_dispute" - BalanceTransactionTypeIssuingTransaction BalanceTransactionType = "issuing_transaction" - BalanceTransactionTypeObligationInbound BalanceTransactionType = "obligation_inbound" - BalanceTransactionTypeObligationOutbound BalanceTransactionType = "obligation_outbound" - BalanceTransactionTypeObligationPayout BalanceTransactionType = "obligation_payout" - BalanceTransactionTypeObligationPayoutFailure BalanceTransactionType = "obligation_payout_failure" - BalanceTransactionTypeObligationReversalInbound BalanceTransactionType = "obligation_reversal_inbound" - BalanceTransactionTypeObligationReversalOutbound BalanceTransactionType = "obligation_reversal_outbound" - BalanceTransactionTypePayment BalanceTransactionType = "payment" - BalanceTransactionTypePaymentFailureRefund BalanceTransactionType = "payment_failure_refund" - BalanceTransactionTypePaymentRefund BalanceTransactionType = "payment_refund" - BalanceTransactionTypePaymentReversal BalanceTransactionType = "payment_reversal" - BalanceTransactionTypePaymentUnreconciled BalanceTransactionType = "payment_unreconciled" - BalanceTransactionTypePayout BalanceTransactionType = "payout" - BalanceTransactionTypePayoutCancel BalanceTransactionType = "payout_cancel" - BalanceTransactionTypePayoutFailure BalanceTransactionType = "payout_failure" - BalanceTransactionTypeRefund BalanceTransactionType = "refund" - BalanceTransactionTypeRefundFailure BalanceTransactionType = "refund_failure" - BalanceTransactionTypeReserveTransaction BalanceTransactionType = "reserve_transaction" - BalanceTransactionTypeReservedFunds BalanceTransactionType = "reserved_funds" - BalanceTransactionTypeStripeFee BalanceTransactionType = "stripe_fee" - BalanceTransactionTypeStripeFxFee BalanceTransactionType = "stripe_fx_fee" - BalanceTransactionTypeTaxFee BalanceTransactionType = "tax_fee" - BalanceTransactionTypeTopup BalanceTransactionType = "topup" - BalanceTransactionTypeTopupReversal BalanceTransactionType = "topup_reversal" - BalanceTransactionTypeTransfer BalanceTransactionType = "transfer" - BalanceTransactionTypeTransferCancel BalanceTransactionType = "transfer_cancel" - BalanceTransactionTypeTransferFailure BalanceTransactionType = "transfer_failure" - BalanceTransactionTypeTransferRefund BalanceTransactionType = "transfer_refund" + BalanceTransactionTypeAdjustment BalanceTransactionType = "adjustment" + BalanceTransactionTypeAdvance BalanceTransactionType = "advance" + BalanceTransactionTypeAdvanceFunding BalanceTransactionType = "advance_funding" + BalanceTransactionTypeAnticipationRepayment BalanceTransactionType = "anticipation_repayment" + BalanceTransactionTypeApplicationFee BalanceTransactionType = "application_fee" + BalanceTransactionTypeApplicationFeeRefund BalanceTransactionType = "application_fee_refund" + BalanceTransactionTypeCharge BalanceTransactionType = "charge" + BalanceTransactionTypeClimateOrderPurchase BalanceTransactionType = "climate_order_purchase" + BalanceTransactionTypeClimateOrderRefund BalanceTransactionType = "climate_order_refund" + BalanceTransactionTypeConnectCollectionTransfer BalanceTransactionType = "connect_collection_transfer" + BalanceTransactionTypeContribution BalanceTransactionType = "contribution" + BalanceTransactionTypeIssuingAuthorizationHold BalanceTransactionType = "issuing_authorization_hold" + BalanceTransactionTypeIssuingAuthorizationRelease BalanceTransactionType = "issuing_authorization_release" + BalanceTransactionTypeIssuingDispute BalanceTransactionType = "issuing_dispute" + BalanceTransactionTypeIssuingTransaction BalanceTransactionType = "issuing_transaction" + BalanceTransactionTypeObligationInbound BalanceTransactionType = "obligation_inbound" + BalanceTransactionTypeObligationOutbound BalanceTransactionType = "obligation_outbound" + BalanceTransactionTypeObligationPayout BalanceTransactionType = "obligation_payout" + BalanceTransactionTypeObligationPayoutFailure BalanceTransactionType = "obligation_payout_failure" + BalanceTransactionTypeObligationReversalInbound BalanceTransactionType = "obligation_reversal_inbound" + BalanceTransactionTypeObligationReversalOutbound BalanceTransactionType = "obligation_reversal_outbound" + BalanceTransactionTypePayment BalanceTransactionType = "payment" + BalanceTransactionTypePaymentFailureRefund BalanceTransactionType = "payment_failure_refund" + BalanceTransactionTypePaymentNetworkReserveHold BalanceTransactionType = "payment_network_reserve_hold" + BalanceTransactionTypePaymentNetworkReserveRelease BalanceTransactionType = "payment_network_reserve_release" + BalanceTransactionTypePaymentRefund BalanceTransactionType = "payment_refund" + BalanceTransactionTypePaymentReversal BalanceTransactionType = "payment_reversal" + BalanceTransactionTypePaymentUnreconciled BalanceTransactionType = "payment_unreconciled" + BalanceTransactionTypePayout BalanceTransactionType = "payout" + BalanceTransactionTypePayoutCancel BalanceTransactionType = "payout_cancel" + BalanceTransactionTypePayoutFailure BalanceTransactionType = "payout_failure" + BalanceTransactionTypeRefund BalanceTransactionType = "refund" + BalanceTransactionTypeRefundFailure BalanceTransactionType = "refund_failure" + BalanceTransactionTypeReserveTransaction BalanceTransactionType = "reserve_transaction" + BalanceTransactionTypeReservedFunds BalanceTransactionType = "reserved_funds" + BalanceTransactionTypeStripeFee BalanceTransactionType = "stripe_fee" + BalanceTransactionTypeStripeFxFee BalanceTransactionType = "stripe_fx_fee" + BalanceTransactionTypeTaxFee BalanceTransactionType = "tax_fee" + BalanceTransactionTypeTopup BalanceTransactionType = "topup" + BalanceTransactionTypeTopupReversal BalanceTransactionType = "topup_reversal" + BalanceTransactionTypeTransfer BalanceTransactionType = "transfer" + BalanceTransactionTypeTransferCancel BalanceTransactionType = "transfer_cancel" + BalanceTransactionTypeTransferFailure BalanceTransactionType = "transfer_failure" + BalanceTransactionTypeTransferRefund BalanceTransactionType = "transfer_refund" ) // Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. @@ -137,7 +139,7 @@ type BalanceTransactionListParams struct { Payout *string `form:"payout"` // Only returns the original transaction. Source *string `form:"source"` - // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + // Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Type *string `form:"type"` } @@ -208,7 +210,7 @@ type BalanceTransaction struct { Source *BalanceTransactionSource `json:"source"` // The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. Status BalanceTransactionStatus `json:"status"` - // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + // Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. Type BalanceTransactionType `json:"type"` } type BalanceTransactionSource struct { diff --git a/error.go b/error.go index 521f0fd6a5..98454219a5 100644 --- a/error.go +++ b/error.go @@ -65,10 +65,12 @@ const ( ErrorCodeCouponExpired ErrorCode = "coupon_expired" ErrorCodeCustomerMaxPaymentMethods ErrorCode = "customer_max_payment_methods" ErrorCodeCustomerMaxSubscriptions ErrorCode = "customer_max_subscriptions" + ErrorCodeCustomerTaxLocationInvalid ErrorCode = "customer_tax_location_invalid" ErrorCodeDebitNotAuthorized ErrorCode = "debit_not_authorized" ErrorCodeEmailInvalid ErrorCode = "email_invalid" ErrorCodeExpiredCard ErrorCode = "expired_card" ErrorCodeFinancialConnectionsAccountInactive ErrorCode = "financial_connections_account_inactive" + ErrorCodeFinancialConnectionsNoSuccessfulTransactionRefresh ErrorCode = "financial_connections_no_successful_transaction_refresh" ErrorCodeIdempotencyKeyInUse ErrorCode = "idempotency_key_in_use" ErrorCodeIncorrectAddress ErrorCode = "incorrect_address" ErrorCodeIncorrectCVC ErrorCode = "incorrect_cvc" diff --git a/paymentintent.go b/paymentintent.go index 9c91a38d04..f36d7fdfee 100644 --- a/paymentintent.go +++ b/paymentintent.go @@ -371,15 +371,13 @@ const ( PaymentIntentPaymentMethodOptionsCardRequestOvercaptureNever PaymentIntentPaymentMethodOptionsCardRequestOvercapture = "never" ) -// 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. +// 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. If not provided, this value 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 PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure string // List of values that PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure can take const ( - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAny PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallenge PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge" - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "challenge_only" + PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAny PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "any" + PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureAutomatic PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure = "automatic" ) // Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1291,7 +1289,7 @@ type PaymentIntentPaymentMethodOptionsCardParams struct { RequestMulticapture *string `form:"request_multicapture"` // Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. RequestOvercapture *string `form:"request_overcapture"` - // 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. + // 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. If not provided, this value 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 *string `form:"request_three_d_secure"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // @@ -2631,7 +2629,7 @@ type PaymentIntentPaymentMethodOptionsCard struct { RequestMulticapture PaymentIntentPaymentMethodOptionsCardRequestMulticapture `json:"request_multicapture"` // Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. RequestOvercapture PaymentIntentPaymentMethodOptionsCardRequestOvercapture `json:"request_overcapture"` - // 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. + // 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. If not provided, this value 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 PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure `json:"request_three_d_secure"` // Indicates that you intend to make future payments with this PaymentIntent's payment method. // diff --git a/paymentlink.go b/paymentlink.go index 7015592385..69dc204195 100644 --- a/paymentlink.go +++ b/paymentlink.go @@ -145,6 +145,16 @@ const ( PaymentLinkSubmitTypePay PaymentLinkSubmitType = "pay" ) +// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod string + +// List of values that PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod can take +const ( + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCancel PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "cancel" + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodCreateInvoice PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "create_invoice" + PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethodPause PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod = "pause" +) + // Returns a list of your payment links. type PaymentLinkListParams struct { ListParams `form:"*"` @@ -375,6 +385,8 @@ type PaymentLinkPaymentIntentDataParams struct { StatementDescriptor *string `form:"statement_descriptor"` // Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix *string `form:"statement_descriptor_suffix"` + // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + TransferGroup *string `form:"transfer_group"` } // AddMetadata adds a new key-value pair to the Metadata. @@ -394,6 +406,18 @@ type PaymentLinkPhoneNumberCollectionParams struct { Enabled *bool `form:"enabled"` } +// Configuration for the `completed_sessions` restriction type. +type PaymentLinkRestrictionsCompletedSessionsParams struct { + // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + Limit *int64 `form:"limit"` +} + +// Settings that restrict the usage of a payment link. +type PaymentLinkRestrictionsParams struct { + // Configuration for the `completed_sessions` restriction type. + CompletedSessions *PaymentLinkRestrictionsCompletedSessionsParams `form:"completed_sessions"` +} + // Configuration for collecting the customer's shipping address. type PaymentLinkShippingAddressCollectionParams struct { // An array of two-letter ISO country codes representing which countries Checkout should provide as options for @@ -407,6 +431,18 @@ type PaymentLinkShippingOptionParams struct { ShippingRate *string `form:"shipping_rate"` } +// Defines how the subscription should behave when the user's free trial ends. +type PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams struct { + // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + MissingPaymentMethod *string `form:"missing_payment_method"` +} + +// Settings related to subscription trials. +type PaymentLinkSubscriptionDataTrialSettingsParams struct { + // Defines how the subscription should behave when the user's free trial ends. + EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehaviorParams `form:"end_behavior"` +} + // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. type PaymentLinkSubscriptionDataParams struct { // 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 surfaces and certain local payment methods UIs. @@ -415,6 +451,8 @@ type PaymentLinkSubscriptionDataParams struct { Metadata map[string]string `form:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. TrialPeriodDays *int64 `form:"trial_period_days"` + // Settings related to subscription trials. + TrialSettings *PaymentLinkSubscriptionDataTrialSettingsParams `form:"trial_settings"` } // AddMetadata adds a new key-value pair to the Metadata. @@ -472,6 +510,8 @@ type PaymentLinkParams struct { CustomText *PaymentLinkCustomTextParams `form:"custom_text"` // Specifies which fields in the response should be expanded. Expand []*string `form:"expand"` + // The custom message to be displayed to a customer when a payment link is no longer active. + InactiveMessage *string `form:"inactive_message"` // Generate a post-purchase Invoice for one-time payments. InvoiceCreation *PaymentLinkInvoiceCreationParams `form:"invoice_creation"` // The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. @@ -494,6 +534,8 @@ type PaymentLinkParams struct { // // We recommend that you review your privacy policy and check with your legal contacts. PhoneNumberCollection *PaymentLinkPhoneNumberCollectionParams `form:"phone_number_collection"` + // Settings that restrict the usage of a payment link. + Restrictions *PaymentLinkRestrictionsParams `form:"restrictions"` // Configuration for collecting the customer's shipping address. ShippingAddressCollection *PaymentLinkShippingAddressCollectionParams `form:"shipping_address_collection"` // The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. @@ -684,11 +726,24 @@ type PaymentLinkPaymentIntentData struct { StatementDescriptor string `json:"statement_descriptor"` // Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. StatementDescriptorSuffix string `json:"statement_descriptor_suffix"` + // A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + TransferGroup string `json:"transfer_group"` } type PaymentLinkPhoneNumberCollection struct { // If `true`, a phone number will be collected during checkout. Enabled bool `json:"enabled"` } +type PaymentLinkRestrictionsCompletedSessions struct { + // The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + Count int64 `json:"count"` + // The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + Limit int64 `json:"limit"` +} + +// Settings that restrict the usage of a payment link. +type PaymentLinkRestrictions struct { + CompletedSessions *PaymentLinkRestrictionsCompletedSessions `json:"completed_sessions"` +} // Configuration for collecting the customer's shipping address. type PaymentLinkShippingAddressCollection struct { @@ -704,6 +759,18 @@ type PaymentLinkShippingOption struct { ShippingRate *ShippingRate `json:"shipping_rate"` } +// Defines how a subscription behaves when a free trial ends. +type PaymentLinkSubscriptionDataTrialSettingsEndBehavior struct { + // Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + MissingPaymentMethod PaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod `json:"missing_payment_method"` +} + +// Settings related to subscription trials. +type PaymentLinkSubscriptionDataTrialSettings struct { + // Defines how a subscription behaves when a free trial ends. + EndBehavior *PaymentLinkSubscriptionDataTrialSettingsEndBehavior `json:"end_behavior"` +} + // When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. type PaymentLinkSubscriptionData struct { // 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 surfaces and certain local payment methods UIs. @@ -712,6 +779,8 @@ type PaymentLinkSubscriptionData struct { Metadata map[string]string `json:"metadata"` // Integer representing the number of trial period days before the customer is charged for the first time. TrialPeriodDays int64 `json:"trial_period_days"` + // Settings related to subscription trials. + TrialSettings *PaymentLinkSubscriptionDataTrialSettings `json:"trial_settings"` } type PaymentLinkTaxIDCollection struct { // Indicates whether tax ID collection is enabled for the session. @@ -758,6 +827,8 @@ type PaymentLink struct { CustomText *PaymentLinkCustomText `json:"custom_text"` // Unique identifier for the object. ID string `json:"id"` + // The custom message to be displayed to a customer when a payment link is no longer active. + InactiveMessage string `json:"inactive_message"` // Configuration for creating invoice for payment mode payment links. InvoiceCreation *PaymentLinkInvoiceCreation `json:"invoice_creation"` // The line items representing what is being sold. @@ -777,6 +848,8 @@ type PaymentLink struct { // The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). PaymentMethodTypes []PaymentLinkPaymentMethodType `json:"payment_method_types"` PhoneNumberCollection *PaymentLinkPhoneNumberCollection `json:"phone_number_collection"` + // Settings that restrict the usage of a payment link. + Restrictions *PaymentLinkRestrictions `json:"restrictions"` // Configuration for collecting the customer's shipping address. ShippingAddressCollection *PaymentLinkShippingAddressCollection `json:"shipping_address_collection"` // The shipping rate options applied to the session. diff --git a/price.go b/price.go index 3073586bac..764c14534b 100644 --- a/price.go +++ b/price.go @@ -30,7 +30,7 @@ const ( PriceCurrencyOptionsTaxBehaviorUnspecified PriceCurrencyOptionsTaxBehavior = "unspecified" ) -// Specifies a usage aggregation strategy for prices 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`. +// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. type PriceRecurringAggregateUsage string // List of values that PriceRecurringAggregateUsage can take @@ -242,7 +242,7 @@ func (p *PriceProductDataParams) AddMetadata(key string, value string) { // The recurring components of a price such as `interval` and `usage_type`. type PriceRecurringParams struct { - // Specifies a usage aggregation strategy for prices 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`. + // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. AggregateUsage *string `form:"aggregate_usage"` // Specifies billing frequency. Either `day`, `week`, `month` or `year`. Interval *string `form:"interval"` @@ -391,7 +391,7 @@ type PriceCustomUnitAmount struct { // The recurring components of a price such as `interval` and `usage_type`. type PriceRecurring struct { - // Specifies a usage aggregation strategy for prices 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`. + // Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. AggregateUsage PriceRecurringAggregateUsage `json:"aggregate_usage"` // The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. Interval PriceRecurringInterval `json:"interval"` diff --git a/setupintent.go b/setupintent.go index d7a88a69db..75ca4c74d0 100644 --- a/setupintent.go +++ b/setupintent.go @@ -155,7 +155,7 @@ const ( 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. +// 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. If not provided, this value 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 // List of values that SetupIntentPaymentMethodOptionsCardRequestThreeDSecure can take @@ -633,7 +633,7 @@ type SetupIntentPaymentMethodOptionsCardParams struct { MOTO *bool `form:"moto"` // Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. Network *string `form:"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. + // 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. If not provided, this value 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 *string `form:"request_three_d_secure"` // If 3D Secure authentication was performed with a third-party provider, // the authentication details to use for this setup. @@ -1247,7 +1247,7 @@ type SetupIntentPaymentMethodOptionsCard struct { 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. + // 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. If not provided, this value 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"` } type SetupIntentPaymentMethodOptionsLink struct {