Skip to content

Commit f7e26ce

Browse files
committed
Multiple fixes for PaymentIntent
1 parent 1b4d3a3 commit f7e26ce

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

src/Stripe.net/Entities/PaymentIntents/PaymentIntentTransferData.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
namespace Stripe
22
{
3+
using System;
34
using Newtonsoft.Json;
45
using Stripe.Infrastructure;
56

67
public class PaymentIntentTransferData : StripeEntity
78
{
8-
[JsonProperty("amount")]
9-
public long Amount { get; set; }
10-
119
#region Expandable Destination (Account)
1210
[JsonIgnore]
1311
public string DestinationId { get; set; }
@@ -29,5 +27,9 @@ internal object InternalDestination
2927
}
3028
}
3129
#endregion
30+
31+
[Obsolete("Use ApplicationFeeAmount instead")]
32+
[JsonProperty("amount")]
33+
public long? Amount { get; set; }
3234
}
3335
}

src/Stripe.net/Services/PaymentIntents/PaymentIntentConfirmOptions.cs

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ namespace Stripe
66

77
public class PaymentIntentConfirmOptions : BaseOptions
88
{
9+
/// <summary>
10+
/// The client secret of the PaymentIntent. Required if a publishable key is used to
11+
/// confirm the payment intent.
12+
/// </summary>
13+
[JsonProperty("client_secret")]
14+
public string ClientSecret { get; set; }
15+
916
[JsonProperty("invoice")]
1017
public string Invoice { get; set; }
1118

@@ -21,6 +28,9 @@ public class PaymentIntentConfirmOptions : BaseOptions
2128
[JsonProperty("save_payment_method")]
2229
public bool? SavePaymentMethod { get; set; }
2330

31+
[JsonProperty("shipping")]
32+
public ChargeShippingOptions Shipping { get; set; }
33+
2434
[JsonProperty("source")]
2535
public string SourceId { get; set; }
2636
}

src/Stripe.net/Services/PaymentIntents/PaymentIntentCreateOptions.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ namespace Stripe
55

66
public class PaymentIntentCreateOptions : PaymentIntentSharedOptions
77
{
8-
[JsonProperty("confirm")]
9-
public bool? Confirm { get; set; }
10-
118
[JsonProperty("capture_method")]
129
public string CaptureMethod { get; set; }
1310

11+
[JsonProperty("confirm")]
12+
public bool? Confirm { get; set; }
13+
1414
[JsonProperty("return_url")]
1515
public string ReturnUrl { get; set; }
1616

17-
[JsonProperty("shipping")]
18-
public ChargeShippingOptions Shipping { get; set; }
19-
2017
[JsonProperty("statement_descriptor")]
2118
public string StatementDescriptor { get; set; }
2219
}

src/Stripe.net/Services/PaymentIntents/PaymentIntentSharedOptions.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ public class PaymentIntentSharedOptions : BaseOptions
2727
[JsonProperty("on_behalf_of")]
2828
public string OnBehalfOf { get; set; }
2929

30-
[JsonProperty("payment_method_types")]
31-
public List<string> PaymentMethodTypes { get; set; }
32-
3330
[JsonProperty("receipt_email")]
3431
public string ReceiptEmail { get; set; }
3532

33+
[JsonProperty("payment_method_types")]
34+
public List<string> PaymentMethodTypes { get; set; }
35+
3636
[JsonProperty("save_payment_method")]
3737
public bool? SavePaymentMethod { get; set; }
3838

39+
[JsonProperty("shipping")]
40+
public ChargeShippingOptions Shipping { get; set; }
41+
3942
[JsonProperty("source")]
4043
public string SourceId { get; set; }
4144

Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
namespace Stripe
22
{
3+
using System;
34
using Newtonsoft.Json;
45

56
public class PaymentIntentTransferDataOptions : INestedOptions
67
{
7-
[JsonProperty("amount")]
8-
public long? Amount { get; set; }
9-
108
// This is only available on creation and not update
119
[JsonProperty("destination")]
1210
public string Destination { get; set; }
11+
12+
[Obsolete("Use ApplicationFeeAmount instead")]
13+
[JsonProperty("amount")]
14+
public long? Amount { get; set; }
1315
}
1416
}

0 commit comments

Comments
 (0)