pub struct StripeConfig {
pub api_key: String,
pub webhook_secret: Option<String>,
}Fields§
§api_key: StringServer-side secret key (sk_live_… or sk_test_…).
webhook_secret: Option<String>Webhook signing secret (whsec_…) for the configured endpoint.
Apps with multiple webhooks should run a separate verifier per
endpoint with each endpoint’s own secret.
Implementations§
Source§impl StripeConfig
impl StripeConfig
Sourcepub fn create_customer(
&self,
email: &str,
name: Option<&str>,
) -> Result<StripeCustomer, String>
pub fn create_customer( &self, email: &str, name: Option<&str>, ) -> Result<StripeCustomer, String>
Create or retrieve a Stripe customer for the given email. If
you already store stripeCustomerId on the user/org row, pass
it instead — retrieve_or_create does the lookup-or-create
dance based on which field is populated.
Sourcepub fn create_checkout(
&self,
customer_id: Option<&str>,
price_ids: &[&str],
mode: CheckoutMode,
success_url: &str,
cancel_url: &str,
) -> Result<CheckoutSession, String>
pub fn create_checkout( &self, customer_id: Option<&str>, price_ids: &[&str], mode: CheckoutMode, success_url: &str, cancel_url: &str, ) -> Result<CheckoutSession, String>
Create a Checkout Session — the standard hosted-payment flow.
price_ids are the Stripe Price ids the customer is buying
(1 for subscriptions, N for cart-style one-time payments).
Trait Implementations§
Source§impl Clone for StripeConfig
impl Clone for StripeConfig
Source§fn clone(&self) -> StripeConfig
fn clone(&self) -> StripeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StripeConfig
impl RefUnwindSafe for StripeConfig
impl Send for StripeConfig
impl Sync for StripeConfig
impl Unpin for StripeConfig
impl UnsafeUnpin for StripeConfig
impl UnwindSafe for StripeConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more