FEATURE: Add new stripe based pricing table (#202)

This commit adds an optional new stripe based pricing table.
If the user is logged in, the email field will be prepopulated with the users email.

The pricing table can be configured in the stripe dashboard.

Once the discourse_subscriptions_pricing_table setting is filled with the pricing table embed code from the stripe dashboard,
the pricing table will be displayed on /s/subscriptions

For more details see https://stripe.com/docs/payments/checkout/pricing-table
---------

Co-authored-by: spirobel <[email protected]>
This commit is contained in:
Blake Erickson
2024-04-29 12:47:58 -06:00
committed by GitHub
co-authored by spirobel
parent dcde03d7c4
commit 45754baa00
11 changed files with 311 additions and 1 deletions
+4
View File
@@ -22,6 +22,10 @@ register_html_builder("server:before-head-close") do |controller|
"<script src='https://js.stripe.com/v3/' nonce='#{controller.helpers.csp_nonce_placeholder}'></script>"
end
register_html_builder("server:before-head-close") do |controller|
"<script async src='https://js.stripe.com/v3/pricing-table.js' nonce='#{controller.helpers.csp_nonce_placeholder}'></script>"
end
extend_content_security_policy(script_src: %w[https://js.stripe.com/v3/ https://hooks.stripe.com])
add_admin_route "discourse_subscriptions.admin_navigation", "discourse-subscriptions.products"