PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.7
JetFormBuilder — Dynamic Blocks Form Builder v3.4.7
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / gateways / table-views / payments.php
jetformbuilder / modules / gateways / table-views Last commit date
actions 2 years ago columns 2 years ago payments.php 2 years ago
payments.php
96 lines
1 <?php
2
3
4 namespace JFB_Modules\Gateways\Table_Views;
5
6 use Jet_Form_Builder\Admin\Pages\Pages_Manager;
7 use Jet_Form_Builder\Admin\Table_Views\Column_Base;
8 use Jet_Form_Builder\Admin\Table_Views\Columns\Record_Id_Column_Advanced;
9 use Jet_Form_Builder\Admin\Table_Views\View_Advanced_Base;
10 use Jet_Form_Builder\Exceptions\Query_Builder_Exception;
11 use JFB_Modules\Gateways\Db_Models\Payment_To_Payer_Shipping_Model;
12 use JFB_Modules\Gateways\Db_Models\Payment_To_Record;
13 use JFB_Modules\Gateways\Query_Views\Payment_Count_View;
14 use JFB_Modules\Gateways\Query_Views\Payment_View;
15 use Jet_Form_Builder\Admin\Table_Views\Columns\Created_At_Column;
16 use JFB_Modules\Gateways\Table_Views\Columns\Gross_Column;
17 use JFB_Modules\Gateways\Table_Views\Columns\Header_Actions_Column;
18 use JFB_Modules\Gateways\Table_Views\Columns\Payer_Column;
19 use JFB_Modules\Gateways\Table_Views\Columns\Payment_Status_Column;
20 use JFB_Modules\Gateways\Table_Views\Columns\Payment_Type_Column;
21 use JFB_Modules\Gateways\Table_Views\Columns\Row_Actions_Column;
22 use JFB_Modules\Gateways\Table_Views\Columns\Transaction_Column;
23 use JFB_Modules\Gateways\Rest_Api;
24
25 // If this file is called directly, abort.
26 if ( ! defined( 'WPINC' ) ) {
27 die;
28 }
29
30 class Payments extends View_Advanced_Base {
31
32 public function get_raw_list( array $args ): array {
33 try {
34 return ( new Payment_View() )
35 ->set_table_args( $args )
36 ->query()
37 ->query_all();
38 } catch ( Query_Builder_Exception $exception ) {
39 return array();
40 }
41 }
42
43 public function get_dependencies(): array {
44 return array(
45 new Payment_To_Payer_Shipping_Model(),
46 new Payment_To_Record(),
47 );
48 }
49
50 public function get_rest_url(): string {
51 return Rest_Api\Receive_Payments::rest_url();
52 }
53
54 public function get_rest_methods(): string {
55 return Rest_Api\Receive_Payments::get_methods();
56 }
57
58 public function get_total(): int {
59 return Payment_Count_View::count();
60 }
61
62 public function get_empty_message(): string {
63 return __( 'No payments found.', 'jet-form-builder' );
64 }
65
66 public function get_global_actions(): array {
67 return ( new Header_Actions_Column() )->get_value();
68 }
69
70 public function get_columns(): array {
71 return array(
72 Column_Base::CHOOSE => new Record_Id_Column_Advanced(),
73 Column_Base::ACTIONS => new Row_Actions_Column(),
74 'type' => new Payment_Type_Column(),
75 'date' => new Created_At_Column(),
76 'payment_status' => new Payment_Status_Column(),
77 'gross' => new Gross_Column(),
78 'payer' => new Payer_Column(),
79 'transaction' => new Transaction_Column(),
80 'id' => new Record_Id_Column_Advanced(),
81 );
82 }
83
84 public function load_data(): array {
85 return array(
86 'export_url' => Pages_Manager::instance()->get_action_url( 'payments-export' ),
87 'counter_endpoint' => Rest_Api\Count_Payments_Endpoint::get_endpoint(),
88 'messages' => array(
89 'empty_checked' => __( 'You have not selected any payment.', 'jet-form-builder' ),
90 'empty_action' => __( 'You have not selected an action.', 'jet-form-builder' ),
91 ),
92 );
93 }
94
95 }
96