@@ -19,35 +19,65 @@ they put into the project. Ultimately the board of the OmniOSce Association
19
19
decides about the use of the money.
20
20
21
21
22
- <form >
22
+ <form class = " patron_form " action = " /create_subscription.php " method = " POST " >
23
23
<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 " >
25
25
<input placeholder="Amount" id="amount" type="text" class="validate">
26
26
<label for="first_name">Amount</label>
27
27
</div >
28
- <div class =" input-field col s3 " >
28
+ <div class =" input-field col s6 m5 l3 xl2 " >
29
29
<select>
30
- <option value="" disabled selected>Choose your option </option>
30
+ <option default value="USD">US Dollars </option>
31
31
<option value="CHF">Swiss France</option>
32
32
<option value="EUR">Euros</option>
33
- <option value="USD">US Dollars</option>
34
33
</select>
35
34
<label>Currency</label>
36
- </div ><div class =" input-field col s3 " >
35
+ </div ><div class =" input-field col s12 offset-m1 m10 l3 xl2 " >
37
36
<select>
38
- <option value="" disabled selected>Choose your option</option>
39
- <option value="Monthly">Monthly</option>
37
+ <option default value="Monthly">Monthly</option>
40
38
<option value="OneTime">One Time</option>
41
39
<option value="Weekly">Weekly</option>
42
40
<option value="Yearly">Yearly</option>
43
41
</select>
44
42
<label>Period</label>
45
43
</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>
48
46
</div >
49
47
</div >
50
48
</form >
51
49
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 >
52
82
53
83
WORK IN PROGRESS!
0 commit comments