-
Notifications
You must be signed in to change notification settings - Fork 9
/
mtpay_install.php
36 lines (32 loc) · 1.1 KB
/
mtpay_install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
if (!defined('_PS_VERSION_'))
exit;
class MidtransPayInstall
{
public function createTable()
{
/* Set database */
if (!Db::getInstance()->Execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'mt_transaction` (
`id_transaction` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_customer` int(10) NOT NULL,
`id_cart` int(10) NOT NULL,
`id_currency` int(10) NOT NULL,
`request_id` varchar(30) DEFAULT NULL,
`token_merchant` varchar(50) NOT NULL,
`transaction_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id_transaction`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1'))
return false;
if (!Db::getInstance()->Execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'mt_validation` (
`id_validation` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_transaction` int(10) NOT NULL,
`id_order` int(10) NOT NULL,
`order_status` varchar(20) DEFAULT NULL,
`validation_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id_validation`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1'))
return false;
}
}