PluginProbe
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More / 0.0.1
Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More v0.0.1
2.4.1 2.4.0 2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.2 2.2.1 2.2.0 2.1.2 2.1.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 68 releases
better-payment / includes / class-betterpayment-installer.php

class-betterpayment-installer.php in Better Payment – Instant Payments, Donations, Fundraising with Subscriptions & More 0.0.1, at includes/class-betterpayment-installer.php

45 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined('ABSPATH') || exit();
3
4 class BetterPayment_Installer
5 {
6
7 public static function install() {
8 self::create_tables();
9 }
10
11 private static function get_schema() {
12 global $wpdb;
13 return [
14 "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}betterpayment(
15 id bigint(20) NOT NULL AUTO_INCREMENT,
16 order_id varchar(50) NOT NULL,
17 transaction_id varchar(50) DEFAULT '',
18 amount decimal(10,2) NOT NULL,
19 status varchar(50) DEFAULT NULL,
20 source varchar(50) NOT NULL,
21 payment_date datetime DEFAULT NULL,
22 email varchar(50) NOT NULL DEFAULT '',
23 customer_info longtext,
24 form_fields_info longtext,
25 currency varchar(11) NOT NULL DEFAULT '',
26 referer varchar(64) DEFAULT NULL,
27 obj_id text,
28 PRIMARY KEY (id),
29 KEY order_id (order_id),
30 KEY status (status)
31 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 "
32 ];
33 }
34
35 public static function create_tables() {
36 global $wpdb;
37 $wpdb->hide_errors();
38 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
39 $tables = self::get_schema();
40 foreach ( $tables as $table ) {
41 dbDelta( $table );
42 }
43 }
44 }
45