return self::get_webhook_url_for_rest();
return self::get_webhook_url_for_curl();
* Determine if the REST API is set in WPForms settings.
public static function is_rest_api_set(): bool {
return wpforms_setting( 'square-webhooks-communication', 'rest' ) === 'rest';
* Get webhook URL for cURL fallback.
public static function get_webhook_url_for_curl(): string {
return add_query_arg( self::get_webhook_endpoint_data()['fallback'], '1', site_url() );
* Determine if webhooks are enabled in WPForms settings.
public static function is_webhook_enabled(): bool {
return wpforms_setting( 'square-webhooks-enabled' );
* Determine whether the application fee is supported.
* @param string $currency Currency.
public static function is_application_fee_supported( string $currency = '' ): bool {
$currency = ! $currency ? wpforms_get_currency() : $currency;
return strtoupper( $currency ) === 'USD';