Skip to content

Commit

Permalink
feat: add retrieve checkout session
Browse files Browse the repository at this point in the history
  • Loading branch information
FL33TW00D committed Jun 23, 2022
1 parent 7826eff commit 25bd0f5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -170,6 +176,7 @@ pub use {
payment_link::*,
item::*
},
checkout_session::checkout_session_ext::*
};

#[rustfmt::skip]
Expand Down
17 changes: 17 additions & 0 deletions src/resources/checkout_session_ext.rs
Original file line number Diff line number Diff line change
@@ -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 <https://stripe.com/docs/api/checkout/sessions/retrieve>.
pub fn retrieve(
client: &Client,
id: &CheckoutSessionId,
expand: &[&str],
) -> Response<CheckoutSession> {
client.get_query(&format!("/checkout/sessions/{}", id), &Expand { expand })
}
}

0 comments on commit 25bd0f5

Please sign in to comment.