HEX
Server: Apache/2.4.65 (Debian)
System: Linux 88f31f35b0b8 6.1.0-38-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.147-1 (2025-08-02) x86_64
User: www-data (33)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/wpforms-lite/src/Integrations/PayPalCommerce/Admin/Entries.php
<?php

namespace WPForms\Integrations\PayPalCommerce\Admin;

use WPForms\Integrations\PayPalCommerce\Helpers;

/**
 * PayPal Commerce admin entries.
 *
 * @since 1.10.0
 */
class Entries {

	/**
	 * Register hooks.
	 *
	 * @since 1.10.0
	 */
	public function hooks(): void {

		add_filter( 'wpforms_has_payment_gateway', [ $this, 'has_payment_gateway' ], 10, 2 );
	}

	/**
	 * Make PayPal Commerce payment gateway work on the Entries page.
	 *
	 * @since 1.10.0
	 *
	 * @param bool  $result    Initial value.
	 * @param array $form_data Form data and settings.
	 *
	 * @return bool
	 *
	 * @noinspection PhpMissingParamTypeInspection
	 */
	public function has_payment_gateway( $result, array $form_data ): bool {

		if ( $result ) {
			return (bool) $result;
		}

		return Helpers::is_paypal_commerce_enabled( $form_data );
	}
}