-
Notifications
You must be signed in to change notification settings - Fork 0
/
donate.html
639 lines (570 loc) · 25.2 KB
/
donate.html
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0; URL=https://arisen.church/donate" />
<meta charset="utf-8">
<title>Donate | Peeps - decentralize everything.</title>
<meta name="title" content="Join The Patriots Club | Peeps - decentralize everything.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Donate to Peeps and help support our movement to bring freedom back to the Internet.">
<meta name="keywords" content="dweb search engine, search dweb, search dapps, search dsites">
<!-- Favicon -->
<link rel="shortcut icon" href="assets/img/logo/peepfab.png">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Nunito:400,400i,600,600i,700,700i%7cPermanent+Marker"
rel="stylesheet">
<link href="assets/css/theme.css" rel="stylesheet" type="text/css" media="all">
<link href="assets/css/custom.css" rel="stylesheet">
<script src="https://js.stripe.com/v3/"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-08BK2XMZTB"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-08BK2XMZTB');
</script>
</head>
<body>
<!------------------------- CUSTOM BLOCK ------------------------>
<section class="height-100 bg-white p-3">
<!-- <img src="#" alt="Image" class="bg-image opacity-10"> -->
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-11 col-lg-12">
<div class="join-logo">
<a class="navbar-brand" href="index.html">
<img alt="Insight" src="assets/img/logo/peepsLogo.png">
</a>
</div>
<div class="text-center">
<h1 class="display-4 font-alt-1 text-center mt-2" style="color: #000;">Donate</h1>
</div>
<form class="wizard card">
<ul class="nav nav-tabs card-header text-center bg-light p-0">
<li class="nav-item flex-fill">
<a class="nav-link" href="#first">1. Your Donation </a>
</li>
<li class="nav-item flex-fill">
<a class="nav-link" href="#second">2. Your Billing Info</a>
</li>
<li class="nav-item flex-fill">
<a class="nav-link" href="#third">3. Choose Payment Method</a>
</li>
<!-- <li class="nav-item flex-fill">
<a class="nav-link" href="#fourth">4. Payment</a>
</li> -->
<li class="nav-item flex-fill">
<a class="nav-link" href="#fourth">4. Success</a>
</li>
</ul>
<div class="tab-content">
<div id="first">
<div class="card-body py-4">
<h3>Choose a donation amount</h3>
<p>Choose your donation amount below:</p>
<!-- <form> -->
<div class="row" id="amounts">
<div class="col-sm-2">
<div class="form-group">
<div class="custom-control custom-radio mb-1">
<input type="radio" id="amountRadio1" name="amountRadio" class="custom-control-input"
value="5" checked="checked">
<label class="custom-control-label" for="amountRadio1">$5</label>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<div class="custom-control custom-radio mb-1">
<input type="radio" id="amountRadio2" name="amountRadio" class="custom-control-input"
value="25">
<label class="custom-control-label" for="amountRadio2">$25</label>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<div class="custom-control custom-radio mb-1">
<input type="radio" id="amountRadio3" name="amountRadio" class="custom-control-input"
value="100">
<label class="custom-control-label" for="amountRadio3">$100</label>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<div class="custom-control custom-radio">
<input type="radio" id="amountRadio4" name="amountRadio" class="custom-control-input"
value="500">
<label class="custom-control-label" for="amountRadio4">$500</label>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<div class="custom-control custom-radio mb-1">
<input type="radio" id="amountRadio5" name="amountRadio" class="custom-control-input"
value="1000">
<label class="custom-control-label" for="amountRadio5">$1000</label>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<div class="custom-control custom-radio">
<input type="radio" id="amountRadio6" name="amountRadio" class="custom-control-input"
value="2000">
<label class="custom-control-label" for="amountRadio6">$2000</label>
</div>
</div>
</div>
</div>
<!-- </form> -->
<!-- <p>Is this a one-time donation or a recurring donation?"</p> -->
<!-- <form> -->
<!-- <div class="custom-control custom-radio mb-1">
<input type="radio" id="asktimeRadio1" name="asktimeRadio" class="custom-control-input">
<label class="custom-control-label" for="asktimeRadio1">One-Time</label>
</div> -->
<!-- <div class="custom-control custom-radio">
<input type="radio" id="asktimeRadio2" name="asktimeRadio" class="custom-control-input">
<label class="custom-control-label" for="asktimeRadio2">Recurring</label>
</div> -->
<!-- </form> -->
<button class="btn btn-primary sw-btn-next margin-20" onclick="firstNextButton()">Next Step</button>
</div>
</div>
<div id="second">
<div class="card-body py-4">
<h3>Enter your billing information</h3>
<!-- <form> -->
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<input name="name" type="text" class="form-control" id="fname" placeholder="First Name*">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<input name="name" type="text" class="form-control" id="lname" placeholder="Last Name*">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<input name="email" type="email" class="form-control" id="email" placeholder="Email*">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<input name="name" type="text" class="form-control" id="addressone" placeholder="Address*">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<input name="name" type="text" class="form-control" id="city" placeholder="City*">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<input name="name" type="text" class="form-control" id="state" placeholder="State*">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<input name="name" type="number" class="form-control" id="zipcode" placeholder="Zip Code*">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<input name="name" type="text" class="form-control" id="country" placeholder="Country*">
</div>
</div>
</div>
<!-- </form> -->
<button class="btn btn-primary margin-20" type="button" onclick="secondNextButton()">Next
Step</button>
</div>
</div>
<div id="third">
<div class="card-body py-4">
<h3>Choose payment method for your donation.</h3>
<!-- <form> -->
<!-- <div class="custom-control custom-radio mb-1">
<input type="radio" id="paymentRadio1" name="paymentRadio" class="custom-control-input"
value="Stripe" checked>
<label class="custom-control-label" for="paymentRadio1">Credit Card / Debit Card</label>
</div> -->
<!-- <div class="custom-control custom-radio">
<input type="radio" id="paymentRadio2" name="paymentRadio" class="custom-control-input"
value="Paypal">
<label class="custom-control-label" for="paymentRadio2">PayPal</label>
</div> -->
<!-- </form> -->
<div class="flex-container payment-optn">
<div id="paypal-button-container"></div>
<!-- <button type="button" class="btn btn-primary btn-blue" data-toggle="modal"
data-target="#myModal">Pay With Card</button> -->
</div>
<!-- <button class="btn btn-primary margin-20" type="button" onclick="thirdNextButton()">Next Step</button> -->
</div>
</div>
<!-- <div id="fourth">
<div class="card-body py-4">
<h3>Make "one-time" or "recurring" donation of "amount"</h3>
<p>Other functionalities to be added here</p>
<button class="btn btn-primary sw-btn-next" type="submit">Next Step</button>
</div>
</div> -->
<div id="fourth">
<div class="card-body py-4">
<h3>Thank you so much for your donation of $<spam id="amountdonated"></spam> and helping further this
decentralized dream of ours.<br/>Your TransectionId is <spam id="TransectionId"></spam>
</h3>
<!-- <button class="btn btn-success" type="submit">Submit</button> -->
</div>
</div>
</div>
</form>
</div>
</div>
<!-- Modal start -->
<div id="myModal" class="modal donet-mod" role="dialog">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<!-- <span class="close">×</span> -->
<h4 class="modal-title">Fill Your Card Details.</h4>
</div>
<div class="modal-body">
<form class="stripeform">
<label>
<span>Name</span>
<input name="cardholder-name" class="field" placeholder="Jane Doe" />
</label>
<label>
<span>Card</span>
<div id="card-element" class="field"></div>
</label>
<div class="pay-btn">
<button type="submit" class="btn btn-sm btn-blue">Pay</button>
<button type="button" class="btn btn-sm btn-blue" data-dismiss="modal"
onclick="closemodl()">Close</button>
</div>
<div class="outcome">
<div class="error"></div>
</div>
</form>
</div>
<!-- <div class="modal-footer">
<h3>Modal Footer</h3>
</div> -->
</div>
</div>
<!-- Modal end -->
<div style="text-align: center;">
<a href="index.html" class="btn btn-primary margin-20">Go back home</a>
</div>
</div>
</section>
<!------------------------- CONTENT BLOCK 1 TEMPLATE End------------------------>
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/popper.min.js"></script>
<script type="text/javascript" src="assets/js/prism.js"></script>
<script type="text/javascript" src="assets/js/smooth-scroll.polyfills.js"></script>
<script type="text/javascript" src="assets/js/scrollMonitor.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.js"></script>
<script type="text/javascript" src="assets/js/clipboard.js"></script>
<script type="text/javascript" src="assets/js/jquery.countdown.min.js"></script>
<script type="text/javascript" src="assets/js/flickity.pkgd.min.js"></script>
<script type="text/javascript" src="assets/js/isotope.pkgd.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.smartWizard.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.fancybox.min.js"></script>
<script type="text/javascript" src="assets/js/zoom.min.js"></script>
<script type="text/javascript" src="assets/js/theme.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.1/axios.min.js"></script>
<script type="text/javascript" src="assets/js/custom/custom.js"></script>
<script>
// Rix price
axios.get('https://nv6khovry9.execute-api.us-east-1.amazonaws.com/dev/rsn_price_from_bts')
.then(function (response) {
document.getElementById('rix-price').innerHTML = ` $ ${parseFloat(response.data.data.USD.price).toFixed(4)}`;
})
.catch(function (error) {
console.log(error)
});
</script>
<script>
// --------------first next button----------------
var amount = 5;
function firstNextButton() {
if (document.getElementById('amountRadio1').checked) {
amount = document.getElementById('amountRadio1').value;
} else if (document.getElementById('amountRadio2').checked) {
amount = document.getElementById('amountRadio2').value;
} else if (document.getElementById('amountRadio3').checked) {
amount = document.getElementById('amountRadio3').value;
}else if (document.getElementById('amountRadio4').checked) {
amount = document.getElementById('amountRadio4').value;
}else if (document.getElementById('amountRadio5').checked) {
amount = document.getElementById('amountRadio5').value;
}else if (document.getElementById('amountRadio6').checked) {
amount = document.getElementById('amountRadio6').value;
}
}
// -------------second next button-------------
function secondNextButton() {
fname = document.getElementById('fname').value
lname = document.getElementById('lname').value
email = document.getElementById('email').value
addressone = document.getElementById('addressone').value
addresstwo = "."
city = document.getElementById('city').value
state = document.getElementById('state').value
zipcode = document.getElementById('zipcode').value
country = document.getElementById('country').value
if (fname == "" || fname == null) {
swal({ title: "Enter first name!", icon: "warning" });
return
} else if (!isNaN(fname)) {
swal({ title: "Enter valid first name!", icon: "warning" });
return
} else if (lname == "" || lname == null) {
swal({ title: "Enter your last name!", icon: "warning" });
return
} else if (!isNaN(lname)) {
swal({ title: "Enter valid last name!", icon: "warning" });
return
} else if (email == "" || email == null) {
swal({ title: "Enter your Email!", icon: "warning" });
return
} else if (addressone == "" || addressone == null) {
swal({ title: "Enter your first address!", icon: "warning" });
return
} else if (city == "" || city == null) {
swal({ title: "Enter city name!", icon: "warning" });
return
} else if (!isNaN(city)) {
swal({ title: "Enter valid city name!", icon: "warning" });
return
} else if (state == "" || state == null) {
swal({ title: "Enter your state name!", icon: "warning" });
return
} else if (!isNaN(state)) {
swal({ title: "Enter valid state name!", icon: "warning" });
return
} else if (zipcode == "" || zipcode == null) {
swal({ title: "Enter your zipcoe!", icon: "warning" });
return
} else if (country == "" || country == null) {
swal({ title: "Enter your country name!", icon: "warning" });
return
} else if (!isNaN(country)) {
swal({ title: "Enter valid country name!", icon: "warning" });
return
}
window.location = "#third"
}
// ----------------third next button--------------
var paymentType = "Stripe"
function thirdNextButton() {
if (document.getElementById('paymentRadio1').checked) {
paymentType = document.getElementById('paymentRadio1').value;
modal.style.display = "block";
} else if (document.getElementById('paymentRadio2').checked) {
paymentType = document.getElementById('paymentRadio2').value;
}
}
</script>
<!-- =============modal start========== -->
<script>
// Get the modal
var modal = document.getElementById("myModal");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on <span> (x), close the modal
span.onclick = function () {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
<script>
var stripe = Stripe('pk_live_51H0hOeJ5nSY4c5DAvFEuc6pmikZ6QUcUTTbbe9duhfYsUCadDTukQRP077ZzOS7GSmJVQWZFskgX4tAQVgJmnGCL00Iw2Cy1Tz');
var elements = stripe.elements({
fonts: [
{
family: 'Open Sans',
weight: 400,
src: 'local("Open Sans"), local("OpenSans"), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3ZBw1xU1rKptJj_0jans920.woff2) format("woff2")',
unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215',
},
]
});
var card = elements.create('card', {
hidePostalCode: true,
style: {
base: {
iconColor: '#F99A52',
color: 'black',
lineHeight: '48px',
fontWeight: 400,
fontFamily: '"Open Sans", "Helvetica Neue", "Helvetica", sans-serif',
fontSize: '15px',
'::placeholder': {
color: '#CFD7DF',
}
},
}
});
card.mount('#card-element');
function setOutcome(result, name) {
// var successElement = document.querySelector('.success');
var errorElement = document.querySelector('.error');
// successElement.classList.remove('visible');
errorElement.classList.remove('visible');
if (result.token) {
this.payment(result.token, name)
$('#myModal').modal('hide');
document.getElementById("loading").style.display = "block";
// Use the token to create a charge or a customer
// https://stripe.com/docs/charges
//successElement.querySelector('.token').textContent = result.token.id;
//successElement.classList.add('visible');
} else if (result.error) {
errorElement.textContent = result.error.message;
errorElement.classList.add('visible');
}
}
card.on('change', function (event) {
setOutcome(event);
});
document.querySelector('.stripeform').addEventListener('submit', function (e) {
e.preventDefault();
var form = document.querySelector('.stripeform');
var extraDetails = {
name: form.querySelector('input[name=cardholder-name]').value,
};
stripe.createToken(card, extraDetails).then(result => {
setOutcome(result, extraDetails.name)
});
});
async function payment(token, name) {
let object = {
"name": name,
"token": token.id,
"amount": amount,
"fname": fname,
"lname": lname,
"email": email,
"addressOne": addressone,
"addressTwo": ".",
"city": city,
"state": state,
"zipcode": zipcode,
"country": country
}
axios.post('https://payments.peepsx.com/users/onetimepayment', object).then((result) => {
if (result.data.status == true) {
window.location = "#fourth"
document.getElementById("amountdonated").innerHTML = amount;
document.getElementById("TransectionId").innerHTML = result.data.data.balance_transaction
} else {
window.location = "#third"
swal({ title: "Sorry, but your payment has failed. Please try again.", icon: 'warning' });
}
// document.getElementById("loading").style.display = "none";
// swal("Your payment is Successful.", `Your SubscriptionId is: ${result.data.data.id}`, "success");
}).catch((error) => {
console.log('error block stripe payment', error)
})
}
</script>
<script
src="https://www.paypal.com/sdk/js?client-id=Aes7-mZ9lsMi3h-m6lZ-eIQFBaUoF_hpHW1fF8bEZ5a59vZvzeTg75ZZc78g5h5igwkSABHfvlDQk8VQ&vault=true"
data-sdk-integration-source="button-factory">
</script>
<!-- JS Plugins Init. -->
<script>
axios.get('https://nv6khovry9.execute-api.us-east-1.amazonaws.com/dev/rsn_price_from_bts')
.then(function (response) {
document.getElementById('rix-price').innerHTML = `RIX: $ ${parseFloat(response.data.data.USD.price).toFixed(4)}`;
})
.catch(function (error) {
console.log(error)
});
</script>
<script>
// Render the PayPal button into #paypal-button-container
paypal.Buttons({
createOrder: function (data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: amount
}
}]
});
},
onApprove: function (data, actions) {
return actions.order.capture().then(function (details) {
if (details.status == "COMPLETED") {
window.location = "#fourth"
document.getElementById("amountdonated").innerHTML = amount;
document.getElementById("TransectionId").innerHTML = details.id
let object = {
"amount": amount,
"transectionId": details.id,
"paymentStatus": details.status,
"fname": fname,
"lname": lname,
"email": email,
"addressOne": addressone,
"addressTwo": ".",
"city": city,
"state": state,
"zipcode": zipcode,
"country": country
}
axios.post('https://payments.peepsx.com/users/paypalonetimepayment', object).then((result) => {
}).catch((error) => {
console.log(error)
})
} else {
window.location = "#third"
swal({ title: "Sorry, but your payment has failed. Please try again.", icon: 'warning' });
}
// Show a success message to the buyer
// alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
},
onCancel: function (data) {
swal({ title: "User has cancelled the payment.", icon: 'warning' });
document.getElementById("loading").style.display = "none";
},
// button style
style: {
layout: 'horizontal',
color: 'blue',
shape: 'pill',
height: 40,
tagline: false
},
}).render('#paypal-button-container');
</script>
</body>
</html>