<commit_before><div class="affirm-learn-more-section">
  <%= render partial: 'spree/checkout/affirm/learn_more' %>
</div>

<script>
  $(window).load(function(){
    console.log('affirm-ative')
    affirmSetup();
  })

  function affirmSetup(){
    /* only include this setup once */
    

    /*****************************************************\
        Include the affirm js snippet
    \*****************************************************/
    var _affirm_config = {
      public_api_key: "<%= payment_method.preferred_api_key %>",
      script: "https://<%= payment_method.preferred_server %>/js/v2/affirm.js"
    };
    (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=["get","token","url","items"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,"affirm","checkout","ui","script","ready");

    /*****************************************************\
        set the shared checkout data
    \*****************************************************/
    affirm.checkout({
      total:                <%= (@order.total * 100).to_i %>,
      currency:             "USD",
      tax_amount:           <%= (@order.additional_tax_total * 100).to_i %>,
      checkout_id:          "<%= @order.number %>",
      discount_code:        "<%= @order.coupon_code %>",
      shipping_type:        "",
      shipping_amount:      0,

      shipping: {
        name: {
          full:  "<NAME>",
        },
        address: {
          line1:        "32 Cooper Square",
          line2:        "2nd Floor",
          city:         "New York",
          state:        "NY",
          country:      "USA",
          zipcode:      "10003",
        }
      },

      billing: {
        email: "<%= @order.email %>",
        name: {
          full:   "<%= @order.bill_address.full_name %>"
        },
        address: {
          line1:          "<%= @order.bill_address.address1 %>",
          line2:          "<%= @order.bill_address.address2 %>",
          city:           "<%= @order.bill_address.city %>",
          state:          "<%= @order.bill_address.state_text %>",
          country:        "<%= @order.bill_address.country.iso %>",
          zipcode:        "<%= @order.bill_address.zipcode %>",
        }
      },


      meta: {
        source: {
          client_name: "spree_affirm",
          version: "<%= Spree::Gateway::Affirm.version %>",
          data: {
            <% if spree_current_user %>
              order_count: "<%= spree_current_user.orders.complete.count %>",
              account_created: "<%= spree_current_user.created_at %>",

              <% if spree_current_user.orders.complete.any? %>
                last_order_date: "<%= spree_current_user.orders.complete.last.completed_at %>",
              <% end %>

            <% end %>
            is_logged_in: <%= !!spree_current_user %>,
            spree_version: "<%= Spree.version %>"
          }
        }
      },

      merchant: {
        user_confirmation_url:    "<%= confirm_affirm_url(:payment_method_id => payment_method.id) %>",<commit_msg>reset billing to consumer info<commit_after><div class="affirm-learn-more-section">
  <%= render partial: 'spree/checkout/affirm/learn_more' %>
</div>

<script>
  $(window).load(function(){
    console.log('affirm-ative')
    affirmSetup();
  })

  function affirmSetup(){
    /* only include this setup once */
    

    /*****************************************************\
        Include the affirm js snippet
    \*****************************************************/
    var _affirm_config = {
      public_api_key: "<%= payment_method.preferred_api_key %>",
      script: "https://<%= payment_method.preferred_server %>/js/v2/affirm.js"
    };
    (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=["get","token","url","items"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,"affirm","checkout","ui","script","ready");

    /*****************************************************\
        set the shared checkout data
    \*****************************************************/
    affirm.checkout({
      total:                <%= (@order.total * 100).to_i %>,
      currency:             "USD",
      tax_amount:           <%= (@order.additional_tax_total * 100).to_i %>,
      checkout_id:          "<%= @order.number %>",
      discount_code:        "<%= @order.coupon_code %>",
      shipping_type:        "",
      shipping_amount:      0,

      shipping: {
        name: {
          full:   "<%= @order.bill_address.full_name %>"
        },
        address: {
          line1:          "<%= @order.bill_address.address1 %>",
          line2:          "<%= @order.bill_address.address2 %>",
          city:           "<%= @order.bill_address.city %>",
          state:          "<%= @order.bill_address.state_text %>",
          country:        "<%= @order.bill_address.country.iso %>",
          zipcode:        "<%= @order.bill_address.zipcode %>"
        }
      },

      billing: {
        email: "<%= @order.email %>",
        name: {
          full:   "<%= @order.bill_address.full_name %>"
        },
        address: {
          line1:          "<%= @order.bill_address.address1 %>",
          line2:          "<%= @order.bill_address.address2 %>",
          city:           "<%= @order.bill_address.city %>",
          state:          "<%= @order.bill_address.state_text %>",
          country:        "<%= @order.bill_address.country.iso %>",
          zipcode:        "<%= @order.bill_address.zipcode %>"
        }
      },


      meta: {
        source: {
          client_name: "spree_affirm",
          version: "<%= Spree::Gateway::Affirm.version %>",
          data: {
            <% if spree_current_user %>
              order_count: "<%= spree_current_user.orders.complete.count %>",
              account_created: "<%= spree_current_user.created_at %>",

              <% if spree_current_user.orders.complete.any? %>
                last_order_date: "<%= spree_current_user.orders.complete.last.completed_at %>",
              <% end %>

            <% end %>
            is_logged_in: <%= !!spree_current_user %>,
            spree_version: "<%= Spree.version %>"
          }
        }
      },

      merchant: {
        user_confirmation_url:    "<%= confirm_affirm_url(:payment_method_id => payment_method.id) %>",
{'fraction_non_alphanumeric': 0.2410112359550562, 'fraction_numerical': 0.0064606741573033704, 'mean_word_length': 2.382897862232779, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 71, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1209454', 'n_tokens_mistral': 2380, 'n_tokens_neox': 2250, 'n_words': 268}