Skip to content

Commit

Permalink
FIX: new geoip for buy-bitcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Apr 22, 2021
1 parent 7682721 commit 90614ca
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions buy-bitcoin-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<noscript>
<meta http-equiv="Refresh" content="0;URL=https://exchange.mercuryo.io/?widget_id=4d94cb57-60a4-4804-82a8-257aa94bcb73&utm_source=BlueWallet&utm_medium=referral&type=buy&currency=BTC&fix_currency=true"/>
<meta http-equiv="Refresh" content="0;URL=https://moonpay-redirect.herokuapp.com/?apiKey=pk_live_IkhSI2lIXSiolwakfd95QFD4p3908cZa&enabledPaymentMethods=credit_debit_card%2Capple_pay%2Csepa_bank_transfer%2Cgbp_bank_transfer%2Cgoogle_pay%2Csamsung_pay&currencyCode=BTC&colorCode=%2368BBE1&showWalletAddressForm=false"/>
</noscript>
<style>
.lds-dual-ring {
Expand Down Expand Up @@ -55,32 +55,33 @@
}

$.ajax({
url: "https://geolocation-db.com/jsonp",
url: "https://ifconfig.co/json",
timeout: 5000,
jsonpCallback: "callback",
dataType: "jsonp",
error: function() {
window.location = 'https://exchange.mercuryo.io/?widget_id=4d94cb57-60a4-4804-82a8-257aa94bcb73&utm_source=BlueWallet&utm_medium=referral&type=buy&currency=BTC&fix_currency=true';
var moonpay_url = 'https://moonpay-redirect.herokuapp.com/?apiKey=pk_live_IkhSI2lIXSiolwakfd95QFD4p3908cZa&enabledPaymentMethods=credit_debit_card%2Capple_pay%2Csepa_bank_transfer%2Cgbp_bank_transfer%2Cgoogle_pay%2Csamsung_pay&currencyCode=BTC&colorCode=%2368BBE1&showWalletAddressForm=false';
if (address) moonpay_url += '&walletAddress=' + address;
if (moonpay_currencies.indexOf(currency) !== -1) moonpay_url += '&baseCurrencyCode=' + currency;
window.location = moonpay_url;
},
success: function( location ) {
console.log('country_code', location.country_code);
if (force_country) location.country_code = force_country;
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) {
console.log('country_iso', location.country_iso);
if (force_country) location.country_iso = force_country;
if (safello_countries.indexOf(location.country_iso) !== -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_code) !== -1) {
} else if (xanpool_countries.indexOf(location.country_iso) !== -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_code) !== -1) {
} else if (mercuryo_countries.indexOf(location.country_iso) !== -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 90614ca

Please sign in to comment.