forked from BlueWallet/Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<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://moonpay-redirect.herokuapp.com/?apiKey=pk_live_IkhSI2lIXSiolwakfd95QFD4p3908cZa&enabledPaymentMethods=credit_debit_card%2Capple_pay%2Csepa_bank_transfer%2Cgbp_bank_transfer%2Cgoogle_pay%2Csamsung_pay¤cyCode=BTC&colorCode=%2368BBE1&showWalletAddressForm=false"/> | ||
</noscript> | ||
<style> | ||
.lds-dual-ring { | ||
display: block; | ||
width: 64px; | ||
height: 64px; | ||
margin: auto; | ||
} | ||
.lds-dual-ring:after { | ||
content: " "; | ||
display: block; | ||
width: 46px; | ||
height: 46px; | ||
margin: 1px; | ||
border-radius: 50%; | ||
border: 5px solid #CCDDF9; | ||
border-color: #CCDDF9 transparent #CCDDF9 transparent; | ||
animation: lds-dual-ring 1.2s linear infinite; | ||
} | ||
@keyframes lds-dual-ring { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="lds-dual-ring"></div> | ||
<script> | ||
var safello_countries = ["SE"]; | ||
var xanpool_countries = []; // + "SG", "HK", "ID" | ||
var moonpay_currencies = ["AUD", "BGN", "BRL", "CAD", "CHF", "CNY", "COP", "CZK", "DKK", "DOP", "EGP", "EUR", "GBP", "HKD", "HRK", "IDR", "ILS", "JOD", "JPY", "KES", "KRW", "KWD", "LKR", "MAD", "MXN", "MYR", "NGN", "NOK", "NZD", "OMR", "PEN", "PKR", "PLN", "RON", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "USD", "VND", "ZAR"]; // curl -s https://api.moonpay.io/v3/currencies?apiKey=pk_live_IkhSI2lIXSiolwakfd95QFD4p3908cZa | jq '.' | grep fiat -A 2 | grep code | ||
var xanpool_currencies = ["SGD", "HKD", "THB", "PHP", "INR", "IDR", "VND", "MYR", "SGD", "HKD", "PHP", "INR", "VND", "THB"]; | ||
var mercuryo_countries = []; | ||
var mercuryo_currencies = ["EUR", "RUB", "USD", "IDR", "KRW", "JPY", "TRY", "GBP", "UAH", "ARS"]; | ||
var u = new URLSearchParams(window.location.search); | ||
var address = u.get('address') || ''; | ||
var currency = u.get('currency') || ''; | ||
var force_country = u.get('force_country') || ''; | ||
var safello_state_token = u.get('safelloStateToken') | ||
if (safello_state_token == 'TEST') { | ||
// for the sake of testing | ||
alert(safello_state_token); | ||
throw new Error("Script execution terminated"); | ||
} | ||
|
||
$.ajax({ | ||
url: "https://geolocation-db.com/jsonp", | ||
timeout: 5000, | ||
jsonpCallback: "callback", | ||
dataType: "jsonp", | ||
error: function() { | ||
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¤cyCode=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 (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_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 += "¤cy=" + currency; | ||
window.location = xanpool_url; | ||
} 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¤cy=BTC&fix_currency=true"; | ||
if (address) mercuryo_url += "&address=" + address; | ||
if (mercuryo_currencies.indexOf(currency) !== -1) mercuryo_url += "&fiat_currency=" + currency; | ||
window.location = mercuryo_url; | ||
} else { | ||
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¤cyCode=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; | ||
} | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |