PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Payments / Migrations / OrderSubscriptions.php

OrderSubscriptions.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.14, at app/Modules/Payments/Migrations/OrderSubscriptions.php

66 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Payments\Migrations;
4
5 if (!defined('ABSPATH')) {
6 exit; // Exit if accessed directly.
7 }
8
9 class OrderSubscriptions
10 {
11 /**
12 * Migrate the table.
13 *
14 * @return void
15 */
16 public static function migrate()
17 {
18 global $wpdb;
19
20 $charsetCollate = $wpdb->get_charset_collate();
21
22 $table = $wpdb->prefix . 'fluentform_subscriptions';
23
24 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Migration file, direct query needed
25 if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table) {
26 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange -- Migration file, schema change is the purpose
27 $sql = "CREATE TABLE $table (
28 id int(20) NOT NULL AUTO_INCREMENT,
29 submission_id int(11),
30 form_id int(11),
31 payment_total int(11) DEFAULT 0,
32 item_name varchar(255),
33 plan_name varchar(255),
34 parent_transaction_id int(11),
35 billing_interval varchar (50),
36 trial_days int(11),
37 initial_amount int(11),
38 quantity int(11) DEFAULT 1,
39 recurring_amount int(11),
40 bill_times int(11),
41 bill_count int(11) DEFAULT 0,
42 vendor_customer_id varchar(255),
43 vendor_subscription_id varchar(255),
44 vendor_plan_id varchar(255),
45 status varchar(255) DEFAULT 'pending',
46 initial_tax_label varchar(255),
47 initial_tax int(11),
48 recurring_tax_label varchar(255),
49 recurring_tax int(11),
50 element_id varchar(255),
51 note text,
52 original_plan text,
53 vendor_response longtext,
54 expiration_at timestamp NULL,
55 created_at timestamp NULL,
56 updated_at timestamp NULL,
57 PRIMARY KEY (id)
58 ) $charsetCollate;";
59
60 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
61
62 dbDelta($sql);
63 }
64 }
65 }
66