collab: Add ability to add tax ID during Stripe Checkout (#34246)
### 1. **Added Tax ID Collection Types** - Created a new `StripeTaxIdCollection` struct with an `enabled` field - Added `tax_id_collection` field to `StripeCreateCheckoutSessionParams` ### 2. **Updated the Stripe Client Interface** - Modified the real Stripe client to handle tax ID collection conversion - Updated the fake Stripe client for testing purposes - Added proper imports across all affected files ### 3. **Enabled Tax ID Collection in Checkout Sessions** - Both `checkout_with_zed_pro` and `checkout_with_zed_pro_trial` methods now enable tax ID collection - The implementation correctly sets `tax_id_collection.enabled = true` for all checkout sessions ### 4. **Key Implementation Details** - Tax ID collection will be shown to new customers and existing customers without tax IDs - Collected tax IDs will be automatically saved to the customer's `tax_ids` array in Stripe - Business names will be saved to the customer's `name` property - The existing `customer_update.name = auto` setting ensures compatibility with tax ID collection Release Notes: - N/A
This commit is contained in:
parent
a58a75c0f6
commit
c09f484ec4
4 changed files with 25 additions and 6 deletions
|
@ -190,6 +190,7 @@ pub struct StripeCreateCheckoutSessionParams<'a> {
|
|||
pub success_url: Option<&'a str>,
|
||||
pub billing_address_collection: Option<StripeBillingAddressCollection>,
|
||||
pub customer_update: Option<StripeCustomerUpdate>,
|
||||
pub tax_id_collection: Option<StripeTaxIdCollection>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||
|
@ -218,6 +219,11 @@ pub struct StripeCreateCheckoutSessionSubscriptionData {
|
|||
pub trial_settings: Option<StripeSubscriptionTrialSettings>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub struct StripeTaxIdCollection {
|
||||
pub enabled: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct StripeCheckoutSession {
|
||||
pub url: Option<String>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue