Plugin Directory

Changeset 3252230


Ignore:
Timestamp:
03/07/2025 02:54:11 PM (12 months ago)
Author:
markhagan
Message:

V1.5.18 Release

  • Vulnerability fixes
Location:
securesubmit/trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • securesubmit/trunk/README.md

    r3218401 r3252230  
    4343
    4444## Changelog
     45#### 1.5.18
     46* Vulnerability fixes
     47
    4548#### 1.5.17
    4649* Bugfix: Corrected gateway endpoints
  • securesubmit/trunk/SecureSubmit.php

    r3218401 r3252230  
    55Description: Heartland Payment Systems SecureSubmit Plugin
    66Author: SecureSubmit
    7 Version: 1.5.17
     7Version: 1.5.18
    88Author URI: https://developer.heartlandpaymentsystems.com/SecureSubmit
    99*/
     
    201201        <!-- Start Page Wrapper -->
    202202        <div class="wrap ss-wrap">
    203             <h1 class="ss-wp-heading-inline"><span class="hidden-small">SecureSubmit Donate / Pay Now&nbsp;</span><?php echo (isset($title) ? $title : esc_html(get_admin_page_title())) ?></h1>
     203            <h1 class="ss-wp-heading-inline"><span class="hidden-small">SecureSubmit Donate / Pay Now&nbsp;</span><?php echo (isset($title) ? esc_html($title) : esc_html(get_admin_page_title())) ?></h1>
    204204            <div id="message" class="updated hidden">
    205205                <p></p>
     
    225225                        ?>
    226226                        <div class="ss-checkbox">
    227                             <input type="checkbox" id="enable_button_builder" <?php echo $ischecked; ?> />
     227                            <input type="checkbox" id="enable_button_builder" <?php echo esc_html($ischecked); ?> />
    228228                            <label for="enable_button_builder" class="ss-checkbox-label">Enable Button Builder</label>
    229229                        </div>
     
    234234                            $ischecked = "checked='checked'";
    235235                        ?>
    236                                 <input type="checkbox" id="enable_recaptcha" <?php echo $ischecked; ?> />
     236                                <input type="checkbox" id="enable_recaptcha" <?php echo esc_html($ischecked); ?> />
    237237                                <label for="enable_recaptcha" class="ss-checkbox-label">Enable Google Recaptcha</label>
    238238                                <br /><span class="ss-subtext">Non-modal only. What is <a target="_blank" href="https://www.google.com/recaptcha/intro/index.html">Google ReCaptcha</a>?</span>
     
    253253                            $ischecked = "checked='checked'";
    254254                        ?>
    255                             <input type="checkbox" id="enable_fraud" <?php echo $ischecked; ?> />
     255                            <input type="checkbox" id="enable_fraud" <?php echo esc_html($ischecked); ?> />
    256256                            <label for="enable_fraud" class="ss-checkbox-label">Enable Fraud Options</label>
    257257                    </div>
     
    262262                        ?>
    263263                        <label for="fraud_message">Displayed Message:</label>
    264                             <textarea id="fraud_message"><?php echo wp_sprintf('%s',$fraud_message); ?></textarea>
     264                            <textarea id="fraud_message"><?php echo wp_sprintf('%s',esc_html($fraud_message)); ?></textarea>
    265265                            <?php
    266266                        $fraud_velocity_attempts = 0;
     
    269269                        ?>
    270270                                <label for="fraud_velocity_attempts">How many failed attempts before blocking?</label>
    271                                     <input type="text" id="fraud_velocity_attempts" <?php echo $fraud_velocity_attempts; ?> />
     271                                    <input type="text" id="fraud_velocity_attempts" <?php echo esc_html($fraud_velocity_attempts); ?> />
    272272                                    <?php
    273273                        $fraud_velocity_timeout = 0;
     
    276276                        ?>
    277277                                        <label for="fraud_velocity_timeout">How long (in minutes) should we keep a tally of recent failures?</label>
    278                                             <input type="text" id="fraud_velocity_timeout" <?php echo $fraud_velocity_timeout; ?> />
     278                                            <input type="text" id="fraud_velocity_timeout" <?php echo esc_html($fraud_velocity_timeout); ?> />
    279279                </div>
    280280                <!-- End Fraud Options Panel -->
     
    388388            </style>
    389389                <div class="wrap ss-wrap">
    390                     <h1 class="ss-wp-heading-inline"><span class="hidden-small">SecureSubmit Donate / Pay Now&nbsp;</span><?php echo (isset($title) ? $title : esc_html(get_admin_page_title())) ?></h1>
     390                    <h1 class="ss-wp-heading-inline"><span class="hidden-small">SecureSubmit Donate / Pay Now&nbsp;</span><?php echo (isset($title) ? esc_html($title) : esc_html(get_admin_page_title())) ?></h1>
    391391                    <form name="report_data" method="post" action="admin.php?page=sub-reporting">
    392392                        <div id="message" class="updated hidden">
     
    411411                    </form>
    412412                    <?php if($_SERVER['REQUEST_METHOD'] =='POST'){
    413                     $transactions = $wpdb->get_results('select * from '.$table_name.' order by id desc limit 10000;' , 'ARRAY_A');
     413                    $transactions = $wpdb->get_results( $wpdb->prepare("SELECT * FROM %s order by id desc limit 10000",$table_name ) , 'ARRAY_A' );
    414414                    $count = 0;
    415415                    ?>
     
    460460                        } ?>
    461461                            <td>
    462                                 <?php echo $row['transaction_id']; ?>
     462                                <?php echo esc_html($row['transaction_id']); ?>
    463463                            </td>
    464464                            <td>
    465                                 <?php echo $row['amount']; ?>
     465                                <?php echo esc_html($row['amount']); ?>
    466466                            </td>
    467467                            <td>
    468                                 <?php echo $row['product_id']; ?>
     468                                <?php echo esc_html($row['product_id']); ?>
    469469                            </td>
    470470                            <td>
    471                                 <?php echo $row['time']; ?>
     471                                <?php echo esc_html($row['time']); ?>
    472472                            </td>
    473473                            <td>
    474                                 <?php echo $row['billing_name']; ?>
     474                                <?php echo esc_html($row['billing_name']); ?>
    475475                            </td>
    476476                            <td>
    477                                 <?php echo $row['billing_address']; ?>
     477                                <?php echo esc_html($row['billing_address']); ?>
    478478                            </td>
    479479                            <td>
    480                                 <?php echo $row['billing_city']; ?>
     480                                <?php echo esc_html($row['billing_city']); ?>
    481481                            </td>
    482482                            <td>
    483                                 <?php echo $row['billing_state']; ?>
     483                                <?php echo esc_html($row['billing_state']); ?>
    484484                            </td>
    485485                            <td>
    486                                 <?php echo $row['billing_zip']; ?>
     486                                <?php echo esc_html($row['billing_zip']); ?>
    487487                            </td>
    488488                            <td>
    489                                 <?php echo $row['billing_email']; ?>
     489                                <?php echo esc_html($row['billing_email']); ?>
    490490                            </td>
    491491                            <?php if($shipping){ ?>
    492492                                <td>
    493                                     <?php echo $row['shipping_name']; ?>
     493                                    <?php echo esc_html($row['shipping_name']); ?>
    494494                                </td>
    495495                                <td>
    496                                     <?php echo $row['shipping_address']; ?>
     496                                    <?php echo esc_html($row['shipping_address']); ?>
    497497                                </td>
    498498                                <td>
    499                                     <?php echo $row['shipping_city']; ?>
     499                                    <?php echo esc_html($row['shipping_city']); ?>
    500500                                </td>
    501501                                <td>
    502                                     <?php echo $row['shipping_state']; ?>
     502                                    <?php echo esc_html($row['shipping_state']); ?>
    503503                                </td>
    504504                                <td>
    505                                     <?php echo $row['shipping_zip']; ?>
     505                                    <?php echo esc_html($row['shipping_zip']); ?>
    506506                                </td>
    507507                            <?php }
    508508                            if($additional){ ?>
    509509                                <td>
    510                                     <?php echo $row['additional_info1']; ?>
     510                                    <?php echo esc_html($row['additional_info1']); ?>
    511511                                </td>
    512512                                <td>
    513                                     <?php echo $row['additional_info2']; ?>
     513                                    <?php echo esc_html($row['additional_info2']); ?>
    514514                                </td>
    515515                                <td>
    516                                     <?php echo $row['additional_info3']; ?>
     516                                    <?php echo esc_html($row['additional_info3']); ?>
    517517                                </td>
    518518                                <td>
    519                                     <?php echo $row['additional_info4']; ?>
     519                                    <?php echo esc_html($row['additional_info4']); ?>
    520520                                </td>
    521521                                <td>
    522                                     <?php echo $row['additional_info5']; ?>
     522                                    <?php echo esc_html($row['additional_info5']); ?>
    523523                                </td>
    524524                                <td>
    525                                     <?php echo $row['additional_info6']; ?>
     525                                    <?php echo esc_html($row['additional_info6']); ?>
    526526                                </td>
    527527                                <td>
    528                                     <?php echo $row['additional_info7']; ?>
     528                                    <?php echo esc_html($row['additional_info7']); ?>
    529529                                </td>
    530530                                <td>
    531                                     <?php echo $row['additional_info8']; ?>
     531                                    <?php echo esc_html($row['additional_info8']); ?>
    532532                                </td>
    533533                                <td>
    534                                     <?php echo $row['additional_info9']; ?>
     534                                    <?php echo esc_html($row['additional_info9']); ?>
    535535                                </td>
    536536                                <td>
    537                                     <?php echo $row['additional_info10']; ?>
     537                                    <?php echo esc_html($row['additional_info10']); ?>
    538538                                </td>
    539539                            <?php } ?>
     
    555555            if ( ! empty( $siteName ) )
    556556                $siteName .= '.';
    557             $fileName = $siteName . 'users.' . date( 'Y-m-d-H-i-s' ) . '.csv';
     557            $fileName = $siteName . 'users.' . gmdate( 'Y-m-d-H-i-s' ) . '.csv';
    558558
    559559
     
    569569                'additional_info8','additional_info9','additional_info10');
    570570
    571 
    572             $transactions = $wpdb->get_results('select * from '.$table_name.' order by id desc;' , 'ARRAY_A');
     571            $transactions = $wpdb->get_results( $wpdb->prepare("SELECT * FROM %s order by id desc",$table_name ) , 'ARRAY_A' );
    573572
    574573            $headers = array();
    575574            foreach ( $fields as $key => $field ) {
    576                 $headers[] = '"' . strtolower( $field ) . '"';
     575                $headers[] = '"' . esc_html( strtolower( $field ) ). '"';
    577576            }
    578577            echo implode( ',', $headers ) . "\n";
     
    582581                    $value = isset( $transaction[$field] ) ? $transaction[$field] : '';
    583582                    $value = is_array( $value ) ? serialize( $value ) : $value;
    584                     $data[] = '"' . str_replace( '"', '""', $value ) . '"';
     583                    $data[] = '"' . esc_html( str_replace( '"', '""', $value ) ) . '"';
    585584                }
    586585                echo implode( ',', $data ) . "\n";
     
    594593        ?>
    595594        <div class="wrap ss-wrap">
    596             <h1 class="ss-wp-heading-inline"><span class="hidden-small">SecureSubmit Donate / Pay Now&nbsp;</span><?php echo (isset($title) ? $title : esc_html(get_admin_page_title())) ?></h1>
     595            <h1 class="ss-wp-heading-inline"><span class="hidden-small">SecureSubmit Donate / Pay Now&nbsp;</span><?php echo (isset($title) ? esc_html($title) : esc_html(get_admin_page_title())) ?></h1>
    597596            <div id="message" class="updated hidden">
    598597                <p></p>
     
    701700        $shippingRequired = $requireShipping ? ' required' : '';
    702701        if ($modal) { ?>
    703             <div id="<?php echo $prefix; ?>_donation">
     702            <div id="<?php echo esc_html($prefix); ?>_donation">
    704703            </div>
    705704            <script language="javascript" type="text/javascript">
    706705                <?php if ($requireShipping) { ?>
    707                     var <?php echo $prefix; ?>_requireShipping = true;
     706                    var <?php echo esc_html($prefix); ?>_requireShipping = true;
    708707                <?php } else { ?>
    709                     var <?php echo $prefix; ?>_requireShipping = false;
     708                    var <?php echo esc_html($prefix); ?>_requireShipping = false;
    710709                <?php } ?>
    711710
    712711                <?php if ($requireBilling) { ?>
    713                     var <?php echo $prefix; ?>_requireBilling = true;
     712                    var <?php echo esc_html($prefix); ?>_requireBilling = true;
    714713                <?php } else { ?>
    715                     var <?php echo $prefix; ?>_requireBilling = false;
     714                    var <?php echo esc_html($prefix); ?>_requireBilling = false;
    716715                <?php } ?>
    717716
    718717                <?php
    719718                if(count($additionalFields)>0){
    720                     echo "var " . $prefix . "_requireAdditionalInfo = true;";
     719                    echo "var " . esc_html($prefix) . "_requireAdditionalInfo = true;";
    721720                } else {
    722                     echo "var " . $prefix . "_requireAdditionalInfo = false;";
     721                    echo "var " . esc_html($prefix) . "_requireAdditionalInfo = false;";
    723722                }
    724723                ?>
     
    728727                });
    729728                if (jQuery('#sss').length == 0)
    730                     jQuery('head').append(jQuery('<link rel="stylesheet" type="text/css" />').attr('href', '<?php echo plugins_url('assets/paybutton.css', __FILE__ ); ?>').attr('id', 'sss'));
    731 
    732                 var trigger_button = jQuery("<div class='pay-button button-main'><a href='#Purchase' id='<?php echo $prefix; ?>_pay_now'><?php echo $buttonText; ?></a><div class='pay-button-border'>&nbsp;</div></div>");
    733                 jQuery('#<?php echo $prefix; ?>_donation').append(trigger_button);
    734 
    735                 jQuery('#<?php echo $prefix; ?>_pay_now').unbind().bind('click', function () {
    736                     <?php echo $prefix; ?>_trigger_payment();
     729                    jQuery('head').append(jQuery('<link rel="stylesheet" type="text/css" />').attr('href', '<?php echo esc_html(plugins_url('assets/paybutton.css', __FILE__ )); ?>').attr('id', 'sss'));
     730
     731                var trigger_button = jQuery("<div class='pay-button button-main'><a href='#Purchase' id='<?php echo esc_html($prefix); ?>_pay_now'><?php echo esc_html($buttonText); ?></a><div class='pay-button-border'>&nbsp;</div></div>");
     732                jQuery('#<?php echo esc_html($prefix); ?>_donation').append(trigger_button);
     733
     734                jQuery('#<?php echo esc_html($prefix); ?>_pay_now').unbind().bind('click', function () {
     735                    <?php echo esc_html($prefix); ?>_trigger_payment();
    737736                });
    738737
    739738                // BUILD CONTROLS
    740                 var <?php echo $prefix; ?>_modal_html = "<a class='boxclose modal-close' id='boxclose'>&times;</a>";
     739                var <?php echo esc_html($prefix); ?>_modal_html = "<a class='boxclose modal-close' id='boxclose'>&times;</a>";
    741740
    742741                // HEADER
    743                 <?php echo $prefix; ?>_modal_html += "<div id='modal-header'>";
    744 
    745                 <?php echo $prefix; ?>_modal_html += "<div style='float: left;'>";
     742                <?php echo esc_html($prefix); ?>_modal_html += "<div id='modal-header'>";
     743
     744                <?php echo esc_html($prefix); ?>_modal_html += "<div style='float: left;'>";
    746745                <?php if (!isset($atts["productimage"])) { ?>
    747                     <?php echo $prefix; ?>_modal_html += "<img src='<?php echo plugins_url('assets/donation.png', __FILE__); ?>' class='checkout-product-image' />";
     746                    <?php echo esc_html($prefix); ?>_modal_html += "<img src='<?php echo esc_html(plugins_url('assets/donation.png', __FILE__)); ?>' class='checkout-product-image' />";
    748747                <?php } else if ($atts["productimage"] == 'none') { ?>
    749                     <?php echo $prefix; ?>_modal_html += "<img src='<?php echo plugins_url('assets/transparent.png', __FILE__); ?>' class='checkout-product-image' />";
     748                    <?php echo esc_html($prefix); ?>_modal_html += "<img src='<?php echo esc_html(plugins_url('assets/transparent.png', __FILE__)); ?>' class='checkout-product-image' />";
    750749                <?php } else { ?>
    751                     <?php echo $prefix; ?>_modal_html += "<img src='<?php echo isset($atts['productimage']) ? $atts["productimage"] : ''; ?>' class='checkout-product-image' />";
     750                    <?php echo esc_html($prefix); ?>_modal_html += "<img src='<?php echo isset($atts['productimage']) ? esc_html($atts["productimage"]) : ''; ?>' class='checkout-product-image' />";
    752751                <?php } ?>
    753                 <?php echo $prefix; ?>_modal_html += "</div>";
    754                 <?php echo $prefix; ?>_modal_html += "<input type='hidden' name='action' id='action' value='ssd_submit_payment'/>";
    755                 <?php echo $prefix; ?>_modal_html += "<input type='hidden' name='product_sku' id='product_sku' value='<?php echo isset($atts['productid']) ? $atts['productid'] : get_the_title(); ?>'/>";
    756                 <?php echo $prefix; ?>_modal_html += "<input type='hidden' name='product_id' id='product_id' value='<?php echo isset($atts['productid']) ? $atts['productid'] : get_the_ID(); ?>'/>";
    757                 <?php echo $prefix; ?>_modal_html += "<div class='checkout-product-name'><?php echo isset($atts['productname']) ? $atts['productname'] : ''; ?></div>";
    758 
    759                 if ('<?php echo isset($atts['amount']) ? $atts['amount'] : ''; ?>' != '') {
    760                     <?php echo $prefix; ?>_modal_html += "<div class='checkout-price'>$<?php echo isset($atts['amount']) ? $atts['amount'] : ''; ?></div>";
    761                     <?php echo $prefix; ?>_modal_html += "<input type='hidden' name='donation_amount' value='<?php echo isset($atts['amount']) ? $atts['amount'] : ''; ?>' />";
     752                <?php echo esc_html($prefix); ?>_modal_html += "</div>";
     753                <?php echo esc_html($prefix); ?>_modal_html += "<input type='hidden' name='action' id='action' value='ssd_submit_payment'/>";
     754                <?php echo esc_html($prefix); ?>_modal_html += "<input type='hidden' name='product_sku' id='product_sku' value='<?php echo isset($atts['productid']) ? esc_html($atts['productid']) : esc_html(get_the_title()); ?>'/>";
     755                <?php echo esc_html($prefix); ?>_modal_html += "<input type='hidden' name='product_id' id='product_id' value='<?php echo isset($atts['productid']) ? esc_html($atts['productid']) : esc_html(get_the_ID()); ?>'/>";
     756                <?php echo esc_html($prefix); ?>_modal_html += "<div class='checkout-product-name'><?php echo isset($atts['productname']) ? esc_html($atts['productname']) : ''; ?></div>";
     757
     758                if ('<?php echo isset($atts['amount']) ? esc_html($atts['amount']) : ''; ?>' != '') {
     759                    <?php echo esc_html($prefix); ?>_modal_html += "<div class='checkout-price'>$<?php echo isset($atts['amount']) ? esc_html($atts['amount']) : ''; ?></div>";
     760                    <?php echo esc_html($prefix); ?>_modal_html += "<input type='hidden' name='donation_amount' value='<?php echo isset($atts['amount']) ? esc_html($atts['amount']) : ''; ?>' />";
    762761                } else {
    763                     <?php echo $prefix; ?>_modal_html += "<div class='donation-price'>Dollar Amount<br />$&nbsp;<input type='text' name='donation_amount' id='donation_amount' class='checkout-input donation-field' placeholder='<?php echo $amountdefault; ?>'></div>";
     762                    <?php echo esc_html($prefix); ?>_modal_html += "<div class='donation-price'>Dollar Amount<br />$&nbsp;<input type='text' name='donation_amount' id='donation_amount' class='checkout-input donation-field' placeholder='<?php echo esc_html($amountdefault); ?>'></div>";
    764763                }
    765764
    766                 <?php echo $prefix; ?>_modal_html += "</div>";
    767 
    768                 <?php echo $prefix; ?>_modal_html += "<div id='modal-body'>";
     765                <?php echo esc_html($prefix); ?>_modal_html += "</div>";
     766
     767                <?php echo esc_html($prefix); ?>_modal_html += "<div id='modal-body'>";
    769768
    770769                // BILLING BODY
    771                 var <?php echo $prefix; ?>_billing_html = "<div id='<?php echo $prefix; ?>_billing_panel'>";
    772                 <?php echo $prefix; ?>_billing_html += "<div class='checkout-card-information'>Billing Information</div>";
    773                 <?php echo $prefix; ?>_billing_html += "<div class='card-number'><input type='text' name='cardholder_name' id='cardholder_name' class='checkout-input checkout-card <?php echo $billingRequired; ?> ' placeholder='Name on Credit Card'></div>";
    774                 <?php echo $prefix; ?>_billing_html += "<div class='card-number'><input type='text' name='cardholder_address' id='cardholder_address' class='checkout-input checkout-card <?php echo $billingRequired; ?>' placeholder='Credit Card Billing Address'></div>";
    775                 <?php echo $prefix; ?>_billing_html += "<div class='card-number'>";
    776                 <?php echo $prefix; ?>_billing_html += "<input type='text' name='cardholder_city' id='cardholder_city' class='checkout-input city-field<?php echo $billingRequired; ?>' placeholder='City'>";
     770                var <?php echo esc_html($prefix); ?>_billing_html = "<div id='<?php echo esc_html($prefix); ?>_billing_panel'>";
     771                <?php echo esc_html($prefix); ?>_billing_html += "<div class='checkout-card-information'>Billing Information</div>";
     772                <?php echo esc_html($prefix); ?>_billing_html += "<div class='card-number'><input type='text' name='cardholder_name' id='cardholder_name' class='checkout-input checkout-card <?php echo esc_html($billingRequired); ?> ' placeholder='Name on Credit Card'></div>";
     773                <?php echo esc_html($prefix); ?>_billing_html += "<div class='card-number'><input type='text' name='cardholder_address' id='cardholder_address' class='checkout-input checkout-card <?php echo esc_html($billingRequired); ?>' placeholder='Credit Card Billing Address'></div>";
     774                <?php echo esc_html($prefix); ?>_billing_html += "<div class='card-number'>";
     775                <?php echo esc_html($prefix); ?>_billing_html += "<input type='text' name='cardholder_city' id='cardholder_city' class='checkout-input city-field<?php echo esc_html($billingRequired); ?>' placeholder='City'>";
    777776                <?php if ($requireState) { ?>
    778                     <?php echo $prefix; ?>_billing_html += "<select name='cardholder_state' id='cardholder_state' class='checkout-input state-field<?php echo $billingRequired; ?>'><option value='AL'>AL</option><option value='AK'>AK</option><option value='AZ'>AZ</option><option value='AR'>AR</option><option value='CA'>CA</option><option value='CO'>CO</option><option value='CT'>CT</option><option value='DC'>DC</option><option value='DE'>DE</option><option value='FL'>FL</option><option value='GA'>GA</option><option value='HI'>HI</option><option value='ID'>ID</option><option value='IL'>IL</option><option value='IN'>IN</option><option value='IA'>IA</option><option value='KS'>KS</option><option value='KY'>KY</option><option value='LA'>LA</option><option value='ME'>ME</option><option value='MD'>MD</option><option value='MA'>MA</option><option value='MI'>MI</option><option value='MN'>MN</option><option value='MS'>MS</option><option value='MO'>MO</option><option value='MT'>MT</option><option value='NE'>NE</option><option value='NV'>NV</option><option value='NH'>NH</option><option value='NJ'>NJ</option><option value='NM'>NM</option><option value='NY'>NY</option><option value='NC'>NC</option><option value='ND'>ND</option><option value='OH'>OH</option><option value='OK'>OK</option><option value='OR'>OR</option><option value='PA'>PA</option><option value='RI'>RI</option><option value='SC'>SC</option><option value='SD'>SD</option><option value='TN'>TN</option><option value='TX'>TX</option><option value='UT'>UT</option><option value='VT'>VT</option><option value='VA'>VA</option><option value='WA'>WA</option><option value='WV'>WV</option><option value='WI'>WI</option><option value='WY'>WY</option></select>";
     777                    <?php echo esc_html($prefix); ?>_billing_html += "<select name='cardholder_state' id='cardholder_state' class='checkout-input state-field<?php echo esc_html($billingRequired); ?>'><option value='AL'>AL</option><option value='AK'>AK</option><option value='AZ'>AZ</option><option value='AR'>AR</option><option value='CA'>CA</option><option value='CO'>CO</option><option value='CT'>CT</option><option value='DC'>DC</option><option value='DE'>DE</option><option value='FL'>FL</option><option value='GA'>GA</option><option value='HI'>HI</option><option value='ID'>ID</option><option value='IL'>IL</option><option value='IN'>IN</option><option value='IA'>IA</option><option value='KS'>KS</option><option value='KY'>KY</option><option value='LA'>LA</option><option value='ME'>ME</option><option value='MD'>MD</option><option value='MA'>MA</option><option value='MI'>MI</option><option value='MN'>MN</option><option value='MS'>MS</option><option value='MO'>MO</option><option value='MT'>MT</option><option value='NE'>NE</option><option value='NV'>NV</option><option value='NH'>NH</option><option value='NJ'>NJ</option><option value='NM'>NM</option><option value='NY'>NY</option><option value='NC'>NC</option><option value='ND'>ND</option><option value='OH'>OH</option><option value='OK'>OK</option><option value='OR'>OR</option><option value='PA'>PA</option><option value='RI'>RI</option><option value='SC'>SC</option><option value='SD'>SD</option><option value='TN'>TN</option><option value='TX'>TX</option><option value='UT'>UT</option><option value='VT'>VT</option><option value='VA'>VA</option><option value='WA'>WA</option><option value='WV'>WV</option><option value='WI'>WI</option><option value='WY'>WY</option></select>";
    779778                <?php } ?>
    780                 <?php echo $prefix; ?>_billing_html += "<input type='text' name='cardholder_zip' id='cardholder_zip' class='checkout-input zip-field<?php echo $billingRequired; ?>' placeholder='Zip'>";
    781                 <?php echo $prefix; ?>_billing_html += "</div>";
     779                <?php echo esc_html($prefix); ?>_billing_html += "<input type='text' name='cardholder_zip' id='cardholder_zip' class='checkout-input zip-field<?php echo esc_html($billingRequired); ?>' placeholder='Zip'>";
     780                <?php echo esc_html($prefix); ?>_billing_html += "</div>";
    782781
    783782                // Additional Info BODY
    784                 var <?php echo $prefix; ?>_additional_html = "<div id='<?php echo $prefix; ?>_additional_panel'>";
    785                 <?php echo $prefix; ?>_additional_html += "<div class='back-button'><a href='#billing' id='<?php echo $prefix; ?>_additional_back'>back</a></div>";
    786                 <?php echo $prefix; ?>_additional_html += "<div class='checkout-card-information'><?php echo $additionalInformationText; ?></div>";
    787                 <?php echo $prefix; ?>_additional_html += "<div style='overflow-y: auto; height: 200px;'>";
     783                var <?php echo esc_html($prefix); ?>_additional_html = "<div id='<?php echo esc_html($prefix); ?>_additional_panel'>";
     784                <?php echo esc_html($prefix); ?>_additional_html += "<div class='back-button'><a href='#billing' id='<?php echo esc_html($prefix); ?>_additional_back'>back</a></div>";
     785                <?php echo esc_html($prefix); ?>_additional_html += "<div class='checkout-card-information'><?php echo esc_html($additionalInformationText); ?></div>";
     786                <?php echo esc_html($prefix); ?>_additional_html += "<div style='overflow-y: auto; height: 200px;'>";
    788787                <?php
    789788                if(count($additionalFields)>0){
     
    806805
    807806                        if ($field_type == "textarea") {
    808                             echo $prefix . '_additional_html += "<div class=\'card-number\'><textarea name=\''.$value.'\' id=\''.$value.'\' class=\'donation-textarea'.$required.'\' placeholder=\''.$atts[$value].'\'></textarea></div>";';
     807                            echo esc_html($prefix) . '_additional_html += "<div class=\'card-number\'><textarea name=\''.esc_html($value).'\' id=\''.esc_html($value).'\' class=\'donation-textarea'.esc_html($required).'\' placeholder=\''.esc_html($atts[$value]).'\'></textarea></div>";';
    809808                        }
    810809                        else if ($field_type == "dropdown") {
    811                             echo $prefix . '_additional_html += "<div class=\'card-number\'><select name=\''.$value.'\' id=\''.$value.'\' class=\'donation-dropdown'.$required.'\'><option>Select an option below</option>";';
     810                            echo esc_html($prefix) . '_additional_html += "<div class=\'card-number\'><select name=\''.esc_html($value).'\' id=\''.esc_html($value).'\' class=\'donation-dropdown'.esc_html($required).'\'><option>Select an option below</option>";';
    812811                            $options = explode("|", $atts[$value]);
    813812                            foreach($options as $option) {
    814                                 echo $prefix . '_additional_html += "<option>' . $option . '</option>";';
     813                                echo esc_html($prefix) . '_additional_html += "<option>' . esc_html($option) . '</option>";';
    815814                            }
    816                             echo $prefix . '_additional_html += "</select></div>";';
     815                            echo esc_html($prefix) . '_additional_html += "</select></div>";';
    817816                        } else if ($field_type == "radio") {
    818                             echo $prefix . '_additional_html += "<div class=\'card-number\'>";';
     817                            echo esc_html($prefix) . '_additional_html += "<div class=\'card-number\'>";';
    819818                            $options = explode("|", $atts[$value]);
    820819                            foreach($options as $option) {
    821                                 echo $prefix . '_additional_html += "<input type=\'radio\' name=\''.$value.'\' value=\'' . $option . '\' class=\'securesubmitradio\'>' . $option . '</input><br />";';
     820                                echo esc_html($prefix) . '_additional_html += "<input type=\'radio\' name=\''.esc_html($value).'\' value=\'' . esc_html($option) . '\' class=\'securesubmitradio\'>' . esc_html($option) . '</input><br />";';
    822821                            }
    823                             echo $prefix . '_additional_html += "</div>";';
     822                            echo esc_html($prefix) . '_additional_html += "</div>";';
    824823                        } else if ($field_type == "checkbox") {
    825                             echo $prefix . '_additional_html += "<input name=\'' . $value . '\' id=\'' . $value . '\' type=\'checkbox\'>&nbsp;<label style=\'display: inline\' for=\'' . $value . '\'>' . $atts[$value] . '</label>";';
     824                            echo esc_html($prefix) . '_additional_html += "<input name=\'' . esc_html($value) . '\' id=\'' . esc_html($value) . '\' type=\'checkbox\'>&nbsp;<label style=\'display: inline\' for=\'' . esc_html($value) . '\'>' . esc_html($atts[$value]) . '</label>";';
    826825                        } else if ($field_type == "label") {
    827826                            $html_links = preg_replace('@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@', "<a href=\'$1\' target=\'blank\'>$1</a>", $atts[$value]);
    828                             echo $prefix . '_additional_html += "<div class=\'card-number\'>' . $html_links . '</div>";';
     827                            echo esc_html($prefix) . '_additional_html += "<div class=\'card-number\'>' . esc_html($html_links) . '</div>";';
    829828                        }
    830829                        else
    831830                        {
    832                             echo $prefix . '_additional_html += "<div class=\'card-number\'><input name=\''.$value.'\' type=\''.$field_type.'\' id=\''.$value.'\' class=\'checkout-input checkout-card'.$required.'\' placeholder=\''.$atts[$value].'\'></div>";';
     831                            echo esc_html($prefix) . '_additional_html += "<div class=\'card-number\'><input name=\''.esc_html($value).'\' type=\''.esc_html($field_type).'\' id=\''.esc_html($value).'\' class=\'checkout-input checkout-card'.esc_html($required).'\' placeholder=\''.esc_html($atts[$value]).'\'></div>";';
    833832                        }
    834833                    }
    835834                }
    836835                ?>
    837                 <?php echo $prefix; ?>_additional_html += "</div>";
    838                 <?php echo $prefix; ?>_additional_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo $prefix; ?>_additional_next_button'>Next</a><div class='pay-button-border'>&nbsp;</div></div>";
    839                 <?php echo $prefix; ?>_additional_html += "<div class='powered_by'><img src='<?php echo plugins_url( 'assets/heart.png', __FILE__ ); ?>' /></div>";
    840                 <?php echo $prefix; ?>_additional_html += "</div>";
     836                <?php echo esc_html($prefix); ?>_additional_html += "</div>";
     837                <?php echo esc_html($prefix); ?>_additional_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo esc_html($prefix); ?>_additional_next_button'>Next</a><div class='pay-button-border'>&nbsp;</div></div>";
     838                <?php echo esc_html($prefix); ?>_additional_html += "<div class='powered_by'><img src='<?php echo esc_html(plugins_url( 'assets/heart.png', __FILE__ )); ?>' /></div>";
     839                <?php echo esc_html($prefix); ?>_additional_html += "</div>";
    841840
    842841
    843842                // TODO: Check if this is checked to skip the shipping screen...
    844                 if (<?php echo $prefix; ?>_requireShipping) {
    845                     <?php echo $prefix; ?>_billing_html += "<div class='same_shipping'><input name='shipping_same' type='checkbox' id='shipping_same'>&nbsp;<label for='shipping_same'>Shipping Same As Billing</label></div>";
     843                if (<?php echo esc_html($prefix); ?>_requireShipping) {
     844                    <?php echo esc_html($prefix); ?>_billing_html += "<div class='same_shipping'><input name='shipping_same' type='checkbox' id='shipping_same'>&nbsp;<label for='shipping_same'>Shipping Same As Billing</label></div>";
    846845                }
    847846
    848                 <?php echo $prefix; ?>_billing_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo $prefix; ?>_billing_next_button'>Next</a><div class='pay-button-border'>&nbsp;</div></div>";
    849                 <?php echo $prefix; ?>_billing_html += "<div class='powered_by'><img src='<?php echo plugins_url( 'assets/heart.png', __FILE__ ); ?>' /></div>";
    850                 <?php echo $prefix; ?>_billing_html += "</div>";
     847                <?php echo esc_html($prefix); ?>_billing_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo esc_html($prefix); ?>_billing_next_button'>Next</a><div class='pay-button-border'>&nbsp;</div></div>";
     848                <?php echo esc_html($prefix); ?>_billing_html += "<div class='powered_by'><img src='<?php echo esc_html(plugins_url( 'assets/heart.png', __FILE__ )); ?>' /></div>";
     849                <?php echo esc_html($prefix); ?>_billing_html += "</div>";
    851850
    852851                // SHIPPING BODY
    853                 var <?php echo $prefix; ?>_shipping_html = "<div id='<?php echo $prefix; ?>_shipping_panel'>";
    854                 <?php echo $prefix; ?>_shipping_html += "<div class='back-button'><a href='#billing' id='<?php echo $prefix; ?>_shipping_back'>back</a></div>";
    855                 <?php echo $prefix; ?>_shipping_html += "<div class='checkout-card-information'>Shipping Information</div>";
    856                 <?php echo $prefix; ?>_shipping_html += "<div class='card-number'><input name='shipping_name' type='text' id='shipping_name' class='checkout-input checkout-card<?php echo $shippingRequired; ?>' placeholder='Shipping Name'></div>";
    857                 <?php echo $prefix; ?>_shipping_html += "<div class='card-number'><input name='shipping_address' type='text' id='shipping_address' class='checkout-input checkout-card<?php echo $shippingRequired; ?>' placeholder='Address'></div>";
    858                 <?php echo $prefix; ?>_shipping_html += "<div class='card-number'>";
    859                 <?php echo $prefix; ?>_shipping_html += "<input type='text' name='shipping_city' id='shipping_city' class='checkout-input city-field<?php echo $shippingRequired; ?>' placeholder='City'>";
     852                var <?php echo esc_html($prefix); ?>_shipping_html = "<div id='<?php echo esc_html($prefix); ?>_shipping_panel'>";
     853                <?php echo esc_html($prefix); ?>_shipping_html += "<div class='back-button'><a href='#billing' id='<?php echo esc_html($prefix); ?>_shipping_back'>back</a></div>";
     854                <?php echo esc_html($prefix); ?>_shipping_html += "<div class='checkout-card-information'>Shipping Information</div>";
     855                <?php echo esc_html($prefix); ?>_shipping_html += "<div class='card-number'><input name='shipping_name' type='text' id='shipping_name' class='checkout-input checkout-card<?php echo esc_html($shippingRequired); ?>' placeholder='Shipping Name'></div>";
     856                <?php echo esc_html($prefix); ?>_shipping_html += "<div class='card-number'><input name='shipping_address' type='text' id='shipping_address' class='checkout-input checkout-card<?php echo esc_html($shippingRequired); ?>' placeholder='Address'></div>";
     857                <?php echo esc_html($prefix); ?>_shipping_html += "<div class='card-number'>";
     858                <?php echo esc_html($prefix); ?>_shipping_html += "<input type='text' name='shipping_city' id='shipping_city' class='checkout-input city-field<?php echo esc_html($shippingRequired); ?>' placeholder='City'>";
    860859                <?php if ($requireState) { ?>
    861                     <?php echo $prefix; ?>_shipping_html += "<select id='shipping_state' name='shipping_state' class='checkout-input state-field<?php echo $shippingRequired; ?>'><option value='AL'>AL</option><option value='AK'>AK</option><option value='AZ'>AZ</option><option value='AR'>AR</option><option value='CA'>CA</option><option value='CO'>CO</option><option value='CT'>CT</option><option value='DC'>DC</option><option value='DE'>DE</option><option value='FL'>FL</option><option value='GA'>GA</option><option value='HI'>HI</option><option value='ID'>ID</option><option value='IL'>IL</option><option value='IN'>IN</option><option value='IA'>IA</option><option value='KS'>KS</option><option value='KY'>KY</option><option value='LA'>LA</option><option value='ME'>ME</option><option value='MD'>MD</option><option value='MA'>MA</option><option value='MI'>MI</option><option value='MN'>MN</option><option value='MS'>MS</option><option value='MO'>MO</option><option value='MT'>MT</option><option value='NE'>NE</option><option value='NV'>NV</option><option value='NH'>NH</option><option value='NJ'>NJ</option><option value='NM'>NM</option><option value='NY'>NY</option><option value='NC'>NC</option><option value='ND'>ND</option><option value='OH'>OH</option><option value='OK'>OK</option><option value='OR'>OR</option><option value='PA'>PA</option><option value='RI'>RI</option><option value='SC'>SC</option><option value='SD'>SD</option><option value='TN'>TN</option><option value='TX'>TX</option><option value='UT'>UT</option><option value='VT'>VT</option><option value='VA'>VA</option><option value='WA'>WA</option><option value='WV'>WV</option><option value='WI'>WI</option><option value='WY'>WY</option></select>";
     860                    <?php echo esc_html($prefix); ?>_shipping_html += "<select id='shipping_state' name='shipping_state' class='checkout-input state-field<?php echo esc_html($shippingRequired); ?>'><option value='AL'>AL</option><option value='AK'>AK</option><option value='AZ'>AZ</option><option value='AR'>AR</option><option value='CA'>CA</option><option value='CO'>CO</option><option value='CT'>CT</option><option value='DC'>DC</option><option value='DE'>DE</option><option value='FL'>FL</option><option value='GA'>GA</option><option value='HI'>HI</option><option value='ID'>ID</option><option value='IL'>IL</option><option value='IN'>IN</option><option value='IA'>IA</option><option value='KS'>KS</option><option value='KY'>KY</option><option value='LA'>LA</option><option value='ME'>ME</option><option value='MD'>MD</option><option value='MA'>MA</option><option value='MI'>MI</option><option value='MN'>MN</option><option value='MS'>MS</option><option value='MO'>MO</option><option value='MT'>MT</option><option value='NE'>NE</option><option value='NV'>NV</option><option value='NH'>NH</option><option value='NJ'>NJ</option><option value='NM'>NM</option><option value='NY'>NY</option><option value='NC'>NC</option><option value='ND'>ND</option><option value='OH'>OH</option><option value='OK'>OK</option><option value='OR'>OR</option><option value='PA'>PA</option><option value='RI'>RI</option><option value='SC'>SC</option><option value='SD'>SD</option><option value='TN'>TN</option><option value='TX'>TX</option><option value='UT'>UT</option><option value='VT'>VT</option><option value='VA'>VA</option><option value='WA'>WA</option><option value='WV'>WV</option><option value='WI'>WI</option><option value='WY'>WY</option></select>";
    862861                <?php } ?>
    863                 <?php echo $prefix; ?>_shipping_html += "<input type='text' name='shipping_zip' id='shipping_zip' class='checkout-input zip-field<?php echo $shippingRequired; ?>' placeholder='Zip'>";
    864                 <?php echo $prefix; ?>_shipping_html += "</div>";
    865                 <?php echo $prefix; ?>_shipping_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo $prefix; ?>_shipping_next_button'>Next</a><div class='pay-button-border'>&nbsp;</div></div>";
    866                 <?php echo $prefix; ?>_shipping_html += "<div class='powered_by'><img src='<?php echo plugins_url('assets/heart.png', __FILE__); ?>' /></div>";
    867                 <?php echo $prefix; ?>_shipping_html += "</div>";
     862                <?php echo esc_html($prefix); ?>_shipping_html += "<input type='text' name='shipping_zip' id='shipping_zip' class='checkout-input zip-field<?php echo esc_html($shippingRequired); ?>' placeholder='Zip'>";
     863                <?php echo esc_html($prefix); ?>_shipping_html += "</div>";
     864                <?php echo esc_html($prefix); ?>_shipping_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo esc_html($prefix); ?>_shipping_next_button'>Next</a><div class='pay-button-border'>&nbsp;</div></div>";
     865                <?php echo esc_html($prefix); ?>_shipping_html += "<div class='powered_by'><img src='<?php echo esc_html(plugins_url('assets/heart.png', __FILE__)); ?>' /></div>";
     866                <?php echo esc_html($prefix); ?>_shipping_html += "</div>";
    868867
    869868                // CARD BODY
    870                 var <?php echo $prefix; ?>_card_html = "<div id='<?php echo $prefix; ?>_card_panel'>";
    871                 <?php echo $prefix; ?>_card_html += "<div class='back-button'><a href='#shipping' id='<?php echo $prefix; ?>_card_back'>back</a></div>";
    872                 <?php echo $prefix; ?>_card_html += "<div class='checkout-card-information'>Card Information</div>";
    873                 <?php echo $prefix; ?>_card_html += "<div class='card-number'><input type='text' id='card_number' class='checkout-input checkout-card required' placeholder='Credit Card'></div>";
    874                 <?php echo $prefix; ?>_card_html += "<div class='card-exp'><input type='text' id='card_exp' class='checkout-exp required' placeholder='MM/YY'></div>";
    875                 <?php echo $prefix; ?>_card_html += "<div class='card-cvc'><input type='text' id='card_cvc' class='checkout-exp' placeholder='CVC'></div>";
    876                 <?php echo $prefix; ?>_card_html += "<div class='clearfixcheckout'>&nbsp;</div>";
    877                 <?php echo $prefix; ?>_card_html += "<div class='email-reciept'><input name='email_reciept' type='checkbox' id='email_reciept' checked='true'>&nbsp;<label for='email_reciept'>Email Receipt</label></div>";
    878                 <?php echo $prefix; ?>_card_html += "<div class='email-address'><input name='email_address' type='text' id='email_address' class='checkout-email' placeholder='Customer Email Address'></div>";
    879                 <?php echo $prefix; ?>_card_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo $prefix; ?>_pay_button'><?php echo $buttonText; ?></a><div class='pay-button-border'>&nbsp;</div></div>";
    880                 <?php echo $prefix; ?>_card_html += "<div class='powered_by'><img src='<?php echo plugins_url( 'assets/heart.png', __FILE__ ); ?>' /></div>";
    881                 <?php echo $prefix; ?>_card_html += "</div>";
     869                var <?php echo esc_html($prefix); ?>_card_html = "<div id='<?php echo esc_html($prefix); ?>_card_panel'>";
     870                <?php echo esc_html($prefix); ?>_card_html += "<div class='back-button'><a href='#shipping' id='<?php echo esc_html($prefix); ?>_card_back'>back</a></div>";
     871                <?php echo esc_html($prefix); ?>_card_html += "<div class='checkout-card-information'>Card Information</div>";
     872                <?php echo esc_html($prefix); ?>_card_html += "<div class='card-number'><input type='text' id='card_number' class='checkout-input checkout-card required' placeholder='Credit Card'></div>";
     873                <?php echo esc_html($prefix); ?>_card_html += "<div class='card-exp'><input type='text' id='card_exp' class='checkout-exp required' placeholder='MM/YY'></div>";
     874                <?php echo esc_html($prefix); ?>_card_html += "<div class='card-cvc'><input type='text' id='card_cvc' class='checkout-exp' placeholder='CVC'></div>";
     875                <?php echo esc_html($prefix); ?>_card_html += "<div class='clearfixcheckout'>&nbsp;</div>";
     876                <?php echo esc_html($prefix); ?>_card_html += "<div class='email-reciept'><input name='email_reciept' type='checkbox' id='email_reciept' checked='true'>&nbsp;<label for='email_reciept'>Email Receipt</label></div>";
     877                <?php echo esc_html($prefix); ?>_card_html += "<div class='email-address'><input name='email_address' type='text' id='email_address' class='checkout-email' placeholder='Customer Email Address'></div>";
     878                <?php echo esc_html($prefix); ?>_card_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo esc_html($prefix); ?>_pay_button'><?php echo esc_html($buttonText); ?></a><div class='pay-button-border'>&nbsp;</div></div>";
     879                <?php echo esc_html($prefix); ?>_card_html += "<div class='powered_by'><img src='<?php echo esc_html(plugins_url( 'assets/heart.png', __FILE__ )); ?>' /></div>";
     880                <?php echo esc_html($prefix); ?>_card_html += "</div>";
    882881
    883882                // PROCESSING BODY
    884                 var <?php echo $prefix; ?>_processing_html = "<div id='<?php echo $prefix; ?>_processing_panel'>";
    885                 <?php echo $prefix; ?>_processing_html += "<div class='transaction-processing'>processing</div>";
    886                 <?php echo $prefix; ?>_processing_html += "</div>";
     883                var <?php echo esc_html($prefix); ?>_processing_html = "<div id='<?php echo esc_html($prefix); ?>_processing_panel'>";
     884                <?php echo esc_html($prefix); ?>_processing_html += "<div class='transaction-processing'>processing</div>";
     885                <?php echo esc_html($prefix); ?>_processing_html += "</div>";
    887886
    888887                // FAILURE BODY
    889                 var <?php echo $prefix; ?>_failure_html = "<div id='<?php echo $prefix; ?>_failure_panel'>";
    890                 <?php echo $prefix; ?>_failure_html += "<div class='checkout-card-information'>Transaction Information</div>";
    891                 <?php echo $prefix; ?>_failure_html += "<div class='transaction-error'>There was a problem while processing your card.</div>";
    892                 <?php echo $prefix; ?>_failure_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo $prefix; ?>_retry_button'>Retry</a><div class='pay-button-border'>&nbsp;</div></div>";
    893                 <?php echo $prefix; ?>_failure_html += "</div>";
     888                var <?php echo esc_html($prefix); ?>_failure_html = "<div id='<?php echo esc_html($prefix); ?>_failure_panel'>";
     889                <?php echo esc_html($prefix); ?>_failure_html += "<div class='checkout-card-information'>Transaction Information</div>";
     890                <?php echo esc_html($prefix); ?>_failure_html += "<div class='transaction-error'>There was a problem while processing your card.</div>";
     891                <?php echo esc_html($prefix); ?>_failure_html += "<div class='pay-button button-next'><a href='#Purchase' id='<?php echo esc_html($prefix); ?>_retry_button'>Retry</a><div class='pay-button-border'>&nbsp;</div></div>";
     892                <?php echo esc_html($prefix); ?>_failure_html += "</div>";
    894893
    895894                // SUCCESS BODY
    896                 var <?php echo $prefix; ?>_success_html = "<div id='<?php echo $prefix; ?>_success_panel'>";
    897                 <?php echo $prefix; ?>_success_html += "<div class='card-number'>Your Payment Was Successful!</div>";
    898                 <?php echo $prefix; ?>_success_html += "</div>";
    899 
    900                 <?php echo $prefix; ?>_modal_html += <?php echo $prefix; ?>_billing_html;
    901                 <?php echo $prefix; ?>_modal_html += <?php echo $prefix; ?>_additional_html;
    902                 <?php echo $prefix; ?>_modal_html += <?php echo $prefix; ?>_shipping_html;
    903                 <?php echo $prefix; ?>_modal_html += <?php echo $prefix; ?>_card_html;
    904                 <?php echo $prefix; ?>_modal_html += <?php echo $prefix; ?>_processing_html;
    905                 <?php echo $prefix; ?>_modal_html += <?php echo $prefix; ?>_failure_html;
    906                 <?php echo $prefix; ?>_modal_html += <?php echo $prefix; ?>_success_html;
    907 
    908                 <?php echo $prefix; ?>_modal_html += "</div>"; // BODY
     895                var <?php echo esc_html($prefix); ?>_success_html = "<div id='<?php echo esc_html($prefix); ?>_success_panel'>";
     896                <?php echo esc_html($prefix); ?>_success_html += "<div class='card-number'>Your Payment Was Successful!</div>";
     897                <?php echo esc_html($prefix); ?>_success_html += "</div>";
     898
     899                <?php echo esc_html($prefix); ?>_modal_html += <?php echo esc_html($prefix); ?>_billing_html;
     900                <?php echo esc_html($prefix); ?>_modal_html += <?php echo esc_html($prefix); ?>_additional_html;
     901                <?php echo esc_html($prefix); ?>_modal_html += <?php echo esc_html($prefix); ?>_shipping_html;
     902                <?php echo esc_html($prefix); ?>_modal_html += <?php echo esc_html($prefix); ?>_card_html;
     903                <?php echo esc_html($prefix); ?>_modal_html += <?php echo esc_html($prefix); ?>_processing_html;
     904                <?php echo esc_html($prefix); ?>_modal_html += <?php echo esc_html($prefix); ?>_failure_html;
     905                <?php echo esc_html($prefix); ?>_modal_html += <?php echo esc_html($prefix); ?>_success_html;
     906
     907                <?php echo esc_html($prefix); ?>_modal_html += "</div>"; // BODY
    909908
    910909                // ACTIONS
    911                 function <?php echo $prefix; ?>_trigger_payment() {
    912                     var prefix = '<?php echo $prefix; ?>';
     910                function <?php echo esc_html($prefix); ?>_trigger_payment() {
     911                    var prefix = '<?php echo esc_html($prefix); ?>';
    913912                    var $ = jQuery;
    914913
     
    939938
    940939                        var stylesheet = $('<link rel="stylesheet" type="text/css" />');
    941                         stylesheet.attr('href', '<?php echo plugins_url( 'assets/checkout.css', __FILE__ ); ?>').attr('id', 'sss');
     940                        stylesheet.attr('href', '<?php echo esc_html(plugins_url( 'assets/checkout.css', __FILE__ )); ?>').attr('id', 'sss');
    942941
    943942                        frame.contents().find('head').append(stylesheet);
     
    949948
    950949                        frameBody.append(form);
    951                         form.append(<?php echo $prefix; ?>_modal_html);
     950                        form.append(<?php echo esc_html($prefix); ?>_modal_html);
    952951
    953952                        function configureCleanUp() {
     
    977976
    978977                        function getPanel(panelName) {
    979                             return frameBody.find('#<?php echo $prefix; ?>_' + panelName + '_panel');
     978                            return frameBody.find('#<?php echo esc_html($prefix); ?>_' + panelName + '_panel');
    980979                        }
    981980
     
    991990                        // Bind Panels
    992991                        // Billing Panel
    993                         var billingButton = billingPanel.find('#<?php echo $prefix; ?>_billing_next_button');
     992                        var billingButton = billingPanel.find('#<?php echo esc_html($prefix); ?>_billing_next_button');
    994993
    995994                        billingPanel.show();
     
    10161015                                billingPanel.hide();
    10171016
    1018                                 if (<?php echo $prefix; ?>_requireAdditionalInfo) {
     1017                                if (<?php echo esc_html($prefix); ?>_requireAdditionalInfo) {
    10191018                                    additionalPanel.fadeIn();
    1020                                 } else if (<?php echo $prefix; ?>_requireShipping) {
     1019                                } else if (<?php echo esc_html($prefix); ?>_requireShipping) {
    10211020                                    cardPanel.hide();
    10221021                                    if (frameBody.find("#shipping_same").attr("checked")) {
     
    10461045
    10471046                        // Additional Panel
    1048                         var additionalNext = additionalPanel.find("#<?php echo $prefix; ?>_additional_next_button");
    1049                         var additionalBack = additionalPanel.find("#<?php echo $prefix; ?>_additional_back");
     1047                        var additionalNext = additionalPanel.find("#<?php echo esc_html($prefix); ?>_additional_next_button");
     1048                        var additionalBack = additionalPanel.find("#<?php echo esc_html($prefix); ?>_additional_back");
    10501049
    10511050                        additionalPanel.hide();
     
    10761075                                additionalPanel.hide();
    10771076
    1078                                 if (<?php echo $prefix; ?>_requireShipping) {
     1077                                if (<?php echo esc_html($prefix); ?>_requireShipping) {
    10791078                                    shippingPanel.fadeIn();
    10801079                                } else {
     
    10951094
    10961095                        // Shipping Panel
    1097                         var shippingNext = shippingPanel.find("#<?php echo $prefix; ?>_shipping_next_button");
    1098                         var shippingBack = shippingPanel.find("#<?php echo $prefix; ?>_shipping_back");
     1096                        var shippingNext = shippingPanel.find("#<?php echo esc_html($prefix); ?>_shipping_next_button");
     1097                        var shippingBack = shippingPanel.find("#<?php echo esc_html($prefix); ?>_shipping_back");
    10991098
    11001099                        shippingPanel.hide();
     
    11241123                        });
    11251124
    1126                         if (<?php echo $prefix; ?>_requireShipping) {
     1125                        if (<?php echo esc_html($prefix); ?>_requireShipping) {
    11271126                            shippingBack.on("click", function (event) {
    11281127                                billingPanel.fadeIn();
     
    11381137
    11391138                        // Card Panel
    1140                         var cardPay = cardPanel.find("#<?php echo $prefix; ?>_pay_button");
    1141                         var cardBack = cardPanel.find("#<?php echo $prefix; ?>_card_back");
     1139                        var cardPay = cardPanel.find("#<?php echo esc_html($prefix); ?>_pay_button");
     1140                        var cardBack = cardPanel.find("#<?php echo esc_html($prefix); ?>_card_back");
    11421141
    11431142                        cardPanel.hide();
     
    11511150
    11521151
    1153                         function <?php echo $prefix; ?>_secureSubmitResponseHandler(response) {
     1152                        function <?php echo esc_html($prefix); ?>_secureSubmitResponseHandler(response) {
    11541153                            if (response.message) {
    11551154                                processingPanel.hide();
     
    11631162                                form.append(token_html);
    11641163
    1165                                 <?php echo $prefix; ?>_do_post();
     1164                                <?php echo esc_html($prefix); ?>_do_post();
    11661165                            }
    11671166                        }
    11681167
    1169                         function <?php echo $prefix; ?>_do_post() {
     1168                        function <?php echo esc_html($prefix); ?>_do_post() {
    11701169                            var datastring = form.serialize();
    1171                             var url = "<?php echo admin_url('admin-ajax.php'); ?>";
     1170                            var url = "<?php echo esc_html(admin_url('admin-ajax.php')); ?>";
    11721171
    11731172                            if ($.browser && $.browser.msie && $.browser.version <= 9) {
     
    11951194
    11961195
    1197                         function <?php echo $prefix; ?>_tokenize() {
     1196                        function <?php echo esc_html($prefix); ?>_tokenize() {
    11981197                            var expirationParts = cardPanel.find('#card_exp').val().split("/");
    11991198                            var month = expirationParts[0];
     
    12231222                            xhr.onload = () => {
    12241223                                if (xhr.readyState == 4 && xhr.status == 201) {
    1225                                     <?php echo $prefix; ?>_secureSubmitResponseHandler(JSON.parse(xhr.responseText));
     1224                                    <?php echo esc_html($prefix); ?>_secureSubmitResponseHandler(JSON.parse(xhr.responseText));
    12261225                                } else {
    1227                                     <?php echo $prefix; ?>_secureSubmitResponseHandler(`Error: ${xhr.status}`);
     1226                                    <?php echo esc_html($prefix); ?>_secureSubmitResponseHandler(`Error: ${xhr.status}`);
    12281227                                }
    12291228                            };
     
    12701269                                $('#modal-launcher, #modal-background').unbind('click');
    12711270                                frameBody.find('.modal-close').unbind('click');
    1272                                 <?php echo $prefix; ?>_tokenize();
     1271                                <?php echo esc_html($prefix); ?>_tokenize();
    12731272                            }
    12741273
     
    12801279                            billingPanel.hide();
    12811280
    1282                             if ((<?php echo $prefix; ?>_requireShipping) && (!frameBody.find("#shipping_same").attr("checked"))) {
     1281                            if ((<?php echo esc_html($prefix); ?>_requireShipping) && (!frameBody.find("#shipping_same").attr("checked"))) {
    12831282                                shippingPanel.show();
    12841283                            } else {
     
    12991298
    13001299                        // Failure Panel
    1301                         var failureRetry = failurePanel.find("#<?php echo $prefix; ?>_retry_button");
     1300                        var failureRetry = failurePanel.find("#<?php echo esc_html($prefix); ?>_retry_button");
    13021301                        failurePanel.hide();
    13031302
     
    13241323
    13251324            ?>
    1326             <div id="<?php echo $prefix; ?>_formContainer">
    1327                 <form id="<?php echo $prefix; ?>_form">
     1325            <div id="<?php echo esc_html($prefix); ?>_formContainer">
     1326                <form id="<?php echo esc_html($prefix); ?>_form">
    13281327                    <input type="hidden" value="" name="securesubmit_token" id="securesubmit_token" />
    1329                     <input type="hidden" name="<?php echo $prefix; ?>_product_id" value="<?php echo $productid; ?>" />
     1328                    <input type="hidden" name="<?php echo esc_html($prefix); ?>_product_id" value="<?php echo esc_html($productid); ?>" />
    13301329                    <input type="hidden" name="action" value="ssd_submit_payment" />
    1331                     <input type="hidden" name="prefix" value="<?php echo $prefix; ?>">
     1330                    <input type="hidden" name="prefix" value="<?php echo esc_html($prefix); ?>">
    13321331
    13331332                    <?php if ($requireBilling) { ?>
     
    13371336                                <td width="200">First Name:</td>
    13381337                                <td>
    1339                                     <input class="form-text<?php echo $billingRequired; ?>" name="billing_firstname" type="text" />
     1338                                    <input class="form-text<?php echo esc_html($billingRequired); ?>" name="billing_firstname" type="text" />
    13401339                                </td>
    13411340                            </tr>
     
    13431342                                <td>Last Name:</td>
    13441343                                <td>
    1345                                     <input class="form-text<?php echo $billingRequired; ?>" name="billing_lastname" type="text" />
     1344                                    <input class="form-text<?php echo esc_html($billingRequired); ?>" name="billing_lastname" type="text" />
    13461345                                </td>
    13471346                            </tr>
     
    13611360                                <td>Address:</td>
    13621361                                <td>
    1363                                     <input class="form-text<?php echo $billingRequired; ?>" name="billing_address" type="text" />
     1362                                    <input class="form-text<?php echo esc_html($billingRequired); ?>" name="billing_address" type="text" />
    13641363                                </td>
    13651364                            </tr>
    13661365                            <tr>
    13671366                                <td>City:</td>
    1368                                 <td><input class="form-text<?php echo $billingRequired; ?>" name="billing_city" type="text" /></td>
     1367                                <td><input class="form-text<?php echo esc_html($billingRequired); ?>" name="billing_city" type="text" /></td>
    13691368                            </tr>
    13701369                            <?php if ($requireState) { ?>
     
    13721371                                    <td>State:</td>
    13731372                                    <td>
    1374                                         <select name="billing_state" class="<?php echo $billingRequired; ?>">
     1373                                        <select name="billing_state" class="<?php echo esc_html($billingRequired); ?>">
    13751374                                            <option value="AL">Alabama</option>
    13761375                                            <option value="AK">Alaska</option>
     
    14311430                                <td>Zip/Postal Code:</td>
    14321431                                <td>
    1433                                     <input class="form-text<?php echo $billingRequired; ?>" name="billing_zip" type="text" />
     1432                                    <input class="form-text<?php echo esc_html($billingRequired); ?>" name="billing_zip" type="text" />
    14341433                                </td>
    14351434                            </tr>
     
    14431442                            <tr>
    14441443                                <td width="200 ">First Name:</td>
    1445                                 <td><input class="form-text<?php echo $shippingRequired; ?>" name="shipping_firstname" type="text"  /></td>
     1444                                <td><input class="form-text<?php echo esc_html($shippingRequired); ?>" name="shipping_firstname" type="text"  /></td>
    14461445                            </tr>
    14471446                            <tr>
    14481447                                <td>Last Name:</td>
    14491448                                <td>
    1450                                     <input class="form-text<?php echo $shippingRequired; ?>" type="text" name="shipping_lastname"  />
     1449                                    <input class="form-text<?php echo esc_html($shippingRequired); ?>" type="text" name="shipping_lastname"  />
    14511450                                </td>
    14521451                            </tr>
    14531452                            <tr>
    14541453                                <td>Address:</td>
    1455                                 <td><input class="form-text<?php echo $shippingRequired; ?>" type="text" name="shipping_address"  /></td>
     1454                                <td><input class="form-text<?php echo esc_html($shippingRequired); ?>" type="text" name="shipping_address"  /></td>
    14561455                            </tr>
    14571456                            <tr>
    14581457                                <td>City:</td>
    14591458                                <td>
    1460                                     <input class="form-text<?php echo $shippingRequired; ?>" type="text" name="shipping_city"  />
     1459                                    <input class="form-text<?php echo esc_html($shippingRequired); ?>" type="text" name="shipping_city"  />
    14611460                                </td>
    14621461                            </tr>
     
    14651464                                    <td>State:</td>
    14661465                                    <td>
    1467                                         <select name="shipping_state" class="<?php echo $shippingRequired; ?>" >
     1466                                        <select name="shipping_state" class="<?php echo esc_html($shippingRequired); ?>" >
    14681467                                            <option value="AL">Alabama</option>
    14691468                                            <option value="AK">Alaska</option>
     
    15241523                                <td>Shipping Zip Code:</td>
    15251524                                <td>
    1526                                     <input class="form-text<?php echo $shippingRequired; ?>" type="text" name="shipping_zip" />
     1525                                    <input class="form-text<?php echo esc_html($shippingRequired); ?>" type="text" name="shipping_zip" />
    15271526                                </td>
    15281527                            </tr>
     
    15831582                        $additionalHTML .= "</table>";
    15841583
    1585                         echo $additionalHTML;
     1584                        echo esc_html($additionalHTML);
    15861585                    }
    15871586                    ?>
     
    15991598                            <td width="200">Card Number:</td>
    16001599                            <td>
    1601                                 <div id="<?php echo $prefix; ?>_card_number"></div>
     1600                                <div id="<?php echo esc_html($prefix); ?>_card_number"></div>
    16021601                            </td>
    16031602                        </tr>
     
    16051604                            <td>Expiration:</td>
    16061605                            <td colspan="2">
    1607                                 <div id="<?php echo $prefix; ?>_exp_month"></div>
     1606                                <div id="<?php echo esc_html($prefix); ?>_exp_month"></div>
    16081607                            </td>
    16091608                        </tr>
     
    16111610                            <td>Card CVC:</td>
    16121611                            <td>
    1613                                 <input class="form-text" type="text" id="<?php echo $prefix; ?>_card_cvc" style="width: 45px;" />
    1614                                 <div id="<?php echo $prefix; ?>_card_cvc"></div>
     1612                                <input class="form-text" type="text" id="<?php echo esc_html($prefix); ?>_card_cvc" style="width: 45px;" />
     1613                                <div id="<?php echo esc_html($prefix); ?>_card_cvc"></div>
    16151614                            </td>
    16161615                        </tr>
     
    16181617                            <td>Amount:</td>
    16191618                            <td nowrap>$
    1620                                 <input class="form-text" id="donation_amount_secure" style="display: inline;" type="text" value="<?php echo $amountdefault; ?>" name="donation_amount" <?php if (!empty($productid)):?>disabled="disabled"
     1619                                <input class="form-text" id="donation_amount_secure" style="display: inline;" type="text" value="<?php echo esc_html($amountdefault); ?>" name="donation_amount" <?php if (!empty($productid)):?>disabled="disabled"
    16211620                                <?php endif;?>/></td>
    16221621                        </tr>
    16231622                        <tr>
    16241623                            <td colspan="2">
    1625                                 <div id="<?php echo $prefix; ?>-donate-response"></div>
     1624                                <div id="<?php echo esc_html($prefix); ?>-donate-response"></div>
    16261625                            </td>
    16271626                        </tr>
     
    16411640
    16421641                                <?php if ($modal) { ?>
    1643                                     <button id="a<?php echo $prefix; ?>-modal-launcher" class="button-secondary">cancel</button>
     1642                                    <button id="a<?php echo esc_html($prefix); ?>-modal-launcher" class="button-secondary">cancel</button>
    16441643                                <?php } ?>
    16451644                            </td>
     
    16481647                </form>
    16491648            </div>
    1650             <div id="<?php echo $prefix; ?>_success" style="display: none;">
     1649            <div id="<?php echo esc_html($prefix); ?>_success" style="display: none;">
    16511650                <strong>Your Payment was Successful. Thank you!</strong>
    16521651            </div>
     
    16571656                var domElement = document.getElementById('ssd-recaptcha');
    16581657                var widgetId = grecaptcha.render(domElement, {
    1659                     'sitekey': '<?php echo $this->recaptchaSiteKey ?>'
     1658                    'sitekey': '<?php echo esc_html($this->recaptchaSiteKey) ?>'
    16601659                });
    16611660                jQuery(domElement).attr('data-widget-id', widgetId);
    16621661            }
    16631662        </script>
    1664         <script src="https://js.globalpay.com/v1/globalpayments.js"></script>
     1663        <?php
     1664            wp_enqueue_script('global-payments','https://js.globalpay.com/v1/globalpayments.js');
     1665        ?>
    16651666        <script type="text/javascript">
    16661667        <?php
     
    16731674            });
    16741675
    1675             var prefix = '<?php echo $prefix; ?>';
     1676            var prefix = '<?php echo esc_html($prefix); ?>';
    16761677
    16771678            // Create Form
     
    17431744                    clearPaymentFields();
    17441745                } else {
    1745                     var prefix = '<?php echo $prefix; ?>';
     1746                    var prefix = '<?php echo esc_html($prefix); ?>';
    17461747                    document.getElementById("securesubmit_token").value = response.paymentReference;
    17471748                    do_post();
     
    17531754
    17541755                var datastring = jQuery("#"+prefix+"_form").serialize();
    1755                 var url = "<?php echo admin_url('admin-ajax.php'); ?>";
     1756                var url = "<?php echo esc_html(admin_url('admin-ajax.php')); ?>";
    17561757
    17571758                jQuery.post(url, datastring, function (response) {
     
    17791780                    );
    17801781
    1781                     $("#a<?php echo $prefix; ?>-modal-launcher, #a<?php echo $prefix; ?>-modal-background, #a<?php echo $prefix; ?>-modal-close").click(function () {
    1782                         $("#a<?php echo $prefix; ?>-modal-content,#a<?php echo $prefix; ?>-modal-background").toggleClass("active");
     1782                    $("#a<?php echo esc_html($prefix); ?>-modal-launcher, #a<?php echo esc_html($prefix); ?>-modal-background, #a<?php echo esc_html($prefix); ?>-modal-close").click(function () {
     1783                        $("#a<?php echo esc_html($prefix); ?>-modal-content,#a<?php echo esc_html($prefix); ?>-modal-background").toggleClass("active");
    17831784                    });
    17841785
     
    17871788                    ?>
    17881789                    var pk = '<?php echo esc_attr($pkey); ?>';
    1789                     var url = "<?php echo admin_url('admin-ajax.php'); ?>";
    1790 
    1791                     $('#<?php echo $prefix; ?>-securesubmit-button').bind('click', a<?php echo $prefix; ?>_handleSubmit);
    1792 
    1793                     function a<?php echo $prefix; ?>_handleSubmit() {
     1790                    var url = "<?php echo esc_html(admin_url('admin-ajax.php')); ?>";
     1791
     1792                    $('#<?php echo esc_html($prefix); ?>-securesubmit-button').bind('click', a<?php echo esc_html($prefix); ?>_handleSubmit);
     1793
     1794                    function a<?php echo esc_html($prefix); ?>_handleSubmit() {
    17941795
    17951796                        var sameAsBilling = jQuery('[name="same_as_billing"]') && jQuery('[name="same_as_billing"]').is(':checked');
    17961797
    17971798                        var continueProcessing = true;
    1798                         jQuery("#<?php echo $prefix; ?>_form").find('.required').each(function (i, obj) {
     1799                        jQuery("#<?php echo esc_html($prefix); ?>_form").find('.required').each(function (i, obj) {
    17991800                            if (continueProcessing) {
    18001801                                // skip validation if "same as billing" checked and field is shipping info
     
    18141815                        if (continueProcessing) {
    18151816
    1816                             var cardNumber = $('#<?php echo $prefix; ?>_card_number').val().replace(/\D/g, ''); // strip out non-numeric
     1817                            var cardNumber = $('#<?php echo esc_html($prefix); ?>_card_number').val().replace(/\D/g, ''); // strip out non-numeric
    18171818
    18181819                            hps.tokenize({
     
    18201821                                    public_key: pk,
    18211822                                    number: cardNumber,
    1822                                     cvc: $('#<?php echo $prefix; ?>_card_cvc').val(),
    1823                                     exp_month: $('#<?php echo $prefix; ?>_exp_month').val(),
    1824                                     exp_year: $('#<?php echo $prefix; ?>_exp_year').val()
     1823                                    cvc: $('#<?php echo esc_html($prefix); ?>_card_cvc').val(),
     1824                                    exp_month: $('#<?php echo esc_html($prefix); ?>_exp_month').val(),
     1825                                    exp_year: $('#<?php echo esc_html($prefix); ?>_exp_year').val()
    18251826                                },
    18261827                                success: function (response) {
    1827                                     a<?php echo $prefix; ?>_secureSubmitResponseHandler(response);
     1828                                    a<?php echo esc_html($prefix); ?>_secureSubmitResponseHandler(response);
    18281829                                },
    18291830                                error: function (response) {
    1830                                     a<?php echo $prefix; ?>_secureSubmitResponseHandler(response);
     1831                                    a<?php echo esc_html($prefix); ?>_secureSubmitResponseHandler(response);
    18311832                                }
    18321833                            });
    18331834
    1834                             $('#<?php echo $prefix; ?>-securesubmit-button').hide();
     1835                            $('#<?php echo esc_html($prefix); ?>-securesubmit-button').hide();
    18351836                        }
    18361837
     
    18401841                    };
    18411842
    1842                     function a<?php echo $prefix; ?>_secureSubmitResponseHandler(response) {
     1843                    function a<?php echo esc_html($prefix); ?>_secureSubmitResponseHandler(response) {
    18431844                        if (response.message) {
    18441845                            alert(response.message);
    1845                             $('#<?php echo $prefix; ?>-securesubmit-button').show();
     1846                            $('#<?php echo esc_html($prefix); ?>-securesubmit-button').show();
    18461847                        } else {
    1847                             $('#<?php echo $prefix; ?>_securesubmit_token').val(response.token_value);
    1848                             a<?php echo $prefix; ?>_chargeToken();
     1848                            $('#<?php echo esc_html($prefix); ?>_securesubmit_token').val(response.token_value);
     1849                            a<?php echo esc_html($prefix); ?>_chargeToken();
    18491850                        }
    18501851                    }
    18511852
    1852                     function a<?php echo $prefix; ?>_chargeToken() {
    1853                         var form = $('#<?php echo $prefix; ?>_form');
     1853                    function a<?php echo esc_html($prefix); ?>_chargeToken() {
     1854                        var form = $('#<?php echo esc_html($prefix); ?>_form');
    18541855                        var sameAsBilling = jQuery('[name="same_as_billing"]') && jQuery('[name="same_as_billing"]').is(':checked');
    18551856                        var continueProcessing = true;
     
    18621863                                if (jQuery(this).val() == '' || jQuery(this).val() == 'Select an option below') {
    18631864                                    alert('Please complete all required fields before proceeding.');
    1864                                     $('#<?php echo $prefix; ?>-securesubmit-button').show();
     1865                                    $('#<?php echo esc_html($prefix); ?>-securesubmit-button').show();
    18651866                                    continueProcessing = false;
    18661867                                    return;
     
    18711872                        if (continueProcessing) {
    18721873                            var datastring = form.serialize();
    1873                             var url = "<?php echo admin_url('admin-ajax.php'); ?>";
     1874                            var url = "<?php echo esc_html(admin_url('admin-ajax.php')); ?>";
    18741875
    18751876                            //wat?!
     
    18841885                            $.post(url, datastring, function (response) {
    18851886                                if (response.indexOf("successful") >= 0) {
    1886                                     $('#<?php echo $prefix; ?>_card_number').val('');
    1887                                     $('#<?php echo $prefix; ?>_card_cvc').val('');
    1888                                     $('#<?php echo $prefix; ?>_formContainer').hide();
    1889                                     $('#<?php echo $prefix; ?>_success').show();
     1887                                    $('#<?php echo esc_html($prefix); ?>_card_number').val('');
     1888                                    $('#<?php echo esc_html($prefix); ?>_card_cvc').val('');
     1889                                    $('#<?php echo esc_html($prefix); ?>_formContainer').hide();
     1890                                    $('#<?php echo esc_html($prefix); ?>_success').show();
    18901891
    18911892                                } else {
     
    18941895                                        grecaptcha.reset($(".g-recaptcha").attr('data-widgit-id'));
    18951896                                    }
    1896                                     $('#<?php echo $prefix; ?>-securesubmit-button').show();
     1897                                    $('#<?php echo esc_html($prefix); ?>-securesubmit-button').show();
    18971898                                }
    18981899                            });
     
    19051906            [/raw]
    19061907        <?php } ?>
    1907         <script src="https://js.globalpay.com/v1/globalpayments.js"></script>
     1908        <?php
     1909            wp_enqueue_script('global-payments','https://js.globalpay.com/v1/globalpayments.js');
     1910        ?>
    19081911        <?php
    19091912        return ob_get_clean();
     
    19121915    function isValidRecaptchaToken($token){
    19131916
    1914         $curl    = curl_init();
    19151917        $recaptchaInfo = array("secret" => $this->recaptchaSecretKey, "response" => $token);
    1916         curl_setopt_array($curl, array(
    1917             CURLOPT_URL            => self::RECAPTCHA_VERIFY_URL,
    1918             CURLOPT_RETURNTRANSFER => true,
    1919             CURLOPT_SSL_VERIFYPEER => false,
    1920             CURLOPT_POST           => true,
    1921             CURLOPT_POSTFIELDS     => $recaptchaInfo,
    1922         ));
    1923         $response = curl_exec($curl);
    1924         curl_close($curl);
     1918        $args = array();
     1919        $args['method'] = 'POST';
     1920        $args['timeout'] = 100;
     1921        $args['sslverify'] = false;
     1922        $args['body'] = $recaptchaInfo;
     1923        $args['httpversion'] = '1.0';
     1924        $args['blocking'] = true;
     1925
     1926        $response = wp_remote_post(self::RECAPTCHA_VERIFY_URL, $args);
     1927        $response =  wp_remote_retrieve_body( $response );
     1928
    19251929        if(empty($response)) {
    19261930            return false;
     
    19941998
    19951999        if($amount > $amountCap){
    1996             die(sprintf('Amount cannot be greater than $%01.2f. Please contact customer support for assistance.', $amountCap));
     2000            die(sprintf('Amount cannot be greater than $%01.2f. Please contact customer support for assistance.', esc_html($amountCap)));
    19972001        }
    19982002
     
    22462250            }
    22472251
    2248             die($e->getMessage());
    2249         }
    2250 
    2251         die('Your Payment was successful! Thank you.' . $body);
     2252            die(esc_html($e->getMessage()));
     2253        }
     2254
     2255        die('Your Payment was successful! Thank you.' . esc_html($body));
    22522256    }
    22532257
  • securesubmit/trunk/lib/src/Abstractions/HpsBuilderAbstract.php

    r1597378 r3252230  
    9393            if (!$result) {
    9494                $class = $validation['exceptionType'];
    95                 throw new $class($validation['exceptionMessage'], 0);
     95                throw new $class(esc_attr($validation['exceptionMessage']), 0);
    9696            }
    9797        }
     
    150150            $this->addAction($action);
    151151        } else {
    152             throw new HpsUnknownPropertyException($this, $property);
     152            throw new HpsUnknownPropertyException(esc_attr($this), esc_attr($property));
    153153        }
    154154    }
  • securesubmit/trunk/lib/src/Abstractions/HpsGatewayServiceAbstract.php

    r1597378 r3252230  
    3232        if ($this->_isConfigInvalid()) {
    3333            throw new HpsAuthenticationException(
    34                 HpsExceptionCodes::INVALID_CONFIGURATION,
     34                esc_attr(HpsExceptionCodes::INVALID_CONFIGURATION),
    3535                "The HPS SDK has not been properly configured. "
    3636                ."Please make sure to initialize the config "
     
    4848            }
    4949            throw new HpsAuthenticationException(
    50                 HpsExceptionCodes::INVALID_CONFIGURATION,
    51                 $message
     50                esc_attr(HpsExceptionCodes::INVALID_CONFIGURATION),
     51                esc_attr($message)
    5252            );
    5353        }
     
    5656
    5757        try {
    58             $request = curl_init();
    59             curl_setopt($request, CURLOPT_URL, $url);
    60             curl_setopt($request, CURLOPT_CONNECTTIMEOUT, 100);
    61             curl_setopt($request, CURLOPT_TIMEOUT, 100);
    62             curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
    63             curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
    64             curl_setopt($request, CURLOPT_SSL_VERIFYHOST, false);
    65             if ($data != null) {
    66                 $logger->log('Request data', $data);
    67                 curl_setopt($request, CURLOPT_CUSTOMREQUEST, $httpVerb);
    68                 curl_setopt($request, CURLOPT_POSTFIELDS, $data);
    69             }
    70             $logger->log('Request headers', $headers);
    71             curl_setopt($request, CURLOPT_HTTPHEADER, $headers);
    72             curl_setopt($request, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
     58            $args = array();
     59            $args['headers'] = $headers;
     60            $args['sslverify'] = false;
     61            $args['method'] = $httpVerb;
     62            $args['timeout'] = 100;
     63            $args['body'] = (string)$data;
     64            $args['httpversion'] = '1.0';
     65            $args['blocking'] = true;
    7366
    74             if ($this->_config->useProxy) {
    75                 curl_setopt($request, CURLOPT_PROXY, $this->_config->proxyOptions['proxy_host']);
    76                 curl_setopt($request, CURLOPT_PROXYPORT, $this->_config->proxyOptions['proxy_port']);
     67            error_log(print_r($args, true));
     68            $response = wp_remote_post($url, $args);
     69            $body =  wp_remote_retrieve_body( $response );
     70
     71            if ( is_wp_error( $response ) ) {
     72                $error_message = $response->get_error_message();
     73                echo "Something went wrong: ". esc_attr($error_message);
     74            } else {
     75                error_log('remote response start');
     76                error_log(print_r($response,true));
     77                error_log('remote response end');
    7778            }
    7879
    79             if (
    80                 $this->_config->curlOptions != null
    81                 && !empty($this->_config->curlOptions)
    82             ) {
    83                 curl_setopt_array($request, $this->_config->curlOptions);
    84             }
     80            $curlResponse = $body;
     81            $curlInfo['http_code'] = wp_remote_retrieve_response_code($response);
     82            $curlError = wp_remote_retrieve_response_code($response);
    8583
    86             $curlResponse = curl_exec($request);
    87             $curlInfo = curl_getinfo($request);
    88             $curlError = curl_errno($request);
    89 
    90             $logger->log('Response data', $curlResponse);
     84            $logger->log('Response data:', $curlResponse);
    9185            $logger->log('Curl info', $curlInfo);
    9286            $logger->log('Curl error', $curlError);
     
    9589                throw new HpsException("gateway_time-out");
    9690            }
     91            if ($data != null) {
     92                $logger->log('Request data', $data);
     93            }
     94            $logger->log('Request headers', $headers);
    9795
    9896            if ($curlError == 35) { //CURLE_SSL_CONNECT_ERROR
     
    106104        } catch (Exception $e) {
    107105            throw new HpsGatewayException(
    108                 $e->getCode() != null ? $e->getCode() : HpsExceptionCodes::UNKNOWN_GATEWAY_ERROR,
    109                 $e->getMessage() != null ? $e->getMessage() : 'Unable to process transaction',
     106                $e->getCode() != null ? esc_attr($e->getCode()) : esc_attr(HpsExceptionCodes::UNKNOWN_GATEWAY_ERROR),
     107                $e->getMessage() != null ? esc_attr($e->getMessage()) : 'Unable to process transaction',
    110108                null,
    111109                null,
    112                 $e
     110                esc_attr($e)
    113111            );
    114112        }
  • securesubmit/trunk/lib/src/Entities/HpsDirectMarketData.php

    r1597378 r3252230  
    1212
    1313        if ($shipMonth == null) {
    14           $shipMonth = date('m');
     14          $shipMonth = gmdate('m');
    1515        }
    1616        $this->shipMonth = $shipMonth;
    1717
    1818        if ($shipDay == null) {
    19           $shipDay = date('d');
     19          $shipDay = gmdate('d');
    2020        }
    2121        $this->shipDay = $shipDay;
  • securesubmit/trunk/lib/src/Infrastructure/Validation/HpsGatewayResponseValidation.php

    r1597378 r3252230  
    1414        if (!isset($response->Transaction) || !isset($response->Transaction->$expectedType)) {
    1515            throw new HpsGatewayException(
    16                 HpsExceptionCodes::UNEXPECTED_GATEWAY_ERROR,
     16                esc_attr(HpsExceptionCodes::UNEXPECTED_GATEWAY_ERROR),
    1717                'Unexpected response from HPS gateway'
    1818            );
  • securesubmit/trunk/lib/src/Infrastructure/Validation/HpsInputValidation.php

    r1597378 r3252230  
    1818        if ($amount < 0 || $amount === null) {
    1919            throw new HpsInvalidRequestException(
    20                 HpsExceptionCodes::INVALID_AMOUNT,
     20                esc_attr(HpsExceptionCodes::INVALID_AMOUNT),
    2121                'Must be greater than or equal to 0.',
    2222                'amount'
     
    3636        if ($currency == null || $currency == '') {
    3737            throw new HpsInvalidRequestException(
    38                 HpsExceptionCodes::MISSING_CURRENCY,
     38                esc_attr(HpsExceptionCodes::MISSING_CURRENCY),
    3939                'Currency cannot be none',
    4040                'currency'
     
    4242        } else if (!in_array(strtolower($currency), $currencies)) {
    4343            throw new HpsInvalidRequestException(
    44                 HpsExceptionCodes::INVALID_CURRENCY,
    45                 "'".strtolower($currency)."' is not a supported currency",
     44                esc_attr(HpsExceptionCodes::INVALID_CURRENCY),
     45                "'".esc_html(strtolower($currency))."' is not a supported currency",
    4646                'currency'
    4747            );
     
    6161    public static function checkDateNotFuture($date)
    6262    {
    63         $current = date('Y-m-d\TH:i:s.00\Z', time());
     63        $current = gmdate('Y-m-d\TH:i:s.00\Z', time());
    6464
    6565        if ($date != null && $date > $current) {
    6666            throw new HpsInvalidRequestException(
    67                 HpsExceptionCodes::INVALID_DATE,
     67                esc_attr(HpsExceptionCodes::INVALID_DATE),
    6868                'Date cannot be in the future'
    6969            );
     
    8989            $errorMessage = 'The value for phone number can be no more than ' . self::$_inputFldMaxLength['PhoneNumber'] . ' characters, Please try again after making corrections';
    9090            throw new HpsInvalidRequestException(
    91             HpsExceptionCodes::INVALID_PHONE_NUMBER, $errorMessage
     91                esc_attr(HpsExceptionCodes::INVALID_PHONE_NUMBER), esc_attr($errorMessage)
    9292            );
    9393        }
     
    108108            $errorMessage = 'The value for zip code can be no more than ' . self::$_inputFldMaxLength['ZipCode'] . ' characters, Please try again after making corrections';
    109109            throw new HpsInvalidRequestException(
    110             HpsExceptionCodes::INVALID_ZIP_CODE, $errorMessage
     110                esc_attr(HpsExceptionCodes::INVALID_ZIP_CODE), esc_attr($errorMessage)
    111111            );
    112112        }
     
    131131            $errorMessage = "The value for $type can be no more than " . self::$_inputFldMaxLength[$type] . ' characters, Please try again after making corrections';
    132132            throw new HpsInvalidRequestException(
    133                 HpsExceptionCodes::INVALID_INPUT_LENGTH, $errorMessage
     133                esc_attr(HpsExceptionCodes::INVALID_INPUT_LENGTH), esc_attr($errorMessage)
    134134            );
    135135        }
     
    150150        if(!empty($value) && filter_var($value, FILTER_VALIDATE_EMAIL) === false){           
    151151            throw new HpsInvalidRequestException(
    152                 HpsExceptionCodes::INVALID_EMAIL_ADDRESS, 'Invalid email address'
     152                esc_attr(HpsExceptionCodes::INVALID_EMAIL_ADDRESS), 'Invalid email address'
    153153            );
    154154        }
     
    158158            $errorMessage = "The value for Email can be no more than " . self::$_inputFldMaxLength['Email'] . ' characters, Please try again after making corrections';
    159159            throw new HpsInvalidRequestException(
    160                 HpsExceptionCodes::INVALID_INPUT_LENGTH, $errorMessage
     160                esc_attr(HpsExceptionCodes::INVALID_INPUT_LENGTH), esc_attr($errorMessage)
    161161            );
    162162        }
  • securesubmit/trunk/lib/src/Services/Fluent/Gateway/Credit/HpsCreditServiceListTransactionsBuilder.php

    r1597378 r3252230  
    3939        parent::execute();
    4040
    41         date_default_timezone_set("UTC");
     41        wp_timezone_string("UTC");
    4242        $dateFormat = 'Y-m-d\TH:i:s.00\Z';
    4343        $current = new DateTime();
  • securesubmit/trunk/lib/src/Services/Fluent/Gateway/HpsFluentCheckService.php

    r1597378 r3252230  
    5151            ($check->checkHolder == null || $check->checkHolder->checkName == null)) {
    5252            throw new HpsInvalidRequestException(
    53                 HpsExceptionCodes::MISSING_CHECK_NAME,
     53                esc_attr(HpsExceptionCodes::MISSING_CHECK_NAME),
    5454                'For SEC code CCD, the check name is required',
    5555                'check_name'
     
    102102        if ($response->responseCode != 0) {
    103103            throw new HpsCheckException(
    104                 $rsp->Header->GatewayTxnId,
    105                 $response->details,
    106                 $response->responseCode,
    107                 $response->responseText
     104                esc_html($rsp->Header->GatewayTxnId),
     105                esc_html($response->details),
     106                esc_html($response->responseCode),
     107                esc_html($response->responseText)
    108108            );
    109109        }
  • securesubmit/trunk/lib/src/Services/Fluent/Gateway/HpsFluentCreditService.php

    r1597378 r3252230  
    145145            } catch (Exception $e) {
    146146                throw new HpsGatewayException(
    147                     HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR,
     147                    esc_html(HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR),
    148148                    'Error occurred while reversing a charge due to HPS gateway timeout',
    149                     $e
     149                    esc_html($e)
    150150                );
    151151            }
     
    175175                        }
    176176                        throw new HpsCreditException(
    177                             $transactionId,
    178                             HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR,
     177                            esc_attr($transactionId),
     178                            esc_attr(HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR),
    179179                            'Error occurred while reversing a charge due to HPS issuer timeout',
    180                             $e
     180                            esc_attr($e)
    181181                        );
    182182                    } catch (HpsException $e) {
    183183                        throw new HpsCreditException(
    184                             $transactionId,
    185                             HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR,
     184                            esc_attr($transactionId),
     185                            esc_attr(HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR),
    186186                            'Error occurred while reversing a charge due to HPS issuer timeout',
    187                             $e
     187                            esc_attr($e)
    188188                        );
    189189                    }
     
    204204                        $this->reverse($cardData, $this->_amount, $this->_currency);
    205205                    } catch (Exception $e) {
    206                         throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
     206                        throw new HpsGatewayException('0', esc_attr(HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR));
    207207                    }
    208208                }
    209                 throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
     209                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', esc_attr($e), 'gateway_timeout');
    210210            }
    211211            throw $e;
  • securesubmit/trunk/lib/src/Services/Gateway/AltPayment/HpsAltPaymentService.php

    r1597378 r3252230  
    279279            } catch (Exception $e) {
    280280                throw new HpsGatewayException(
    281                     HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR,
     281                    esc_attr(HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR),
    282282                    'Error occurred while reversing a charge due to HPS gateway timeout',
    283                     $e
     283                    esc_attr($e)
    284284                );
    285285            }
     
    322322                //     }
    323323                // }
    324                 throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
     324                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', esc_attr($e), 'gateway_timeout');
    325325            }
    326326            throw $e;
  • securesubmit/trunk/lib/src/Services/Gateway/AltPayment/HpsMasterPassService.php

    r1597378 r3252230  
    424424            throw new HpsArgumentException(
    425425                'Currency is not supported',
    426                 HpsExceptionCodes::INVALID_CURRENCY
     426                esc_attr(HpsExceptionCodes::INVALID_CURRENCY)
    427427            );
    428428        }
     
    549549        }
    550550
    551         throw new HpsException((string)$response->ErrorDesc);
     551        throw new HpsException(esc_attr((string)$response->ErrorDesc));
    552552    }
    553553
     
    569569        }
    570570
    571         throw new HpsException((string)$response->ErrorDesc);
     571        throw new HpsException(esc_attr((string)$response->ErrorDesc));
    572572    }
    573573
  • securesubmit/trunk/lib/src/Services/Gateway/HpsAttachmentService.php

    r1597378 r3252230  
    5353        $GatewayTxnId = filter_var($GatewayTxnId, FILTER_SANITIZE_NUMBER_FLOAT);
    5454        if (!$GatewayTxnId) {
    55             throw new HpsArgumentException('Gateway Transaction ID required', HpsExceptionCodes::INVALID_NUMBER);
     55            throw new HpsArgumentException('Gateway Transaction ID required', esc_attr(HpsExceptionCodes::INVALID_NUMBER));
    5656        }
    5757
     
    6060        // this is a limitation of the gateway and we want to inform the user
    6161        if ($AttachmentTypeProvided && $AttachmentDataId) {
    62             throw new HpsGatewayException(HpsExceptionCodes::GATEWAY_ERROR, "Since the AttachmentDataId was provided the AttachmentType was ignored by the server");
     62            throw new HpsGatewayException(esc_attr(HpsExceptionCodes::GATEWAY_ERROR), "Since the AttachmentDataId was provided the AttachmentType was ignored by the server");
    6363            trigger_error("Since the AttachmentDataId was provided the AttachmentType was ignored by the server", E_USER_NOTICE);
    6464        }
     
    102102        } catch (HpsException $e) {
    103103            if ($e->innerException != null && $e->innerException->getMessage() == 'gateway_time-out') {
    104                 throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
     104                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', esc_attr($e), 'gateway_timeout');
    105105            }
    106106            throw $e;
     
    139139        if ($gatewayRspCode == '3') {
    140140            throw new HpsGatewayException(
    141                 HpsExceptionCodes::GATEWAY_ERROR,
    142                 'Image could not be retrieved for ' . $transactionId
     141                esc_attr(HpsExceptionCodes::GATEWAY_ERROR),
     142                'Image could not be retrieved for ' . esc_attr($transactionId)
    143143            );
    144144        }
  • securesubmit/trunk/lib/src/Services/Gateway/HpsCentinelGatewayService.php

    r1597378 r3252230  
    4343            case '500':
    4444                $faultString = '';
    45                 throw new HpsException($faultString);
     45                throw new HpsException(esc_attr($faultString));
    4646                break;
    4747            default:
  • securesubmit/trunk/lib/src/Services/Gateway/HpsCheckService.php

    r1597378 r3252230  
    7676            ($check->checkHolder == null || $check->checkHolder->checkName == null)) {
    7777            throw new HpsInvalidRequestException(
    78                 HpsExceptionCodes::MISSING_CHECK_NAME,
     78                esc_attr(HpsExceptionCodes::MISSING_CHECK_NAME),
    7979                'For SEC code CCD, the check name is required',
    8080                'check_name'
     
    117117        if ($response->responseCode != 0) {
    118118            throw new HpsCheckException(
    119                 $rsp->Header->GatewayTxnId,
    120                 $response->details,
    121                 $response->responseCode,
    122                 $response->responseText
     119                esc_attr($rsp->Header->GatewayTxnId),
     120                esc_attr($response->details),
     121                esc_attr($response->responseCode),
     122                esc_attr($response->responseText)
    123123            );
    124124        }
  • securesubmit/trunk/lib/src/Services/Gateway/HpsCreditService.php

    r3020479 r3252230  
    277277    {
    278278        $this->_filterBy = $filterBy;
    279         date_default_timezone_set("UTC");
     279        wp_timezone_string("UTC");
    280280        $dateFormat = 'Y-m-d\TH:i:s.00\Z';
    281281        $current = new DateTime();
     
    429429            } catch (Exception $e) {
    430430                throw new HpsGatewayException(
    431                     HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR,
     431                    esc_attr(HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR),
    432432                    'Error occurred while reversing a charge due to HPS gateway timeout',
    433                     $e
     433                    esc_attr($e)
    434434                );
    435435            }
     
    459459                        }
    460460                        throw new HpsCreditException(
    461                             $transactionId,
    462                             HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR,
     461                            esc_attr($transactionId),
     462                            esc_attr(HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR),
    463463                            'Error occurred while reversing a charge due to HPS issuer timeout',
    464                             $e
     464                            esc_attr($e)
    465465                        );
    466466                    } catch (HpsException $e) {
    467467                        throw new HpsCreditException(
    468                             $transactionId,
    469                             HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR,
     468                            esc_attr($transactionId),
     469                            esc_attr(HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR),
    470470                            'Error occurred while reversing a charge due to HPS issuer timeout',
    471                             $e
     471                            esc_attr($e)
    472472                        );
    473473                    }
     
    504504                        $this->reverse($cardData, $this->_amount, $this->_currency);
    505505                    } catch (Exception $e) {
    506                         throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
     506                        throw new HpsGatewayException('0', esc_attr(HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR));
    507507                    }
    508508                }
    509                 throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
     509                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', esc_attr($e), 'gateway_timeout');
    510510            }
    511511            throw $e;
  • securesubmit/trunk/lib/src/Services/Gateway/HpsDebitService.php

    r1597378 r3252230  
    215215            } catch (Exception $e) {
    216216                throw new HpsGatewayException(
    217                     HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR,
     217                    esc_attr(HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR),
    218218                    'Error occurred while reversing a charge due to HPS gateway timeout',
    219                     $e
     219                    esc_attr($e)
    220220                );
    221221            }
     
    245245                        }
    246246                        throw new HpsCreditException(
    247                             $transactionId,
    248                             HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR,
     247                            esc_attr($transactionId),
     248                            esc_attr(HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR),
    249249                            'Error occurred while reversing a charge due to HPS issuer timeout',
    250                             $e
     250                            esc_attr($e)
    251251                        );
    252252                    } catch (HpsException $e) {
    253253                        throw new HpsCreditException(
    254                             $transactionId,
    255                             HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR,
     254                            esc_attr($transactionId),
     255                            esc_attr(HpsExceptionCodes::ISSUER_TIMEOUT_REVERSAL_ERROR),
    256256                            'Error occurred while reversing a charge due to HPS issuer timeout',
    257                             $e
     257                            esc_attr($e)
    258258                        );
    259259                    }
     
    279279                        $this->reverse($cardData, $this->_amount, $this->_currency);
    280280                    } catch (Exception $e) {
    281                         throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
     281                        throw new HpsGatewayException('0', esc_attr(HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR));
    282282                    }
    283283                }
    284                 throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
     284                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', esc_attr($e), 'gateway_timeout');
    285285            }
    286286            throw $e;
  • securesubmit/trunk/lib/src/Services/Gateway/HpsRestGatewayService.php

    r1597378 r3252230  
    4141        }
    4242
    43         $encodedData = json_encode($data);
     43        $encodedData = wp_json_encode($data);
    4444
    4545        $identity = array();
     
    8282                break;
    8383            case '400':
    84                 throw new HpsException($response->error->message);
     84                throw new HpsException(esc_attr($response->error->message));
    8585                break;
    8686            default:
  • securesubmit/trunk/lib/src/Services/Gateway/HpsSoapGatewayService.php

    r2957905 r3252230  
    4444        $url = $this->_gatewayUrlForKey();
    4545        $header = array(
    46             'Content-type: text/xml;charset="utf-8"',
    47             'Accept: text/xml',
    48             'SOAPAction: ""',
    49             'Content-length: '.strlen($xml->saveXML()),
     46            'Content-Type' => 'text/xml;charset="utf-8"',
     47            'Accept' => 'text/xml',
     48            'SOAPAction' => "",
     49            'Content-length' => strlen($xml->saveXML()),
    5050        );
    5151        $data = $xml->saveXML();
     
    6666            case '500':
    6767                $faultString = $this->_XMLFault2String($curlResponse);
    68                 throw new HpsException($faultString);
     68                throw new HpsException(esc_attr($faultString));
    6969                break;
    7070            default:
  • securesubmit/trunk/lib/src/Services/Gateway/HpsTokenService.php

    r1597378 r3252230  
    4242
    4343        if (isset($response->error) && is_object($response->error)) {
    44             throw new HpsException($response->error->message, $response->error->code);
     44            throw new HpsException(esc_attr($response->error->message), esc_attr($response->error->code));
    4545        }
    4646       
  • securesubmit/trunk/readme.txt

    r3218401 r3252230  
    11=== WP SecureSubmit ===
    2 Contributors: markhagan, tonysmedal, mayur-vachchewar
    3 Tags: donation, donations, payment, buy now, gateway, heartland
     2Contributors: markhagan
     3Tags: donation, payment, buy now, securesubmit, heartland
    44Requires at least: 3.0.1
    55Tested up to: 6.7.1
    66Stable tag: trunk
    7 License: Custom
    8 License URI: https://github.com/SecureSubmit/magento-extension/blob/master/LICENSE
     7License: GPLv2
     8License URI: https://github.com/hps/heartland-wordpress-plugin/blob/master/LICENSE.md
    99
    1010SecureSubmit allows merchants using Heartland Payment Systems to take PCI-Friendly donations on their WordPress site.
     
    5050
    5151== Changelog ==
     52= 1.5.18 =
     53* Vulnerability fixes
     54
    5255= 1.5.17 =
    5356* Bugfix: Corrected gateway endpoints
Note: See TracChangeset for help on using the changeset viewer.