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 / PaymentsTable.php

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

49 lines 1.6 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 * Payments table for Square and future payment providers.
15 */
16 class PaymentsTable extends AbstractDatabaseTable
17 {
18 public const TABLE = 'payments';
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) NULL,
31 `formId` INT(11) NOT NULL,
32 `transactionId` VARCHAR(255) NOT NULL,
33 `paymentMethod` VARCHAR(50) NULL DEFAULT 'square',
34 `customerName` VARCHAR(255) NULL,
35 `amount` INT(11) NOT NULL,
36 `currency` VARCHAR(3) NOT NULL,
37 `squareReceiptUrl` VARCHAR(500) NULL,
38 `status` VARCHAR(50) NOT NULL DEFAULT 'succeeded',
39 `providerMeta` TEXT NULL,
40 `dateCreated` DATETIME NULL,
41 PRIMARY KEY (`id`),
42 KEY `entryId` (`entryId`),
43 KEY `formId` (`formId`),
44 KEY `status` (`status`),
45 UNIQUE KEY `transactionId` (`transactionId`)
46 ) DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
47 }
48 }
49