<% id = payment_method.id %>

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

<% if current_store.braintree_configuration.paypal? %>
  <%= render "spree/shared/paypal_checkout_button" %>
<% end %>

<% if current_store.braintree_configuration.credit_card? %>
  <fieldset class="braintree-hosted-fields" data-braintree-hosted-fields data-id="<%= id %>">
    <%= render "spree/shared/braintree_hosted_fields", id: id %>
  </fieldset>
<% end %>

<% if current_store.braintree_configuration.apple_pay? %>
  <%= render "spree/shared/apple_pay_button" %>
<% end %>

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

<% id = payment_method.id %>

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

<% if current_store.braintree_configuration.paypal? %>
  <%= render "spree/shared/paypal_checkout_button" %>
<% end %>

<% if current_store.braintree_configuration.credit_card? %>
  <fieldset class="braintree-hosted-fields" data-braintree-hosted-fields data-id="<%= id %>">
    <%= render "spree/shared/braintree_hosted_fields", id: id %>
  </fieldset>
<% end %>

<% if current_store.braintree_configuration.apple_pay? %>
  <%= render "spree/shared/apple_pay_button", id: id %>
<% end %>

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

Fix undefined local variable or method `id' error
Fix undefined local variable or method `id' error

Closes #222. It adds an `id` local variable to `spree/shared/apple_pay_button` partial rendering in order to give such partial access to the payment method id.