diff --git a/src/resources.rs b/src/resources.rs index ed878f9c5..fc098c6fd 100644 --- a/src/resources.rs +++ b/src/resources.rs @@ -44,6 +44,12 @@ mod billing { pub mod usage_record_ext; } +#[path = "resources"] +#[cfg(feature = "checkout")] +mod checkout { + pub mod checkout_session_ext; +} + #[path = "resources"] #[cfg(feature = "connect")] mod connect { @@ -170,6 +176,7 @@ pub use { payment_link::*, item::* }, + checkout_session::checkout_session_ext::* }; #[rustfmt::skip] diff --git a/src/resources/checkout_session_ext.rs b/src/resources/checkout_session_ext.rs new file mode 100644 index 000000000..9deedf9a3 --- /dev/null +++ b/src/resources/checkout_session_ext.rs @@ -0,0 +1,17 @@ +use crate::client::{Client, Response}; +use crate::ids::CheckoutSessionId; +use crate::params::Expand; +use crate::resources::CheckoutSession; + +impl CheckoutSession { + /// Retrieves a Session object. + /// + /// For more details see . + pub fn retrieve( + client: &Client, + id: &CheckoutSessionId, + expand: &[&str], + ) -> Response { + client.get_query(&format!("/checkout/sessions/{}", id), &Expand { expand }) + } +}