Skip to content

Commit

Permalink
fix: add plan prefix to PriceId
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Jan 10, 2024
1 parent 8032120 commit 6655058
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def_id!(
def_id!(PersonId, "person_");
def_id!(PlanId: String); // N.B. A plan id can be user-provided so can be any arbitrary string
def_id!(PlatformTaxFeeId, "ptf");
def_id!(PriceId, "price_");
def_id!(PriceId, "price_" | "plan_"); // see #470
def_id!(ProductId: String); // N.B. A product id can be user-provided so can be any arbitrary string
def_id!(PromotionCodeId, "promo_");
def_id!(QuoteId, "qt_");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ use serde::{Deserialize, Serialize};
/// The resource representing a Stripe "SubscriptionsTrialsResourceTrialSettings".
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct SubscriptionsTrialsResourceTrialSettings {

pub end_behavior: SubscriptionsTrialsResourceEndBehavior,
}

#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct SubscriptionsTrialsResourceEndBehavior {

/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method.
pub missing_payment_method: SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod,
}
Expand All @@ -31,7 +29,9 @@ impl SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod {
pub fn as_str(self) -> &'static str {
match self {
SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Cancel => "cancel",
SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice",
SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::CreateInvoice => {
"create_invoice"
}
SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Pause => "pause",
}
}
Expand Down

0 comments on commit 6655058

Please sign in to comment.