You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey. Excellent script. I would like to use it in an Online Shop for Checkout.
I kinda hacked it in a way that now I remove and regenerate the DOM object of the button each time the value changes by calling this custom function:
varextCurrency='EUR';functionaddMetaMask(){if($('#metamask-checkout').length)$('#metamask-checkout').remove();// create div$('<div/>').addClass('eth-commerce-button').attr('id','metamask-checkout').appendTo("div.widget");// turn it into an ETHCommerce buttonvarethCommerce=newEthCommerce();ethCommerce.render({targetElement: 'metamask-checkout',type: 'PAY',amount: $('span.ct-cart-total').text().replace(/\D/g,''),currency: extCurrency,address: '0x11A7Ca870700f284e4647E55DeD9040f0F86D4D4'},(e)=>{console.log('error callback',e);},(tx)=>{console.log('success callback',tx);});}
It would be cool if your class had a function to update the amount in a more elegant way.
The text was updated successfully, but these errors were encountered:
Feature Request
Hey. Excellent script. I would like to use it in an Online Shop for Checkout.
I kinda hacked it in a way that now I remove and regenerate the DOM object of the button each time the value changes by calling this custom function:
It would be cool if your class had a function to update the amount in a more elegant way.
The text was updated successfully, but these errors were encountered: