diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 8110841c8f..604997fea3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2202 \ No newline at end of file +v2203 \ No newline at end of file diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs index 5478c4dd6c..cdb1c6b1d3 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextAction.cs @@ -133,5 +133,11 @@ public class PaymentIntentNextAction : StripeEntity [STJS.JsonPropertyName("wechat_pay_redirect_to_ios_app")] #endif public PaymentIntentNextActionWechatPayRedirectToIosApp WechatPayRedirectToIosApp { get; set; } + + [JsonProperty("crypto_display_details")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("crypto_display_details")] +#endif + public PaymentIntentNextActionCryptoDisplayDetails CryptoDisplayDetails { get; set; } } } diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetails.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetails.cs new file mode 100644 index 0000000000..49b4a6d0ea --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetails.cs @@ -0,0 +1,17 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetails : StripeEntity + { + [JsonProperty("deposit_addresses")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("deposit_addresses")] +#endif + public PaymentIntentNextActionCryptoDisplayDetailsDepositAddresses DepositAddresses { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddresses.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddresses.cs new file mode 100644 index 0000000000..0c361306a4 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddresses.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddresses : StripeEntity + { + [JsonProperty("base")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("base")] +#endif + public PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase Base { get; set; } + + [JsonProperty("solana")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("solana")] +#endif + public PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana Solana { get; set; } + + [JsonProperty("tempo")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("tempo")] +#endif + public PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo Tempo { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase.cs new file mode 100644 index 0000000000..959a346df7 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase.cs @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System.Collections.Generic; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBase : StripeEntity + { + /// + /// Address of the deposit address. + /// + [JsonProperty("address")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("address")] +#endif + public string Address { get; set; } + + /// + /// The token currencies supported on this network. + /// + [JsonProperty("supported_tokens")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("supported_tokens")] +#endif + public List SupportedTokens { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBaseSupportedToken.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBaseSupportedToken.cs new file mode 100644 index 0000000000..71a6ed27d6 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBaseSupportedToken.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesBaseSupportedToken : StripeEntity + { + /// + /// The on-chain contract address for the supported token currency on this specific network. + /// + [JsonProperty("token_contract_address")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("token_contract_address")] +#endif + public string TokenContractAddress { get; set; } + + /// + /// The supported token currency. Supported token currencies include: usdc. + /// + [JsonProperty("token_currency")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("token_currency")] +#endif + public string TokenCurrency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana.cs new file mode 100644 index 0000000000..321130644d --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana.cs @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System.Collections.Generic; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolana : StripeEntity + { + /// + /// Address of the deposit address. + /// + [JsonProperty("address")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("address")] +#endif + public string Address { get; set; } + + /// + /// The token currencies supported on this network. + /// + [JsonProperty("supported_tokens")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("supported_tokens")] +#endif + public List SupportedTokens { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolanaSupportedToken.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolanaSupportedToken.cs new file mode 100644 index 0000000000..1568c0e3ce --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolanaSupportedToken.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesSolanaSupportedToken : StripeEntity + { + /// + /// The on-chain contract address for the supported token currency on this specific network. + /// + [JsonProperty("token_contract_address")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("token_contract_address")] +#endif + public string TokenContractAddress { get; set; } + + /// + /// The supported token currency. Supported token currencies include: usdc. + /// + [JsonProperty("token_currency")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("token_currency")] +#endif + public string TokenCurrency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo.cs new file mode 100644 index 0000000000..64907d76de --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo.cs @@ -0,0 +1,30 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System.Collections.Generic; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempo : StripeEntity + { + /// + /// Address of the deposit address. + /// + [JsonProperty("address")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("address")] +#endif + public string Address { get; set; } + + /// + /// The token currencies supported on this network. + /// + [JsonProperty("supported_tokens")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("supported_tokens")] +#endif + public List SupportedTokens { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempoSupportedToken.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempoSupportedToken.cs new file mode 100644 index 0000000000..3afb04bb86 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempoSupportedToken.cs @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentNextActionCryptoDisplayDetailsDepositAddressesTempoSupportedToken : StripeEntity + { + /// + /// The on-chain contract address for the supported token currency on this specific network. + /// + [JsonProperty("token_contract_address")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("token_contract_address")] +#endif + public string TokenContractAddress { get; set; } + + /// + /// The supported token currency. Supported token currencies include: usdc. + /// + [JsonProperty("token_currency")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("token_currency")] +#endif + public string TokenCurrency { get; set; } + } +} diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs index 0978b21ac6..00b8e9f561 100644 --- a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCrypto.cs @@ -33,5 +33,21 @@ public class PaymentIntentPaymentMethodOptionsCrypto : StripeEntity + /// The mode of the crypto payment. + /// One of: default, or deposit. + /// + [JsonProperty("mode")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("mode")] +#endif + public string Mode { get; set; } } } diff --git a/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptions.cs b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptions.cs new file mode 100644 index 0000000000..c8deaf2054 --- /dev/null +++ b/src/Stripe.net/Entities/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptions.cs @@ -0,0 +1,24 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System.Collections.Generic; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentPaymentMethodOptionsCryptoDepositOptions : StripeEntity + { + /// + /// The blockchain networks to support for deposits. Learn more about supported + /// networks and tokens. + /// One of: base, solana, or tempo. + /// + [JsonProperty("networks")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("networks")] +#endif + public List Networks { get; set; } + } +} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions.cs new file mode 100644 index 0000000000..aacf492cb5 --- /dev/null +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions.cs @@ -0,0 +1,24 @@ +// File generated from our OpenAPI spec +namespace Stripe +{ + using System.Collections.Generic; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions : INestedOptions + { + /// + /// The blockchain networks to support for deposits. Learn more about supported + /// networks and tokens. + /// One of: base, solana, or tempo. + /// + [JsonProperty("networks")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("networks")] +#endif + public List Networks { get; set; } + } +} diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs index 4d18add8ff..0b0c813491 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentPaymentMethodOptionsCryptoOptions.cs @@ -8,6 +8,25 @@ namespace Stripe public class PaymentIntentPaymentMethodOptionsCryptoOptions : INestedOptions { + /// + /// Specific configuration for this PaymentIntent when the mode is deposit. + /// + [JsonProperty("deposit_options")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("deposit_options")] +#endif + public PaymentIntentPaymentMethodOptionsCryptoDepositOptionsOptions DepositOptions { get; set; } + + /// + /// The mode of the crypto payment. + /// One of: default, or deposit. + /// + [JsonProperty("mode")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("mode")] +#endif + public string Mode { get; set; } + /// /// Indicates that you intend to make future payments with this PaymentIntent's payment /// method. diff --git a/src/Stripe.net/Services/TestHelpers/PaymentIntents/PaymentIntentService.cs b/src/Stripe.net/Services/TestHelpers/PaymentIntents/PaymentIntentService.cs new file mode 100644 index 0000000000..6c5f5c3ea7 --- /dev/null +++ b/src/Stripe.net/Services/TestHelpers/PaymentIntents/PaymentIntentService.cs @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec +namespace Stripe.TestHelpers +{ + using System; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class PaymentIntentService : Service + { + public PaymentIntentService() + { + } + + internal PaymentIntentService(ApiRequestor requestor) + : base(requestor) + { + } + + public PaymentIntentService(IStripeClient client) + : base(client) + { + } + + /// + ///

