Sha256: f39994b66dc2a4862bde02d7c22afdc8f6afc5d4f7f007f28048ca8056dbe511

Contents?: true

Size: 610 Bytes

Versions: 2

Compression:

Stored size: 610 Bytes

Contents

$(window).bind("load", function() {
  Iugu.setAccountID("671e7c16-950b-4de4-9b29-2f441d66cd2c");
  Iugu.setTestMode(true);
  Iugu.setup();
});

jQuery(function($) {
  $('#catarse_iugu_form').submit(function submitIuguForm(evt) {
    var form = $(this);
    Iugu.createPaymentToken(this, tokenResponseHandler);
    return false;

    function tokenResponseHandler(data) {
      if (data.errors) {
        // console.log(data.errors);
        alert("Erro salvando cartão: " + JSON.stringify(data.errors));
      } else {
        $("#token").val( data.id );
        form.get(0).submit();
      }
    }
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
catarse_iugu-0.1.1 app/assets/javascripts/catarse_iugu.js
catarse_iugu-0.1 app/assets/javascripts/catarse_iugu.js