HEX
Server: Apache
System: Linux efa57bbe-abb1-400d-2985-3b056fbc2701.secureserver.net 6.1.147-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 24 12:33:32 EDT 2025 x86_64
User: root (0)
PHP: 8.0.30.4
Disabled: NONE
Upload Files
File: /var/www/wp-content/mu-plugins/vendor/godaddy/mwc-core/assets/js/payments/captures.js
(function($) {

	window.MWCPaymentsCaptureHandler = class MWCPaymentsCaptureHandler
	{
		constructor( args )
		{
			this.action = args.action;
			this.ajaxUrl = args.ajaxUrl;
			this.nonce = args.nonce;
			this.orderId = args.orderId;

			this.i18n = {};
			this.i18n.ays = args.i18n.ays;
			this.i18n.errorMessage = args.i18n.errorMessage;

			$( 'button.mwc-payments-capture' ).on( 'click', ( event ) => {

				if ( confirm(this.i18n.ays ) ) {
					this.submit();
				} else {
					event.preventDefault();
				}
			} );
		}

		submit()
		{
			$( '#woocommerce-order-items' ).block( {
				message: null,
				overlayCSS: {
					background: '#fff',
					opacity: 0.6
				}
			} );

			$.post({
				url: this.ajaxUrl,
				data: {
					action: this.action,
					nonce: this.nonce,
					orderId: this.orderId
				}
			}).done((response) => {

				if (! response.success) {
					alert(response.data.message);
					return;
				}

				location.reload();

			}).fail(() => {

				alert(this.i18n.errorMessage);

			}).always(() => {

				$( '#woocommerce-order-items' ).unblock();

			});
		}
	}

})(jQuery);