Simulate an incoming crypto deposit for a testmode PaymentIntent with + /// payment_method_options[crypto][mode]=deposit. The transaction_hash + /// parameter determines whether the simulated deposit succeeds or fails. Learn more about + /// testing + /// your integration.

. + ///
+ public virtual PaymentIntent SimulateCryptoDeposit(string id, PaymentIntentSimulateCryptoDepositOptions options = null, RequestOptions requestOptions = null) + { + return this.Request(BaseAddress.Api, HttpMethod.Post, $"/v1/test_helpers/payment_intents/{WebUtility.UrlEncode(id)}/simulate_crypto_deposit", options, requestOptions); + } + + /// + ///

Simulate an incoming crypto deposit for a testmode PaymentIntent with + /// payment_method_options[crypto][mode]=deposit. The transaction_hash + /// parameter determines whether the simulated deposit succeeds or fails. Learn more about + /// testing + /// your integration.

. + ///
+ public virtual Task SimulateCryptoDepositAsync(string id, PaymentIntentSimulateCryptoDepositOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) + { + return this.RequestAsync(BaseAddress.Api, HttpMethod.Post, $"/v1/test_helpers/payment_intents/{WebUtility.UrlEncode(id)}/simulate_crypto_deposit", options, requestOptions, cancellationToken); + } + } +} diff --git a/src/Stripe.net/Services/TestHelpers/PaymentIntents/PaymentIntentSimulateCryptoDepositOptions.cs b/src/Stripe.net/Services/TestHelpers/PaymentIntents/PaymentIntentSimulateCryptoDepositOptions.cs new file mode 100644 index 0000000000..9a7ad30f04 --- /dev/null +++ b/src/Stripe.net/Services/TestHelpers/PaymentIntents/PaymentIntentSimulateCryptoDepositOptions.cs @@ -0,0 +1,48 @@ +// File generated from our OpenAPI spec +namespace Stripe.TestHelpers +{ + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class PaymentIntentSimulateCryptoDepositOptions : BaseOptions + { + /// + /// The buyer's wallet address from which the crypto deposit is originating. + /// + [JsonProperty("buyer_wallet")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("buyer_wallet")] +#endif + public string BuyerWallet { get; set; } + + /// + /// The blockchain network of the simulated crypto deposit. + /// One of: base, solana, or tempo. + /// + [JsonProperty("network")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("network")] +#endif + public string Network { get; set; } + + /// + /// The token currency of the simulated crypto deposit. + /// + [JsonProperty("token_currency")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("token_currency")] +#endif + public string TokenCurrency { get; set; } + + /// + /// A testmode transaction hash that determines the outcome of the simulated deposit. + /// + [JsonProperty("transaction_hash")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("transaction_hash")] +#endif + public string TransactionHash { get; set; } + } +} diff --git a/src/Stripe.net/Services/TestHelpersService.cs b/src/Stripe.net/Services/TestHelpersService.cs index d9f2ea0c03..e526b2d20d 100644 --- a/src/Stripe.net/Services/TestHelpersService.cs +++ b/src/Stripe.net/Services/TestHelpersService.cs @@ -11,6 +11,7 @@ public class TestHelpersService : Service private TestHelpers.ConfirmationTokenService confirmationTokens; private TestHelpers.CustomerService customers; private TestHelpers.IssuingService issuing; + private TestHelpers.PaymentIntentService paymentIntents; private TestHelpers.RefundService refunds; private TestHelpers.SharedPaymentService sharedPayment; private TestHelpers.TerminalService terminal; @@ -39,6 +40,9 @@ internal TestHelpersService(IStripeClient client) public virtual TestHelpers.IssuingService Issuing => this.issuing ??= new TestHelpers.IssuingService( this.Requestor); + public virtual TestHelpers.PaymentIntentService PaymentIntents => this.paymentIntents ??= new TestHelpers.PaymentIntentService( + this.Requestor); + public virtual TestHelpers.RefundService Refunds => this.refunds ??= new TestHelpers.RefundService( this.Requestor);