# jetformbuilder/3.6.6/modules/gateways/rest-api/count-payments-endpoint.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.6. 41 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/code/modules/gateways/rest-api/count-payments-endpoint.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.6/raw/modules/gateways/rest-api/count-payments-endpoint.php
- Modified: 2025-11-05T11:14:02+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.6/code/modules/gateways/rest-api/count-payments-endpoint.php#L10-L20`.

```php
<?php


namespace JFB_Modules\Gateways\Rest_Api;

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

use Jet_Form_Builder\Db_Queries\Views\View_Base;
use JFB_Components\Rest_Api;
use JFB_Modules\Gateways\Query_Views\Payment_Count_View;

class Count_Payments_Endpoint extends Rest_Api\Rest_Api_Endpoint_Base {

	use Rest_Api\Traits\Paginated_Args;

	public static function get_rest_base() {
		return 'payments/count';
	}

	public static function get_methods() {
		return \WP_REST_Server::READABLE;
	}

	public function check_permission(): bool {
		return current_user_can( 'manage_options' );
	}

	public function run_callback( \WP_REST_Request $request ) {
		$args = View_Base::get_paginated_args( $this->get_paginate_args( $request ) );

		return new \WP_REST_Response(
			array(
				'total' => Payment_Count_View::count( $args ),
			)
		);
	}
}

```
