diff --git a/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs b/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs index 3bc7d8aa22..aeb2453cc8 100644 --- a/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs +++ b/src/Stripe.net/Infrastructure/FormEncoding/ContentEncoder.cs @@ -163,6 +163,12 @@ private static List> FlattenParamsValue(object valu flatParams = SingleParam(keyPrefix, JsonUtils.SerializeObject(e).Trim('"')); break; + case bool b: + flatParams = SingleParam( + keyPrefix, + b ? "true" : "false"); + break; + default: flatParams = SingleParam( keyPrefix, diff --git a/src/StripeTests/Infrastructure/FormEncoding/ContentEncoderTest.cs b/src/StripeTests/Infrastructure/FormEncoding/ContentEncoderTest.cs index 09602f3268..2953e0eba0 100644 --- a/src/StripeTests/Infrastructure/FormEncoding/ContentEncoderTest.cs +++ b/src/StripeTests/Infrastructure/FormEncoding/ContentEncoderTest.cs @@ -205,7 +205,7 @@ public void CreateQueryString() { Bool = false, }, - Want = "bool=False", + Want = "bool=false", }, new QueryStringTestCase { @@ -213,7 +213,7 @@ public void CreateQueryString() { Bool = true, }, - Want = "bool=True", + Want = "bool=true", }, // DateRangeOptions diff --git a/src/StripeTests/Services/PaymentIntents/PaymentIntentConfirmOptionsTest.cs b/src/StripeTests/Services/PaymentIntents/PaymentIntentConfirmOptionsTest.cs index 9e9b6f01c8..2a049aefcb 100644 --- a/src/StripeTests/Services/PaymentIntents/PaymentIntentConfirmOptionsTest.cs +++ b/src/StripeTests/Services/PaymentIntents/PaymentIntentConfirmOptionsTest.cs @@ -14,7 +14,7 @@ public void SerializeObjectProperly() OffSession = true, }; - Assert.Equal("off_session=True", ContentEncoder.CreateQueryString(options_bool)); + Assert.Equal("off_session=true", ContentEncoder.CreateQueryString(options_bool)); } } } diff --git a/src/StripeTests/Services/PaymentIntents/PaymentIntentCreateOptionsTest.cs b/src/StripeTests/Services/PaymentIntents/PaymentIntentCreateOptionsTest.cs index 011ca022a0..ea099904b7 100644 --- a/src/StripeTests/Services/PaymentIntents/PaymentIntentCreateOptionsTest.cs +++ b/src/StripeTests/Services/PaymentIntents/PaymentIntentCreateOptionsTest.cs @@ -14,7 +14,7 @@ public void SerializeObjectProperly() OffSession = true, }; - Assert.Equal("off_session=True", ContentEncoder.CreateQueryString(options_bool)); + Assert.Equal("off_session=true", ContentEncoder.CreateQueryString(options_bool)); } } }