WC_Payment_Gateway::tokenization_script
Enqueues our tokenization script to handle some of the new form options.
Метод класса: WC_Payment_Gateway{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WC_Payment_Gateway = new WC_Payment_Gateway(); $WC_Payment_Gateway->tokenization_script();
Список изменений
| С версии 2.6.0 | Введена. |
Код WC_Payment_Gateway::tokenization_script() WC Payment Gateway::tokenization script WC 10.5.0
public function tokenization_script() {
wp_enqueue_script(
'woocommerce-tokenization-form',
plugins_url( '/assets/js/frontend/tokenization-form' . ( Constants::is_true( 'SCRIPT_DEBUG' ) ? '' : '.min' ) . '.js', WC_PLUGIN_FILE ),
array( 'jquery' ),
WC()->version,
false
);
wp_localize_script(
'woocommerce-tokenization-form',
'wc_tokenization_form_params',
array(
'is_registration_required' => WC()->checkout()->is_registration_required(),
'is_logged_in' => is_user_logged_in(),
)
);
}