Sha256: 2808d7244d71d604bb1c1b955863346e784009e37de3998a46fa98b1fa273531

Contents?: true

Size: 1.72 KB

Versions: 4

Compression:

Stored size: 1.72 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,
    venmoFunding: <%= SolidusPaypalBraintree::Gateway.first.preferred_enable_venmo_funding %>,
    buyerCountry: '<%= SolidusPaypalBraintree::Gateway.first.preferred_force_buyer_country %>',
    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

4 entries across 4 versions & 1 rubygems

Version Path
solidus_paypal_braintree-1.2.0 lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb
solidus_paypal_braintree-1.1.2 lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb
solidus_paypal_braintree-1.1.1 lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb
solidus_paypal_braintree-1.1.0 lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb