HEX
Server: Apache
System: Linux top 5.8.11-1.el7.elrepo.x86_64 #1 SMP Tue Sep 22 18:18:35 EDT 2020 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.018111.cn/wp-content/plugins/wp-user-manager/assets/js/src/wpum-stripe.js
(function($) {

	$( document ).ready( function() {

		$('.wpum-registration-form form').submit(function(e){
			if ( ! $('input[name="wpum_stripe_plan"]').length ) {
				return;
			}

			e.preventDefault();

			$('.wpum-message').remove();

			var $submit = $("input[type=submit]",this);
			$submit.attr('disabled', 'disabled').css('opacity', '0.8').val('Registering...');
			var self = this;

			var data = $( this ).serialize();
			data = data + '&' + $submit.attr('name') + '=1';

			$.post( wpum_stripe.ajaxurl, {
					action: 'wpum_stripe_register',
					data: data
				},
				function( response ) {
					if ( !response.success && response.data ) {
						$( self ).before( response.data );
						$submit.removeAttr( 'disabled' ).css( 'opacity', '1' ).val( 'Register' );
						return;
					}

					if ( response.data.id ) {
						const stripe = Stripe( wpum_stripe.stripe );

						stripe.redirectToCheckout( {
							sessionId: response.data.id,
						} );
					} else {
						window.location.href = '/';
					}
				} )
				.fail( function() {
					alert( "error" );
					$submit.removeAttr('disabled').css('opacity', '1').val('Register');
				} );
		} );

		$( '#wpum-stripe-manage-billing').on('click', function(e) {
			e.preventDefault();
			var button = $( this );

			button.attr( 'disabled', 'disabled' ).css( 'opacity', '0.8' )
			$.post( wpum_stripe.ajaxurl, {
					action: 'wpum_stripe_manage_billing',
					nonce: button.data('nonce'),
				},
				function( response ) {
					if ( !response.success && response.data ) {
						alert( response.data );
						button.removeAttr( 'disabled' ).css( 'opacity', '1' );
						return;
					}

					if ( response.data.url ) {
						window.location.href = response.data.url;
					}
					$( this ).removeAttr( 'disabled' ).css( 'opacity', '1' );
				} )
				.fail( function() {
					alert( "Error" );
					$( this ).removeAttr( 'disabled' ).css( 'opacity', '1' );
				} );
		} );

		$( '.wpum-stripe-checkout').on('click', function(e) {
			e.preventDefault();

			var button = $( this );
			var plan_id = button.data('plan-id');

			button.attr( 'disabled', 'disabled' ).css( 'opacity', '0.8' )
			$.post( wpum_stripe.ajaxurl, {
					action: 'wpum_stripe_checkout',
					plan: plan_id,
					nonce: button.data('nonce'),
				},
				function( response ) {
					if ( !response.success && response.data ) {
						alert( response.data );
						button.removeAttr( 'disabled' ).css( 'opacity', '1' );
						return;
					}

					if ( response.data.id ) {
						const stripe = Stripe( wpum_stripe.stripe );

						stripe.redirectToCheckout( {
							sessionId: response.data.id,
						} );
					} else {
						alert( "error" );
					}
					$( this ).removeAttr( 'disabled' ).css( 'opacity', '1' );
				} )
				.fail( function() {
					alert( "error" );
					button.removeAttr( 'disabled' ).css( 'opacity', '1' );
				} );
		} );

	});

}(jQuery));