Sha256: ba59bf0e2b3226c2c9fdc2991d5f7f276b433dee2660457ad228c1d2157136df

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

<% address = SolidusBraintree::Address.new(current_order.ship_address) %>

<button id="apple-pay-button" class="apple-pay-button"></button>

<script>
  var applePayButtonElement = document.getElementById('apple-pay-button');
  var applePayOptions = {
    paymentMethodId: <%= id %>,
    storeName: "<%= current_store.name %>",
    orderEmail: "<%= current_order.email %>",
    amount: "<%= current_order.total %>",
    shippingContact: {
      emailAddress: '<%= current_order.email %>',
      givenName: '<%= address.firstname %>',
      familyName: '<%= address.lastname %>',
      phoneNumber: '<%= address.phone %>',
      addressLines: ['<%= address.address1 %>','<%= address.address2 %>'],
      locality: '<%= address.city %>',
      administrativeArea: '<%= address.state.name %>',
      postalCode: '<%= address.zipcode %>',
      country: '<%= address.country.name %>',
      countryCode: '<%= address.country.iso %>'
    }
  };
  var button = new SolidusBraintree.createApplePayButton(applePayButtonElement, applePayOptions);
  button.initialize();
</script>

Version data entries

4 entries across 4 versions & 1 rubygems

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