Sha256: 6497f19c4f7b1a14080af8f45b7c639429b4fe0a1c21f36b60a6bff9fa706638

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

<%= button_tag '', id: 'venmo-button', class: 'venmo-button', type: 'button' %>

<% store = Spree::Store.default %>
<% style = venmo_button_style(store) %>

<style>
  .venmo-button {
    width: <%= style[:width] %>px;
    background-image: url('<%= venmo_button_asset_url(style)%>');
  }
  .venmo-button:active, .venmo-button:hover {
    background-color: transparent !important;
    background-image: url('<%= venmo_button_asset_url(style, active: true)%>') !important;
  }
</style>

<% prefix = "payment_source[#{payment_method.id}]" %>

<div class="venmo-fields">
  <div class="clear"></div>
  <input disabled type="hidden" name="<%= prefix %>[payment_type]" value="<%= SolidusBraintree::Source::VENMO %>">
  <input disabled type="hidden" id="venmo_payment_method_nonce" name="<%= prefix %>[nonce]">
</div>

<script>
  var venmoButtonElement = document.getElementById('venmo-button');
  var venmoOptions = {
    newBrowserTabSupported: <%= SolidusBraintree::Gateway.first.preferred_venmo_new_tab_support %>,
    flow: '<%= SolidusBraintree::Gateway.first.preferred_paypal_flow %>'
  };
  var button = new SolidusBraintree.createVenmoButton(venmoButtonElement, venmoOptions);
  button.initialize();
</script>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_braintree-3.2.0 lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_venmo_button.html.erb
solidus_braintree-3.1.0 lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_venmo_button.html.erb
solidus_braintree-3.0.1 lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_venmo_button.html.erb
solidus_braintree-3.0.0 lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_venmo_button.html.erb
solidus_braintree-2.0.0 app/views/spree/shared/_venmo_button.html.erb