Closed seenickcode closed 3 years ago
Turns out I needed to enable the "checkout" feature flag, i.e. stripe-rust = { version = "0.12.3", default-features = false, features = ["checkout", "default-tls", "webhook-events"] }
Hi @seenickcode, I'm noobing out here but could you share your AppData
or an version of it?
Also was pool
ever used from the stripe_webhook
params?
This is could probably be added to /examples as how to parse webhook events. 🤷🏻♂️
Thank you 🙇🏻♂️
#[derive(Clone)]
pub struct AppData {
pub stripe_webhook_secret: String,
}
impl AppData {
pub fn new() -> Self {
Self {
stripe_webhook_secret: get_env(
"STRIPE_WEBHOOK_SECRET",
"redacted",
),
}
}
}
Yes I use pool in the handler because I need to access my database.
Hi there, I'm a bit new to Rust and wanted to use this lib for receiving a Stripe webhook for event type
checkout.session.completed
. My goal is to be able to get the SKU associated with acheckout_session
'sline_items
field, yet accessing theEvent
only provides theplaceholders::CheckoutSession
type which doesn't expose what I need (it only exposes an ID).Here's an example
actix_web
handler I'm using to attempt to get this.Line 34 is what I'm having trouble with:
Any help would be appreciated. Thanks.