Skip to content

Commit

Permalink
FIX: geoip
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Apr 23, 2021
1 parent 90614ca commit c8df03c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions buy-bitcoin-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}

$.ajax({
url: "https://ifconfig.co/json",
url: "https://geolocation-db.com/jsonp",
timeout: 5000,
jsonpCallback: "callback",
dataType: "jsonp",
Expand All @@ -66,22 +66,22 @@
window.location = moonpay_url;
},
success: function( location ) {
console.log('country_iso', location.country_iso);
if (force_country) location.country_iso = force_country;
if (safello_countries.indexOf(location.country_iso) !== -1) {
console.log('country_code', location.country_code);
if (force_country) location.country_code = force_country;
if (safello_countries.indexOf(location.country_code) !== -1) {
var safello_url = 'https://app.safello.com/sdk/quickbuy.html?appId=4904c769-8a1d-43ca-8bd0-896520c94fdf&utm_source=BlueWallet&utm_medium=Wallet&country=' + location.country_code + '&theme=bluewallet&layout=app&address=' + address;

if (safello_state_token) {
safello_url += '&stateToken=' + safello_state_token
}

window.location = safello_url
} else if (xanpool_countries.indexOf(location.country_iso) !== -1) {
} else if (xanpool_countries.indexOf(location.country_code) !== -1) {
var xanpool_url = "https://widget.xanpool.com/?apiKey=7e3o3bzh5f2opybhhkqgo63yfbqykmll&cryptoCurrency=btc&transactionType=buy&isWebView=true";
if (address) xanpool_url += "&wallet=" + address;
if (xanpool_currencies.indexOf(currency) !== -1) xanpool_url += "&currency=" + currency;
window.location = xanpool_url;
} else if (mercuryo_countries.indexOf(location.country_iso) !== -1) {
} else if (mercuryo_countries.indexOf(location.country_code) !== -1) {
var mercuryo_url = "https://exchange.mercuryo.io/?widget_id=4d94cb57-60a4-4804-82a8-257aa94bcb73&hide_address=true&utm_source=BlueWallet&utm_medium=referral&type=buy&currency=BTC&fix_currency=true";
if (address) mercuryo_url += "&address=" + address;
if (mercuryo_currencies.indexOf(currency) !== -1) mercuryo_url += "&fiat_currency=" + currency;
Expand Down

0 comments on commit c8df03c

Please sign in to comment.