<commit_before><script>
    var key = '<?php
        if($this->getMethod()->getConfigData('test_mode'))
            echo $this->getMethod()->getConfigData('test_open_key');
        else
            echo $this->getMethod()->getConfigData('live_open_key');
    ?>';
        if(StartCheckout){
            StartCheckout.config({
                key: key,
                label: 'Enter Your Card Details',
                form_label: 'Add Card',
                complete: function(params) {
                  submitFormWithToken(params); // params.token.id, params.email
                }
            });
        }

        function submitFormWithToken(params) {
          // params.token.id, params.email are passed

          // remove old values if any
          jQuery('input[name=payfortToken], input[name=payfortEmail]').remove();

          // Append the params to the form
          frmCheckout = jQuery("form#co-payment-form");
          frmCheckout.append("<input type='hidden' name='payfortToken' value='" + params.token.id + "'>");
          frmCheckout.append("<input type='hidden' name='payfortEmail' value='" + params.email + "'>");

          // Set text for entered card
          jQuery('#payfortCardDetails').show().html("<p>Pay with Card: xxxx-xxxx-xxxx-<b>" + params.token.card.last4 + "</b></p>");

          //hide button
          jQuery('#btnCheckout').hide();

          // show link to change card details
          jQuery('#changeCardBtn').show();
        }

        jQuery(document).on('click','#btnCheckout,#changeCardBtn', function(event) {
            event.preventDefault();
            StartCheckout.open({
              amount: quoteBaseGrandTotal*100, // e.g. 100 = $1.00
              currency: "<?php
                $quote = Mage::getSingleton('checkout/session')->getQuote();
                echo $quote->getOrderCurrencyCode()
              ?>", // supports USD, AED only for now
              email: "<?php echo $quote->getBillingAddress()->getEmail();?>" // should be a customer email from order info
            });
          });

</script>
<div class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
  <div>
      <button id="btnCheckout" class='button' >Place Order</button>
      <div id='payfortCardDetails'></div>
      <a id="changeCardBtn"  href="#_" style="display:none">Change Card Details</a>
  </div>
</div>
<div>
    <?php echo $this->getMethod()->getConfigData('message');?>
</div><commit_msg>fix button titles<commit_after><script>
    var key = '<?php
        if($this->getMethod()->getConfigData('test_mode'))
            echo $this->getMethod()->getConfigData('test_open_key');
        else
            echo $this->getMethod()->getConfigData('live_open_key');
    ?>';
        if(StartCheckout){
            StartCheckout.config({
                key: key,
                formLabel: 'Ok',
                complete: function(params) {
                  submitFormWithToken(params); // params.token.id, params.email
                }
            });
        }

        function submitFormWithToken(params) {
          // params.token.id, params.email are passed

          // remove old values if any
          jQuery('input[name=payfortToken], input[name=payfortEmail]').remove();

          // Append the params to the form
          frmCheckout = jQuery("form#co-payment-form");
          frmCheckout.append("<input type='hidden' name='payfortToken' value='" + params.token.id + "'>");
          frmCheckout.append("<input type='hidden' name='payfortEmail' value='" + params.email + "'>");

          // Set text for entered card
          jQuery('#payfortCardDetails').show().html("<p>Pay with Card: xxxx-xxxx-xxxx-<b>" + params.token.card.last4 + "</b></p>");

          //hide button
          jQuery('#btnCheckout').hide();

          // show link to change card details
          jQuery('#changeCardBtn').show();
        }

        jQuery(document).on('click','#btnCheckout,#changeCardBtn', function(event) {
            event.preventDefault();
            StartCheckout.open({
              amount: quoteBaseGrandTotal*100, // e.g. 100 = $1.00
              currency: "<?php
                $quote = Mage::getSingleton('checkout/session')->getQuote();
                echo $quote->getOrderCurrencyCode()
              ?>", // supports USD, AED only for now
              email: "<?php echo $quote->getBillingAddress()->getEmail();?>" // should be a customer email from order info
            });
          });

</script>
<div class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">
  <div>
      <button id="btnCheckout" class='button' >Enter Card Details</button>
      <div id='payfortCardDetails'></div>
      <a id="changeCardBtn"  href="#_" style="display:none">Change Card Details</a>
  </div>
</div>
<div>
    <?php echo $this->getMethod()->getConfigData('message');?>
</div>
{'fraction_non_alphanumeric': 0.16314935064935066, 'fraction_numerical': 0.004058441558441558, 'mean_word_length': 2.2991967871485945, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 79, 'https://': 0, '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': '6440603', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1354, 'n_words': 276}