forked from arlyon/async-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: api changes to resolve overlapping imports
- Loading branch information
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//! Basic tests to ensure that the plan interval types | ||
//! are exported properly. Mainly just needs to compile. | ||
mod mock; | ||
|
||
#[test] | ||
#[cfg(feature = "blocking")] | ||
fn can_create_plan() { | ||
let id = "price_123".parse().unwrap(); | ||
mock::with_client(|client| { | ||
let mut plan = stripe::Plan::retrieve(client, &id, &[]).unwrap(); | ||
plan.interval = Some(stripe::PlanInterval::Month); | ||
}); | ||
} | ||
|
||
#[test] | ||
#[cfg(feature = "blocking")] | ||
fn can_create_subscription_interval() { | ||
let recurring = stripe::SubscriptionPriceDataRecurring { | ||
interval: stripe::SubscriptionInterval::Month, | ||
interval_count: Some(100), | ||
}; | ||
} | ||
|
||
#[test] | ||
#[cfg(feature = "blocking")] | ||
fn can_create_subscription_plan_interval() { | ||
mock::with_client(|client| { | ||
let id = "sub_123".parse().unwrap(); | ||
let mut create = stripe::CreateSubscriptionItem::new(id); | ||
create.price_data = Some(stripe::SubscriptionItemPriceData { | ||
currency: stripe::Currency::USD, | ||
product: "My Product".to_string(), | ||
recurring: stripe::SubscriptionItemPriceDataRecurring { | ||
interval: stripe::SubscriptionItemInterval::Day, | ||
interval_count: Some(6), | ||
}, | ||
tax_behavior: None, | ||
unit_amount: None, | ||
unit_amount_decimal: None, | ||
}); | ||
let result = stripe::SubscriptionItem::create(client, create).unwrap(); | ||
}); | ||
} |