-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.pug
62 lines (56 loc) · 1.66 KB
/
index.pug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
html
head
title Home
meta(name="viewport" content="width=device-width, initial-scale=1")
script(src="https://js.stripe.com/v3/")
style.
body { font-family: sans-serif; margin: 30px; }
table { border-collapse: collapse; }
td { border: solid 1px #ccc; padding: 8px; }
tr td:first-child { font-weight: bold; }
.buttons { margin-top: 20px; }
.buttons a { display: inline-block; margin-right: 10px; }
body
h1 Subscription
if sub.plan
table
tbody
tr
td Plan
td #{sub.plan.name} (#{sub.valid ? 'Valid' : 'Invalid'})
tr
td Status
td= sub.status
tr
td Card
td= sub.card.summary
if sub.customer.vat
tr
td VAT
td= sub.customer.vat
.buttons
a(href="/card?customer="+customer) Change Card
if sub.cancelled
a(href="/reactivate?customer="+customer) Reactivate Subscription
else
a(href="/cancel?customer="+customer) Cancel Subscription
else
p No active plan.
.buttons
a(href="/upgrade?customer="+customer) Upgrade
if sub.requiresAction
script.
const stripe = Stripe('#{stripePublicKey}');
stripe.confirmCardPayment('#{sub.requiresAction}').then(() => {
location.reload(); // reload the page to update the status info
});
if receipts.length
h2 Receipts
table
tbody
each e in receipts
tr
td= e.date
td $#{e.amount/100}
td
a(href=e.url) Save