echo leyka_pf_get_amount_field();
    echo leyka_pf_get_hidden_fields();
    ?>

	<input name="leyka_payment_method" value="<?php 
    echo esc_attr($pm->full_id);
    ?>
" type="hidden" />
	<input name="leyka_ga_payment_method" value="<?php 
    echo esc_attr($pm->label);
    ?>
" type="hidden" />
	<div class='leyka-user-data'>
	<?php 
    echo leyka_pf_get_name_field();
    echo leyka_pf_get_email_field();
    echo leyka_pf_get_pm_fields();
    ?>

	</div>
	
<?php 
    echo leyka_pf_get_recurring_field();
    echo leyka_pf_get_agree_field();
    echo leyka_pf_get_submit_field();
    $icons = leyka_pf_get_pm_icons();
    if ($icons) {
        $list = array();
        foreach ($icons as $i) {
            $list[] = "<li>{$i}</li>";
        }
Пример #2
0
function leyka_currency_choice_action()
{
    check_ajax_referer('leyka_payment_form', '_leyka_ajax_nonce');
    if (empty($_POST['currency'])) {
        die('-1');
    }
    $curr_currency = trim($_POST['currency']);
    $pm_selected = trim($_POST['current_pm']);
    $currently_active_pmethods = leyka_get_pm_list(true, $curr_currency);
    $curr_pm_is_active = false;
    foreach ($currently_active_pmethods as $pm) {
        if ($pm->id == $pm_selected) {
            $curr_pm_is_active = true;
            $pm_selected = $pm;
            break;
        }
    }
    if (!$curr_pm_is_active) {
        $pm_selected = reset($currently_active_pmethods);
    }
    leyka_setup_current_pm($pm_selected, $curr_currency);
    echo leyka_pf_get_hidden_fields((int) $_POST['campaign']);
    ?>

    <!-- pm selector -->
    <div id="pm-selector" class="form-part">
        <ul class="leyka-pm-selector">
            <?php 
    foreach ($currently_active_pmethods as $pm) {
        ?>
                <li>
                    <label class="radio">
                        <input type="radio" name="leyka_payment_method" value="<?php 
        echo esc_attr($pm->full_id);
        ?>
" <?php 
        checked($pm_selected->id, $pm->id);
        ?>
 data-pm_id="<?php 
        echo esc_attr($pm->id);
        ?>
">
                        <?php 
        echo $pm->label;
        ?>
                    </label>
                </li>
            <?php 
    }
    ?>
        </ul>
    </div>

    <!-- changeable area -->
    <div id="leyka-pm-data" class="changeable-fields form-part">

        <div class="leyka-pm-fields">

            <div class='leyka-user-data'>
                <!-- field for GA -->
                <input type="hidden" name="leyka_ga_payment_method" value="<?php 
    echo esc_attr($curr_pm->label);
    ?>
" />
                <?php 
    echo leyka_pf_get_name_field();
    echo leyka_pf_get_email_field();
    echo leyka_pf_get_pm_fields();
    ?>
            </div>

            <?php 
    echo leyka_pf_get_agree_field();
    echo leyka_pf_get_submit_field();
    $icons = leyka_pf_get_pm_icons();
    if ($icons) {
        $list = array();
        foreach ($icons as $i) {
            $list[] = "<li>{$i}</li>";
        }
        echo "<ul class='leyka-pm-icons cf'>";
        echo implode('', $list);
        echo "</ul>";
    }
    ?>
        </div>
        <?php 
    echo "<div class='leyka-pm-desc'>" . apply_filters('leyka_the_content', leyka_pf_get_pm_description()) . "</div>";
    ?>

    </div>
    <?php 
    die;
}
	<input name="leyka_ga_payment_method" value="<?php 
    echo esc_attr($pm->label);
    ?>
" type="hidden">
		<input type='hidden' name="leyka_needy_id" value="<?php 
    echo $needyId;
    ?>
" />
		<input type='hidden' name="leyka_needy_type" value="<?php 
    echo $needyType;
    ?>
" />
	<div class='leyka-user-data'>

	<?php 
    echo leyka_pf_get_name_field() . leyka_pf_get_email_field() . leyka_pf_get_pm_fields();
    ?>

	</div>

<?php 
    echo leyka_pf_get_recurring_field() . leyka_pf_get_agree_field() . leyka_pf_get_submit_field();
    $icons = leyka_pf_get_pm_icons();
    if ($icons) {
        $list = array();
        foreach ($icons as $i) {
            $list[] = "<li>{$i}</li>";
        }
        echo '<ul class="leyka-pm-icons cf">' . implode('', $list) . '</ul>';
    }
    ?>