Skip to main content

max / makenotwork

9.4 KB · 183 lines History Blame Raw
1 {% extends "base.html" %}
2
3 {% block title %}Confirm Purchase - Makenotwork{% endblock %}
4 {% block body_attrs %} class="purchase-page"{% endblock %}
5
6 {% block content %}
7 <div class="container">
8 {{ crate::shell::wordmark()|safe }}
9 <p class="tagline">Fair distribution for creatives of all kinds<span class="dot">.</span></p>
10
11 <div class="checkout-box content-section raised">
12 <div class="step-indicator">Step 2 of 2</div>
13 <h2 class="section-header">Confirm Purchase</h2>
14
15 <div class="item-summary">
16 <div class="item-thumbnail{% if item.cover().is_none() %} item-thumbnail-empty{% endif %}">{% if let Some(img) = item.cover() %}<img src="{{ img }}" alt="{{ item.title }}">{% else %}{{ item.thumbnail }}{% endif %}</div>
17 <div class="item-details">
18 <div class="item-title">{{ item.title }}</div>
19 <div class="item-creator">
20 by <a href="/u/{{ creator_username }}">{{ creator_username }}</a>
21 </div>
22 <div class="item-description">{{ item.description }}</div>
23 </div>
24 </div>
25
26 <div class="info-box">
27 <h3>What you'll get:</h3>
28 <ul>
29 <li>Lifetime access to all current and future versions</li>
30 <li>Email notifications for updates</li>
31 <li>Direct support from the creator</li>
32 </ul>
33 </div>
34
35 <div class="price-breakdown">
36 <h2 class="section-header">Price Breakdown</h2>
37 <div class="price-row">
38 <span>Item price</span>
39 <span>{{ item.price }}</span>
40 </div>
41 <div class="price-row total">
42 <span>You pay</span>
43 <span>{{ item.price }}</span>
44 </div>
45 <p class="price-breakdown-note">
46 {% if stripe_tax_enabled %}
47 Applicable taxes will be calculated at checkout based on your location.
48 {% else %}
49 Taxes not included. Applicable taxes may vary by jurisdiction.
50 {% endif %}
51 </p>
52 </div>
53
54 <div class="creator-breakdown">
55 <h2 class="section-header">What {{ creator_username }} receives</h2>
56 {% if show_fee_estimate %}
57 <div class="price-row">
58 <span>Payment processing (~2.9% + 30c)</span>
59 <span>-{{ stripe_fee }}</span>
60 </div>
61 {% else %}
62 <div class="price-row">
63 <span>Payment processing</span>
64 <span>Stripe's rate for {{ creator_username }}'s country</span>
65 </div>
66 {% endif %}
67 <div class="price-row">
68 <span>Platform fee</span>
69 <span class="platform-fee-amount">{{ currency_symbol }}0.00</span>
70 </div>
71 {% if show_fee_estimate %}
72 <div class="price-row is-total">
73 <span>Creator receives</span>
74 <span>~{{ creator_receives }}</span>
75 </div>
76 {% endif %}
77 <p class="creator-breakdown-note">
78 0% platform fee; only standard payment processing applies.
79 </p>
80 </div>
81
82 <div class="payment-section">
83 <h2 class="section-header">Secure Checkout</h2>
84 <p class="payment-section-lead">
85 You'll be redirected to a secure checkout page to complete your purchase.
86 </p>
87
88 {% if is_logged_in && !pending_started.is_empty() %}
89 <div class="info-box pending-checkout">
90 <p><strong>You have an unfinished checkout</strong> for this item, started {{ pending_started }}.</p>
91 <p class="is-sub">
92 Stripe only allows one open checkout at a time. Cancel the previous attempt to start a new one.
93 </p>
94 <form action="/stripe/checkout/{{ item.id }}/cancel-pending" method="POST">
95 {% if let Some(token) = csrf_token %}<input type="hidden" name="_csrf" value="{{ token }}">{% endif %}
96 <button class="btn-secondary" type="submit">Cancel previous checkout</button>
97 </form>
98 </div>
99 {% endif %}
100
101 {% if is_logged_in %}
102 {% if pending_started.is_empty() %}
103 <form action="/stripe/checkout/{{ item.id }}" method="POST">
104 {% if pwyw_enabled %}
105 <div class="checkout-field">
106 <label for="pwyw_amount" class="checkout-field-label">Name your price (suggested: {{ currency_symbol }}{{ suggested_price }})</label>
107 <div class="pwyw-row">
108 <span class="pwyw-symbol">{{ currency_symbol }}</span>
109 <input type="number" id="pwyw_amount" class="pwyw-input" value="{{ suggested_price }}" min="{{ pwyw_min_dollars }}" step="0.01" data-input="onPwywInput">
110 <input type="hidden" id="amount_cents" name="amount_cents" value="{{ pwyw_min_cents }}">
111 </div>
112 {% if pwyw_min_cents > 0 %}
113 <p class="pwyw-min-note">Minimum: {{ currency_symbol }}{{ pwyw_min_dollars }}</p>
114 {% else if let Some(note) = pwyw_min_note %}
115 <p class="pwyw-min-note">{{ note }}</p>
116 {% endif %}
117 </div>
118 {% endif %}
119 <div class="checkout-field">
120 <label for="promo_code" class="checkout-field-label">Promo code (optional)</label>
121 <input type="text" id="promo_code" name="promo_code" class="promo-input" value="{{ promo_code }}" placeholder="e.g. LAUNCH50">
122 </div>
123 <div class="checkout-field">
124 <label class="share-contact-label">
125 <input type="checkbox" name="share_contact" value="true" class="share-contact-checkbox">
126 Share my email address with the creator
127 </label>
128 </div>
129 <button class="btn-primary" type="submit" id="checkout-btn" data-loading-text="Redirecting to Stripe...">Continue to Payment - {% if pwyw_enabled %}${{ suggested_price }}{% else %}{{ item.price }}{% endif %}</button>
130 </form>
131 <p class="cart-alt-link">
132 or <a href="#" data-prevent data-action="onAddToCartLink" data-arg="{{ item.id }}">add to cart</a> to buy with other items and save the creator on fees
133 </p>
134 {% endif %}
135 {% else %}
136 <div id="guest-checkout">
137 {% if pwyw_enabled %}
138 <div class="checkout-field">
139 <label for="guest_pwyw_amount" class="checkout-field-label">Name your price (suggested: ${{ suggested_price }})</label>
140 <div class="pwyw-row">
141 <span class="pwyw-symbol">$</span>
142 <input type="number" id="guest_pwyw_amount" class="pwyw-input" value="{{ suggested_price }}" min="{{ pwyw_min_dollars }}" step="0.01">
143 </div>
144 {% if pwyw_min_cents > 0 %}
145 <p class="pwyw-min-note">Minimum: {{ currency_symbol }}{{ pwyw_min_dollars }}</p>
146 {% else if let Some(note) = pwyw_min_note %}
147 <p class="pwyw-min-note">{{ note }}</p>
148 {% endif %}
149 </div>
150 {% endif %}
151 <button class="btn-primary" id="guest-checkout-btn" data-action="guestCheckout">
152 Buy Now - {% if pwyw_enabled %}${{ suggested_price }}{% else %}{{ item.price }}{% endif %}
153 </button>
154 <p class="guest-hint">
155 No account required. You'll receive a download link via email.
156 </p>
157 <p class="guest-login-prompt">
158 <a href="/login?return_to=/purchase/{{ item.id }}">Log in</a> to save purchases to your library.
159 </p>
160 </div>
161 <div id="page-purchase-cfg" hidden data-item-id="{{ item.id }}" data-pwyw-enabled="{% if pwyw_enabled %}true{% else %}false{% endif %}"></div>
162 <script src="/static/page-purchase.js?v=0623" defer></script>
163 {% endif %}
164 <button class="btn-secondary" data-action="back">Cancel</button>
165 </div>
166
167 <div class="security-note">
168 Your payment information is encrypted and never stored on Makenotwork servers
169 </div>
170 </div>
171
172 <div class="checkout-footer">
173 By completing this purchase, you agree to our <a href="/policy">Content Policy</a>
174 </div>
175 </div>
176 {% endblock %}
177
178 {% block scripts %}
179 {% if pwyw_enabled %}
180 <script src="/static/page-purchase-2.js?v=0623" defer></script>
181 {% endif %}
182 {% endblock %}
183