Sha256: 124912aced72cedcab3b84be6db6204200a314fa1057079ab74a1f18459cf2c0

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

<% address = 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 SolidusPaypalBraintree.createApplePayButton(applePayButtonElement, applePayOptions);
  button.initialize();
</script>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_paypal_braintree-1.2.0 app/views/spree/shared/_apple_pay_button.html.erb
solidus_paypal_braintree-1.1.2 app/views/spree/shared/_apple_pay_button.html.erb
solidus_paypal_braintree-1.1.1 app/views/spree/shared/_apple_pay_button.html.erb
solidus_paypal_braintree-1.1.0 app/views/spree/shared/_apple_pay_button.html.erb
solidus_paypal_braintree-1.0.0 app/views/spree/shared/_apple_pay_button.html.erb