本文整理汇总了PHP中is_checkout_pay_page函数的典型用法代码示例。如果您正苦于以下问题:PHP is_checkout_pay_page函数的具体用法?PHP is_checkout_pay_page怎么用?PHP is_checkout_pay_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_checkout_pay_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
global $woocommerce;
$this->method_title = 'Amazon Payments Advanced';
$this->id = 'amazon_payments_advanced';
$this->has_fields = function_exists('is_checkout_pay_page') ? is_checkout_pay_page() : is_page(woocommerce_get_page_id('pay'));
$this->icon = apply_filters('woocommerce_amazon_pa_logo', plugins_url(basename(dirname(dirname(__FILE__))) . '/assets/images/amazon-payments.gif'));
// Load the form fields.
$this->init_form_fields();
// Load the settings.
$this->init_settings();
// Define user set variables
$this->title = $this->settings['title'];
$this->seller_id = $this->settings['seller_id'];
$this->mws_access_key = $this->settings['mws_access_key'];
$this->secret_key = $this->settings['secret_key'];
$this->sandbox = $this->settings['sandbox'] == 'yes' ? true : false;
$this->payment_capture = isset($this->settings['payment_capture']) ? $this->settings['payment_capture'] : '';
// Get endpoint
$location = in_array($woocommerce->countries->get_base_country(), array('US', 'GB', 'DE')) ? $woocommerce->countries->get_base_country() : 'US';
$this->endpoint = $this->sandbox ? $this->endpoints['sandbox'][$location] : $this->endpoints['production'][$location];
// Get refererence ID
$this->reference_id = !empty($_REQUEST['amazon_reference_id']) ? $_REQUEST['amazon_reference_id'] : '';
if (isset($_POST['post_data'])) {
parse_str($_POST['post_data'], $post_data);
if (isset($post_data['amazon_reference_id'])) {
$this->reference_id = $post_data['amazon_reference_id'];
}
}
add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
}
开发者ID:sergioblanco86,项目名称:git-gitlab.com-kinivo-kinivo.com,代码行数:34,代码来源:class-wc-gateway-amazon-payments-advanced.php
示例2: is_available
/**
* Disables the gateway under any of these conditions:
* 1) If the cart does not contain a pre-order
* 2) If the pre-order amount is charged upfront
* 3) On the pay page
*
* @since 1.0
* @return bool
*/
public function is_available()
{
$is_available = true;
// Backwards compatibility checking for payment page
if (function_exists('is_checkout_pay_page')) {
$pay_page = is_checkout_pay_page();
} else {
$pay_page = is_page(woocommerce_get_page_id('pay'));
}
// on checkout page
if (!$pay_page || defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT) {
// not available if the cart does not contain a pre-order
if (WC_Pre_Orders_Cart::cart_contains_pre_order()) {
// not available when the pre-order amount is charged upfront
if (WC_Pre_Orders_Product::product_is_charged_upfront(WC_Pre_Orders_Cart::get_pre_order_product())) {
$is_available = false;
}
} else {
$is_available = false;
}
} else {
// not available on the pay page (for now)
$is_available = false;
}
return $is_available;
}
示例3: maybe_remove_unsupported_gateways
/**
* Conditionally remove any gateways that don't support pre-orders on the checkout page when the pre-order is charged
* upon release. This is done because payment info is not required in this case so displaying gateways/payment fields
* is not needed.
*
* @since 1.0
* @param array $available_gateways
* @return array
*/
public function maybe_remove_unsupported_gateways($available_gateways)
{
// Backwards compatibility checking for payment page
if (function_exists('is_checkout_pay_page')) {
$pay_page = is_checkout_pay_page();
} else {
$pay_page = is_page(woocommerce_get_page_id('pay'));
}
// on checkout page
if ($pay_page && WC_Pre_Orders_Cart::cart_contains_pre_order() && WC_Pre_Orders_Product::product_is_charged_upon_release(WC_Pre_Orders_Cart::get_pre_order_product()) || defined('WOOCOMMERCE_CHECKOUT') && WOOCOMMERCE_CHECKOUT && WC_Pre_Orders_Cart::cart_contains_pre_order() && WC_Pre_Orders_Product::product_is_charged_upon_release(WC_Pre_Orders_Cart::get_pre_order_product())) {
// remove any non-supported payment gateways
foreach ($available_gateways as $gateway_id => $gateway) {
if (!method_exists($gateway, 'supports') || false === $gateway->supports('pre-orders')) {
unset($available_gateways[$gateway_id]);
}
}
}
return $available_gateways;
}
示例4: load_stripe_scripts
public function load_stripe_scripts()
{
wp_enqueue_script('stripe', 'https://js.stripe.com/v2/', false, '2.0', true);
wp_enqueue_script('stripewoojs', plugins_url('assets/js/stripewoo.js', __FILE__), array('stripe', 'wc-credit-card-form'), '', true);
$stripe_array = array('stripe_publishablekey' => $this->stripe_sandbox == 'yes' ? $this->stripe_testpublickey : $this->stripe_livepublickey);
if (is_checkout_pay_page()) {
$order_key = urldecode($_GET['key']);
$order_id = absint(get_query_var('order-pay'));
$order = new WC_Order($order_id);
if ($order->id == $order_id && $order->order_key == $order_key) {
$stripe_array['billing_name'] = $order->billing_first_name . ' ' . $order->billing_last_name;
$stripe_array['billing_address_1'] = $order->billing_address_1;
$stripe_array['billing_address_2'] = $order->billing_address_2;
$stripe_array['billing_city'] = $order->billing_city;
$stripe_array['billing_state'] = $order->billing_state;
$stripe_array['billing_postcode'] = $order->billing_postcode;
$stripe_array['billing_country'] = $order->billing_country;
}
}
wp_localize_script('stripewoojs', 'stripe_array', $stripe_array);
}
示例5: woocommerce_intuit_qbms_payment_fields
/**
* Pluggable function to render the checkout page payment fields form
*
* @since 1.0
* @param WC_Gateway_Intuit_QBMS_Credit_Card $gateway gateway object
*/
function woocommerce_intuit_qbms_payment_fields($gateway)
{
// safely display the description, if there is one
if ($gateway->get_description()) {
echo '<p>' . wp_kses_post($gateway->get_description()) . '</p>';
}
$payment_method_defaults = array('account-number' => '', 'exp-month' => '', 'exp-year' => '', 'csc' => '');
// for the demo environment, display a notice and supply a default test payment method
if ($gateway->is_environment('test')) {
echo '<p>' . __('TEST MODE ENABLED', 'woocommerce-gateway-intuit-qbms') . '</p>';
$payment_method_defaults = array('account-number' => '4111111111111111', 'exp-month' => '1', 'exp-year' => date('Y') + 1, 'csc' => '123');
// convenience for testing error conditions
$test_conditions = array('10200_comm' => __('CC Processing Gateway comm error', 'woocommerce-gateway-intuit-qbms'), '10201_login' => __('Processing Gateway login error', 'woocommerce-gateway-intuit-qbms'), '10301_ccinvalid' => __('Invalid CC account number', 'woocommerce-gateway-intuit-qbms'), '10400_insufffunds' => __('Insufficient funds', 'woocommerce-gateway-intuit-qbms'), '10401_decline' => __('Transaction declined', 'woocommerce-gateway-intuit-qbms'), '10403_acctinvalid' => __('Invalid merchant account', 'woocommerce-gateway-intuit-qbms'), '10404_referral' => __('Declined pending voice auth', 'woocommerce-gateway-intuit-qbms'), '10406_capture' => __('Capture error', 'woocommerce-gateway-intuit-qbms'), '10500_general' => __('General error', 'woocommerce-gateway-intuit-qbms'), '10000_avscvdfail' => __('AVS Failure', 'woocommerce-gateway-intuit-qbms'));
echo '<select name="wc-intuit-qbms-test-condition">';
echo '<option value="">' . __('Test an Error Condition:', 'woocommerce-gateway-intuit-qbms') . '</option>';
foreach ($test_conditions as $key => $value) {
echo '<option value="' . $key . '">' . $value . '</option>';
}
echo '</select>';
}
// tokenization is allowed if tokenization is enabled on the gateway
$tokenization_allowed = $gateway->tokenization_enabled();
// on the pay page there is no way of creating an account, so disallow tokenization for guest customers
if ($tokenization_allowed && is_checkout_pay_page() && !is_user_logged_in()) {
$tokenization_allowed = false;
}
$tokens = array();
$default_new_card = true;
if ($tokenization_allowed && is_user_logged_in()) {
$tokens = $gateway->get_payment_tokens(get_current_user_id());
foreach ($tokens as $token) {
if ($token->is_default()) {
$default_new_card = false;
break;
}
}
}
// load the payment fields template file
woocommerce_get_template('checkout/intuit-qbms-payment-fields.php', array('payment_method_defaults' => $payment_method_defaults, 'enable_csc' => $gateway->csc_enabled(), 'tokens' => $tokens, 'tokenization_allowed' => $tokenization_allowed, 'tokenization_forced' => $gateway->tokenization_forced(), 'default_new_card' => $default_new_card), '', $gateway->get_plugin()->get_plugin_path() . '/templates/');
}
示例6: payment_scripts
/**
* payment_scripts function.
*
* Outputs scripts used for stripe payment
*
* @access public
*/
public function payment_scripts()
{
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
if ($this->stripe_checkout) {
wp_enqueue_script('stripe', 'https://checkout.stripe.com/v2/checkout.js', '', '2.0', true);
wp_enqueue_script('woocommerce_stripe', plugins_url('assets/js/stripe_checkout' . $suffix . '.js', WC_STRIPE_MAIN_FILE), array('stripe'), WC_STRIPE_VERSION, true);
} else {
wp_enqueue_script('stripe', 'https://js.stripe.com/v2/', '', '1.0', true);
wp_enqueue_script('woocommerce_stripe', plugins_url('assets/js/stripe' . $suffix . '.js', WC_STRIPE_MAIN_FILE), array('jquery-payment', 'stripe'), WC_STRIPE_VERSION, true);
}
$stripe_params = array('key' => $this->publishable_key, 'i18n_terms' => __('Please accept the terms and conditions first', 'woocommerce-gateway-stripe'), 'i18n_required_fields' => __('Please fill in required checkout fields first', 'woocommerce-gateway-stripe'));
// If we're on the pay page we need to pass stripe.js the address of the order.
if (is_checkout_pay_page() && isset($_GET['order']) && isset($_GET['order_id'])) {
$order_key = urldecode($_GET['order']);
$order_id = absint($_GET['order_id']);
$order = wc_get_order($order_id);
if ($order->id === $order_id && $order->order_key === $order_key) {
$stripe_params['billing_first_name'] = $order->billing_first_name;
$stripe_params['billing_last_name'] = $order->billing_last_name;
$stripe_params['billing_address_1'] = $order->billing_address_1;
$stripe_params['billing_address_2'] = $order->billing_address_2;
$stripe_params['billing_state'] = $order->billing_state;
$stripe_params['billing_city'] = $order->billing_city;
$stripe_params['billing_postcode'] = $order->billing_postcode;
$stripe_params['billing_country'] = $order->billing_country;
}
}
$stripe_params['no_prepaid_card_msg'] = __('Sorry, we\'re not accepting prepaid cards at this time.', 'woocommerce-gateway-stripe');
$stripe_params['allow_prepaid_card'] = apply_filters('wc_stripe_allow_prepaid_card', true) ? 'yes' : 'no';
$stripe_params['stripe_checkout_require_billing_address'] = apply_filters('wc_stripe_checkout_require_billing_address', false) ? 'yes' : 'no';
// localize error messages from Stripe
$stripe_params['invalid_number'] = __('The card number is not a valid credit card number.', 'woocommerce-gateway-stripe');
$stripe_params['invalid_expiry_month'] = __('The card\'s expiration month is invalid.', 'woocommerce-gateway-stripe');
$stripe_params['invalid_expiry_year'] = __('The card\'s expiration year is invalid.', 'woocommerce-gateway-stripe');
$stripe_params['invalid_cvc'] = __('The card\'s security code is invalid.', 'woocommerce-gateway-stripe');
$stripe_params['incorrect_number'] = __('The card number is incorrect.', 'woocommerce-gateway-stripe');
$stripe_params['expired_card'] = __('The card has expired.', 'woocommerce-gateway-stripe');
$stripe_params['incorrect_cvc'] = __('The card\'s security code is incorrect.', 'woocommerce-gateway-stripe');
$stripe_params['incorrect_zip'] = __('The card\'s zip code failed validation.', 'woocommerce-gateway-stripe');
$stripe_params['card_declined'] = __('The card was declined.', 'woocommerce-gateway-stripe');
$stripe_params['missing'] = __('There is no card on a customer that is being charged.', 'woocommerce-gateway-stripe');
$stripe_params['processing_error'] = __('An error occurred while processing the card.', 'woocommerce-gateway-stripe');
$stripe_params['invalid_request_error'] = __('Could not find payment information.', 'woocommerce-gateway-stripe');
wp_localize_script('woocommerce_stripe', 'wc_stripe_params', apply_filters('wc_stripe_params', $stripe_params));
}
示例7: woo_special_nav_class
function woo_special_nav_class($classes, $item)
{
if ((is_woocommerce() || is_product_category() || is_checkout() || is_checkout_pay_page() || is_cart()) && get_post_meta($item->ID, '_menu_item_object_id', true) == SHOP_ID) {
$classes[] = 'current-menu-item';
}
return $classes;
}
示例8: enqueue_scripts_on_checkout
/**
* Enqueue scripts on Checkout
*
* @access public
* @return void
*/
public function enqueue_scripts_on_checkout()
{
// Scripts only needed on the Checkout page
if (!is_page(wc_get_page_id('checkout'))) {
return;
}
// Different scripts for different Checkout styles
if ($this->checkout_style == 'inline') {
// External Stripe script
wp_register_script('subscriptio_stripe_js', 'https://js.stripe.com/v2/');
// jQuery Payment Plugin
if (!wp_script_is('jquery-payment', 'registered')) {
wp_register_script('jquery-payment', SUBSCRIPTIO_PLUGIN_URL . '/assets/gateways/stripe/js/jquery.payment.min.js', array('jquery'), '1.1.2');
}
// Plugin's script
wp_register_script('subscriptio_stripe_inline', SUBSCRIPTIO_PLUGIN_URL . '/assets/gateways/stripe/js/frontend_inline.js', array('jquery'), SUBSCRIPTIO_VERSION);
// Pass Stripe config to frontend
$this->add_stripe_config('subscriptio_stripe_inline');
// Add billing details if payment is being made
if (function_exists('is_checkout_pay_page') ? is_checkout_pay_page() : is_page(woocommerce_get_page_id('pay'))) {
$this->add_billing_details('subscriptio_stripe_inline');
}
// Enqueue scripts
wp_enqueue_script('subscriptio_stripe_js');
wp_enqueue_script('jquery-payment');
wp_enqueue_script('subscriptio_stripe_inline');
}
else {
// External Stripe script
wp_register_script('subscriptio_stripe_checkout_js', 'https://checkout.stripe.com/checkout.js');
// Plugin's script
wp_register_script('subscriptio_stripe_modal', SUBSCRIPTIO_PLUGIN_URL . '/assets/gateways/stripe/js/frontend_modal.js', array('jquery'), SUBSCRIPTIO_VERSION);
// Pass Stripe config to frontend
$this->add_stripe_config('subscriptio_stripe_modal');
// Add billing details if payment is being made
if (function_exists('is_checkout_pay_page') ? is_checkout_pay_page() : is_page(woocommerce_get_page_id('pay'))) {
$this->add_billing_details('subscriptio_stripe_modal');
}
// Enqueue scripts
wp_enqueue_script('subscriptio_stripe_checkout_js');
wp_enqueue_script('subscriptio_stripe_modal');
}
}
示例9: scripts
/**
* Add scripts
*/
public function scripts()
{
$enqueue_scripts = is_cart() || is_checkout() || is_checkout_pay_page();
if (!apply_filters('woocommerce_amazon_pa_enqueue_scripts', $enqueue_scripts)) {
return;
}
$type = 'yes' == $this->settings['enable_login_app'] ? 'app' : 'standard';
wp_enqueue_style('amazon_payments_advanced', plugins_url('assets/css/style.css', __FILE__));
wp_enqueue_script('amazon_payments_advanced_widgets', WC_Amazon_Payments_Advanced_API::get_widgets_url(), array(), '1.0', true);
wp_enqueue_script('amazon_payments_advanced', plugins_url('assets/js/amazon-' . $type . '-widgets.js', __FILE__), array(), '1.0', true);
$redirect_page = is_cart() ? add_query_arg('amazon_payments_advanced', 'true', get_permalink(woocommerce_get_page_id('checkout'))) : add_query_arg('amazon_payments_advanced', 'true');
$params = array('seller_id' => $this->settings['seller_id'], 'reference_id' => $this->reference_id, 'redirect' => esc_url_raw($redirect_page), 'is_checkout_pay_page' => is_checkout_pay_page(), 'is_checkout' => is_checkout(), 'access_token' => $this->access_token);
if ('yes' == $this->settings['enable_login_app']) {
$params['button_type'] = 'LwA';
$params['button_color'] = 'Gold';
$params['button_size'] = 'small';
$params['checkout_url'] = esc_url_raw(get_permalink(woocommerce_get_page_id('checkout')));
}
if (class_exists('WC_Subscriptions_Cart')) {
$cart_contains_subscription = WC_Subscriptions_Cart::cart_contains_subscription() || wcs_cart_contains_renewal();
$change_payment_for_subscription = isset($_GET['change_payment_method']) && wcs_is_subscription(absint($_GET['change_payment_method']));
$params['is_recurring'] = $cart_contains_subscription || $change_payment_for_subscription;
}
$params = array_map('esc_js', apply_filters('woocommerce_amazon_pa_widgets_params', $params));
wp_localize_script('amazon_payments_advanced', 'amazon_payments_advanced_params', $params);
}
示例10: payment_fields
/**
* Payment fields for Realex.
*
* @see WC_Payment_Gateway::payment_fields()
*/
public function payment_fields()
{
if ($this->threedsecure->is_3dsecure_available() && (!is_checkout_pay_page() || isset($_GET['pay_for_order']))) {
parent::payment_fields();
?>
<style type="text/css">#payment ul.payment_methods li label[for='payment_method_realex'] img:nth-child(n+2) { margin-left:1px; }</style>
<?php
return;
}
// default to new card
$card_ref = 'new';
if ($this->vault_available()) {
// get the credit card tokens for the user
$current_user = wp_get_current_user();
$credit_cards = array();
if ($current_user->ID) {
$credit_cards = get_user_meta($current_user->ID, 'woocommerce_realex_cc', true);
}
// if there are saved cards, and one hasn't been selected, default to the first
if ($credit_cards) {
$card_ref = (object) current($credit_cards);
$card_ref = $card_ref->ref;
}
}
?>
<style type="text/css">#payment ul.payment_methods li label[for='payment_method_realex'] img:nth-child(n+2) { margin-left:1px; }</style>
<fieldset>
<?php
if ($this->description) {
?>
<p><?php
echo esc_html($this->description);
?>
<?php
if ($this->is_test_mode()) {
esc_html_e('TEST MODE ENABLED', 'woocommerce-gateway-realex');
}
?>
</p><?php
}
?>
<?php
if ($this->vault_available() && $credit_cards) {
?>
<div>
<p class="form-row form-row-first" style="width:65%;">
<?php
foreach ($credit_cards as $credit_card) {
$credit_card = (object) $credit_card;
?>
<input type="radio" id="<?php
echo esc_attr($credit_card->ref);
?>
" name="realex_card_ref" style="width:auto;" value="<?php
echo esc_attr($credit_card->ref);
?>
" <?php
checked($credit_card->ref, $card_ref);
?>
/>
<label style="display:inline;" for="<?php
echo esc_attr($credit_card->ref);
?>
">
<?php
/* translators: Placeholders: %1$s - credit card type, %2$s - credit card last 4, %3$s - credit card expiration MM/YY */
printf(esc_html__('%1$s ending in %2$s (%3$s)', 'woocommerce-gateway-realex'), $this->card_type_options[$credit_card->type], $credit_card->last4, $credit_card->expiration_month . '/' . $credit_card->expiration_year);
?>
</label><br />
<?php
}
?>
<input type="radio" id="realex_new" name="realex_card_ref" style="width:auto;" <?php
checked('new', $card_ref);
?>
value="0" /> <label style="display:inline;" for="realex_new"><?php
esc_html_e('Use Another Credit Card', 'woocommerce-gateway-realex');
?>
</label>
</p>
<p class="form-row form-row-last" style="width:30%;"><a class="button" href="<?php
echo esc_url(wc_get_page_permalink('myaccount'));
?>
#saved-cards"><?php
echo esc_html($this->managecards);
?>
</a></p>
<div style="clear:both;"></div>
</div>
<div class="clear"></div>
<?php
}
?>
//.........这里部分代码省略.........
示例11: wp_head
wp_head();
?>
</head>
<?php
$class_name = 'header--sticky';
if (wpgrade::option('nav_always_show')) {
$class_name .= ' nav-scroll-show';
} else {
$class_name .= ' nav-scroll-hide';
}
$data_smoothscrolling = wpgrade::option('use_smooth_scroll') == 1 ? 'data-smoothscrolling' : '';
$data_main_color = wpgrade::option('main_color') ? 'data-color="' . wpgrade::option('main_color') . '"' : '';
//first let's test if we are in woocommerce
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
//we need to setup post data
if (is_shop() || is_cart() || is_checkout() || is_checkout_pay_page() || is_account_page() || is_order_received_page()) {
$shop_page_id = wc_get_page_id('shop');
if (!empty($shop_page_id) && $shop_page_id != 0) {
global $post;
$post = get_post($shop_page_id);
setup_postdata($post);
$make_transparent_menu_bar = get_post_meta(wpgrade::lang_page_id(get_the_ID()), wpgrade::prefix() . 'header_transparent_menu_bar', true);
if ($make_transparent_menu_bar == 'on') {
$class_name .= ' header--transparent';
}
}
}
}
//make the header menu bar transparent
//only for static pages
if (is_page()) {
示例12: scripts
/**
* Add scripts
*/
public function scripts()
{
wp_enqueue_style('amazon_payments_advanced', plugins_url('assets/css/style.css', __FILE__));
wp_enqueue_script('amazon_payments_advanced_widgets', WC_AMAZON_PA_WIDGETS_URL, '', '1.0', true);
wp_enqueue_script('amazon_payments_advanced', plugins_url('assets/js/amazon-checkout.js', __FILE__), array('amazon_payments_advanced_widgets'), '1.0', true);
$redirect_page = is_cart() ? add_query_arg('amazon_payments_advanced', 'true', get_permalink(woocommerce_get_page_id('checkout'))) : esc_url_raw(add_query_arg('amazon_payments_advanced', 'true'));
$is_pay_page = function_exists('is_checkout_pay_page') ? is_checkout_pay_page() : is_page(woocommerce_get_page_id('pay'));
wp_localize_script('amazon_payments_advanced', 'amazon_payments_advanced_params', array('seller_id' => $this->settings['seller_id'], 'reference_id' => $this->reference_id, 'redirect' => $redirect_page, 'is_checkout_pay_page' => $is_pay_page));
}
示例13: tokenization_allowed
/**
* Returns true if tokenization is allowed for the payment form. This is true
* if both the gateway supports tokenization and it is enabled.
*
* Note that tokenization is not allowed on the pay page for guest customers,
* as there is no way to create an account there.
*
* @since 4.0.0
* @return bool true if tokenization is allowed
*/
public function tokenization_allowed()
{
// tokenization is allowed if tokenization is enabled on the gateway
$tokenization_allowed = $this->get_gateway()->supports_tokenization() && $this->get_gateway()->tokenization_enabled();
// on the pay page there is no way of creating an account, so disallow tokenization for guest customers
if ($tokenization_allowed && is_checkout_pay_page() && !is_user_logged_in()) {
$tokenization_allowed = false;
}
/**
* Payment Gateway Payment Form Tokenization Allowed.
*
* Filters whether tokenization is allowed for the payment form.
*
* @since 4.0.0
* @param bool $tokenization_allowed
* @param \SV_WC_Payment_Gateway_Payment_Form $this payment form instance
*/
return apply_filters('wc_' . $this->get_gateway()->get_id() . '_payment_form_tokenization_allowed', $tokenization_allowed, $this);
}
示例14: change_payment_method_page_title
/**
* Replace a page title with the endpoint title
*
* @param string $title
* @return string
* @since 2.0
*/
public static function change_payment_method_page_title($title)
{
if (is_main_query() && in_the_loop() && is_page() && is_checkout_pay_page() && self::$is_request_to_change_payment) {
$title = __('Change Payment Method', 'woocommerce-subscriptions');
}
return $title;
}
示例15: payment_scripts
/**
* payment_scripts function.
*
* Outputs scripts used for stripe payment
*
* @access public
*/
public function payment_scripts()
{
if (!is_checkout()) {
return;
}
if ($this->stripe_checkout) {
wp_enqueue_script('stripe', 'https://checkout.stripe.com/v2/checkout.js', '', '2.0', true);
wp_enqueue_script('woocommerce_stripe', plugins_url('assets/js/stripe_checkout.js', dirname(__FILE__)), array('stripe'), WC_STRIPE_VERSION, true);
} else {
wp_enqueue_script('stripe', 'https://js.stripe.com/v2/', '', '1.0', true);
wp_enqueue_script('woocommerce_stripe', plugins_url('assets/js/stripe.js', dirname(__FILE__)), array('stripe'), WC_STRIPE_VERSION, true);
}
$stripe_params = array('key' => $this->publishable_key, 'i18n_terms' => __('Please accept the terms and conditions first', 'woocommerce-gateway-stripe'), 'i18n_required_fields' => __('Please fill in required checkout fields first', 'woocommerce-gateway-stripe'));
// If we're on the pay page we need to pass stripe.js the address of the order.
if (is_checkout_pay_page() && isset($_GET['order']) && isset($_GET['order_id'])) {
$order_key = urldecode($_GET['order']);
$order_id = absint($_GET['order_id']);
$order = new WC_Order($order_id);
if ($order->id == $order_id && $order->order_key == $order_key) {
$stripe_params['billing_first_name'] = $order->billing_first_name;
$stripe_params['billing_last_name'] = $order->billing_last_name;
$stripe_params['billing_address_1'] = $order->billing_address_1;
$stripe_params['billing_address_2'] = $order->billing_address_2;
$stripe_params['billing_state'] = $order->billing_state;
$stripe_params['billing_city'] = $order->billing_city;
$stripe_params['billing_postcode'] = $order->billing_postcode;
$stripe_params['billing_country'] = $order->billing_country;
}
}
wp_localize_script('woocommerce_stripe', 'wc_stripe_params', $stripe_params);
}