Skip to content

Commit

Permalink
Added computer product to shop
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Jun 3, 2024
1 parent b6d6d52 commit 096d19f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scheduler/src/routes/stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,28 @@
"en": {
"product_wikipedia": "Wikipedia Hotspot English",
"product_preppers": "Preppers Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "One month Imager Access",
"product_access_1y": "Annual Imager Access",
},
"de": {
"product_wikipedia": "Wikipedia Hotspot auf Deutsch",
"product_preppers": "Preppers Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "One month Imager Access",
"product_access_1y": "Annual Imager Access",
},
"es": {
"product_wikipedia": "Wikipedia Hotspot en español",
"product_preppers": "Preppers Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "One month Imager Access",
"product_access_1y": "Annual Imager Access",
},
"fr": {
"product_wikipedia": "Wikipedia Hotspot Français",
"product_preppers": "Preppers Hotspot",
"product_computer": "Computer Hotspot",
"product_access_1m": "Accès Imager 1 mois",
"product_access_1y": "Accès Imager annuel",
},
Expand Down Expand Up @@ -266,6 +270,11 @@ def handle_access_order(session, customer):
os.getenv("STRIPE_PRICE_PP"),
handle_image_order,
),
"computer": (
os.getenv("STRIPE_METHOD_CS"),
os.getenv("STRIPE_PRICE_CS"),
handle_image_order,
),
"access-1m": (
os.getenv("STRIPE_METHOD_ACCESS1M"),
os.getenv("STRIPE_PRICE_ACCESS1M"),
Expand Down Expand Up @@ -410,7 +419,7 @@ def success():

context = {"customer": customer, "session": session, "shop_url": SHOP_PUBLIC_URL}
product = session.metadata.get("product")
if product.startswith("wikipedia-") or product in ("preppers", ):
if product.startswith("wikipedia-") or product in ("preppers", "computer"):
kind = "image"
http_url, torrent_url, _ = get_links_for(product)
context.update({"http_url": http_url, "torrent_url": torrent_url})
Expand Down
25 changes: 25 additions & 0 deletions scheduler/src/templates/stripe/shop.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,31 @@ <h2>Preppers package</h2>
</form>
</div>

<div class="offer">
<header>
<h2>Computer package</h2>
<p>Network down? Not for you</p>
</header>
<section class="price"><span class="amount">$25</span></section>
<section class="description">
<ul>
<li>The entirety of StackOverflow, plus nearly sixty specialized Stack Exchange Q&A</li>
<li>CS lecture notes</li>
<li>Python Enhancement Proposals</li>
<li>Fits on a 200 GB microSD card</li>
</ul>
</section>
<form class="button-holder">
<input type="hidden" name="product" value="computer">
<button class="btn btn-outline-secondary">Purchase</button>
<div class="loader"><i class="spinner-border spinner-border-xl" role="status"></i></div>
</form>
</div>

</div>

<div class="table-offer">

<div class="offer">
<header>
<h2>Build your own</h2>
Expand Down

0 comments on commit 096d19f

Please sign in to comment.