Sha256: 10c2f56d28b57750bd80815eaa39774ade23650141a64100ddf90356e491ec55

Contents?: true

Size: 858 Bytes

Versions: 1

Compression:

Stored size: 858 Bytes

Contents

<%= javascript_include_tag 'https://checkout.stripe.com/v2/checkout.js' %>
<script type="text/javascript">
  $('#bodega-checkout').click(function(event) {
    event.preventDefault();
    var button = $(this);
    var form = button.parents('form');

    var token = function(response) {
      button.attr('name', '');
      input = $('<input type="hidden" name="stripe" />').val(response.id);
      form.append('<input type="hidden" name="checkout" value="1" />');
      form.append(input).submit();
    };

    StripeCheckout.open({
      key: <%= Bodega.config.stripe.publishable_key.inspect.html_safe %>,
      amount: <%= current_order.total_cents %>,
      name: <%= Bodega.config.store_name.inspect.html_safe %>,
      description: <%= current_order.summary.inspect.html_safe %>,
      panelLabel: 'Confirm:',
      token: token
    });
  });
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bodega-0.4.9 app/views/bodega/orders/_stripe.html.erb