Sha256: 5ef473f9b4993e1705440ef908a4508bae927098eb55e6d2bbb7b7a7c42b806d

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

<div id="paypal-button"></div>
<div data-pp-message data-pp-placement="payment" data-pp-amount="<%= @order.total %>"></div>

<script>
  var address = <%= sanitize SolidusPaypalBraintree::Address.new(current_order.ship_address).to_json %>

  var paypalOptions = {
    flow: '<%= SolidusPaypalBraintree::Gateway.first.preferred_paypal_flow %>',
    amount: '<%= current_order.total %>',
    currency: '<%= current_order.currency %>',
    enableShippingAddress: true,
    shippingAddressOverride: address,
    shippingAddressEditable: false,
    environment: '<%= Rails.env.production? ? "production" : "sandbox" %>',
    locale: '<%= paypal_button_preference(:paypal_button_locale, store: current_store) %>',
    style: {
      color: '<%= paypal_button_preference(:paypal_button_color, store: current_store) %>',
      shape: '<%= paypal_button_preference(:paypal_button_shape, store: current_store) %>',
      label: '<%= paypal_button_preference(:paypal_button_label, store: current_store) %>',
      layout: '<%= paypal_button_preference(:paypal_button_layout, store: current_store) %>',
      <% if paypal_button_preference(:paypal_button_layout, store: current_store) == "horizontal" %>
        tagline: '<%= paypal_button_preference(:paypal_button_tagline, store: current_store) %>',
      <% end %>
      messaging: '<%= paypal_button_preference(:paypal_button_messaging, store: current_store) %>'
    }
  }

  var button = new SolidusPaypalBraintree.createPaypalButton(document.querySelector("#paypal-button"), paypalOptions);
  button.initialize();
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_paypal_braintree-1.0.0 lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb