pub struct DodoConfig {
pub api_key: String,
pub webhook_secret: String,
pub product_pro: String,
pub product_agency: String,
pub api_url: Url,
}Expand description
Dodo Payments billing (cloud only). All four keys are needed; with any missing, billing is off: the billing pages say so and checkout is disabled.
Fields§
§api_key: StringBearer token for the Dodo API (DODO_API_KEY).
webhook_secret: Stringwhsec_<base64 key> the webhooks are signed with (DODO_WEBHOOK_SECRET).
product_pro: String§product_agency: String§api_url: Urlhttps://test.dodopayments.com or https://live.dodopayments.com (DODO_ENV), or
DODO_API_URL when set (tests point it at a fake).
Implementations§
Source§impl DodoConfig
impl DodoConfig
Sourcepub fn plan_for_product(&self, product_id: &str) -> Option<Plan>
pub fn plan_for_product(&self, product_id: &str) -> Option<Plan>
The plan a Dodo product sells, or None for a product that isn’t ours.
Sourcepub fn product_for(&self, plan: Plan) -> Option<&str>
pub fn product_for(&self, plan: Plan) -> Option<&str>
The Dodo product that sells plan.
Trait Implementations§
Source§impl Clone for DodoConfig
impl Clone for DodoConfig
Auto Trait Implementations§
impl Freeze for DodoConfig
impl RefUnwindSafe for DodoConfig
impl Send for DodoConfig
impl Sync for DodoConfig
impl Unpin for DodoConfig
impl UnsafeUnpin for DodoConfig
impl UnwindSafe for DodoConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more