5
5
use serde:: { Deserialize , Serialize } ;
6
6
7
7
use crate :: client:: { Client , Response } ;
8
- use crate :: ids:: { CheckoutSessionId , CustomerId , PaymentIntentId , SubscriptionId } ;
8
+ use crate :: ids:: { CheckoutSessionId , CustomerId , PaymentIntentId , PaymentLinkId , SubscriptionId } ;
9
9
use crate :: params:: { Expand , Expandable , List , Metadata , Object , Paginable , Timestamp } ;
10
10
use crate :: resources:: {
11
11
Address , CheckoutSessionItem , Currency , Customer , Discount , Invoice ,
@@ -1178,6 +1178,10 @@ pub struct ListCheckoutSessions<'a> {
1178
1178
#[ serde( skip_serializing_if = "Option::is_none" ) ]
1179
1179
pub payment_intent : Option < PaymentIntentId > ,
1180
1180
1181
+ /// Only return the Checkout Sessions for the Payment Link specified.
1182
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1183
+ pub payment_link : Option < PaymentLinkId > ,
1184
+
1181
1185
/// A cursor for use in pagination.
1182
1186
///
1183
1187
/// `starting_after` is an object ID that defines your place in the list.
@@ -1199,6 +1203,7 @@ impl<'a> ListCheckoutSessions<'a> {
1199
1203
expand : Default :: default ( ) ,
1200
1204
limit : Default :: default ( ) ,
1201
1205
payment_intent : Default :: default ( ) ,
1206
+ payment_link : Default :: default ( ) ,
1202
1207
starting_after : Default :: default ( ) ,
1203
1208
subscription : Default :: default ( ) ,
1204
1209
}
@@ -1631,6 +1636,10 @@ pub struct CreateCheckoutSessionSubscriptionData {
1631
1636
/// Has to be at least 1.
1632
1637
#[ serde( skip_serializing_if = "Option::is_none" ) ]
1633
1638
pub trial_period_days : Option < u32 > ,
1639
+
1640
+ /// Settings related to subscription trials.
1641
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
1642
+ pub trial_settings : Option < CreateCheckoutSessionSubscriptionDataTrialSettings > ,
1634
1643
}
1635
1644
1636
1645
#[ derive( Clone , Debug , Default , Deserialize , Serialize ) ]
@@ -2240,6 +2249,12 @@ pub struct CreateCheckoutSessionSubscriptionDataTransferData {
2240
2249
pub destination : String ,
2241
2250
}
2242
2251
2252
+ #[ derive( Clone , Debug , Default , Deserialize , Serialize ) ]
2253
+ pub struct CreateCheckoutSessionSubscriptionDataTrialSettings {
2254
+ /// Defines how the subscription should behave when the user's free trial ends.
2255
+ pub end_behavior : CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior ,
2256
+ }
2257
+
2243
2258
#[ derive( Clone , Debug , Default , Deserialize , Serialize ) ]
2244
2259
pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields {
2245
2260
/// The name of the custom field.
@@ -2441,6 +2456,13 @@ pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount {
2441
2456
Option < CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions > ,
2442
2457
}
2443
2458
2459
+ #[ derive( Clone , Debug , Default , Deserialize , Serialize ) ]
2460
+ pub struct CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior {
2461
+ /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
2462
+ pub missing_payment_method :
2463
+ CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod ,
2464
+ }
2465
+
2444
2466
#[ derive( Clone , Debug , Default , Deserialize , Serialize ) ]
2445
2467
pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer {
2446
2468
/// The desired country code of the bank account information.
@@ -6532,6 +6554,48 @@ impl std::default::Default for CreateCheckoutSessionShippingOptionsShippingRateD
6532
6554
}
6533
6555
}
6534
6556
6557
+ /// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field.
6558
+ #[ derive( Copy , Clone , Debug , Deserialize , Serialize , Eq , PartialEq ) ]
6559
+ #[ serde( rename_all = "snake_case" ) ]
6560
+ pub enum CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod {
6561
+ Cancel ,
6562
+ CreateInvoice ,
6563
+ Pause ,
6564
+ }
6565
+
6566
+ impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod {
6567
+ pub fn as_str ( self ) -> & ' static str {
6568
+ match self {
6569
+ CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod :: Cancel => "cancel" ,
6570
+ CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod :: CreateInvoice => "create_invoice" ,
6571
+ CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod :: Pause => "pause" ,
6572
+ }
6573
+ }
6574
+ }
6575
+
6576
+ impl AsRef < str >
6577
+ for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
6578
+ {
6579
+ fn as_ref ( & self ) -> & str {
6580
+ self . as_str ( )
6581
+ }
6582
+ }
6583
+
6584
+ impl std:: fmt:: Display
6585
+ for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
6586
+ {
6587
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
6588
+ self . as_str ( ) . fmt ( f)
6589
+ }
6590
+ }
6591
+ impl std:: default:: Default
6592
+ for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod
6593
+ {
6594
+ fn default ( ) -> Self {
6595
+ Self :: Cancel
6596
+ }
6597
+ }
6598
+
6535
6599
/// An enum representing the possible values of an `PaymentPagesCheckoutSessionAutomaticTax`'s `status` field.
6536
6600
#[ derive( Copy , Clone , Debug , Deserialize , Serialize , Eq , PartialEq ) ]
6537
6601
#[ serde( rename_all = "snake_case" ) ]
0 commit comments