PluginProbe
The Innovative Form Builder – IvyForms / 1.5.1
The Innovative Form Builder – IvyForms v1.5.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Routes / Payment / Payment.php

Payment.php in The Innovative Form Builder – IvyForms 1.5.1, at backend/src/Routes/Payment/Payment.php

39 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Routes\Payment;
4
5 use IvyForms\Controllers\Payment\GetPaymentController;
6 use IvyForms\Controllers\Payment\SearchPaymentsController;
7 use IvyForms\Vendor\DI\Container;
8 use WP_REST_Server;
9
10 class Payment
11 {
12 public static function registerRoutes(Container $container, string $namespace): void
13 {
14 register_rest_route(
15 $namespace,
16 '/payments',
17 [
18 'methods' => WP_REST_Server::READABLE,
19 'callback' => $container->get(SearchPaymentsController::class),
20 'permission_callback' => static function () {
21 return current_user_can('manage_options');
22 },
23 ]
24 );
25
26 register_rest_route(
27 $namespace,
28 '/payment/entry/(?P<entryId>\d+)',
29 [
30 'methods' => WP_REST_Server::READABLE,
31 'callback' => $container->get(GetPaymentController::class),
32 'permission_callback' => static function () {
33 return current_user_can('manage_options');
34 },
35 ]
36 );
37 }
38 }
39