<commit_before><?php
/**
 * Adyen Payment Module
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category	Adyen
 * @package	Adyen_Payment
 * @copyright	Copyright (c) 2011 Adyen (http://www.adyen.com)
 * @license	http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * @category   Payment Gateway
 * @package    Adyen_Payment
 * @author     Adyen
 * @property   Adyen B.V
 * @copyright  Copyright (c) 2014 Adyen BV (http://www.adyen.com)
 */
?>
<?php $_code = $this->getMethodCode() ?>

<?php $disabled = $this->getHppOptionsDisabled();?>

<?php $id = ($disabled) ? "" : "adyen_hpp_enable_fields"; ?>
<fieldset id="<?php echo $id; ?>" class="">
    <?php $hidePaymentMethod = ($disabled) ? ' style="display: none;"' : '';?>
    <?php

    // use a different name if hpp options is in the checkout, then this form must always be visable so change the id from basic to let this ignore in the switchMethod javascript call of Magento
//    $paymentmethodId = ($disabled) ? "payment_form_" : "hpp_payment_form_";


    ?>
    <ul id="<?php echo "payment_form_" . $_code; ?>"<?php echo $hidePaymentMethod; ?>>
        <?php
        if(empty($disabled)):
            $enabledTypes = $this->getHppAvailableTypes();
            if(!empty($enabledTypes)):
        ?>
            <li>
                <div class="input-box required-entry">
                    <?php foreach ($enabledTypes as $_typeCode=>$_type): ?>
                    <?php $_typeName = $_type['name']; ?>
                    <?php $filename = $this->getSkinUrl('images'.DS.'adyen'.DS. $_typeCode . ".png"); ?>
                            <table>
                                <tr>
                                    <td width="20px">
                                        <input type="radio" id="hpp_type_<?php echo $_typeCode ?>" name="payment[hpp_type]" value="<?php echo $_typeCode ?>"/>
                                        <input type="hidden" name="payment[hpp_type_label_<?php echo $_typeCode ?>]" value="<?php echo $_typeName; ?>" />
                                    </td>
                                    <td width="80px"><label for="hpp_type_<?php echo $_typeCode ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></label></td>

                                    <?php if ($_typeName == "pm.c_cash.buttonName"):
                                            $_typeName = "Cash";
                                    endif; ?>
                                    <td><label for="hpp_type_<?php echo $_typeCode ?>"><?php echo $this->__($_typeName) ?></label></td>

                                    <?php if ($_typeCode == 'ideal' && !empty($_type['issuers'])): ?>
                                    <td class="payment_form_ideal">
                                        <fieldset class="form-list" id="payment_form_ideal" style="display:none">
                                            <?php
                                            foreach ($_type['issuers'] as $_issueId => $_IssueLabel): ?>
                                                <?php
                                                       $_bankFile = strtoupper(str_replace(" ", '', $_IssueLabel));
                                                       $_filename = $this->getSkinUrl('images'.DS.'adyen'.DS. $_bankFile . ".png");
                                                       if (empty($_issueId) || empty($_IssueLabel)) continue;
                                                ?>
                                                <table class="banks">
                                                    <tr>
                                                        <td width="20px">
                                                            <input type="radio" id="hpp_ideal_type_<?php echo $_issueId ?>" name="payment[hpp_ideal_type]" value="<?php echo $_issueId .DS. $_IssueLabel ?>"/>
                                                        </td>
                                                            <td width="80px"><label for="hpp_ideal_type_<?php echo $_issueId ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_bankFile.png") ?>" alt="<?php echo $_IssueLabel ?>" label="<?php echo $_IssueLabel ?>" /></label></td>
                                                    </tr>
                                                </table>
                                            <?php endforeach ?>
                                        </fieldset>
                                    </td>
                                    <?php endif; ?>
                                </tr>
                            </table>
                            <script type="text/javascript">
                            //<![CDATA[

                                var IdealChecked= function() {

                                    // uncheck hpp_oneclick if exists
                                    if($('oneclick_payment_form_adyen_oneclick'))
                                    {
                                        var form = $('oneclick_payment_form_adyen_oneclick');
                                        var elements = form.getElementsByTagName('input');
                                        for (var i=0; i<elements.length; i++) elements[i].checked = false;

                                        // hide open cvc field
                                        $$('.cvc_block').each(
                                            function (e) {
                                                e.setStyle({display:'none'});
                                            }
                                        );

                                        // hide update link
                                        $$('.update-expiration-date').each(
                                            function (e) {
                                                e.setStyle({display:'none'});
                                            }
                                        );

                                        // hide installment box
                                        $$('.adyen-oneclick-installments').each(
                                            function (e) {
                                                e.setStyle({display:'none'});
                                            }
                                        );

                                    }

                                    var method = $('hpp_type_<?php echo $_typeCode?>');

                                    // set the adyen_hpp payment method
                                    $('p_method_adyen_hpp').checked = true;

                                    payment.switchMethod("adyen_hpp");


                                    if (method.value == 'ideal') {
                                        $('payment_form_ideal').show();
                                    } else {
                                        $('payment_form_ideal').hide();
                                    }
                                };
                                Event.observe($('hpp_type_<?php echo $_typeCode?>'), 'change', IdealChecked);
                            //]]>
                            </script>
                    <?php endforeach ?>
                </div>
            </li>
            <?php endif; ?>
        <?php else: ?>
            <li>
                <?php  echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
            </li>
        <?php endif; ?>
    </ul>
