File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414from findthatpostcode .controllers .areas import area_types_count
1515from findthatpostcode .db import ElasticsearchDep
1616from findthatpostcode .limiter import limiter
17+ from findthatpostcode .settings import STRIPE_PRICING_TABLE_ID , STRIPE_PUBLISHABLE_KEY
1718from findthatpostcode .utils import templates
1819
1920app = APIRouter ()
@@ -50,6 +51,20 @@ def about(request: Request):
5051 )
5152
5253
54+ @app .get ("/pricing" )
55+ @limiter .exempt
56+ def pricing (request : Request ):
57+ return templates .TemplateResponse (
58+ request = request ,
59+ name = "pricing.html.j2" ,
60+ media_type = "text/html" ,
61+ context = {
62+ "stripe_pricing_table_id" : STRIPE_PRICING_TABLE_ID ,
63+ "stripe_publishable_key" : STRIPE_PUBLISHABLE_KEY ,
64+ },
65+ )
66+
67+
5368app .include_router (areas .bp )
5469app .include_router (addtocsv .bp )
5570app .include_router (areatypes .bp )
Original file line number Diff line number Diff line change @@ -45,3 +45,8 @@ def get_es_url(default):
4545AREA_INDEX = "geo_area"
4646POSTCODE_INDEX = "geo_postcode"
4747PLACENAME_INDEX = "geo_placename"
48+
49+ STRIPE_PRICING_TABLE_ID = os .environ .get ("STRIPE_PRICING_TABLE_ID" )
50+ STRIPE_PUBLISHABLE_KEY = os .environ .get ("STRIPE_PUBLISHABLE_KEY" )
51+ STRIPE_SECRET_KEY = os .environ .get ("STRIPE_SECRET_KEY" )
52+ STRIPE_SIGNING_SECRET = os .environ .get ("STRIPE_SIGNING_SECRET" )
Original file line number Diff line number Diff line change 1+ {% set title = 'Pricing' %}
2+ {% extends "base.html.j2" %}
3+ {% block content %}
4+ <section class =" section entry-content" id =" pricing" >
5+ <div class =" container" >
6+ <stripe-pricing-table pricing-table-id =" {{ stripe_pricing_table_id }}"
7+ publishable-key =" {{ stripe_publishable_key }}" >
8+ </stripe-pricing-table >
9+ </div >
10+ </section >
11+ {% endblock %}
12+
13+ {% block bodyscripts %}
14+ {{ super() }}
15+ <script async src =" https://js.stripe.com/v3/pricing-table.js" ></script >
16+ {% endblock %}
You can’t perform that action at this time.
0 commit comments