forked from BlueWallet/Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buy-bitcoin-redirect.html
36 lines (34 loc) · 1.5 KB
/
buy-bitcoin-redirect.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<div>country_code: <span id="country_code"></span></div>
<a href="https://old.changelly.com/?ref_id=rtagfcvnwiwvhm99">Click here if you are not being redirected</a>
<script>
var safello_countries = ["SE", "GB", "AD", "AT", "AX", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GG", "GI", "GR", "HR", "HU", "IE", "IM", "IS", "IT", "JE", "LI", "LT", "LU", "LV", "MC", "ME", "MT", "NL", "NO", "PL", "PT", "SI", "SK", "SM", "IC"];
var u = new URLSearchParams(window.location.search);
var address = u.get('address') || '';
$.ajax({
url: "https://geoip-db.com/jsonp",
jsonpCallback: "callback",
dataType: "jsonp",
error: function(){
window.location = 'https://old.changelly.com/?ref_id=rtagfcvnwiwvhm99';
},
success: function( location ) {
$('#country_code').html(location.country_code);
if (location.country_code == 'ZA' || location.country_code == 'ZAF' || location.country_code == 'ZAR') {
window.location = 'https://ice3x.com?ref=14342738';
} else if (safello_countries.indexOf(location.country_code) !== -1) {
window.location = 'https://app.safello.com/sdk/quickbuy.html?appId=4904c769-8a1d-43ca-8bd0-896520c94fdf&theme=bluewallet&layout=app&address=' + address;
} else {
window.location = 'https://old.changelly.com/?ref_id=rtagfcvnwiwvhm99';
}
}
});
</script>
</body>
</html>