</fieldset><commit_msg>#119 select ideal payment method if you have selected a bank.<commit_after><?php
/**
 * Adyen Payment Module
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category	Adyen
 * @package	Adyen_Payment
 * @copyright	Copyright (c) 2011 Adyen (http://www.adyen.com)
 * @license	http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * @category   Payment Gateway
 * @package    Adyen_Payment
 * @author     Adyen
 * @property   Adyen B.V
 * @copyright  Copyright (c) 2014 Adyen BV (http://www.adyen.com)
 */
?>
<?php $_code = $this->getMethodCode() ?>

<?php $disabled = $this->getHppOptionsDisabled();?>

<?php $id = ($disabled) ? "" : "adyen_hpp_enable_fields"; ?>
<fieldset id="<?php echo $id; ?>" class="">
    <?php $hidePaymentMethod = ($disabled) ? ' style="display: none;"' : '';?>

    <ul id="<?php echo "payment_form_" . $_code; ?>"<?php echo $hidePaymentMethod; ?>>
        <?php
        if(empty($disabled)):
            $enabledTypes = $this->getHppAvailableTypes();
            if(!empty($enabledTypes)):
        ?>
            <li>
                <div class="input-box required-entry">
                    <?php foreach ($enabledTypes as $_typeCode=>$_type): ?>
                    <?php $_typeName = $_type['name']; ?>
                    <?php $filename = $this->getSkinUrl('images'.DS.'adyen'.DS. $_typeCode . ".png"); ?>
                            <table>
                                <tr>
                                    <td width="20px">
                                        <input type="radio" id="hpp_type_<?php echo $_typeCode ?>" name="payment[hpp_type]" value="<?php echo $_typeCode ?>"/>
                                        <input type="hidden" name="payment[hpp_type_label_<?php echo $_typeCode ?>]" value="<?php echo $_typeName; ?>" />
                                    </td>
                                    <td width="80px"><label for="hpp_type_<?php echo $_typeCode ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_typeCode.png") ?>" alt="<?php echo $_typeName ?>" /></label></td>

                                    <?php if ($_typeName == "pm.c_cash.buttonName"):
                                            $_typeName = "Cash";
                                    endif; ?>
                                    <td><label for="hpp_type_<?php echo $_typeCode ?>"><?php echo $this->__($_typeName) ?></label></td>

                                    <?php if ($_typeCode == 'ideal' && !empty($_type['issuers'])): ?>
                                    <td class="payment_form_ideal">
                                        <fieldset class="form-list" id="payment_form_ideal" style="display:none">
                                            <?php
                                            foreach ($_type['issuers'] as $_issueId => $_IssueLabel): ?>
                                                <?php
                                                       $_bankFile = strtoupper(str_replace(" ", '', $_IssueLabel));
                                                       $_filename = $this->getSkinUrl('images'.DS.'adyen'.DS. $_bankFile . ".png");
                                                       if (empty($_issueId) || empty($_IssueLabel)) continue;
                                                ?>
                                                <table class="banks">
                                                    <tr>
                                                        <td width="20px">
                                                            <input type="radio" id="hpp_ideal_type_<?php echo $_issueId ?>" name="payment[hpp_ideal_type]" value="<?php echo $_issueId .DS. $_IssueLabel ?>"/>
                                                        </td>
                                                            <td width="80px"><label for="hpp_ideal_type_<?php echo $_issueId ?>"><img src="<?php echo $this->getSkinUrl('images'.DS.'adyen'.DS."$_bankFile.png") ?>" alt="<?php echo $_IssueLabel ?>" label="<?php echo $_IssueLabel ?>" /></label></td>
                                                    </tr>
                                                </table>
                                                <script type="text/javascript">
                                                    $("hpp_ideal_type_<?php echo $_issueId; ?>").observe("click", function (e) {
                                                        // set ideal as payment method
                                                        $('hpp_type_ideal').checked = true;
                                                        // set the adyen_hpp payment method
                                                        $('p_method_adyen_hpp').checked = true;
                                                        payment.switchMethod("adyen_hpp");
                                                    });
                                                </script>
                                            <?php endforeach ?>
                                        </fieldset>
                                    </td>
                                    <?php endif; ?>
                                </tr>
                            </table>
                            <script type="text/javascript">
                            //<![CDATA[

                                var IdealChecked= function() {

                                    // uncheck hpp_oneclick if exists
                                    if($('oneclick_payment_form_adyen_oneclick'))
                                    {
                                        var form = $('oneclick_payment_form_adyen_oneclick');
                                        var elements = form.getElementsByTagName('input');
                                        for (var i=0; i<elements.length; i++) elements[i].checked = false;

                                        // hide open cvc field
                                        $$('.cvc_block').each(
                                            function (e) {
                                                e.setStyle({display:'none'});
                                            }
                                        );

                                        // hide update link
                                        $$('.update-expiration-date').each(
                                            function (e) {
                                                e.setStyle({display:'none'});
                                            }
                                        );

                                        // hide installment box
                                        $$('.adyen-oneclick-installments').each(
                                            function (e) {
                                                e.setStyle({display:'none'});
                                            }
                                        );

                                    }

                                    var method = $('hpp_type_<?php echo $_typeCode?>');
                                    // set the adyen_hpp payment method
                                    $('p_method_adyen_hpp').checked = true;
                                    payment.switchMethod("adyen_hpp");
                                    if (method.value == 'ideal') {
                                        $('payment_form_ideal').show();
                                    } else {
                                        $('payment_form_ideal').hide();
                                    }
                                };
                                Event.observe($('hpp_type_<?php echo $_typeCode?>'), 'change', IdealChecked);
                            //]]>
                            </script>
                    <?php endforeach ?>
                </div>
            </li>
            <?php endif; ?>
        <?php else: ?>
            <li>
                <?php  echo $this->__('You will be redirected to Adyen website when you place an order.') ?>
            </li>
        <?php endif; ?>
    </ul>
</fieldset>
{'fraction_non_alphanumeric': 0.11995913215938458, 'fraction_numerical': 0.003185287577378448, 'mean_word_length': 0.92347705467576, 'pattern_counts': {'":': 0, '<': 183, '<?xml version=': 0, '>': 203, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 214, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1086713', 'n_tokens_mistral': 3596, 'n_tokens_neox': 3417, 'n_words': 829}