1jQuery(document).ready(function($) { 2 /** 3 * Display Apple Pay in payment methods 4 */ 5 function wcPaytrailInitApplePay() { 6 if ( $( '.wc-paytrail-classic #wc-paytrail-ppa-method-apple_pay' ).length > 0 && typeof checkoutFinland !== 'undefined' ) { 7 const applePayButton = checkoutFinland.applePayButton; 8 9 if (applePayButton.canMakePayment()) { 10 $( '#wc-paytrail-ppa-method-group-applepay' ).removeClass( 'wc-paytrail-hide-ap' ); 11 } 12 } 13 } 14 wcPaytrailInitApplePay(); 15 16 $( document.body ).on( 'updated_checkout', function() { 17 wcPaytrailInitApplePay(); 18 } ); 19 20 /** 21 * When clicking Paytrail card token, add active class and check radio button 22 */ 23 $( 'form.checkout, form#order_review' ).on( 'click', '#payment .payment_methods .payment_method_paytrail_ppa li.woocommerce-SavedPaymentMethods-token', function( e ) { 24 $( '#payment .payment_methods .payment_method_paytrail_ppa li.woocommerce-SavedPaymentMethods-token' ).removeClass( 'selected' ); 25 $( this ).addClass( 'selected' ); 26 $( 'input[type="radio"]', this ).prop( 'checked', true ).change(); 27 } ); 28 29 /** 30 * When clicking Paytrail PPA payment method, add active class and check radio button 31 */ 32 $( 'form.checkout, form#order_review' ).on( 'click', '.wc-paytrail-classic .wc-paytrail-ppa-method', function( e ) { 33 $( '.wc-paytrail-ppa-method.selected').removeClass( 'selected' ); 34 $( this ).addClass( 'selected' ); 35 $( 'input[type="radio"]', this ).prop( 'checked', true ).change(); 36 } ); 37});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.