<span class="divider" aria-hidden="true"><i class="glyphicon glyphicon-shopping-cart"></i></span> </div> </div> <div class="text-justify"><?php the_content(); ?> </div> <div class="tabpanel"> <div class="row"> <div class="col-sm-6"> <?php $theme_options = euzakupki_theme_options_get(); ?> <?php echo __(sprintf('Курс € на сегодня: <strong>%s</strong>', $theme_options['currency_fee']), 'euzakupki'); ?> </div> <div class="col-sm-6 text-right"> <p> <?php echo __(sprintf('Задолженность по заказам: <strong>%s</strong>', apply_filters('euzakupki_output_price', euzakupki_get_debt_by_customer(get_current_user_id()))), 'euzakupki'); ?> , <?php echo __(sprintf('<em>%s</em>', apply_filters('euzakupki_output_pln_price', euzakupki_get_debt_by_customer(get_current_user_id()))), 'euzakupki'); ?> </p>
function euzakupki_post_funds_submission($entry, $form) { $map = file_get_contents(get_template_directory() . '/inc/gravityforms/dotpay.json'); $map = json_decode($map); if ($form['id'] != $map->form->id) { return; } $current_user = wp_get_current_user(); if (!$current_user) { return; } $theme_options = euzakupki_theme_options_get(); if (!$theme_options) { return; } $payment_details = euzakupki_get_payment_details($entry['id']); if (!$payment_details) { return; } $amount = str_replace(',', '.', $payment_details->amount); $pln_amount = euzakupki_euro_to_pln($amount); $payment_description = get_bloginfo('name') . '. Order id: ' . $entry['id']; $form_action = PAYMENT_MODE == 'TEST' ? PAYMENT_TEST_URL : PAYMENT_PROD_URL; $api_version = PAYMENT_MODE == 'TEST' ? PAYMENT_TEST_API_VERSION : PAYMENT_PROD_API_VERSION; $merchant_id = PAYMENT_MODE == 'TEST' ? PAYMENT_TEST_MERCHANT_ID : $theme_options['merchant_id']; $merchant_pin = PAYMENT_MODE == 'TEST' ? PAYMENT_TEST_MERCHANT_PIN : $theme_options['merchant_pin']; $customer_email = PAYMENT_MODE == 'TEST' ? get_bloginfo('admin_email') : get_user_meta($current_user->ID, 'nickname', true); $chk = $merchant_id . $pln_amount . PAYMENT_CURRENCY . $payment_description . $entry['id'] . $merchant_pin; $chk = rawurlencode($chk); $signature = md5($chk); ?> <div class="dotpay_payment_container"> <div class="payment-details"> <h3><?php echo __('Детали платежа', 'euzakupki'); ?> </h3> <?php echo __('Сумма к оплате', 'euzakupki'); ?> <strong><?php echo apply_filters('euzakupki_output_price', $amount); ?> </strong> <em><?php echo apply_filters('euzakupki_output_pln_price', $amount); ?> </em> </div> <div class="alert alert-success"> <div class="row"> <div class="col-sm-10"> <strong><?php echo __('Обращаем ваше внимание, что сумма увеличена на 2% (комиссия платёжной системы)', 'euzakupy'); ?> </strong><br /> <?php echo __('Для продолжения оплаты нажмите "Далее". Вы будете перенаправлены на защищенную страницу оплаты', 'euzakupy'); ?> </div> <div class="col-sm-2"> <a href="http://www.dotpay.pl" target="_blank" class="text-left"> <div> </div> <img src="<?php echo get_template_directory_uri() . '/img/logo-dotpay-small.png'; ?> " /> </a> </div> </div> </div> <form action="<?php echo $form_action; ?> " method="post" class="dotpay_payment" id="dotpay_payment"> <input type="hidden" name="id" value="<?php echo $merchant_id; ?> " /> <input type="hidden" name="amount" value="<?php echo $pln_amount; ?> " /> <input type="hidden" name="firstname" value="<?php echo get_user_meta($current_user->ID, 'first_name', true); ?> " /> <input type="hidden" name="lastname" value="<?php echo get_user_meta($current_user->ID, 'last_name', true); ?> " /> <input type="hidden" name="street" value="<?php echo get_user_meta($current_user->ID, 'delivery_street', true); ?> " /> <input type="hidden" name="street_n1" value="<?php echo get_user_meta($current_user->ID, 'delivery_street', true); ?> " /> <input type="hidden" name="city" value="<?php echo get_user_meta($current_user->ID, 'delivery_city', true); ?> " /> <input type="hidden" name="postcode" value="<?php echo get_user_meta($current_user->ID, 'delivery_zip', true); ?> " /> <input type="hidden" name="phone" value="<?php echo get_user_meta($current_user->ID, 'delivery_phone', true); ?> " /> <!-- <input type="hidden" value="--><?php //echo get_user_meta( $current_user->ID, 'delivery_country', true ); ?> <!--" name="country" />--> <input type="hidden" name="country" value="BY" /> <input type="hidden" name="email" value="<?php echo $customer_email; ?> " /> <input type="hidden" name="currency" value="<?php echo PAYMENT_CURRENCY; ?> " /> <input type="hidden" name="URL" value="<?php echo MERCHANT_URL; ?> " /> <input type="hidden" name="URLC" value="<?php echo MERCHANT_URLC; ?> " /> <input type="hidden" name="type" value="<?php echo PAYMENT_TYPE; ?> " /> <input type="hidden" name="description" value="<?php echo $payment_description; ?> " /> <input type="hidden" name="control" value="<?php echo $entry['id']; ?> " /> <input type="hidden" name="api_version" value="<?php echo $api_version; ?> " /> <input type="hidden" name="chk" value="<?php echo $signature; ?> " /> <button class="btn btn-primary"><?php echo __('Дальше', 'euzakupki'); ?> </button> <div> </div> </form> </div> <?php }
function euzakupki_social_get_merchant_pin() { $options = euzakupki_theme_options_get(); $value = isset($options['merchant_pin']) ? $options['merchant_pin'] : ''; echo '<input type="text" name="euzakupki_theme_options[merchant_pin]" value="' . esc_attr($value) . '" class="regular-text" id="merchant_pin" />'; }
/** * @param $amount * * @return bool|string */ function euzakupki_pln_to_euro($amount) { $options = euzakupki_theme_options_get(); if (!$options) { return false; } return number_format(floatval($amount / $options['currency_fee']), 2); }
function euzakupki_cookie_info_html() { $options = euzakupki_theme_options_get(); $value = $options['cookie_info']; ?> <div class="cookie-info hide"> <div class="container alert alert-info"> <div class="row"> <div class="col-sm-11 text-justify"> <?php echo str_replace("\n", "<br />", $value); ?> </div> <div class="col-sm-1"> <div class="close text-right glyphicon glyphicon-remove"></div> </div> </div> </div> </div> <?php }