From cbdd84fe2bc7c5f4288d14dbe6fa0b97c5939260 Mon Sep 17 00:00:00 2001 From: Aarash Heydari Date: Tue, 12 Mar 2024 03:09:56 -0400 Subject: [PATCH] Add new 'require_successful_payment' optional field for CreditLedgerInvoiceSettingsRequestParams --- src/client/customers.rs | 4 ++++ src/client/subscriptions.rs | 4 ++-- src/lib.rs | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/client/customers.rs b/src/client/customers.rs index 35728fe..822c674 100644 --- a/src/client/customers.rs +++ b/src/client/customers.rs @@ -274,6 +274,10 @@ pub struct CreditLedgerInvoiceSettingsRequestParams<'a> { /// An optional memo to display on the invoice #[serde(skip_serializing_if = "Option::is_none")] pub memo: Option<&'a str>, + /// Whether the credits should be withheld from the customer account until the invoice is paid. + /// This applies primarily to stripe invoicing. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_successful_payment: Option, } /// The parameters used to create a customer credit ledger entry. diff --git a/src/client/subscriptions.rs b/src/client/subscriptions.rs index c060023..d7b47fe 100644 --- a/src/client/subscriptions.rs +++ b/src/client/subscriptions.rs @@ -166,8 +166,8 @@ pub struct SubscriptionFixedFee { #[serde(with = "time::serde::rfc3339")] pub start_date: OffsetDateTime, /// The date at which the fixed fee ends. - #[serde(with = "time::serde::rfc3339")] - pub end_date: OffsetDateTime, + #[serde(with = "time::serde::rfc3339::option")] + pub end_date: Option, /// The price ID for the fixed fee. pub price_id: String, /// The quantity of the fixed fee. diff --git a/src/lib.rs b/src/lib.rs index 452df3d..73f0674 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,8 +44,8 @@ mod util; pub use client::customers::{ AddIncrementCreditLedgerEntryRequestParams, AddVoidCreditLedgerEntryRequestParams, Address, - AddressRequest, CostViewMode, CreateCustomerRequest, Customer, CustomerCostBucket, - CustomerCostItem, CustomerCostParams, CustomerCostPriceBlock, + AddressRequest, CostViewMode, CreateCustomerRequest, CreditLedgerInvoiceSettingsRequestParams, + Customer, CustomerCostBucket, CustomerCostItem, CustomerCostParams, CustomerCostPriceBlock, CustomerCostPriceBlockMatrixPrice, CustomerCostPriceBlockMatrixPriceConfig, CustomerCostPriceBlockMatrixPriceValue, CustomerCostPriceBlockPrice, CustomerCostPriceBlockPriceGroup, CustomerCostPriceBlockUnitPrice,