pub struct StripeConfig {
pub secret: String,
pub payment_links: StripePaymentLinks,
pub webhook_signing_secret: String,
pub billing_portal_url: String,
pub price_texts: StripePriceTexts,
pub product_ids: StripeProductIds,
pub price_ids: StripePriceIds,
}Expand description
Configuration for Stripe integration.
User IDs are sent to Stripe through the payment link. https://docs.stripe.com/payment-links/url-parameters#streamline-reconciliation-with-a-url-parameter
§Testing
- Run
stripe loginusing the Stripe CLI - Run
stripe listen --forward-to localhost:4118/api/v1/service_hooks/stripe - Use testing card numbers: https://docs.stripe.com/testing?testing-method=card-numbers#visa
Fields§
§secret: StringYour Stripe API secret.
payment_links: StripePaymentLinksPayment links from the Stripe dashboard.
- Create a product and set the price for your membership
- Set the product price to a recurring subscription
- Create a payment link for the new product
- The payment link pasted into this config field should NOT include a query string
webhook_signing_secret: StringTo apply benefits to user accounts, you should then go into the Stripe developer
“workbench” and create a new webhook. The webhook needs the scopes:
invoice.payment_succeeded, customer.subscription.deleted, checkout.session.completed, charge.succeeded.
The webhook’s destination address should be {your server origin}/api/v1/service_hooks/stripe.
The signing secret can be found on the right after you have created the webhook.
billing_portal_url: StringThe URL of your customer billing portal.
price_texts: StripePriceTextsThe text representation of prices. (like $4 USD)
product_ids: StripeProductIdsProduct IDs from the Stripe dashboard.
These are checked when we receive a webhook to ensure we provide the correct product.
price_ids: StripePriceIdsThe IDs of individual prices for products which require us to generate sessions ourselves.
Trait Implementations§
Source§impl Clone for StripeConfig
impl Clone for StripeConfig
Source§fn clone(&self) -> StripeConfig
fn clone(&self) -> StripeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more