Sha256: 3c1f04e568a2433d55a4c19a37f477118b69e2ea6d51b6fb7c458619059669ff

Contents?: true

Size: 1.49 KB

Versions: 1

Compression:

Stored size: 1.49 KB

Contents

<%= render "spree/shared/paypal_braintree_head_scripts" %>

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

<script>
  var paypalOptions = {
    flow: '<%= SolidusPaypalBraintree::Gateway.first.preferred_paypal_flow %>',
    amount: '<%= current_order.total %>',
    currency: '<%= current_order.currency %>',
    enableShippingAddress: true,
    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 options = {
    restart_checkout: true
  }

  var button = new SolidusPaypalBraintree.createPaypalButton(
    document.querySelector("#paypal-button"),
    paypalOptions,
    options
  )

  button.initialize();
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_paypal_braintree-1.0.0 app/views/spree/shared/_paypal_cart_button.html.erb