/** Insert the following in the head tags
<script src='coinbaseButtons.js'></script>
**/
function getCoinbaseButtonAsString(buttonId,custom){
return "<div id='buttonCode'><a class='buy-with-crypto' onclick='javascript:checkForPayment()' data-custom='"+custom+"' href='https://commerce.coinbase.com/checkout/"+buttonId+"'>Bet</a></div>";
//data-cache-disabled='true' removed for caching
}
function loadScript(){
var scriptElement=document.createElement('script');
var buttonCode=document.getElementById('buttonCode');
scriptElement.src="https://commerce.coinbase.com/v1/checkout.js?onload=callBackFunction";
buttonCode.append(scriptElement);}
function callBackFunction(){
BuyWithCrypto.registerCallback('onFailure', function(e){
});
BuyWithCrypto.registerCallback('onSuccess', function(e){
});
BuyWithCrypto.registerCallback('onPaymentDetected', function(e){
});
}
function getButtonId(optionAmount){
if(optionAmount=='$5.00'){
return 'f9cfa1cc-b72f-495c-8c3e-13cf3f266aeb';
}
if(optionAmount=='$10.00'){
return 'acf1b02d-641a-4b2a-9ca8-b9c3ec098515';
}
if(optionAmount=='$20.00'){
return '3c97ca48-592f-4283-915a-b9018e47507f';
}
if(optionAmount=='$50.00'){
return '12f30b4e-646c-4d55-a453-5b8993d72cc8';
}
if(optionAmount=='$100.00'){
return 'c9675d66-13bc-407a-8110-724bb81fefcf';
}
}