Commit | Line | Data |
---|---|---|
d5f8418b AC |
1 | <% val you = Init.getUser () %> |
2 | ||
f8b39e09 CE |
3 | <% if $"cmd" = "stripeSuccess" then %> |
4 | <div class="notice"> | |
5 | ||
6 | <h3>Stripe Payment Succeeded</h3> | |
7 | ||
8 | <p>Your payment via Stripe must still be applied to your balance | |
9 | manually at present, and will be applied by the treasurer within a few | |
10 | days.</p> | |
11 | ||
12 | </div> | |
13 | <% end %> | |
14 | ||
15 | <h3>Add To Your Balance</h3> | |
16 | ||
17 | <script src="https://code.jquery.com/jquery-1.11.0.min.js"></script> | |
18 | <script src="https://checkout.stripe.com/checkout.js"></script> | |
19 | ||
20 | <p>Remember that we credit member balances for payments <b>after subtracting service fees</b>. This means that, to increase your balance by a particular amount, you must make a <b>larger</b> payment than just that amount.</p> | |
21 | ||
22 | <h4>Add to your balance with <a href="https://paypal.com">PayPal</a></h4> | |
23 | ||
24 | <p>You should consult <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_display-fees-outside">the PayPal fees page</a> to figure out how much extra to send. We have a business account, which means, for example, a 2.9% plus 30 cent fee for payments from the USA. This means that you can calculate the amount <em>x</em> to send from the amount <em>y</em> you want us to receive with this formula: <em>x</em> = (<em>y</em> + .3) / (1 - .029). The fees may be different for other countries.</p> | |
25 | ||
26 | <form method="GET" action="https://www.paypal.com/cgi-bin/webscr"> | |
27 | <input type="hidden" name="cmd" value="_xclick" /> | |
28 | <input type="hidden" name="business" value="payment@hcoop.net" /> | |
29 | <input type="hidden" name="item_name" value="Member payment for <% Init.getUserName () %>" /> | |
30 | ||
31 | <select id="paypalDuesEasy"> | |
32 | <option value="" selected="selected">---</option> | |
33 | <% foreach (amt) in [10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100] do %> | |
34 | <option value="<% amt %>.00">$<% amt %>.00</option> | |
35 | <% end %> | |
36 | </select> | |
37 | ||
38 | <script> | |
39 | $("#paypalDuesEasy").change (function () { | |
40 | $("#paypalDues").val ($(this).val ()); | |
41 | }); | |
42 | </script> | |
43 | ||
44 | <label>$<input id="paypalDues" type="text" name="amount" pattern="^\\d+\\.\\d\\d$" /></label> | |
45 | <input type="submit" value="Add to Your Balance With Paypal" /> | |
46 | </form> | |
ab0b905b | 47 | |
d5f8418b AC |
48 | <% switch #paypal you of |
49 | NONE => %><p>You haven't set a PayPal e-mail address. If you are going to send a payment by PayPal, please <a href="pref">set a PayPal e-mail address on the Preferences page</a> first to ensure that you are credited promptly and accurately.</p><% | |
50 | end %> | |
51 | ||
f8b39e09 CE |
52 | <h4>Add to your balance with <a href="https://stripe.com/">Stripe</a></h4> |
53 | ||
54 | <p>Stripe fees are $0.30 + 2.9% for each transaction regardless of country.</p> | |
55 | ||
56 | <form id="stripeForm" action="/stripe/stripe-payment.cgi" method="POST"> | |
57 | <select id="stripeDuesEasy"> | |
58 | <option value="" selected="selected">---</option> | |
59 | <% foreach (amt) in [10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100] do %> | |
60 | <option value="<% amt %>.00">$<% amt %>.00</option> | |
61 | <% end %> | |
62 | </select> | |
63 | ||
64 | <script> | |
65 | $("#stripeDuesEasy").change (function () { | |
66 | $("#stripeDues").val ($(this).val ()); | |
67 | }); | |
68 | </script> | |
69 | <label>$<input type="text" name="stripeDues" id="stripeDues" pattern="^\\d+\\.\\d\\d$"/></label> | |
70 | <input type="hidden" name="webuser_id" value="<% #id you %>" /> | |
71 | <input type="hidden" name="webuser_name" value="<% #name you %>" /> | |
72 | ||
73 | <button id="stripePay">Add To Your Balance With Stripe</button> | |
74 | ||
75 | <script> | |
76 | $("#stripePay").click (function(e) { | |
77 | if ($("#stripeDues")[0].validity.valid) { | |
78 | var token = function(res){ | |
79 | var $input = $('<input type=hidden name=stripeToken />').val(res.id); | |
80 | $("#stripeDues").val($("#stripeDues").val() * 100); | |
81 | $('#stripeForm').append($input).submit(); | |
82 | }; | |
83 | ||
84 | // Open Checkout with further options | |
85 | StripeCheckout.open({ | |
86 | key: 'pk_test_sJkMs1I4fVK4JQu9QkFDjOMs', | |
87 | image: '/globe.gif', | |
88 | name: 'Hcoop', | |
89 | description: 'Dues', | |
90 | amount: ($("#stripeDues").val() * 100), | |
91 | currency: 'usd', | |
92 | address: true, | |
93 | panelLabel: 'Pay {{amount}}', | |
94 | token: token | |
95 | }); | |
96 | } | |
97 | return false; | |
98 | }); | |
99 | </script> | |
100 | </form> | |
101 |