Skip to content

Commit ea5e746

Browse files
committed
js integration ... guess we have to move to https now ...
1 parent 83ca896 commit ea5e746

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

favicon-512.png

19.8 KB
Loading

favicon-round.xar

20.1 KB
Binary file not shown.

patron.md

+40-10
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,65 @@ they put into the project. Ultimately the board of the OmniOSce Association
1919
decides about the use of the money.
2020

2121

22-
<form>
22+
<form class="patron_form" action="/create_subscription.php" method="POST">
2323
<div class="row">
24-
<div class="input-field col s3">
24+
<div class="input-field col s6 offset-m1 m5 offset-l2 l2 offset-xl3 xl2">
2525
<input placeholder="Amount" id="amount" type="text" class="validate">
2626
<label for="first_name">Amount</label>
2727
</div>
28-
<div class="input-field col s3">
28+
<div class="input-field col s6 m5 l3 xl2">
2929
<select>
30-
<option value="" disabled selected>Choose your option</option>
30+
<option default value="USD">US Dollars</option>
3131
<option value="CHF">Swiss France</option>
3232
<option value="EUR">Euros</option>
33-
<option value="USD">US Dollars</option>
3433
</select>
3534
<label>Currency</label>
36-
</div><div class="input-field col s3">
35+
</div><div class="input-field col s12 offset-m1 m10 l3 xl2">
3736
<select>
38-
<option value="" disabled selected>Choose your option</option>
39-
<option value="Monthly">Monthly</option>
37+
<option default value="Monthly">Monthly</option>
4038
<option value="OneTime">One Time</option>
4139
<option value="Weekly">Weekly</option>
4240
<option value="Yearly">Yearly</option>
4341
</select>
4442
<label>Period</label>
4543
</div>
46-
<div class="col s3">
47-
<button class="btn waves-effect waves-light btn-large" type="submit" name="action"><i class="material-icons right">done</i>Become a Patron</button>
44+
<div class="col s12 offset-m1 m10 offset-l2 l8 offset-xl3 xl6">
45+
<button style="width: 100%" id="start-stripe" class="btn waves-effect waves-light btn-large" type="submit" name="action"><i class="material-icons right">done</i>Become a Patron</button>
4846
</div>
4947
</div>
5048
</form>
5149

50+
<script src="https://checkout.stripe.com/checkout.js"></script>
51+
<script>
52+
(function(){
53+
var handler = StripeCheckout.configure({
54+
key: 'pk_test_UFESfp6M4UmMqz340REVYtCB',
55+
image: '/favicon-512.png',
56+
locale: 'auto',
57+
token: function(token) {
58+
// You can access the token ID with `token.id`.
59+
// Get the token ID to your server-side code for use.
60+
}
61+
});
62+
63+
document.getElementById('start-stripe').addEventListener('click', function(e) {
64+
// Open Checkout with further options:
65+
handler.open({
66+
name: 'OmniOS Patron',
67+
description: 'Subscription',
68+
currency: 'chf',
69+
amount: 2000,
70+
allowRememberMe: true,
71+
billingAddress: true
72+
});
73+
e.preventDefault();
74+
});
75+
76+
// Close Checkout on page navigation:
77+
window.addEventListener('popstate', function() {
78+
handler.close();
79+
});
80+
})();
81+
</script>
5282

5383
WORK IN PROGRESS!

0 commit comments

Comments
 (0)