-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdonation.php
40 lines (30 loc) · 887 Bytes
/
donation.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
<?php
$type = $_GET["type"];
$currency = $_GET["currency"];
if($currency == "") {
$currency == "USD";
}
$amount = $_GET["amount"];
if($amount == "") {
$amount == "1.00";
}
$title = $_GET["title"];
if($title == "") {
$title == "Donation using PayACoffee.com";
}
if($type == "paypal") {
$email = $_GET["email"];
if(strpos($email, "@") !== false) {
$payacoffeeURL = "https://www.paypal.com/cgi-bin/webscr?" . "business=" . $email . "&cmd=_xclick" . "¤cy_code=" . $currency . "&amount=" . $amount . "&item_name=" . $title;
header("Location: " . $payacoffeeURL);
}
}
if($type == "bitcoin") {
$bitcoin = $_GET["bitcoin"];
if(strlen($bitcoin)>=26 && strlen($bitcoin)<=34) {
$payacoffeeURL = "bitcoin:" . $bitcoin . "?amount=" . number_format($amount/425, 8, '.', ' ') . "&label=" . $title;
echo $payacoffeeURL;
header("Location: " . $payacoffeeURL);
}
}
?>