# jetformbuilder/3.6.0.1/modules/gateways/rest-api/gateway-endpoint.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.0.1. 37 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.0.1/code/modules/gateways/rest-api/gateway-endpoint.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.0.1/raw/modules/gateways/rest-api/gateway-endpoint.php
- Modified: 2023-11-20T11:46:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetformbuilder/3.6.0.1/code/modules/gateways/rest-api/gateway-endpoint.php#L10-L20`.

```php
<?php


namespace JFB_Modules\Gateways\Rest_Api;

use JFB_Components\Rest_Api\Dynamic_Rest_Url_Trait;
use JFB_Components\Rest_Api\Rest_Api_Endpoint_Base;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

abstract class Gateway_Endpoint extends Rest_Api_Endpoint_Base {

	use Dynamic_Rest_Url_Trait;

	abstract public static function gateway_rest_base(): string;

	abstract public static function gateway_id(): string;

	public static function get_rest_base() {
		return '(?P<gateway>[\w\-]+)/' . static::gateway_rest_base();
	}

	public function get_common_args(): array {
		return array(
			'gateway' => array(
				'validate_callback' => function ( $param, $request, $key ) {
					return static::gateway_id() === $param;
				},
			),
		);
	}

}

```
