File size: 2,505 Bytes
aec61e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{% extends "base.html" %}
{% block content %}
<section class="payment-page payment-{{ payment_kind }}">
  <div class="payment-intro">
    <p class="page-eyebrow">{% if payment_kind == 'membership' %}Change.org Membership{% else %}Support Change.org{% endif %}</p>
    <h1>{{ payment_heading }}</h1>
    <p>{{ payment_copy }}</p>
    <ul>
      <li>Keep the platform free and open for everyone</li>
      <li>Help petition starters reach more supporters</li>
      <li>Support technology that turns voices into victories</li>
    </ul>
  </div>
  <div class="payment-card">
    {% if payment_result %}
      <div class="payment-result payment-result-{{ payment_result.status }}" role="status">
        <span aria-hidden="true">{% if payment_result.status == 'approved' %}✓{% elif payment_result.status == 'declined' %}!{% else %}↻{% endif %}</span>
        <h2>{{ payment_result.title }}</h2>
        <p>{{ payment_result.message }}</p>
      </div>
    {% endif %}
    <form action="{{ action }}" method="post" data-payment-form>
      <input type="hidden" name="csrf" value="{{ csrf }}">
      <input type="hidden" name="payment_kind" value="{{ payment_kind }}">
      <input type="hidden" name="idempotency_key" value="{{ payment_form_key }}">
      <h2>{% if payment_kind == 'membership' %}Choose a monthly amount{% else %}Choose your contribution{% endif %}</h2>
      <div class="amount-options" role="radiogroup" aria-label="Amount">
        {% for amount in amounts %}
          <label><input type="radio" name="amount" value="{{ amount }}" {% if loop.index == 2 %}checked{% endif %}><span>${{ amount }}</span></label>
        {% endfor %}
      </div>
      <label for="custom-amount">Other amount (CAD)</label>
      <input id="custom-amount" name="custom_amount" inputmode="decimal" placeholder="$">
      <fieldset>
        <legend>Local payment outcome</legend>
        <label><input type="radio" name="scenario" value="sandbox-card-approved" checked> Approved</label>
        <label><input type="radio" name="scenario" value="sandbox-card-declined"> Declined</label>
        <label><input type="radio" name="scenario" value="sandbox-retry"> Retryable</label>
      </fieldset>
      <button class="change-primary-button" type="submit">{% if payment_kind == 'membership' %}Become a member{% else %}Contribute{% endif %}</button>
      <p class="payment-security"><span aria-hidden="true">⌾</span> Secure local sandbox · No real charge</p>
    </form>
  </div>
</section>
{% endblock %}