-
Notifications
You must be signed in to change notification settings - Fork 138
/
donate.php
264 lines (230 loc) · 8.98 KB
/
donate.php
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
<?php
require_once "classControllers/init.php";
$donation = new Donation();
if(isset($_POST['pay'])){
$name = $database->escape_string($_POST['name']);
$phone = $database->escape_string($_POST['phone']);
$email = $database->escape_string($_POST['email']);
$amount = $database->escape_string($_POST['amount']);
$ref = $donation->pay("$amount","$name","$phone","$email");
$url = "http://hngi7.hng.tech/donate.php";
$curl = curl_init();
$customer_email = $email;
//$amount = $amount;
//$currency = "USD";
$txref = $ref; // ensure you generate unique references per transaction.
$PBFPubKey = "FLWPUBK_TEST-2632b2661e8fb72e6cce1f4482169959-X"; // get your public key from the dashboard.
$redirect_url = $url;
//$payment_plan = "pass the plan id"; // this is only required for recurring payments.
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/hosted/pay',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(
array(
'amount'=>$amount,
'customer_email'=>$customer_email,
'currency'=> "NGN",
'txref'=>$txref,
'PBFPubKey'=>$PBFPubKey,
'redirect_url'=>$redirect_url
//'payment_plan'=>$payment_plan
)
),
CURLOPT_HTTPHEADER =>
array(
"content-type: application/json",
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
if($err){
// there was an error contacting the rave API
die('Curl returned error: ' . $err);
}
$transaction = json_decode($response);
if(!$transaction->data && !$transaction->data->link){
// there was an error from the API
print_r('API returned error: ' . $transaction->message);
}
// uncomment out this line if you want to redirect the user to the payment page
//print_r($transaction->data->message);
// redirect to page so User can pay
// uncomment this line to allow the user redirect to the payment page
header('Location: ' . $transaction->data->link);
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Donate</title>
<link rel="icon" type="img/png" href="images/hng-favicon.png" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"/>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css"/>
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<link rel="stylesheet" type="text/css" href="css/header-footer.css" />
<link rel="stylesheet" href="./css/main.css" />
<link rel="stylesheet" href="./css/donate.css" />
<link rel="icon" type="img/png" href="images/hng-favicon.png">
<style>
.jumbo {
background-color: #d1f0f6;
padding-bottom: 20px;
}
.hero-cont a.button-primary{
margin-bottom: 10px !important;
}
</style>
</head>
<body>
<div style="background-color: #D1F0F6 !important;"><?php include('fragments/site_header.php'); ?></div>
<section class="container-fluid1" >
<!-- <div class="body-container"> -->
<div class="hero-cont">
<h2 class="title">Donate to HNG</h2>
<p class="desc">
Your donations go towards providing adequate resources, such as
electricity, internet, laptops and tutorials to interns who don't have
access to them. They keep the internship going and help us keep
finding and nurturing talent.
</p>
<a href="https://dashboard.flutterwave.com/donate/rbazqm2uou8y" class="button-primary">Donate</a>
<!-- <a href="newsponsor" class="button-primary">Register as Sponsor(Brand)</a> -->
</div>
<section class="whatwe">
<figure>
<img src="https://bit.ly/2Vug2Vf" alt="Computer" />
</figure>
<div class="text">
<h3 class="title">What we use it for</h3>
<p class="desc">
Among the several ways we improve interns lives with your help, these
are some of the major ways your donations are used
</p>
<ul class="list">
<li>Laptops</li>
<li>Internet Subscriptions</li>
<li>Prizes</li>
<li>Meetups</li>
</ul>
<a href="https://dashboard.flutterwave.com/donate/rbazqm2uou8y" class="button-primary">Donate</a>
</div>
</section>
<section class="banner">
<h3 class="title">Your Donations Help</h3>
<p class="desc">
During HNGi6.0, we raised a total of ₦2,200,000 plus $10k in AWS credit. With
your help, we can raise even more.
</p>
<a href="https://dashboard.flutterwave.com/donate/rbazqm2uou8y" class="button-primary">Donate</a>
</section>
<section class="women">
<figure>
<img src="https://res.cloudinary.com/cloud-y/image/upload/v1572988274/images_cq2tcg.jpg" alt="Computer" />
</figure>
<div class="text">
<h3 class="title">Donate to specific groups</h3>
<p class="desc">
You can also donate specifically to groups with special needs or
groups that are underrepresented in the tech space like:
</p>
<ul class="list">
<li>Women</li>
<li>People with disabilities</li>
</ul>
<a href="https://flutterwave.com/pay/se5mtah7yl3o" class="button-primary">Donate</a>
</div>
</section>
<!-- <section class="banner form" id="form"> -->
<!-- <h3 class="title">Donate Today</h3> -->
<!-- <form action="" id="actualForms" method="post">
<input
type="text"
name="name"
placeholder="Enter Name"
required
/>
<input
type="email"
name="email"
placeholder="Enter Email address"
required
/>
<input
required
type="text"
name="phone"
placeholder="Enter Phone number"
/>
<input
type="number"
name="amount"
placeholder="Donation amount"
required
/>
<input type="submit" name="pay" value="Donate Now" /> <br>
<h5>Want to become a sponsor ?</h5>
<a href="contactform">Send Us Message</a>
</form> -->
<!-- </section> -->
<div class="banner form" id="supportForm">
<h3 class="title">Support via software or tool</h3>
<p class="desc">
Give anything you have that can make an intern's journey easier
</p>
<!-- <form action="" id="actualSupportForms" method="post">
<input
type="text"
name="amount"
placeholder="How much do you want to donate"
required
/>
<input
type="text"
name="name"
placeholder="Enter Name"
required
/>
<input
type="email"
name="email"
placeholder="Enter Email address"
required
/>
<input
type="number"
name="phone"
placeholder="Enter Phone number"
/> -->
<a href="https://hngi7.hng.tech/contactform" class="button-primary">Contact Us</a>
</form>
</div>
</section>
<?php include "fragments/site_footer.php" ?>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<?php // include('fragments/chat.php'); ?>
</body>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script src="js/main.js"></script>
<script type="text/javascript" src="js/countdown.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js" crossorigin="anonymous"></script>
<script src="./js/scroll-to-top.js"></script>
</html>