PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.2.3
JetFormBuilder — Dynamic Blocks Form Builder v3.2.3
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 / meta-boxes / payment-details-box.php
jetformbuilder / modules / gateways / meta-boxes Last commit date
actions 2 years ago columns 2 years ago payer-box.php 2 years ago payer-shipping-box.php 2 years ago payment-actions-box.php 2 years ago payment-details-box.php 2 years ago payment-info-for-record.php 2 years ago
payment-details-box.php
80 lines
1 <?php
2
3
4 namespace JFB_Modules\Gateways\Meta_Boxes;
5
6 use Jet_Form_Builder\Admin\Exceptions\Not_Found_Page_Exception;
7 use Jet_Form_Builder\Admin\Single_Pages\Meta_Boxes\Base_List_Box;
8 use Jet_Form_Builder\Admin\Table_Views\Columns\Created_At_Column;
9 use Jet_Form_Builder\Admin\Table_Views\Columns\Updated_At_Column;
10 use Jet_Form_Builder\Exceptions\Query_Builder_Exception;
11 use JFB_Modules\Gateways\Meta_Boxes\Actions\Delete_Payment_Action;
12 use JFB_Modules\Gateways\Meta_Boxes\Columns\Gateway_Type_Column;
13 use JFB_Modules\Gateways\Meta_Boxes\Columns\Payment_Amount_Column;
14 use JFB_Modules\Gateways\Meta_Boxes\Columns\Payment_Currency_Column;
15 use JFB_Modules\Gateways\Table_Views\Columns\Transaction_Column;
16 use JFB_Modules\Gateways\Pages\Single_Payment_Page;
17 use JFB_Modules\Gateways\Query_Views\Payment_View;
18 use JFB_Modules\Gateways\Rest_Api\Receive_Payment;
19 use JFB_Modules\Gateways\Table_Views\Columns\Payment_Status_Column;
20
21 // If this file is called directly, abort.
22 if ( ! defined( 'WPINC' ) ) {
23 die;
24 }
25
26 class Payment_Details_Box extends Base_List_Box {
27
28 public function get_title(): string {
29 return __( 'Payment Details', 'jet-form-builder' );
30 }
31
32 public function get_columns(): array {
33 return array(
34 'amount' => new Payment_Amount_Column(),
35 'code' => new Payment_Currency_Column(),
36 'gateway' => new Gateway_Type_Column(),
37 'status' => new Payment_Status_Column(),
38 'transaction' => new Transaction_Column(),
39 'created_at' => new Created_At_Column(),
40 'updated_at' => new Updated_At_Column(),
41 );
42 }
43
44 public function get_actions(): array {
45 if ( ! is_a( jet_fb_current_page(), Single_Payment_Page::class ) ) {
46 return array();
47 }
48
49 return array(
50 new Delete_Payment_Action(),
51 );
52 }
53
54 public function get_rest_url(): string {
55 return Receive_Payment::dynamic_rest_url(
56 array( 'id' => $this->get_id() )
57 );
58 }
59
60 public function get_rest_methods(): string {
61 return Receive_Payment::get_methods();
62 }
63
64 /**
65 * @return array
66 * @throws Not_Found_Page_Exception
67 */
68 public function get_list(): array {
69 try {
70 return Payment_View::findById( $this->get_id() );
71 } catch ( Query_Builder_Exception $exception ) {
72 throw new Not_Found_Page_Exception(
73 esc_html( $exception->getMessage() ),
74 // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
75 ...$exception->get_additional()
76 );
77 }
78 }
79 }
80