
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    Payment
 * @copyright  Copyright 2006-2020 Webligo Developments
 * @license    http://www.socialengine.com/license/
 * @version    $Id: my.sql 10171 2014-04-18 19:03:41Z mfeineman $
 * @author     John Boehr <j@webligo.com>
 */


-- --------------------------------------------------------

--
-- Table structure for table `engine4_payment_gateways`
--

DROP TABLE IF EXISTS `engine4_payment_gateways`;
CREATE TABLE IF NOT EXISTS `engine4_payment_gateways` (
  `gateway_id` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(128) NOT NULL,
  `description` text NULL,
  `enabled` tinyint(1) unsigned NOT NULL default '0',
  `plugin` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `config` mediumblob NULL,
	`is_recurring` TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'If any gateway supports recurring, use 1; otherwise, use 0.',
  `test_mode` tinyint(1) unsigned NOT NULL default '0',
	`default_icon` TEXT NULL DEFAULT NULL,
  PRIMARY KEY  (`gateway_id`),
  KEY `enabled` (`enabled`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `engine4_payment_gateways`
--

INSERT INTO `engine4_payment_gateways` (`gateway_id`, `title`, `description`, `enabled`, `plugin`, `test_mode`, `is_recurring`) VALUES
(1, 'PayPal', NULL, 0, 'Payment_Plugin_Gateway_PayPal', 0, 1),
(4, 'Bank', NULL, 0, 'Payment_Plugin_Gateway_Bank', 0, 0),
(5, 'Cash', NULL, 0, 'Payment_Plugin_Gateway_Cash', 0, 0),
(6, 'Cheque', NULL, 0, 'Payment_Plugin_Gateway_Cheque', 0, 0),
(3000, 'Wallet', NULL, 0, 'Payment_Plugin_Gateway_Wallet', 0, 1);

-- --------------------------------------------------------

--
-- Table structure for table `engine4_payment_orders`
--

DROP TABLE IF EXISTS `engine4_payment_orders`;
CREATE TABLE IF NOT EXISTS `engine4_payment_orders` (
  `order_id` int(10) unsigned NOT NULL auto_increment,
  `user_id` int(10) unsigned NOT NULL,
  `gateway_id` int(10) unsigned NOT NULL,
  `gateway_order_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL,
  `gateway_transaction_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL,
  `state` enum('pending','cancelled','failed','incomplete','complete') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL default 'pending',
  `creation_date` datetime NOT NULL,
  `source_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL,
  `source_id` int(10) unsigned default NULL,
	`gateway_type` VARCHAR(255) NULL DEFAULT NULL,
  PRIMARY KEY  (`order_id`),
  KEY `user_id` (`user_id`),
  KEY `gateway_id` (`gateway_id`,`gateway_order_id`),
  KEY `state` (`state`),
  KEY `source_type` (`source_type`,`source_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `engine4_payment_packages`
--

DROP TABLE IF EXISTS `engine4_payment_packages`;
CREATE TABLE IF NOT EXISTS `engine4_payment_packages` (
  `package_id` int(10) unsigned NOT NULL auto_increment,
  `title` varchar(128) NOT NULL,
  `description` text NOT NULL,
  `level_id` int(10) unsigned NOT NULL,
  `downgrade_level_id` int(10) unsigned NOT NULL default '0',
  `price` decimal(16,2) unsigned NOT NULL,
  `recurrence` int(11) unsigned NOT NULL,
  `recurrence_type` enum('day','week','month','year','forever') NOT NULL,
  `duration` int(11) unsigned NOT NULL,
  `duration_type` enum('day','week','month','year','forever') NOT NULL,
  `trial_duration` int(11) unsigned NOT NULL default '0',
  `trial_duration_type` enum('day','week','month','year','forever') default NULL,
  `enabled` tinyint(1) unsigned NOT NULL default '1',
  `signup` tinyint(1) unsigned NOT NULL default '1',
  `after_signup` tinyint(1) unsigned NOT NULL default '1',
  `default` tinyint(1) unsigned NOT NULL default '0',
  `extra_day` INT(8) NOT NULL,
  `reminder_email` INT(8) NOT NULL,
  `reminder_email_type` ENUM('day','week','month','year') NOT NULL,
  `send_reminder` TINYINT(1) NOT NULL DEFAULT "1",
  `order` INT(11) NOT NULL DEFAULT '0',
  `photo_id` VARCHAR(255) NULL DEFAULT NULL,
  `packagestyles` TEXT NULL DEFAULT NULL,
  `features` TEXT NULL DEFAULT NULL,
  PRIMARY KEY  (`package_id`),
  KEY `level_id` (`level_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------
--
-- Table structure for table `engine4_payment_products`
--

DROP TABLE IF EXISTS `engine4_payment_products`;
CREATE TABLE IF NOT EXISTS `engine4_payment_products` (
  `product_id` int(10) unsigned NOT NULL auto_increment,
  `extension_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL,
  `extension_id` int(10) unsigned default NULL,
  `sku` bigint(20) unsigned NOT NULL,
  `title` varchar(128) NOT NULL,
  `description` text NOT NULL,
  `price` decimal(16,2) unsigned NOT NULL,
  PRIMARY KEY  (`product_id`),
  UNIQUE KEY `sku` (`sku`),
  KEY `extension_type` (`extension_type`,`extension_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `engine4_payment_subscriptions`
--

DROP TABLE IF EXISTS `engine4_payment_subscriptions`;
CREATE TABLE IF NOT EXISTS `engine4_payment_subscriptions` (
  `subscription_id` int(11) unsigned NOT NULL auto_increment,
  `user_id` int(11) unsigned NOT NULL,
  `package_id` int(11) unsigned NOT NULL,
  `main_package_id` int(11) unsigned NOT NULL DEFAULT '0',
  `status` enum('initial','trial','pending','active','cancelled','expired','overdue','refunded') NOT NULL default 'initial',
  `active` tinyint(1) unsigned NOT NULL default '0',
  `creation_date` datetime NOT NULL,
  `modified_date` datetime default NULL,
  `payment_date` datetime default NULL,
  `expiration_date` datetime default NULL,
  `notes` text NULL,
  `gateway_id` int(10) unsigned default NULL,
  `gateway_profile_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci default NULL,
  `email_reminder` TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'This is for subscription plan is expiring reminder email.',
  PRIMARY KEY  (`subscription_id`),
  UNIQUE KEY `gateway_id` (`gateway_id`, `gateway_profile_id`),
  KEY `user_id` (`user_id`),
  KEY `package_id` (`package_id`),
  KEY `status` (`status`),
  KEY `active` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- --------------------------------------------------------

--
-- Table structure for table `engine4_payment_transactions`
--

DROP TABLE IF EXISTS `engine4_payment_transactions`;
CREATE TABLE IF NOT EXISTS `engine4_payment_transactions` (
  `transaction_id` int(10) unsigned NOT NULL auto_increment,
  `user_id` int(10) unsigned NOT NULL default '0',
  `gateway_id` int(10) unsigned NOT NULL,
  `timestamp` datetime NOT NULL,
  `order_id` int(10) unsigned NOT NULL default '0',
  `type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `state` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `gateway_transaction_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `gateway_parent_transaction_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `gateway_order_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
  `amount` decimal(16,2) NOT NULL,
  `currency` char(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL default '',
  `params` VARCHAR(255) NULL,
  `file_id` INT NULL,
  `expiration_date` DATETIME NULL,
  PRIMARY KEY  (`transaction_id`),
  KEY `user_id` (`user_id`),
  KEY `gateway_id` (`gateway_id`),
  KEY `type` (`type`),
  KEY `state` (`state`),
  KEY `gateway_transaction_id` (`gateway_transaction_id`),
  KEY `gateway_parent_transaction_id` (`gateway_parent_transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Dumping data for table `engine4_core_mailtemplates`
--

INSERT IGNORE INTO `engine4_core_mailtemplates` (`type`, `module`, `vars`) VALUES
('payment_subscription_active', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_subscription_cancelled', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_subscription_expired', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_subscription_overdue', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_subscription_pending', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_subscription_recurrence', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_subscription_refunded', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_subscription_transaction', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link],[gateway_type],[attechment]'),
('payment_subscription_expiredsoon', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link],[plan_name],[period]');

INSERT IGNORE INTO `engine4_core_mailtemplates` (`type`, `module`, `vars`) VALUES
('payment_subscription_changed', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link],[subscription_title],[subscription_description],[subscription_terms],[current_plan],[changed_plan]'),
('payment_manual_subscribe', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[payment_method],[admin_link]');


INSERT IGNORE INTO `engine4_activity_notificationtypes` (`type`, `module`, `body`, `is_request`, `handler`) VALUES
("payment_subscription_expiredsoon", "payment", 'Your subscription plan {var:$planName} is going to expire soon on {var:$period}.', 0, ""),
("payment_subscription_changed", "payment", 'Your subscription plan changed from {var:$currentPlan} to {var:$changedPlan}.', 0, ""),
("payment_manual_subscribe", "payment", '{item:$subject} has subscribe with payment method {var:$payment_method} on this {var:$adminsidelink}.', 0, "");
-- --------------------------------------------------------

--
-- Dumping data for table `engine4_core_menuitems`
--

/*
INSERT IGNORE INTO `engine4_core_menuitems` (`name`, `module`, `label`, `plugin`, `params`, `menu`, `submenu`, `order`) VALUES
('payment_admin_main_transactions', 'payment', 'Transactions', '', '{"route":"admin_default","module":"payment","controller":"transactions","action":"index"}', 'payment_admin_main', '', 1),
('payment_admin_main_settings', 'payment', 'Settings', '', '{"route":"admin_default","module":"payment","controller":"settings"}', 'payment_admin_main', '', 2),
('payment_admin_main_gateway', 'payment', 'Gateways', '', '{"route":"admin_default","module":"payment","controller":"gateway"}', 'payment_admin_main', '', 3),
('payment_admin_main_package', 'payment', 'Plans', '', '{"route":"admin_default","module":"payment","controller":"package"}', 'payment_admin_main', '', 4),
('payment_admin_main_subscription', 'payment', 'Subscriptions', '', '{"route":"admin_default","module":"payment","controller":"subscription"}', 'payment_admin_main', '', 5)
;
*/

INSERT IGNORE INTO `engine4_core_menuitems` (`name`, `module`, `label`, `plugin`, `params`, `menu`, `submenu`, `order`) VALUES
-- ('core_mini_currency', 'payment', 'Currency Chooser', 'Payment_Plugin_Menus', '{"route":"default","module":"payment","icon":"fa fa-usd"}', 'core_mini', '', 8),
('user_settings_payment', 'user', 'Membership Subscription', 'Payment_Plugin_Menus', '{"route":"default", "module":"payment", "controller":"settings", "action":"index", "icon":"fi fi-rr-membership-vip"}', 'user_settings', '', 4),

('core_admin_main_payment', 'payment', 'Billing Settings', '', '{"route":"admin_default","module":"payment","controller":"settings","action":"index"}', 'core_admin_main_monetization', '', 7),
('core_admin_main_payment_settings', 'payment', 'Global Settings', '', '{"route":"admin_default","module":"payment","controller":"settings","action":"index"}', 'core_admin_main_payment', '', 1),
('core_admin_main_payment_gateways', 'payment', 'Gateways', '', '{"route":"admin_default","module":"payment","controller":"gateway","action":"index"}', 'core_admin_main_payment', '', 2),
("core_admin_main_payment_currency", "payment", "Manage Currency", "", '{"route":"admin_default","module":"payment","controller":"settings","action":"currency"}', "core_admin_main_payment", "", 3),

('core_admin_main_orders', 'payment', 'Orders', '', '{"route":"admin_default","module":"payment","controller":"index","action":"index"}', 'core_admin_main_monetization', '', 9),
('core_admin_main_orders_transactions', 'payment', 'Transactions', '', '{"route":"admin_default","module":"payment","controller":"index","action":"index"}', 'core_admin_main_orders', '', 1),

('core_admin_main_membership', 'payment', 'Member Subscription Settings', '', '{"route":"admin_default","module":"payment","controller":"package","action":"settings"}', 'core_admin_main_monetization', '', 6),
('core_admin_main_membership_settings', 'payment', 'Global Settings', '', '{"route":"admin_default","module":"payment","controller":"package","action":"settings"}', 'core_admin_main_membership', '', 1),
('core_admin_main_payment_packages', 'payment', 'Plans', '', '{"route":"admin_default","module":"payment","controller":"package","action":"index"}', 'core_admin_main_membership', '', 2),
('core_admin_main_payment_subscriptions', 'payment', 'Subscriptions', '', '{"route":"admin_default","module":"payment","controller":"subscription","action":"index"}', 'core_admin_main_membership', '', 3),

('user_settings_transaction', 'payment', 'Transaction History', 'Payment_Plugin_Menus', '{"route":"default", "module":"payment", "controller":"settings", "action":"transaction", "icon":"fi fi-rr-membership-vip"}', 'user_settings', '', 20),
('user_settings_verification', 'user', 'Verification', 'Payment_Plugin_Menus', '{"route":"default", "module":"payment", "controller":"settings", "action":"verification", "icon":"fi fi-rr-shield-trust"}', 'user_settings', '', 10);
-- --------------------------------------------------------

--
-- Dumping data for table `engine4_core_modules`
--

INSERT INTO `engine4_core_modules` (`name`, `title`, `description`, `version`, `enabled`, `type`) VALUES
('payment', 'Payment', 'Payment', '4.8.11', 1, 'standard');


-- --------------------------------------------------------

--
-- Dumping data for table `engine4_core_settings`
--

INSERT IGNORE INTO `engine4_core_settings` (`name`, `value`) VALUES
('payment.benefit', 'all'),
('payment.currency', 'USD'),
('payment.secret', MD5(CONCAT(RAND(), NOW())));
/*
('payment.subscription.enabled', 0),
('payment.lapse', 'reassign'),
('payment.subscription.required', 0)
*/


-- --------------------------------------------------------

--
-- Dumping data for table `engine4_core_tasks`
--

INSERT IGNORE INTO `engine4_core_tasks` (`title`, `module`, `plugin`, `timeout`) VALUES
('Payment Maintenance', 'user', 'Payment_Plugin_Task_Cleanup', 3600);


-- --------------------------------------------------------

--
-- Dumping data for table `engine4_user_signup`
--

INSERT INTO `engine4_user_signup` (`class`, `order`, `enable`) VALUES
('Payment_Plugin_Signup_Subscription', 2, 0);


DROP TABLE IF EXISTS `engine4_payment_verifications`;
CREATE TABLE IF NOT EXISTS `engine4_payment_verifications` (
	`verification_id` int(11) NOT NULL AUTO_INCREMENT,
	`user_id` int(11) DEFAULT NULL,
	`transaction_id` int(11) NOT NULL default "0",
	`params` VARCHAR(255) NULL,
	PRIMARY KEY (`verification_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


INSERT IGNORE INTO `engine4_activity_notificationtypes` (`type`, `module`, `body`, `is_request`, `handler`) VALUES
("payment_manual_verification", "payment", '{item:$subject} has made {var:$payment_method} payment for user verification. You can take appropriate action in {var:$adminsidelink}.', 0, "");

INSERT IGNORE INTO `engine4_core_mailtemplates` (`type`, `module`, `vars`) VALUES
('payment_verification_active', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_terms],[object_link]'),
('payment_verification_cancelled', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_verification_pending', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_terms],[object_link]'),
('payment_verification_overdue', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_terms],[object_link]'),
('payment_verification_refunded', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_terms],[object_link]'),
('payment_verification_recurrence', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link]'),
('payment_manual_verification', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[payment_method],[admin_link]');



DROP TABLE IF EXISTS `engine4_payment_currencies`;
CREATE TABLE IF NOT EXISTS `engine4_payment_currencies` (
  `currency_id` int(11) unsigned NOT NULL auto_increment,
  `title` varchar(128) NOT NULL,
  `code` char(3) NOT NULL default '',
  `change_rate` FLOAT NOT NULL DEFAULT "1",
  `enabled` tinyint(1) unsigned NOT NULL default '0',
  `icon` VARCHAR(255) NULL,
  `symbol` char(6) NOT NULL default '',
  `seprator` char(2) NOT NULL default ',',
  `placement` char(5) NOT NULL default 'pre',
  `gateways` varchar(128) NULL,
  `order` INT(11) NOT NULL DEFAULT '0',
  PRIMARY KEY  (`currency_id`),
  KEY `enabled` (`enabled`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT IGNORE INTO `engine4_payment_currencies` (`currency_id`, `title`, `code`, `change_rate`, `enabled`, `icon`, `symbol`, `seprator`, `placement`, `gateways`, `order`) VALUES
(1, 'Afghan Afghani', 'AFA', 1, 0, NULL, '؋', ',', 'pre', NULL, 1),
(2, 'Albanian Lek', 'ALL', 1, 0, NULL, 'Lek', ',', 'pre', NULL, 2),
(3, 'Algerian Dinar', 'DZD', 1, 0, NULL, 'دج', ',', 'pre', NULL, 3),
(4, 'Angolan Kwanza', 'AOA', 1, 0, NULL, 'Kz', ',', 'pre', NULL, 4),
(5, 'Argentine Peso', 'ARS', 1, 0, NULL, '$', ',', 'pre', NULL, 5),
(6, 'Armenian Dram', 'AMD', 1, 0, NULL, '֏', ',', 'pre', NULL, 6),
(7, 'Aruban Florin', 'AWG', 1, 0, NULL, 'ƒ', ',', 'pre', NULL, 7),
(8, 'Australian Dollar', 'AUD', 1, 0, NULL, 'AU$', ',', 'pre', NULL, 8),
(9, 'Azerbaijani Manat', 'AZN', 1, 0, NULL, 'm', ',', 'pre', NULL, 9),
(10, 'Bahamian Dollar', 'BSD', 1, 0, NULL, 'B$', ',', 'pre', NULL, 10),
(11, 'Bahraini Dinar', 'BHD', 1, 0, NULL, '.د.ب', ',', 'pre', NULL, 11),
(12, 'Bangladeshi Taka', 'BDT', 1, 0, NULL, '৳', ',', 'pre', NULL, 12),
(13, 'Barbadian Dollar', 'BBD', 1, 0, NULL, 'Bds$', ',', 'pre', NULL, 13),
(14, 'Belarusian Ruble', 'BYR', 1, 0, NULL, 'Br', ',', 'pre', NULL, 14),
(15, 'Belgian Franc', 'BEF', 1, 0, NULL, 'fr', ',', 'pre', NULL, 15),
(16, 'Belize Dollar', 'BZD', 1, 0, NULL, '$', ',', 'pre', NULL, 16),
(17, 'Bermudan Dollar', 'BMD', 1, 0, NULL, '$', ',', 'pre', NULL, 17),
(18, 'Bhutanese Ngultrum', 'BTN', 1, 0, NULL, 'Nu.', ',', 'pre', NULL, 18),
(19, 'Bitcoin', 'BTC', 1, 0, NULL, '฿', ',', 'pre', NULL, 19),
(20, 'Bolivian Boliviano', 'BOB', 1, 0, NULL, 'Bs.', ',', 'pre', NULL, 20),
(21, 'Bosnia-Herzegovina Convertible Mark', 'BAM', 1, 0, NULL, 'KM', ',', 'pre', NULL, 21),
(22, 'Botswanan Pula', 'BWP', 1, 0, NULL, 'P', ',', 'pre', NULL, 22),
(23, 'Brazilian Real', 'BRL', 1, 0, NULL, 'R$', ',', 'pre', NULL, 23),
(24, 'British Pound Sterling', 'GBP', 1, 0, NULL, '£', ',', 'pre', NULL, 24),
(25, 'Brunei Dollar', 'BND', 1, 0, NULL, 'B$', ',', 'pre', NULL, 25),
(26, 'Bulgarian Lev', 'BGN', 1, 0, NULL, 'Лв.', ',', 'pre', NULL, 26),
(27, 'Burundian Franc', 'BIF', 1, 0, NULL, 'FBu', ',', 'pre', NULL, 27),
(28, 'Cambodian Riel', 'KHR', 1, 0, NULL, 'KHR', ',', 'pre', NULL, 28),
(29, 'Canadian Dollar', 'CAD', 1, 0, NULL, '$', ',', 'pre', NULL, 29),
(30, 'Cape Verdean Escudo', 'CVE', 1, 0, NULL, '$', ',', 'pre', NULL, 30),
(31, 'Cayman Islands Dollar', 'KYD', 1, 0, NULL, '$', ',', 'pre', NULL, 31),
(32, 'CFA Franc BCEAO', 'XOF', 1, 0, NULL, 'CFA', ',', 'pre', NULL, 32),
(33, 'CFA Franc BEAC', 'XAF', 1, 0, NULL, 'FCFA', ',', 'pre', NULL, 33),
(34, 'CFP Franc', 'XPF', 1, 0, NULL, '₣', ',', 'pre', NULL, 34),
(35, 'Chilean Peso', 'CLP', 1, 0, NULL, '$', ',', 'pre', NULL, 35),
(36, 'Chilean Unit of Account', 'CLF', 1, 0, NULL, 'CLF', ',', 'pre', NULL, 36),
(37, 'Chinese Yuan', 'CNY', 1, 0, NULL, '¥', ',', 'pre', NULL, 37),
(38, 'Colombian Peso', 'COP', 1, 0, NULL, '$', ',', 'pre', NULL, 38),
(39, 'Comorian Franc', 'KMF', 1, 0, NULL, 'CF', ',', 'pre', NULL, 39),
(40, 'Congolese Franc', 'CDF', 1, 0, NULL, 'FC', ',', 'pre', NULL, 40),
(41, 'Costa Rican Colón', 'CRC', 1, 0, NULL, '₡', ',', 'pre', NULL, 41),
(42, 'Croatian Kuna', 'HRK', 1, 0, NULL, 'kn', ',', 'pre', NULL, 42),
(43, 'Cuban Convertible Peso', 'CUC', 1, 0, NULL, '$, CUC', ',', 'pre', NULL, 43),
(44, 'Czech Republic Koruna', 'CZK', 1, 0, NULL, 'Kč', ',', 'pre', NULL, 44),
(45, 'Danish Krone', 'DKK', 1, 0, NULL, 'Kr.', ',', 'pre', NULL, 45),
(46, 'Djiboutian Franc', 'DJF', 1, 0, NULL, 'Fdj', ',', 'pre', NULL, 46),
(47, 'Dominican Peso', 'DOP', 1, 0, NULL, '$', ',', 'pre', NULL, 47),
(48, 'East Caribbean Dollar', 'XCD', 1, 0, NULL, '$', ',', 'pre', NULL, 48),
(49, 'Egyptian Pound', 'EGP', 1, 0, NULL, 'ج.م', ',', 'pre', NULL, 49),
(50, 'Eritrean Nakfa', 'ERN', 1, 0, NULL, 'Nfk', ',', 'pre', NULL, 50),
(51, 'Estonian Kroon', 'EEK', 1, 0, NULL, 'kr', ',', 'pre', NULL, 51),
(52, 'Ethiopian Birr', 'ETB', 1, 0, NULL, 'Nkf', ',', 'pre', NULL, 52),
(53, 'Euro', 'EUR', 1, 0, NULL, '€', ',', 'pre', NULL, 53),
(54, 'Falkland Islands Pound', 'FKP', 1, 0, NULL, '£', ',', 'pre', NULL, 54),
(55, 'Fijian Dollar', 'FJD', 1, 0, NULL, 'FJ$', ',', 'pre', NULL, 55),
(56, 'Gambian Dalasi', 'GMD', 1, 0, NULL, 'D', ',', 'pre', NULL, 56),
(57, 'Georgian Lari', 'GEL', 1, 0, NULL, 'ლ', ',', 'pre', NULL, 57),
(58, 'German Mark', 'DEM', 1, 0, NULL, 'DM', ',', 'pre', NULL, 58),
(59, 'Ghanaian Cedi', 'GHS', 1, 0, NULL, 'GH₵', ',', 'pre', NULL, 59),
(60, 'Gibraltar Pound', 'GIP', 1, 0, NULL, '£', ',', 'pre', NULL, 60),
(61, 'Greek Drachma', 'GRD', 1, 0, NULL, '₯, Δρχ', ',', 'pre', NULL, 61),
(62, 'Guatemalan Quetzal', 'GTQ', 1, 0, NULL, 'Q', ',', 'pre', NULL, 62),
(63, 'Guinean Franc', 'GNF', 1, 0, NULL, 'FG', ',', 'pre', NULL, 63),
(64, 'Guyanaese Dollar', 'GYD', 1, 0, NULL, '$', ',', 'pre', NULL, 64),
(65, 'Haitian Gourde', 'HTG', 1, 0, NULL, 'G', ',', 'pre', NULL, 65),
(66, 'Honduran Lempira', 'HNL', 1, 0, NULL, 'L', ',', 'pre', NULL, 66),
(67, 'Hong Kong Dollar', 'HKD', 1, 0, NULL, '$', ',', 'pre', NULL, 67),
(68, 'Hungarian Forint', 'HUF', 1, 0, NULL, 'Ft', ',', 'pre', NULL, 68),
(69, 'Icelandic Króna', 'ISK', 1, 0, NULL, 'kr', ',', 'pre', NULL, 69),
(70, 'Indian Rupee', 'INR', 1, 0, NULL, '₹', ',', 'pre', NULL, 70),
(71, 'Indonesian Rupiah', 'IDR', 1, 0, NULL, 'Rp', ',', 'pre', NULL, 71),
(72, 'Iranian Rial', 'IRR', 1, 0, NULL, '﷼', ',', 'pre', NULL, 72),
(73, 'Iraqi Dinar', 'IQD', 1, 0, NULL, 'د.ع', ',', 'pre', NULL, 73),
(74, 'Israeli New Sheqel', 'ILS', 1, 0, NULL, '₪', ',', 'pre', NULL, 74),
(75, 'Italian Lira', 'ITL', 1, 0, NULL, 'L,£', ',', 'pre', NULL, 75),
(76, 'Jamaican Dollar', 'JMD', 1, 0, NULL, 'J$', ',', 'pre', NULL, 76),
(77, 'Japanese Yen', 'JPY', 1, 0, NULL, '¥', ',', 'pre', NULL, 77),
(78, 'Jordanian Dinar', 'JOD', 1, 0, NULL, 'ا.د', ',', 'pre', NULL, 78),
(79, 'Kazakhstani Tenge', 'KZT', 1, 0, NULL, 'лв', ',', 'pre', NULL, 79),
(80, 'Kenyan Shilling', 'KES', 1, 0, NULL, 'KSh', ',', 'pre', NULL, 80),
(81, 'Kuwaiti Dinar', 'KWD', 1, 0, NULL, 'ك.د', ',', 'pre', NULL, 81),
(82, 'Kyrgystani Som', 'KGS', 1, 0, NULL, 'лв', ',', 'pre', NULL, 82),
(83, 'Laotian Kip', 'LAK', 1, 0, NULL, '₭', ',', 'pre', NULL, 83),
(84, 'Latvian Lats', 'LVL', 1, 0, NULL, 'Ls', ',', 'pre', NULL, 84),
(85, 'Lebanese Pound', 'LBP', 1, 0, NULL, '£', ',', 'pre', NULL, 85),
(86, 'Lesotho Loti', 'LSL', 1, 0, NULL, 'L', ',', 'pre', NULL, 86),
(87, 'Liberian Dollar', 'LRD', 1, 0, NULL, '$', ',', 'pre', NULL, 87),
(88, 'Libyan Dinar', 'LYD', 1, 0, NULL, 'د.ل', ',', 'pre', NULL, 88),
(89, 'Litecoin', 'LTC', 1, 0, NULL, 'Ł', ',', 'pre', NULL, 89),
(90, 'Lithuanian Litas', 'LTL', 1, 0, NULL, 'Lt', ',', 'pre', NULL, 90),
(91, 'Macanese Pataca', 'MOP', 1, 0, NULL, '$', ',', 'pre', NULL, 91),
(92, 'Macedonian Denar', 'MKD', 1, 0, NULL, 'ден', ',', 'pre', NULL, 92),
(93, 'Malagasy Ariary', 'MGA', 1, 0, NULL, 'Ar', ',', 'pre', NULL, 93),
(94, 'Malawian Kwacha', 'MWK', 1, 0, NULL, 'MK', ',', 'pre', NULL, 94),
(95, 'Malaysian Ringgit', 'MYR', 1, 0, NULL, 'RM', ',', 'pre', NULL, 95),
(96, 'Maldivian Rufiyaa', 'MVR', 1, 0, NULL, 'Rf', ',', 'pre', NULL, 96),
(97, 'Mauritanian Ouguiya', 'MRO', 1, 0, NULL, 'MRU', ',', 'pre', NULL, 97),
(98, 'Mauritian Rupee', 'MUR', 1, 0, NULL, '₨', ',', 'pre', NULL, 98),
(99, 'Mexican Peso', 'MXN', 1, 0, NULL, '$', ',', 'pre', NULL, 99),
(100, 'Moldovan Leu', 'MDL', 1, 0, NULL, 'L', ',', 'pre', NULL, 100),
(101, 'Mongolian Tugrik', 'MNT', 1, 0, NULL, '₮', ',', 'pre', NULL, 101),
(102, 'Moroccan Dirham', 'MAD', 1, 0, NULL, 'MAD', ',', 'pre', NULL, 102),
(103, 'Mozambican Metical', 'MZM', 1, 0, NULL, 'MT', ',', 'pre', NULL, 103),
(104, 'Myanmar Kyat', 'MMK', 1, 0, NULL, 'K', ',', 'pre', NULL, 104),
(105, 'Namibian Dollar', 'NAD', 1, 0, NULL, '$', ',', 'pre', NULL, 105),
(106, 'Nepalese Rupee', 'NPR', 1, 0, NULL, '₨', ',', 'pre', NULL, 106),
(107, 'Netherlands Antillean Guilder', 'ANG', 1, 0, NULL, 'ƒ', ',', 'pre', NULL, 107),
(108, 'New Taiwan Dollar', 'TWD', 1, 0, NULL, '$', ',', 'pre', NULL, 108),
(109, 'New Zealand Dollar', 'NZD', 1, 0, NULL, '$', ',', 'pre', NULL, 109),
(110, 'Nicaraguan Córdoba', 'NIO', 1, 0, NULL, 'C$', ',', 'pre', NULL, 110),
(111, 'Nigerian Naira', 'NGN', 1, 0, NULL, '₦', ',', 'pre', NULL, 111),
(112, 'North Korean Won', 'KPW', 1, 0, NULL, '₩', ',', 'pre', NULL, 112),
(113, 'Norwegian Krone', 'NOK', 1, 0, NULL, 'kr', ',', 'pre', NULL, 113),
(114, 'Omani Rial', 'OMR', 1, 0, NULL, '.ع.ر', ',', 'pre', NULL, 114),
(115, 'Pakistani Rupee', 'PKR', 1, 0, NULL, '₨', ',', 'pre', NULL, 115),
(116, 'Panamanian Balboa', 'PAB', 1, 0, NULL, 'B/.', ',', 'pre', NULL, 116),
(117, 'Papua New Guinean Kina', 'PGK', 1, 0, NULL, 'K', ',', 'pre', NULL, 117),
(118, 'Paraguayan Guarani', 'PYG', 1, 0, NULL, '₲', ',', 'pre', NULL, 118),
(119, 'Peruvian Nuevo Sol', 'PEN', 1, 0, NULL, 'S/.', ',', 'pre', NULL, 119),
(120, 'Philippine Peso', 'PHP', 1, 0, NULL, '₱', ',', 'pre', NULL, 120),
(121, 'Polish Zloty', 'PLN', 1, 0, NULL, 'zł', ',', 'pre', NULL, 121),
(122, 'Qatari Rial', 'QAR', 1, 0, NULL, 'ق.ر', ',', 'pre', NULL, 122),
(123, 'Romanian Leu', 'RON', 1, 0, NULL, 'lei', ',', 'pre', NULL, 123),
(124, 'Russian Ruble', 'RUB', 1, 0, NULL, '₽', ',', 'pre', NULL, 124),
(125, 'Rwandan Franc', 'RWF', 1, 0, NULL, 'FRw', ',', 'pre', NULL, 125),
(126, 'Salvadoran Colón', 'SVC', 1, 0, NULL, '₡', ',', 'pre', NULL, 126),
(127, 'Samoan Tala', 'WST', 1, 0, NULL, 'SAT', ',', 'pre', NULL, 127),
(128, 'São Tomé and Príncipe Dobra', 'STD', 1, 0, NULL, 'Db', ',', 'pre', NULL, 128),
(129, 'Saudi Riyal', 'SAR', 1, 0, NULL, '﷼', ',', 'pre', NULL, 129),
(130, 'Serbian Dinar', 'RSD', 1, 0, NULL, 'din', ',', 'pre', NULL, 130),
(131, 'Seychellois Rupee', 'SCR', 1, 0, NULL, 'SRe', ',', 'pre', NULL, 131),
(132, 'Sierra Leonean Leone', 'SLL', 1, 0, NULL, 'Le', ',', 'pre', NULL, 132),
(133, 'Singapore Dollar', 'SGD', 1, 0, NULL, '$', ',', 'pre', NULL, 133),
(134, 'Slovak Koruna', 'SKK', 1, 0, NULL, 'Sk', ',', 'pre', NULL, 134),
(135, 'Solomon Islands Dollar', 'SBD', 1, 0, NULL, 'Si$', ',', 'pre', NULL, 135),
(136, 'Somali Shilling', 'SOS', 1, 0, NULL, 'Sh.so.', ',', 'pre', NULL, 136),
(137, 'South African Rand', 'ZAR', 1, 0, NULL, 'R', ',', 'pre', NULL, 137),
(138, 'South Korean Won', 'KRW', 1, 0, NULL, '₩', ',', 'pre', NULL, 138),
(139, 'South Sudanese Pound', 'SSP', 1, 0, NULL, '£', ',', 'pre', NULL, 139),
(140, 'Special Drawing Rights', 'XDR', 1, 0, NULL, 'SDR', ',', 'pre', NULL, 140),
(141, 'Sri Lankan Rupee', 'LKR', 1, 0, NULL, 'Rs', ',', 'pre', NULL, 141),
(142, 'St. Helena Pound', 'SHP', 1, 0, NULL, '£', ',', 'pre', NULL, 142),
(143, 'Sudanese Pound', 'SDG', 1, 0, NULL, '.س.ج', ',', 'pre', NULL, 143),
(144, 'Surinamese Dollar', 'SRD', 1, 0, NULL, '$', ',', 'pre', NULL, 144),
(145, 'Swazi Lilangeni', 'SZL', 1, 0, NULL, 'E', ',', 'pre', NULL, 145),
(146, 'Swedish Krona', 'SEK', 1, 0, NULL, 'kr', ',', 'pre', NULL, 146),
(147, 'Swiss Franc', 'CHF', 1, 0, NULL, 'CHf', ',', 'pre', NULL, 147),
(148, 'Syrian Pound', 'SYP', 1, 0, NULL, 'LS', ',', 'pre', NULL, 148),
(149, 'Tajikistani Somoni', 'TJS', 1, 0, NULL, 'SM', ',', 'pre', NULL, 149),
(150, 'Tanzanian Shilling', 'TZS', 1, 0, NULL, 'TSh', ',', 'pre', NULL, 150),
(151, 'Thai Baht', 'THB', 1, 0, NULL, '฿', ',', 'pre', NULL, 151),
(152, 'Tongan Paanga', 'TOP', 1, 0, NULL, '$', ',', 'pre', NULL, 152),
(153, 'Trinidad & Tobago Dollar', 'TTD', 1, 0, NULL, '$', ',', 'pre', NULL, 153),
(154, 'Tunisian Dinar', 'TND', 1, 0, NULL, 'ت.د', ',', 'pre', NULL, 154),
(155, 'Turkish Lira', 'TRY', 1, 0, NULL, '₺', ',', 'pre', NULL, 155),
(156, 'Turkmenistani Manat', 'TMT', 1, 0, NULL, 'T', ',', 'pre', NULL, 156),
(157, 'Ugandan Shilling', 'UGX', 1, 0, NULL, 'USh', ',', 'pre', NULL, 157),
(158, 'Ukrainian Hryvnia', 'UAH', 1, 0, NULL, '₴', ',', 'pre', NULL, 158),
(159, 'United Arab Emirates Dirham', 'AED', 1, 0, NULL, 'إ.د', ',', 'pre', NULL, 159),
(160, 'Uruguayan Peso', 'UYU', 1, 0, NULL, '$', ',', 'pre', NULL, 160),
(161, 'US Dollar', 'USD', 1, 1, NULL, '$', ',', 'pre', NULL, 161),
(162, 'Uzbekistan Som', 'UZS', 1, 0, NULL, 'лв', ',', 'pre', NULL, 162),
(163, 'Vanuatu Vatu', 'VUV', 1, 0, NULL, 'VT', ',', 'pre', NULL, 163),
(164, 'Venezuelan BolÃvar', 'VEF', 1, 0, NULL, 'Bs', ',', 'pre', NULL, 164),
(165, 'Vietnamese Dong', 'VND', 1, 0, NULL, '₫', ',', 'pre', NULL, 165),
(166, 'Yemeni Rial', 'YER', 1, 0, NULL, '﷼', ',', 'pre', NULL, 166),
(167, 'Zambian Kwacha', 'ZMK', 1, 0, NULL, 'ZK', ',', 'pre', NULL, 167),
(168, 'Zimbabwean dollar', 'ZWL', 1, 0, NULL, '$', ',', 'pre', NULL, 168);

ALTER TABLE `engine4_payment_transactions` ADD `change_rate` FLOAT NOT NULL DEFAULT '0', ADD `current_currency` CHAR(3) NULL DEFAULT NULL COMMENT 'paid by the user in currency';

ALTER TABLE `engine4_payment_transactions` CHANGE `currency` `currency` CHAR(3) NOT NULL COMMENT 'default currency';

INSERT IGNORE INTO `engine4_payment_gateways` (`title`, `description`, `enabled`, `plugin`, `test_mode`, `is_recurring`) VALUES ("Stripe", NULL, 0, "Payment_Plugin_Gateway_Stripe", 0, 1);



DROP TABLE IF EXISTS `engine4_payment_packagetemplates`;
CREATE TABLE `engine4_payment_packagetemplates` (
  `packagetemplate_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  `title` varchar(255) NOT NULL,
  `body_container_clr` varchar(16) DEFAULT NULL,
  `header_bgclr` varchar(16) DEFAULT NULL,
  `header_txtclr` varchar(16) DEFAULT NULL,
  `overlap` tinyint(1) NOT NULL DEFAULT 0,
  `params` TEXT NULL DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 0,
  `default` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `engine4_payment_packagestyles`;
CREATE TABLE `engine4_payment_packagestyles` (
  `packagestyle_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  `package_id` int(11) NOT NULL,
  `packagetemplate_id` int(11) NOT NULL,
  `enabled` tinyint(1) NOT NULL DEFAULT 0,
  `column_title` varchar(255) NOT NULL,
  `column_width` varchar(64) DEFAULT NULL,
  `column_margin` int(2) DEFAULT NULL,
  `row_height` int(6) DEFAULT NULL,
  `column_descr_height` int(6) DEFAULT NULL,
  `icon_position` tinyint(1) NOT NULL, 
  `show_highlight` tinyint(1) DEFAULT NULL, 
  `show_label` tinyint(1) NOT NULL DEFAULT 0,
  `label_text` varchar(255) DEFAULT NULL,
  `footer_text` varchar(256) DEFAULT NULL,
  `column_text_color` varchar(64) DEFAULT NULL,
  `footer_text_color` varchar(64) DEFAULT NULL,
  `footer_bg_color` varchar(64) DEFAULT NULL,
  `column_color` varchar(32) DEFAULT NULL,
  `column_row_color` varchar(32) DEFAULT NULL,
  `column_row_text_color` varchar(32) DEFAULT NULL,
  `label_text_color` varchar(32) DEFAULT NULL,
  `label_color` varchar(32) DEFAULT NULL,
  `row_border_color` varchar(32) DEFAULT NULL,
  `upgrade_footer_text` VARCHAR(255) NULL DEFAULT NULL,
  `label_position` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;

ALTER TABLE `engine4_payment_currencies` ADD INDEX(`code`);
ALTER TABLE `engine4_payment_currencies` ADD INDEX(`order`);
INSERT IGNORE INTO `engine4_core_settings` (`name`, `value`) VALUES
('payment.body.container.clr', '#FFFFFF'),
('payment.header.bgclr', '#FFFFFF'),
('payment.header.txtclr', '#000000'),
('payment.table.description', 'Please choose a subscription plan from the options below.'),
('payment.table.title', 'Subscription Plans');


-- wallet
DROP TABLE IF EXISTS `engine4_payment_wallets`;
CREATE TABLE IF NOT EXISTS `engine4_payment_wallets` (
	`wallet_id` int(11) NOT NULL AUTO_INCREMENT,
	`user_id` int(11) DEFAULT NULL,
	`transaction_id` int(11) NOT NULL default "0",
	`params` VARCHAR(255) NULL,
	PRIMARY KEY (`wallet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

INSERT IGNORE INTO `engine4_activity_notificationtypes` (`type`, `module`, `body`, `is_request`, `handler`, `is_admin`) VALUES
("payment_wallet_active", "payment", 'Your {var:$walletlink} has been successfully recharged using {var:$payment_method}.', 0, "", "0");

INSERT IGNORE INTO `engine4_core_mailtemplates` (`type`, `module`, `vars`) VALUES
('payment_wallet_active', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[wallet_terms],[object_link]'),
('payment_wallet_pending', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[wallet_terms],[object_link]'),
('payment_manual_wallet', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[payment_method],[admin_link]'),
('payment_wallet_cancelled', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[wallet_title],[wallet_description],[object_link]'),
('payment_verification_transaction', 'payment', '[host],[email],[recipient_title],[recipient_link],[recipient_photo],[subscription_title],[subscription_description],[object_link],[gateway_type],[attechment]');

INSERT IGNORE INTO `engine4_activity_notificationtypes` (`type`, `module`, `body`, `is_request`, `handler`, `is_admin`) VALUES
("payment_manual_wallet", "payment", '{item:$subject} has made {var:$payment_method} payment for wallet recharge. You can take appropriate action in {var:$adminsidelink}.', 0, "", "1");


ALTER TABLE `engine4_payment_subscriptions` ADD `order_id` INT(11) NOT NULL DEFAULT '0', ADD `resource_id` INT(11) NOT NULL DEFAULT '0', ADD `resource_type` VARCHAR(64) NULL DEFAULT NULL;
ALTER TABLE `engine4_payment_transactions` ADD `subscription_id` INT(11) NOT NULL DEFAULT '0';



-- --------------------------------------------------------

--
-- Table structure for table `engine4_payment_packages`
--

DROP TABLE IF EXISTS `engine4_payment_verificationpackages`;
CREATE TABLE IF NOT EXISTS `engine4_payment_verificationpackages` (
  `verificationpackage_id` int(10) unsigned NOT NULL auto_increment,
  `level_id` int(10) unsigned NOT NULL,
  `price` decimal(16,2) unsigned NOT NULL,
  `recurrence` int(11) unsigned NOT NULL,
  `recurrence_type` enum('day','week','month','year','forever') NOT NULL,
  `duration` int(11) unsigned NOT NULL,
  `duration_type` enum('day','week','month','year','forever') NOT NULL,
  `verified_icon` VARCHAR(255) NULL DEFAULT NULL,
  `verified_tiptext` VARCHAR(255) NULL DEFAULT NULL,
  `verified` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`verificationpackage_id`),
  KEY `level_id` (`level_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT IGNORE INTO `engine4_payment_verificationpackages`
  SELECT
  	NULL as `verificationpackage_id`,
    level_id as `level_id`,
    1 as `price`,
    0 as `recurrence`,
    'forever' as `recurrence_type`,
    0 as `duration`,
    'forever' as `duration_type`,
    NULL as `verified_icon`,
    'Verified' as `verified_tiptext`,
    0 as `verified`
  FROM `engine4_authorization_levels` WHERE `type` NOT IN('public');


UPDATE `engine4_payment_gateways` SET `default_icon` = '<svg width="18" height="24" viewBox="0 0 18 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_2824_18901)"><path d="M5.22191 13.8719C5.05785 14.7719 4.40629 18.9672 4.2141 20.1531C4.20004 20.2375 4.16723 20.2703 4.07348 20.2703H0.5766C0.22035 20.2703 -0.0374623 19.9609 0.00941265 19.6188L2.75629 2.18595C2.8266 1.73595 3.22973 1.39376 3.69379 1.39376C10.8329 1.39376 11.4328 1.22032 13.2563 1.92814C16.0735 3.02032 16.3313 5.6547 15.3188 8.5047C14.311 11.4391 11.9204 12.7 8.7516 12.7375C6.71722 12.7703 5.49379 12.4094 5.22191 13.8719ZM16.7391 7.12657C16.6547 7.06564 16.6219 7.0422 16.5985 7.18751C16.5047 7.72189 16.3594 8.2422 16.186 8.76251C14.3157 14.0969 9.13129 13.6328 6.60004 13.6328C6.3141 13.6328 6.1266 13.7875 6.0891 14.0734C5.02972 20.6547 4.81879 22.0281 4.81879 22.0281C4.77191 22.3609 4.98285 22.6328 5.31566 22.6328H8.29222C8.69535 22.6328 9.02816 22.3375 9.10785 21.9344C9.14066 21.6813 9.05629 22.2203 9.78285 17.6547C9.99848 16.6234 10.4532 16.7313 11.1563 16.7313C14.4844 16.7313 17.0813 15.3813 17.8547 11.4672C18.1594 9.83595 18.0704 8.12032 16.7391 7.12657Z" fill="currentColor"/>
</g><defs><clipPath id="clip0_2824_18901"><rect width="18" height="24" fill="white"/></clipPath></defs></svg>' WHERE `engine4_payment_gateways`.`plugin` = 'Payment_Plugin_Gateway_PayPal';

UPDATE `engine4_payment_gateways` SET `default_icon` = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_387_46100)"><path d="M21.6 0H2.4C1.07452 0 0 1.07452 0 2.4V21.6C0 22.9255 1.07452 24 2.4 24H21.6C22.9255 24 24 22.9255 24 21.6V2.4C24 1.07452 22.9255 0 21.6 0Z" fill="black"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10.9269 8.97662C10.9269 8.35262 11.4389 8.11263 12.2869 8.11263C13.5029 8.11263 15.0389 8.48063 16.2549 9.13663V5.37662C14.9269 4.84862 13.6149 4.64062 12.2869 4.64062C9.03891 4.64062 6.87891 6.33662 6.87891 9.16863C6.87891 13.5846 12.9589 12.8806 12.9589 14.7846C12.9589 15.5206 12.3189 15.7606 11.4229 15.7606C10.0949 15.7606 8.39891 15.2166 7.05491 14.4806V18.2886C8.54291 18.9286 10.0469 19.2006 11.4229 19.2006C14.7509 19.2006 17.0389 17.5526 17.0389 14.6886C17.0229 9.92063 10.9269 10.7686 10.9269 8.97662Z" fill="white"/></g><defs><clipPath id="clip0_387_46100"><rect width="24" height="24" fill="white"/></clipPath></defs></svg>' WHERE `engine4_payment_gateways`.`plugin` = 'Payment_Plugin_Gateway_Stripe';

UPDATE `engine4_payment_gateways` SET `default_icon` = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 14C16 14.8284 16.6716 15.5 17.5 15.5C18.3284 15.5 19 14.8284 19 14C19 13.1716 18.3284 12.5 17.5 12.5C16.6716 12.5 16 13.1716 16 14Z" fill="white" stroke="currentColor" stroke-width="1.5"/><path d="M18.9 8C18.9656 7.67689 19 7.34247 19 7C19 4.23858 16.7614 2 14 2C11.2386 2 9 4.23858 9 7C9 7.34247 9.03443 7.67689 9.10002 8" stroke="currentColor" stroke-width="1.5"/><path d="M7 7.99324H16C18.8284 7.99324 20.2426 7.99324 21.1213 8.87234C22 9.75145 22 11.1663 22 13.9961V15.9971C22 18.8269 22 20.2418 21.1213 21.1209C20.2426 22 18.8284 22 16 22H10C6.22876 22 4.34315 22 3.17157 20.8279C2 19.6557 2 17.7692 2 13.9961V11.9952C2 8.22211 2 6.33558 3.17157 5.16344C4.11466 4.2199 5.52043 4.03589 8 4H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>' WHERE `engine4_payment_gateways`.`plugin` = 'Payment_Plugin_Gateway_Wallet';

UPDATE `engine4_payment_gateways` SET `default_icon` = '<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="mask0_3286_37858" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="26" height="26"><path d="M0 0H26V26H0V0Z" fill="white"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13 6.86474L10.402 8.50074H15.598L13 6.86474ZM13.267 4.66874C13.1872 4.61847 13.0948 4.5918 13.0005 4.5918C12.9062 4.5918 12.8138 4.61847 12.734 4.66874L4.939 9.57774C4.515 9.84474 4.704 10.5007 5.206 10.5007H20.794C21.296 10.5007 21.485 9.84474 21.061 9.57774L13.267 4.66874ZM4.5 20.0007C4.5 19.7355 4.60536 19.4812 4.79289 19.2936C4.98043 19.1061 5.23478 19.0007 5.5 19.0007H20.5C20.7652 19.0007 21.0196 19.1061 21.2071 19.2936C21.3946 19.4812 21.5 19.7355 21.5 20.0007C21.5 20.266 21.3946 20.5203 21.2071 20.7078C21.0196 20.8954 20.7652 21.0007 20.5 21.0007H5.5C5.23478 21.0007 4.98043 20.8954 4.79289 20.7078C4.60536 20.5203 4.5 20.266 4.5 20.0007ZM7 11.5007C7.26522 11.5007 7.51957 11.6061 7.70711 11.7936C7.89464 11.9812 8 12.2355 8 12.5007V17.5007C8 17.766 7.89464 18.0203 7.70711 18.2078C7.51957 18.3954 7.26522 18.5007 7 18.5007C6.73478 18.5007 6.48043 18.3954 6.29289 18.2078C6.10536 18.0203 6 17.766 6 17.5007V12.5007C6 12.2355 6.10536 11.9812 6.29289 11.7936C6.48043 11.6061 6.73478 11.5007 7 11.5007ZM10 11.5007C10.2652 11.5007 10.5196 11.6061 10.7071 11.7936C10.8946 11.9812 11 12.2355 11 12.5007V17.5007C11 17.766 10.8946 18.0203 10.7071 18.2078C10.5196 18.3954 10.2652 18.5007 10 18.5007C9.73478 18.5007 9.48043 18.3954 9.29289 18.2078C9.10536 18.0203 9 17.766 9 17.5007V12.5007C9 12.2355 9.10536 11.9812 9.29289 11.7936C9.48043 11.6061 9.73478 11.5007 10 11.5007ZM13 11.5007C13.2652 11.5007 13.5196 11.6061 13.7071 11.7936C13.8946 11.9812 14 12.2355 14 12.5007V17.5007C14 17.766 13.8946 18.0203 13.7071 18.2078C13.5196 18.3954 13.2652 18.5007 13 18.5007C12.7348 18.5007 12.4804 18.3954 12.2929 18.2078C12.1054 18.0203 12 17.766 12 17.5007V12.5007C12 12.2355 12.1054 11.9812 12.2929 11.7936C12.4804 11.6061 12.7348 11.5007 13 11.5007ZM16 11.5007C16.2652 11.5007 16.5196 11.6061 16.7071 11.7936C16.8946 11.9812 17 12.2355 17 12.5007V17.5007C17 17.766 16.8946 18.0203 16.7071 18.2078C16.5196 18.3954 16.2652 18.5007 16 18.5007C15.7348 18.5007 15.4804 18.3954 15.2929 18.2078C15.1054 18.0203 15 17.766 15 17.5007V12.5007C15 12.2355 15.1054 11.9812 15.2929 11.7936C15.4804 11.6061 15.7348 11.5007 16 11.5007ZM19 11.5007C19.2652 11.5007 19.5196 11.6061 19.7071 11.7936C19.8946 11.9812 20 12.2355 20 12.5007V17.5007C20 17.766 19.8946 18.0203 19.7071 18.2078C19.5196 18.3954 19.2652 18.5007 19 18.5007C18.7348 18.5007 18.4804 18.3954 18.2929 18.2078C18.1054 18.0203 18 17.766 18 17.5007V12.5007C18 12.2355 18.1054 11.9812 18.2929 11.7936C18.4804 11.6061 18.7348 11.5007 19 11.5007Z" fill="black"/></mask><g mask="url(#mask0_3286_37858)"><path d="M13 26C20.1797 26 26 20.1797 26 13C26 5.8203 20.1797 0 13 0C5.8203 0 0 5.8203 0 13C0 20.1797 5.8203 26 13 26Z" fill="currentColor"/></g></svg>' WHERE `engine4_payment_gateways`.`plugin` = 'Payment_Plugin_Gateway_Bank';

UPDATE `engine4_payment_gateways` SET `default_icon` = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3286_37875)"><path d="M22.2585 3.35C22.1646 3.24023 22.0481 3.15211 21.9169 3.09169C21.7857 3.03127 21.643 2.99999 21.4985 3H12.4985C12.3565 3.00018 12.2162 3.03059 12.0869 3.08922C11.9576 3.14784 11.8422 3.23333 11.7485 3.34C11.6546 3.447 11.5846 3.57283 11.5432 3.70907C11.5018 3.84531 11.49 3.98882 11.5085 4.13L12.5085 11.63C12.5256 11.7613 12.5684 11.888 12.6344 12.0028C12.7004 12.1176 12.7884 12.2182 12.8933 12.299C12.9983 12.3798 13.1181 12.4391 13.2459 12.4736C13.3738 12.5081 13.5072 12.5171 13.6385 12.5C13.7698 12.4829 13.8965 12.4402 14.0113 12.3741C14.1261 12.3081 14.2268 12.2201 14.3075 12.1152C14.3883 12.0103 14.4477 11.8904 14.4821 11.7626C14.5166 11.6347 14.5256 11.5013 14.5085 11.37L13.6985 5.28C13.6929 5.24584 13.6953 5.21083 13.7058 5.17782C13.7162 5.1448 13.7343 5.11471 13.7585 5.09C13.7795 5.06452 13.8053 5.04344 13.8345 5.028C13.8637 5.01255 13.8956 5.00303 13.9285 5H19.9985C20.0352 4.99795 20.0718 5.00512 20.105 5.02084C20.1382 5.03656 20.1669 5.06033 20.1885 5.09C20.2129 5.11666 20.231 5.1485 20.2414 5.18313C20.2518 5.21777 20.2542 5.2543 20.2485 5.29L19.1585 11.86C19.1148 12.1252 19.1781 12.397 19.3347 12.6154C19.4913 12.8339 19.7283 12.9812 19.9935 13.025C20.1248 13.0467 20.2591 13.0423 20.3888 13.012C20.5184 12.9818 20.6408 12.9263 20.749 12.8488C20.9674 12.6922 21.1148 12.4552 21.1585 12.19L22.4985 4.19C22.5247 4.04095 22.5167 3.88791 22.4751 3.74241C22.4335 3.5969 22.3595 3.46273 22.2585 3.35Z" fill="currentColor"/><path d="M19 14.0001H13C12.9535 14.0018 12.9075 13.9893 12.8682 13.9643C12.829 13.9393 12.7982 13.9029 12.78 13.8601L11.82 12.0001C11.7837 11.9244 11.729 11.8591 11.6608 11.8102C11.5927 11.7613 11.5133 11.7303 11.43 11.7201C11.3459 11.7104 11.2608 11.7218 11.1823 11.7532C11.1037 11.7846 11.0342 11.8351 10.98 11.9001L9.1 14.2101C8.94533 14.374 8.73479 14.4739 8.51 14.4901H7.51C7.44265 14.4887 7.37572 14.501 7.31323 14.5261C7.25074 14.5513 7.19398 14.5888 7.14634 14.6364C7.09871 14.6841 7.0612 14.7408 7.03605 14.8033C7.0109 14.8658 6.99864 14.9327 7 15.0001V21.0001C6.99837 21.078 7.01572 21.1551 7.05057 21.2248C7.08541 21.2945 7.1367 21.3546 7.2 21.4001C9.5 23.1301 11.28 24.0001 12.5 24.0001H18.05C18.4854 24.0737 18.9324 23.9751 19.2964 23.725C19.6603 23.4749 19.9127 23.093 20 22.6601C20.4872 20.2974 20.8212 17.9058 21 15.5001C21 14.7501 20.31 14.0001 19 14.0001ZM4.83 13.5001H1.75C1.6837 13.5001 1.62011 13.5264 1.57322 13.5733C1.52634 13.6202 1.5 13.6838 1.5 13.7501V22.7501C1.5 22.8164 1.52634 22.88 1.57322 22.9269C1.62011 22.9737 1.6837 23.0001 1.75 23.0001H4.83C4.91363 23.0099 4.99839 23.002 5.07878 22.9769C5.15916 22.9519 5.23336 22.9101 5.29656 22.8545C5.35975 22.7988 5.41053 22.7305 5.44558 22.6539C5.48063 22.5774 5.49917 22.4943 5.5 22.4101V14.0901C5.49917 14.0059 5.48063 13.9228 5.44558 13.8462C5.41053 13.7697 5.35975 13.7013 5.29656 13.6457C5.23336 13.59 5.15916 13.5483 5.07878 13.5232C4.99839 13.4981 4.91363 13.4903 4.83 13.5001ZM15.5 9.00008C15.5 9.39791 15.658 9.77944 15.9393 10.0607C16.2206 10.342 16.6022 10.5001 17 10.5001C17.3978 10.5001 17.7794 10.342 18.0607 10.0607C18.342 9.77944 18.5 9.39791 18.5 9.00008C18.5 8.60226 18.342 8.22073 18.0607 7.93942C17.7794 7.65812 17.3978 7.50008 17 7.50008C16.6022 7.50008 16.2206 7.65812 15.9393 7.93942C15.658 8.22073 15.5 8.60226 15.5 9.00008ZM10 11.0001C10.1459 11.002 10.2905 10.9719 10.4236 10.9119C10.5567 10.852 10.675 10.7637 10.7703 10.6531C10.8656 10.5426 10.9355 10.4125 10.9752 10.272C11.0149 10.1316 11.0234 9.98415 11 9.84008L9.73 2.29008C9.70538 2.22569 9.70538 2.15448 9.73 2.09008C9.76051 2.0494 9.8027 2.01899 9.85094 2.00291C9.89918 1.98683 9.95118 1.98584 10 2.00008H18C18.2652 2.00008 18.5196 1.89473 18.7071 1.70719C18.8946 1.51965 19 1.2653 19 1.00008C19 0.734867 18.8946 0.480513 18.7071 0.292976C18.5196 0.10544 18.2652 8.31726e-05 18 8.31726e-05H8.5C8.35406 -0.00179908 8.20948 0.0282869 8.0764 0.0882289C7.94333 0.148171 7.82499 0.236516 7.72969 0.34706C7.6344 0.457605 7.56445 0.58767 7.52477 0.728124C7.48509 0.868577 7.47664 1.01601 7.5 1.16008L9 10.1601C9.03833 10.3967 9.16039 10.6117 9.34394 10.7659C9.52748 10.9201 9.76031 11.0032 10 11.0001Z" fill="currentColor"/></g><defs><clipPath id="clip0_3286_37875"><rect width="24" height="24" fill="white"/></clipPath></defs></svg>' WHERE `engine4_payment_gateways`.`plugin` = 'Payment_Plugin_Gateway_Cash';

UPDATE `engine4_payment_gateways` SET `default_icon` = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 14H19V15H5V14ZM21 17V8H3V17H21ZM1 5H23V19H1V5ZM5 10H12V12H5V10Z" fill="currentColor"/></svg>' WHERE `engine4_payment_gateways`.`plugin` = 'Payment_Plugin_Gateway_Cheque';