PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
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 / Services / InstallActions / DB / Payment / OrdersTable.php

OrdersTable.php in The Innovative Form Builder – IvyForms 1.5, at backend/src/Services/InstallActions/DB/Payment/OrdersTable.php

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @copyright © Melograno Venture Studio. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace IvyForms\Services\InstallActions\DB\Payment;
9
10 use IvyForms\Common\Exceptions\InvalidArgumentException;
11 use IvyForms\Services\InstallActions\DB\AbstractDatabaseTable;
12
13 /**
14 * Orders table for tracking Square orders linked to form submissions.
15 */
16 class OrdersTable extends AbstractDatabaseTable
17 {
18 public const TABLE = 'orders';
19
20 /**
21 * @return string
22 * @throws InvalidArgumentException
23 */
24 public static function buildTable(): string
25 {
26 $table = self::getTableName();
27
28 return "CREATE TABLE $table (
29 `id` INT(11) NOT NULL AUTO_INCREMENT,
30 `entryId` INT(11) NOT NULL,
31 `squareOrderId` VARCHAR(255) NOT NULL,
32 `status` VARCHAR(50) NOT NULL DEFAULT 'OPEN',
33 `squareCustomerId` VARCHAR(255) NULL,
34 `amount` INT(11) NOT NULL,
35 `currency` VARCHAR(3) NOT NULL,
36 `dateCreated` DATETIME NULL,
37 PRIMARY KEY (`id`),
38 UNIQUE KEY `squareOrderId` (`squareOrderId`),
39 KEY `entryId` (`entryId`)
40 ) DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
41 }
42 }
43