/
show.html.liquid
123 lines (102 loc) · 5.05 KB
/
show.html.liquid
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<div class="row">
<div class="col-md-9">
{% include 'users_menu' %}
<div class="panel panel-default">
<div class="panel-heading important">
<div class="pull-right">
{% comment %} In this example we're only using the heading for edit links {% endcomment %}
{% comment %} Braintree combines billing address + cc details in 1 form {% endcomment %}
{% if provider.payment_gateway.type == "braintree_blue" %}
<a href="{{ current_account.edit_braintree_blue_credit_card_details_url }}">
{% if current_account.has_billing_address? and current_account.credit_card_stored? %}
<i class="fa fa-pencil"></i>
Edit Credit Card Details and Billing Address
{% endif %}
</a>
{% endif %}
{% comment %} Ogone & stripe have separate forms for billing address + cc details {% endcomment %}
{% if current_account.has_billing_address? %}
{% case provider.payment_gateway.type %}
{% when "ogone" %}
<a href="{{ current_account.edit_ogone_billing_address_url }}">
<i class="fa fa-pencil"></i>
Edit billing address
</a>
{% when "stripe" %}
<a href="{{ current_account.edit_stripe_billing_address_url }}">
<i class="fa fa-pencil"></i>
Edit billing address
</a>
{% endcase %}
{% endif %}
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body">
{% comment %} In this example we're only rendering billing address and cc card info if they exist {% endcomment %}
{% if current_account.has_billing_address? %}
<dl class="dl-horizontal" id="billing_address">
<dt>Address</dt>
<dd>{{ current_account.billing_address.address }}</dd>
<dt>Zip</dt>
<dd>{{ current_account.billing_address.zip }}</dd>
<dt>City</dt>
<dd>{{ current_account.billing_address.city }}</dd>
<dt>State</dt>
<dd>{{ current_account.billing_address.state }}</dd>
<dt>Country</dt>
<dd>{{ current_account.billing_address.country }}</dd>
<dt>Phone</dt>
<dd>{{ current_account.billing_address.phone }}</dd>
{% if current_account.credit_card_stored? %}
<dt>Credit card number</dt>
<dd>{{ current_account.credit_card_display_number }}</dd>
{% unless provider.payment_gateway.authorize_net? %}
<dt>Expiration date</dt>
<dd>{{ current_account.credit_card_expiration_date }}<dd>
{% endunless %}
{% endif %}
</dl>
{% endif %}
{% comment %} In this example we're mostly using main content area for first add links {% endcomment %}
{% case provider.payment_gateway.type %}
{% comment %} Braintree combines billing address + cc details in 1 form {% endcomment %}
{% when "braintree_blue" %}
<a href="{{ current_account.edit_braintree_blue_credit_card_details_url }}">
{% unless current_account.has_billing_address? and current_account.credit_card_stored? %}
Add Credit Card Details and Billing Address
{% endunless %}
</a>
{% comment %} Authorize.net combines billing address + cc details in 1 external form {% endcomment %}
{% when "authorize_net" %}
{% if current_account.credit_card_stored? %}
{% authorize_net_form "Edit Credit Card Details" %}
{% else %}
{% authorize_net_form "Add Credit Card Details" %}
{% endif %}
{% comment %} Ogone renders a link to the external cc form once a billing address has been added {% endcomment %}
{% when "ogone" %}
{% if current_account.has_billing_address? %}
{% if current_account.credit_card_stored? %}
{% ogone_form "Edit Credit Card Details" %}
{% else %}
{% ogone_form "Add Credit Card Details" %}
{% endif %}
{% else %}
<p><a href="{{ current_account.edit_ogone_billing_address_url }}">First add a billing address</a></p>
{% endif %}
{% comment %} Stripe renders the form in place once a billing address has been added {% endcomment %}
{% when "stripe" %}
{% if current_account.has_billing_address? %}
{% stripe_form %}
{% else %}
<p><a href="{{ current_account.edit_stripe_billing_address_url }}">First add a billing address</a></p>
{% endif %}
{% endcase %}
</div>
<div class="panel-footer">
<p>By <strong>Entering Credit Card details</strong> you agree to the <a href="{{ urls.credit_card_terms }}" id="terms-link">Terms of Service</a>, <a href="{{ urls.credit_card_privacy }}" id="privacy-link">Privacy</a> and <a href="{{ urls.credit_card_refunds }}" id="refunds-link">Refund</a>.</p>
</div>
</div>
</div>
</div>