<fieldset data-hook="credit_card">
  <% if payment.source && payment.source.transaction_id && payment.source.transaction_response && payment.source.transaction_response.payment %>
    <legend align="center"><%= Spree.t(:credit_card) %></legend>
    <div class="row">
      <div class="alpha twelve columns">
        <dl>
          <dt><%= Spree.t(:transaction) %>:</dt>
          <dd><%= link_to payment.source.transaction_id, "https://app.paymill.com/transactions/#{payment.source.transaction_id}", target: "_blank" %></dd>
          <dt><%= Spree.t(:card) %>:</dt>
          <dd>XXXX-XXXX-XXXX-<%= payment.source.transaction_response.payment.last4.to_s %></dd>
          <dt><%= Spree.t(:expiration) %>:</dt>
          <dd><%= payment.source.transaction_response.payment.expire_month %>/<%= payment.source.transaction_response.payment.expire_year %></dd>
        </dl>
      </div>
    </div>
  <% else %>
    <legend align="center">No payment details available</legend>
  <% end %>
</fieldset>

<fieldset data-hook="credit_card">
  <% if payment.source && payment.source.transaction_id && payment.source.transaction_response && payment.source.transaction_response.payment %>
    <legend align="center"><%= Spree.t(:credit_card) %></legend>
    <div class="row">
      <div class="alpha twelve columns">
        <dl>
          <dt><%= Spree.t(:transaction) %>:</dt>
          <dd><%= link_to payment.source.transaction_id, "https://app.paymill.com/transactions/#{payment.source.transaction_id}", target: "_blank" %></dd>
          <dt><%= Spree.t(:card) %>:</dt>
          <% if payment.source.transaction_response.payment.kind_of?(Paymill::Payment) %>
            <dd>XXXX-XXXX-XXXX-<%= payment.source.transaction_response.payment.last4.to_s %></dd>
          <% else %>
            <dd>XXXX-XXXX-XXXX-<%= payment.source.transaction_response.payment["last4"] %></dd>
          <% end %>
          <dt><%= Spree.t(:expiration) %>:</dt>
          <dd><%= payment.source.transaction_response.payment.expire_month %>/<%= payment.source.transaction_response.payment.expire_year %></dd>
        </dl>
      </div>
    </div>
  <% else %>
    <legend align="center">No payment details available</legend>
  <% end %>
</fieldset>

Fix orders which may be stored as a hash
Fix orders which may be stored as a hash
