diff --git a/js/gratipay/payments.js b/js/gratipay/payments.js index 131d96ba2f..ac45b535a2 100644 --- a/js/gratipay/payments.js +++ b/js/gratipay/payments.js @@ -331,16 +331,24 @@ Gratipay.payments.cc.submit = function(e) { Gratipay.payments.bc = {}; Gratipay.payments.bc.init = function () { - $('form#bitcoin-payin').submit(Gratipay.payments.bc.createOrder); + $('button#pay').click(Gratipay.payments.bc.createOrder); }; Gratipay.payments.bc.createOrder = function () { var amount = $('form#bitcoin-payin input#amount').val(); + $('button#pay').prop('disabled', true); jQuery.ajax({ url: "/" + Gratipay.username + "/routes/bitcoin-payin.json", - data: { amount: amount }, + data: {}, type: "POST", - success: function(data) {}, + success: function(data) { + var iframe = $(''); + $('button#pay').remove(); + $('.coinbase-box').append(iframe); + }, error: Gratipay.error }); return false; diff --git a/www/%username/routes/bitcoin-payin.html.spt b/www/%username/routes/bitcoin-payin.html.spt index 7c5ce4cbb5..d668932cac 100644 --- a/www/%username/routes/bitcoin-payin.html.spt +++ b/www/%username/routes/bitcoin-payin.html.spt @@ -12,7 +12,6 @@ title = _("Bitcoin Payin")
{{ _("We currently support one-time payins via Bitcoin.") }} {{ _("You can either send bitcoins manually, or use your coinbase account to complete the transaction.") }} - {% endblock %} {% block scripts %} @@ -29,16 +28,14 @@ title = _("Bitcoin Payin") {% endblock %} {% block content %} - {% if user.ANON %} - {% include "templates/sign-in-using.html" %} - {{ _("and then you'll be able to payin with bitcoin.") }} - {% else %} -
- - {% endif %} + + {% if user.ANON %} + {% include "templates/sign-in-using.html" %} + {{ _("and then you'll be able to payin with bitcoin.") }} + {% else %} +