Des modules ajoutés et mise en page du CSS
This commit is contained in:
234
local/modules/PayPal/Config/Update/3.0.2.sql
Normal file
234
local/modules/PayPal/Config/Update/3.0.2.sql
Normal file
@@ -0,0 +1,234 @@
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until are tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_customer
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_customer`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`paypal_user_id` INTEGER NOT NULL,
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`name` VARCHAR(255),
|
||||
`given_name` VARCHAR(255),
|
||||
`family_name` VARCHAR(255),
|
||||
`middle_name` VARCHAR(255),
|
||||
`picture` VARCHAR(255),
|
||||
`email_verified` TINYINT,
|
||||
`gender` VARCHAR(255),
|
||||
`birthday` VARCHAR(255),
|
||||
`zoneinfo` VARCHAR(255),
|
||||
`locale` VARCHAR(255),
|
||||
`language` VARCHAR(255),
|
||||
`verified` TINYINT,
|
||||
`phone_number` VARCHAR(255),
|
||||
`verified_account` VARCHAR(255),
|
||||
`account_type` VARCHAR(255),
|
||||
`age_range` VARCHAR(255),
|
||||
`payer_id` VARCHAR(255),
|
||||
`postal_code` VARCHAR(255),
|
||||
`locality` VARCHAR(255),
|
||||
`region` VARCHAR(255),
|
||||
`country` VARCHAR(255),
|
||||
`street_address` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`,`paypal_user_id`),
|
||||
CONSTRAINT `fk_paypal_payer_customer_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_planified_payment
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_planified_payment`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`frequency` VARCHAR(255) NOT NULL,
|
||||
`frequency_interval` INTEGER NOT NULL,
|
||||
`cycle` INTEGER NOT NULL,
|
||||
`min_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`max_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`position` INTEGER DEFAULT 0 NOT NULL,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_cart
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_cart`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`planified_payment_id` INTEGER,
|
||||
`express_payment_id` VARCHAR(255),
|
||||
`express_payer_id` VARCHAR(255),
|
||||
`express_token` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FI_paypal_cart_planified_payment_id` (`planified_payment_id`),
|
||||
CONSTRAINT `fk_paypal_cart_cart_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `cart` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_paypal_cart_planified_payment_id`
|
||||
FOREIGN KEY (`planified_payment_id`)
|
||||
REFERENCES `paypal_planified_payment` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_order
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_order`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`payment_id` VARCHAR(50),
|
||||
`agreement_id` VARCHAR(255),
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`state` VARCHAR(20),
|
||||
`amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`description` LONGTEXT,
|
||||
`payer_id` VARCHAR(255),
|
||||
`token` VARCHAR(255),
|
||||
`planified_title` VARCHAR(255) NOT NULL,
|
||||
`planified_description` LONGTEXT,
|
||||
`planified_frequency` VARCHAR(255) NOT NULL,
|
||||
`planified_frequency_interval` INTEGER NOT NULL,
|
||||
`planified_cycle` INTEGER NOT NULL,
|
||||
`planified_actual_cycle` INTEGER DEFAULT 0 NOT NULL,
|
||||
`planified_min_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`planified_max_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
`version` INTEGER DEFAULT 0,
|
||||
`version_created_at` DATETIME,
|
||||
`version_created_by` VARCHAR(100),
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_paypal_order_order_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_plan
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_plan`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`paypal_order_id` INTEGER NOT NULL,
|
||||
`plan_id` VARCHAR(255),
|
||||
`state` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FI_paypal_plan_paypal_order_id` (`paypal_order_id`),
|
||||
CONSTRAINT `fk_paypal_plan_paypal_order_id`
|
||||
FOREIGN KEY (`paypal_order_id`)
|
||||
REFERENCES `paypal_order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_log
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_log`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`customer_id` INTEGER,
|
||||
`order_id` INTEGER,
|
||||
`hook` VARCHAR(255),
|
||||
`channel` VARCHAR(255),
|
||||
`level` INTEGER,
|
||||
`message` LONGTEXT,
|
||||
`time` INTEGER,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `FI_paypal_log_customer_id` (`customer_id`),
|
||||
INDEX `FI_paypal_log_order_id` (`order_id`),
|
||||
CONSTRAINT `fk_paypal_log_customer_id`
|
||||
FOREIGN KEY (`customer_id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_paypal_log_order_id`
|
||||
FOREIGN KEY (`order_id`)
|
||||
REFERENCES `order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_planified_payment_i18n
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_planified_payment_i18n`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
|
||||
`title` VARCHAR(255) NOT NULL,
|
||||
`description` LONGTEXT,
|
||||
PRIMARY KEY (`id`,`locale`),
|
||||
CONSTRAINT `paypal_planified_payment_i18n_FK_1`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `paypal_planified_payment` (`id`)
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_order_version
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_order_version`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`payment_id` VARCHAR(50),
|
||||
`agreement_id` VARCHAR(255),
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`state` VARCHAR(20),
|
||||
`amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`description` LONGTEXT,
|
||||
`payer_id` VARCHAR(255),
|
||||
`token` VARCHAR(255),
|
||||
`planified_title` VARCHAR(255) NOT NULL,
|
||||
`planified_description` LONGTEXT,
|
||||
`planified_frequency` VARCHAR(255) NOT NULL,
|
||||
`planified_frequency_interval` INTEGER NOT NULL,
|
||||
`planified_cycle` INTEGER NOT NULL,
|
||||
`planified_actual_cycle` INTEGER DEFAULT 0 NOT NULL,
|
||||
`planified_min_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`planified_max_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
`version` INTEGER DEFAULT 0 NOT NULL,
|
||||
`version_created_at` DATETIME,
|
||||
`version_created_by` VARCHAR(100),
|
||||
`id_version` INTEGER DEFAULT 0,
|
||||
PRIMARY KEY (`id`,`version`),
|
||||
CONSTRAINT `paypal_order_version_FK_1`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `paypal_order` (`id`)
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
144
local/modules/PayPal/Config/config.xml
Normal file
144
local/modules/PayPal/Config/config.xml
Normal file
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||
|
||||
<loops>
|
||||
<loop name="paypal_order" class="PayPal\Loop\PayPalOrderLoop" />
|
||||
<loop name="paypal_planified_payment" class="PayPal\Loop\PayPalPlanifiedPaymentLoop" />
|
||||
<loop name="paypal_log" class="PayPal\Loop\PayPalLogLoop" />
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<form name="paypal_form_configure" class="PayPal\Form\ConfigurationForm" />
|
||||
<form name="paypal_planified_payment_create_form" class="PayPal\Form\PayPalPlanifiedPaymentCreateForm" />
|
||||
<form name="paypal_planified_payment_update_form" class="PayPal\Form\PayPalPlanifiedPaymentUpdateForm" />
|
||||
</forms>
|
||||
|
||||
<commands>
|
||||
<!--
|
||||
<command class="PayPal\Command\MySuperCommand" />
|
||||
-->
|
||||
</commands>
|
||||
|
||||
<services>
|
||||
<!-- **************** -->
|
||||
<!-- *** Services *** -->
|
||||
<!-- **************** -->
|
||||
<service id="paypal_base_service" class="PayPal\Service\Base\PayPalBaseService">
|
||||
<argument type="service" id="event_dispatcher" />
|
||||
<argument type="service" id="request_stack" />
|
||||
<argument type="service" id="router.paypal" />
|
||||
</service>
|
||||
|
||||
<service id="paypal_payment_service" class="PayPal\Service\PayPalPaymentService">
|
||||
<argument type="service" id="event_dispatcher" />
|
||||
<argument type="service" id="request_stack" />
|
||||
<argument type="service" id="router.paypal" />
|
||||
</service>
|
||||
|
||||
<service id="paypal_agreement_service" class="PayPal\Service\PayPalAgreementService">
|
||||
<argument type="service" id="event_dispatcher" />
|
||||
<argument type="service" id="request_stack" />
|
||||
<argument type="service" id="router.paypal" />
|
||||
</service>
|
||||
|
||||
<service id="paypal_customer_service" class="PayPal\Service\PayPalCustomerService">
|
||||
<argument type="service" id="thelia.securityContext" />
|
||||
</service>
|
||||
|
||||
|
||||
|
||||
<service id="paypal_logger_service" class="PayPal\Service\PayPalLoggerService">
|
||||
</service>
|
||||
|
||||
<!-- ********************** -->
|
||||
<!-- *** EventListeners *** -->
|
||||
<!-- ********************** -->
|
||||
|
||||
<!-- ***** -->
|
||||
<!-- Order -->
|
||||
<!-- ***** -->
|
||||
<service id="paypal.order.order.listener" class="PayPal\EventListeners\PayPalOrderListener">
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
<service id="paypal.cart.listener" class="PayPal\EventListeners\PayPalCartListener">
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
<service id="paypal.order.listener" class="PayPal\EventListeners\OrderListener">
|
||||
<argument type="service" id="mailer"/>
|
||||
<argument type="service" id="event_dispatcher"/>
|
||||
<argument type="service" id="request_stack"/>
|
||||
<argument type="service" id="paypal_payment_service"/>
|
||||
<argument type="service" id="paypal_agreement_service"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
<service id="paypal.plan.listener" class="PayPal\EventListeners\PayPalPlanListener">
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<!-- ******** -->
|
||||
<!-- Customer -->
|
||||
<!-- ******** -->
|
||||
<service id="paypal.customer.customer.listener" class="PayPal\EventListeners\PayPalCustomerListener">
|
||||
<argument type="service" id="request_stack"/>
|
||||
<argument type="service" id="event_dispatcher"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<!-- ********************** -->
|
||||
<!-- *** Form extension *** -->
|
||||
<!-- ********************** -->
|
||||
<service id="paypal.thelia.order.payment.form" class="PayPal\EventListeners\Form\TheliaOrderPaymentForm">
|
||||
<argument type="service" id="request_stack"/>
|
||||
<argument type="service" id="event_dispatcher"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<!-- ************************* -->
|
||||
<!-- *** Planified Payment *** -->
|
||||
<!-- ************************* -->
|
||||
<service id="paypal.planified.payment.listener" class="PayPal\EventListeners\PayPalPlanifiedPaymentListener">
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<hooks>
|
||||
<!-- backOffice -->
|
||||
<hook id="paypal.back.hook" class="PayPal\Hook\BackHookManager">
|
||||
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfigure" />
|
||||
<tag name="hook.event_listener" event="order-edit.payment-module-bottom" type="back" method="onOrderEditPaymentModuleBottom"/>
|
||||
<tag name="hook.event_listener" event="order.edit-js" type="back" method="onOrderEditJs"/>
|
||||
</hook>
|
||||
<!-- frontOffice -->
|
||||
<hook id="paypal.front.hook" class="PayPal\Hook\FrontHookManager">
|
||||
<argument type="service" id="request_stack"/>
|
||||
<argument type="service" id="service_container" />
|
||||
<tag name="hook.event_listener" event="login.main-bottom" type="front" method="onLoginMainBottom"/>
|
||||
<tag name="hook.event_listener" event="order-invoice.payment-extra" type="front" method="onOrderInvoicePaymentExtra"/>
|
||||
<tag name="hook.event_listener" event="order-invoice.bottom" type="front" method="onOrderInvoiceBottom"/>
|
||||
<tag name="hook.event_listener" event="order-invoice.javascript-initialization" type="front" method="onOrderInvoiceJavascriptInitialization"/>
|
||||
<tag name="hook.event_listener" event="order-placed.additional-payment-info" type="front" method="onOrderPlacedAdditionalPaymentInfo"/>
|
||||
<tag name="hook.event_listener" event="cart.bottom" type="front" method="onCartBottom"/>
|
||||
<tag name="hook.event_listener" event="order-delivery.form-bottom" type="front" method="onOrderDeliveryFormBottom"/>
|
||||
<tag name="hook.event_listener" event="order-delivery.after-javascript-include" type="front" method="onOrderAfterJavascriptInclude"/>
|
||||
</hook>
|
||||
<!-- pdf -->
|
||||
<hook id="paypal.pdf.hook" class="PayPal\Hook\PdfHookManager">
|
||||
<tag name="hook.event_listener" event="invoice.after-payment-module" type="pdf" method="onAfterPaymentModule"/>
|
||||
</hook>
|
||||
</hooks>
|
||||
|
||||
<!--
|
||||
<exports>
|
||||
|
||||
</exports>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<imports>
|
||||
|
||||
</imports>
|
||||
-->
|
||||
</config>
|
||||
195
local/modules/PayPal/Config/create.sql
Normal file
195
local/modules/PayPal/Config/create.sql
Normal file
@@ -0,0 +1,195 @@
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until are tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_customer
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_customer`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`paypal_user_id` INTEGER NOT NULL,
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`name` VARCHAR(255),
|
||||
`given_name` VARCHAR(255),
|
||||
`family_name` VARCHAR(255),
|
||||
`middle_name` VARCHAR(255),
|
||||
`picture` VARCHAR(255),
|
||||
`email_verified` TINYINT,
|
||||
`gender` VARCHAR(255),
|
||||
`birthday` VARCHAR(255),
|
||||
`zoneinfo` VARCHAR(255),
|
||||
`locale` VARCHAR(255),
|
||||
`language` VARCHAR(255),
|
||||
`verified` TINYINT,
|
||||
`phone_number` VARCHAR(255),
|
||||
`verified_account` VARCHAR(255),
|
||||
`account_type` VARCHAR(255),
|
||||
`age_range` VARCHAR(255),
|
||||
`payer_id` VARCHAR(255),
|
||||
`postal_code` VARCHAR(255),
|
||||
`locality` VARCHAR(255),
|
||||
`region` VARCHAR(255),
|
||||
`country` VARCHAR(255),
|
||||
`street_address` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`,`paypal_user_id`),
|
||||
CONSTRAINT `fk_paypal_payer_customer_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_planified_payment
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_planified_payment`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`frequency` VARCHAR(255) NOT NULL,
|
||||
`frequency_interval` INTEGER NOT NULL,
|
||||
`cycle` INTEGER NOT NULL,
|
||||
`min_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`max_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`position` INTEGER DEFAULT 0 NOT NULL,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_cart
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_cart`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`planified_payment_id` INTEGER,
|
||||
`express_payment_id` VARCHAR(255),
|
||||
`express_payer_id` VARCHAR(255),
|
||||
`express_token` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_paypal_cart_planified_payment_id` (`planified_payment_id`),
|
||||
CONSTRAINT `fk_paypal_cart_cart_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `cart` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_paypal_cart_planified_payment_id`
|
||||
FOREIGN KEY (`planified_payment_id`)
|
||||
REFERENCES `paypal_planified_payment` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_order
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_order`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`payment_id` VARCHAR(50),
|
||||
`agreement_id` VARCHAR(255),
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`state` VARCHAR(20),
|
||||
`amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`description` LONGTEXT,
|
||||
`payer_id` VARCHAR(255),
|
||||
`token` VARCHAR(255),
|
||||
`planified_title` VARCHAR(255) NOT NULL,
|
||||
`planified_description` LONGTEXT,
|
||||
`planified_frequency` VARCHAR(255) NOT NULL,
|
||||
`planified_frequency_interval` INTEGER NOT NULL,
|
||||
`planified_cycle` INTEGER NOT NULL,
|
||||
`planified_actual_cycle` INTEGER DEFAULT 0 NOT NULL,
|
||||
`planified_min_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`planified_max_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_paypal_order_order_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_plan
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_plan`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`paypal_order_id` INTEGER NOT NULL,
|
||||
`plan_id` VARCHAR(255),
|
||||
`state` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_paypal_plan_paypal_order_id` (`paypal_order_id`),
|
||||
CONSTRAINT `fk_paypal_plan_paypal_order_id`
|
||||
FOREIGN KEY (`paypal_order_id`)
|
||||
REFERENCES `paypal_order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_log
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_log`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`customer_id` INTEGER,
|
||||
`order_id` INTEGER,
|
||||
`hook` VARCHAR(255),
|
||||
`channel` VARCHAR(255),
|
||||
`level` INTEGER,
|
||||
`message` LONGTEXT,
|
||||
`time` INTEGER,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_paypal_log_customer_id` (`customer_id`),
|
||||
INDEX `fi_paypal_log_order_id` (`order_id`),
|
||||
CONSTRAINT `fk_paypal_log_customer_id`
|
||||
FOREIGN KEY (`customer_id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_paypal_log_order_id`
|
||||
FOREIGN KEY (`order_id`)
|
||||
REFERENCES `order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_planified_payment_i18n
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `paypal_planified_payment_i18n`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
|
||||
`title` VARCHAR(255) NOT NULL,
|
||||
`description` LONGTEXT,
|
||||
PRIMARY KEY (`id`,`locale`),
|
||||
CONSTRAINT `paypal_planified_payment_i18n_fk_c9dfe7`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `paypal_planified_payment` (`id`)
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
41
local/modules/PayPal/Config/module.xml
Normal file
41
local/modules/PayPal/Config/module.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="http://thelia.net/schema/dic/module"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd">
|
||||
<fullnamespace>PayPal\PayPal</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>PayPal</title>
|
||||
<!--
|
||||
<subtitle></subtitle>
|
||||
<description></description>
|
||||
<postscriptum></postscriptum>
|
||||
-->
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>PayPal</title>
|
||||
</descriptive>
|
||||
<!-- <logo></logo> -->
|
||||
<!--<images-folder>images</images-folder>-->
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>4.0.0</version>
|
||||
<authors>
|
||||
<author>
|
||||
<name>gbarral</name>
|
||||
<email>gbarral@openstudio.fr</email>
|
||||
</author>
|
||||
</authors>
|
||||
<type>classic</type>
|
||||
<!--
|
||||
module dependencies
|
||||
<required>
|
||||
<module version=">=0.1">Front</module>
|
||||
<module version="~1.0">HookCart</module>
|
||||
<module version=">0.2">HookSearch</module>
|
||||
</required>
|
||||
-->
|
||||
<thelia>2.4.0</thelia>
|
||||
<stability>other</stability>
|
||||
</module>
|
||||
108
local/modules/PayPal/Config/routing.xml
Normal file
108
local/modules/PayPal/Config/routing.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<route id="paypal.configure" path="/admin/module/paypal/configure" methods="post">
|
||||
<default key="_controller">PayPal:Configuration:configure</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.admin.configuration.log" path="/admin/module/paypal/configure/log" methods="get">
|
||||
<default key="_controller">PayPal:Configuration:log</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.admin.configuration.general" path="/admin/module/paypal/configure" methods="post">
|
||||
<default key="_controller">PayPal:Configuration:configure</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.admin.configuration.planified" path="/admin/module/paypal/configure/planified" methods="get">
|
||||
<default key="_controller">PayPal:PayPalPlanifiedPayment:default</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.admin.configuration.planified.create" path="/admin/module/paypal/configure/planified/create" methods="post">
|
||||
<default key="_controller">PayPal:PayPalPlanifiedPayment:create</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.admin.configuration.planified.delete" path="/admin/module/paypal/configure/planified/create/delete" methods="post">
|
||||
<default key="_controller">PayPal:PayPalPlanifiedPayment:delete</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.admin.configuration.planified.update" path="/admin/module/paypal/configure/planified/{planifiedPaymentId}" methods="get">
|
||||
<default key="_controller">PayPal:PayPalPlanifiedPayment:update</default>
|
||||
<requirement key="planifiedPaymentId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.admin.configuration.planified.save" path="/admin/module/paypal/configure/planified/{planifiedPaymentId}" methods="post">
|
||||
<default key="_controller">PayPal:PayPalPlanifiedPayment:processUpdate</default>
|
||||
<requirement key="planifiedPaymentId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.cancel" path="/module/paypal/cancel/{orderId}" methods="get">
|
||||
<default key="_controller">PayPal:PayPalResponse:cancel</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.ok" path="/module/paypal/ok/{orderId}" methods="get">
|
||||
<default key="_controller">PayPal:PayPalResponse:ok</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.express.checkout" path="/module/paypal/express/checkout">
|
||||
<default key="_controller">PayPal:PayPalResponse:expressCheckout</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.express.checkout.ok" path="/module/paypal/express/checkout/ok/{cartId}">
|
||||
<default key="_controller">PayPal:PayPalResponse:expressCheckoutOk</default>
|
||||
<requirement key="cartId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.express.checkout.ko" path="/module/paypal/express/checkout/ko/{cartId}">
|
||||
<default key="_controller">PayPal:PayPalResponse:expressCheckoutKo</default>
|
||||
<requirement key="cartId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.invoice.express.checkout" path="/module/paypal/invoice/express/checkout">
|
||||
<default key="_controller">PayPal:PayPalResponse:invoiceExpressCheckout</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.invoice.express.checkout.ok" path="/module/paypal/invoice/express/checkout/ok/{cartId}">
|
||||
<default key="_controller">PayPal:PayPalResponse:invoiceExpressCheckoutOk</default>
|
||||
<requirement key="cartId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.invoice.express.checkout.ko" path="/module/paypal/invoice/express/checkout/ko/{cartId}">
|
||||
<default key="_controller">PayPal:PayPalResponse:invoiceExpressCheckoutKo</default>
|
||||
<requirement key="cartId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<!-- OVERLOAD order management process -->
|
||||
<route id="order.delivery.process" path="/order/delivery" methods="post">
|
||||
<default key="_controller">PayPal:PayPalResponse:executeExpressCheckout</default>
|
||||
<default key="_view">order-delivery</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.login.ok" path="/module/paypal/login/ok" methods="get">
|
||||
<default key="_controller">PayPal:PayPalResponse:loginOk</default>
|
||||
</route>
|
||||
|
||||
<route id="paypal.agreement.ok" path="/module/paypal/agreement/ok/{orderId}" methods="get">
|
||||
<default key="_controller">PayPal:PayPalResponse:agreementOk</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.agreement.ko" path="/module/paypal/agreement/ko/{orderId}" methods="get">
|
||||
<default key="_controller">PayPal:PayPalResponse:agreementKo</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.ipn" path="/module/paypal/ipn/{orderId}">
|
||||
<default key="_controller">PayPal:PayPalResponse:ipn</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="paypal.webhook.all" path="/module/paypal/webhook/all/events">
|
||||
<default key="_controller">PayPal:PayPalWebHook:all</default>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
133
local/modules/PayPal/Config/schema.xml
Normal file
133
local/modules/PayPal/Config/schema.xml
Normal file
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../../vendor/propel/propel/resources/xsd/database.xsd" >
|
||||
|
||||
<table name="paypal_customer" namespace="PayPal\Model">
|
||||
<column name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="paypal_user_id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="credit_card_id" size="40" type="VARCHAR" />
|
||||
<column name="name" size="255" type="VARCHAR" />
|
||||
<column name="given_name" size="255" type="VARCHAR" />
|
||||
<column name="family_name" size="255" type="VARCHAR" />
|
||||
<column name="middle_name" size="255" type="VARCHAR" />
|
||||
<column name="picture" size="255" type="VARCHAR" />
|
||||
<column name="email_verified" type="TINYINT" />
|
||||
<column name="gender" size="255" type="VARCHAR" />
|
||||
<column name="birthday" size="255" type="VARCHAR" />
|
||||
<column name="zoneinfo" size="255" type="VARCHAR" />
|
||||
<column name="locale" size="255" type="VARCHAR" />
|
||||
<column name="language" size="255" type="VARCHAR" />
|
||||
<column name="verified" type="TINYINT" />
|
||||
<column name="phone_number" size="255" type="VARCHAR" />
|
||||
<column name="verified_account" size="255" type="VARCHAR" />
|
||||
<column name="account_type" size="255" type="VARCHAR" />
|
||||
<column name="age_range" size="255" type="VARCHAR" />
|
||||
<column name="payer_id" size="255" type="VARCHAR" />
|
||||
<column name="postal_code" size="255" type="VARCHAR" />
|
||||
<column name="locality" size="255" type="VARCHAR" />
|
||||
<column name="region" size="255" type="VARCHAR" />
|
||||
<column name="country" size="255" type="VARCHAR" />
|
||||
<column name="street_address" size="255" type="VARCHAR" />
|
||||
|
||||
<foreign-key foreignTable="customer" name="fk_paypal_payer_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="id" />
|
||||
</foreign-key>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
|
||||
<table name="paypal_planified_payment" namespace="PayPal\Model">
|
||||
<column name="id" autoIncrement="true" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="title" size="255" type="VARCHAR" required="true" />
|
||||
<column name="description" type="CLOB" />
|
||||
<column name="frequency" size="255" type="VARCHAR" required="true" />
|
||||
<column name="frequency_interval" type="INTEGER" required="true" />
|
||||
<column name="cycle" type="INTEGER" required="true" />
|
||||
<column name="min_amount" type="DECIMAL" scale="6" size="16" defaultValue="0.000000" />
|
||||
<column name="max_amount" type="DECIMAL" scale="6" size="16" defaultValue="0.000000" />
|
||||
<column name="position" type="INTEGER" required="true" defaultValue="0" />
|
||||
|
||||
<behavior name="i18n">
|
||||
<parameter name="i18n_columns" value="title, description" />
|
||||
</behavior>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
|
||||
<table name="paypal_cart" namespace="PayPal\Model">
|
||||
<column name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="credit_card_id" size="40" type="VARCHAR" />
|
||||
<column name="planified_payment_id" type="INTEGER" />
|
||||
|
||||
<column name="express_payment_id" size="255" type="VARCHAR" />
|
||||
<column name="express_payer_id" size="255" type="VARCHAR" />
|
||||
<column name="express_token" size="255" type="VARCHAR" />
|
||||
|
||||
<foreign-key foreignTable="cart" name="fk_paypal_cart_cart_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="id" />
|
||||
</foreign-key>
|
||||
<foreign-key foreignTable="paypal_planified_payment" name="fk_paypal_cart_planified_payment_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="planified_payment_id" />
|
||||
</foreign-key>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
|
||||
<table name="paypal_order" namespace="PayPal\Model">
|
||||
<column name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="payment_id" size="50" type="VARCHAR" />
|
||||
<column name="agreement_id" size="255" type="VARCHAR" />
|
||||
<column name="credit_card_id" size="40" type="VARCHAR" />
|
||||
<column name="state" size="20" type="VARCHAR" />
|
||||
<column name="amount" type="DECIMAL" scale="6" size="16" defaultValue="0.000000" />
|
||||
<column name="description" type="CLOB" />
|
||||
<column name="payer_id" size="255" type="VARCHAR" />
|
||||
<column name="token" size="255" type="VARCHAR" />
|
||||
|
||||
<column name="planified_title" size="255" type="VARCHAR" required="true" />
|
||||
<column name="planified_description" type="CLOB" />
|
||||
<column name="planified_frequency" size="255" type="VARCHAR" required="true" />
|
||||
<column name="planified_frequency_interval" type="INTEGER" required="true" />
|
||||
<column name="planified_cycle" type="INTEGER" required="true" />
|
||||
<column name="planified_actual_cycle" type="INTEGER" required="true" defaultValue="0" />
|
||||
<column name="planified_min_amount" type="DECIMAL" scale="6" size="16" defaultValue="0.000000" />
|
||||
<column name="planified_max_amount" type="DECIMAL" scale="6" size="16" defaultValue="0.000000" />
|
||||
|
||||
<foreign-key foreignTable="order" name="fk_paypal_order_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="id" />
|
||||
</foreign-key>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
|
||||
<table name="paypal_plan" namespace="PayPal\Model">
|
||||
<column name="id" autoIncrement="true" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="paypal_order_id" required="true" type="INTEGER" />
|
||||
<column name="plan_id" size="255" type="VARCHAR" />
|
||||
<column name="state" size="255" type="VARCHAR" />
|
||||
|
||||
<foreign-key foreignTable="paypal_order" name="fk_paypal_plan_paypal_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="paypal_order_id" />
|
||||
</foreign-key>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
|
||||
<table name="paypal_log" namespace="PayPal\Model">
|
||||
<column name="id" autoIncrement="true" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="customer_id" type="INTEGER" />
|
||||
<column name="order_id" type="INTEGER" />
|
||||
<column name="hook" size="255" type="VARCHAR" />
|
||||
<column name="channel" size="255" type="VARCHAR" />
|
||||
<column name="level" type="INTEGER" />
|
||||
<column name="message" type="CLOB" />
|
||||
<column name="time" type="INTEGER" />
|
||||
|
||||
<foreign-key foreignTable="customer" name="fk_paypal_log_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="customer_id" />
|
||||
</foreign-key>
|
||||
<foreign-key foreignTable="order" name="fk_paypal_log_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="order_id" />
|
||||
</foreign-key>
|
||||
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
2
local/modules/PayPal/Config/sqldb.map
Normal file
2
local/modules/PayPal/Config/sqldb.map
Normal file
@@ -0,0 +1,2 @@
|
||||
# Sqlfile -> Database map
|
||||
thelia.sql=thelia
|
||||
210
local/modules/PayPal/Config/thelia.sql
Normal file
210
local/modules/PayPal/Config/thelia.sql
Normal file
@@ -0,0 +1,210 @@
|
||||
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until are tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_customer
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `paypal_customer`;
|
||||
|
||||
CREATE TABLE `paypal_customer`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`paypal_user_id` INTEGER NOT NULL,
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`name` VARCHAR(255),
|
||||
`given_name` VARCHAR(255),
|
||||
`family_name` VARCHAR(255),
|
||||
`middle_name` VARCHAR(255),
|
||||
`picture` VARCHAR(255),
|
||||
`email_verified` TINYINT,
|
||||
`gender` VARCHAR(255),
|
||||
`birthday` VARCHAR(255),
|
||||
`zoneinfo` VARCHAR(255),
|
||||
`locale` VARCHAR(255),
|
||||
`language` VARCHAR(255),
|
||||
`verified` TINYINT,
|
||||
`phone_number` VARCHAR(255),
|
||||
`verified_account` VARCHAR(255),
|
||||
`account_type` VARCHAR(255),
|
||||
`age_range` VARCHAR(255),
|
||||
`payer_id` VARCHAR(255),
|
||||
`postal_code` VARCHAR(255),
|
||||
`locality` VARCHAR(255),
|
||||
`region` VARCHAR(255),
|
||||
`country` VARCHAR(255),
|
||||
`street_address` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`,`paypal_user_id`),
|
||||
CONSTRAINT `fk_paypal_payer_customer_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_planified_payment
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `paypal_planified_payment`;
|
||||
|
||||
CREATE TABLE `paypal_planified_payment`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`frequency` VARCHAR(255) NOT NULL,
|
||||
`frequency_interval` INTEGER NOT NULL,
|
||||
`cycle` INTEGER NOT NULL,
|
||||
`min_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`max_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`position` INTEGER DEFAULT 0 NOT NULL,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_cart
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `paypal_cart`;
|
||||
|
||||
CREATE TABLE `paypal_cart`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`planified_payment_id` INTEGER,
|
||||
`express_payment_id` VARCHAR(255),
|
||||
`express_payer_id` VARCHAR(255),
|
||||
`express_token` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_paypal_cart_planified_payment_id` (`planified_payment_id`),
|
||||
CONSTRAINT `fk_paypal_cart_cart_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `cart` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_paypal_cart_planified_payment_id`
|
||||
FOREIGN KEY (`planified_payment_id`)
|
||||
REFERENCES `paypal_planified_payment` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_order
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `paypal_order`;
|
||||
|
||||
CREATE TABLE `paypal_order`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`payment_id` VARCHAR(50),
|
||||
`agreement_id` VARCHAR(255),
|
||||
`credit_card_id` VARCHAR(40),
|
||||
`state` VARCHAR(20),
|
||||
`amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`description` LONGTEXT,
|
||||
`payer_id` VARCHAR(255),
|
||||
`token` VARCHAR(255),
|
||||
`planified_title` VARCHAR(255) NOT NULL,
|
||||
`planified_description` LONGTEXT,
|
||||
`planified_frequency` VARCHAR(255) NOT NULL,
|
||||
`planified_frequency_interval` INTEGER NOT NULL,
|
||||
`planified_cycle` INTEGER NOT NULL,
|
||||
`planified_actual_cycle` INTEGER DEFAULT 0 NOT NULL,
|
||||
`planified_min_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`planified_max_amount` DECIMAL(16,6) DEFAULT 0.000000,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_paypal_order_order_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_plan
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `paypal_plan`;
|
||||
|
||||
CREATE TABLE `paypal_plan`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`paypal_order_id` INTEGER NOT NULL,
|
||||
`plan_id` VARCHAR(255),
|
||||
`state` VARCHAR(255),
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_paypal_plan_paypal_order_id` (`paypal_order_id`),
|
||||
CONSTRAINT `fk_paypal_plan_paypal_order_id`
|
||||
FOREIGN KEY (`paypal_order_id`)
|
||||
REFERENCES `paypal_order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_log
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `paypal_log`;
|
||||
|
||||
CREATE TABLE `paypal_log`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`customer_id` INTEGER,
|
||||
`order_id` INTEGER,
|
||||
`hook` VARCHAR(255),
|
||||
`channel` VARCHAR(255),
|
||||
`level` INTEGER,
|
||||
`message` LONGTEXT,
|
||||
`time` INTEGER,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_paypal_log_customer_id` (`customer_id`),
|
||||
INDEX `fi_paypal_log_order_id` (`order_id`),
|
||||
CONSTRAINT `fk_paypal_log_customer_id`
|
||||
FOREIGN KEY (`customer_id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_paypal_log_order_id`
|
||||
FOREIGN KEY (`order_id`)
|
||||
REFERENCES `order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- paypal_planified_payment_i18n
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `paypal_planified_payment_i18n`;
|
||||
|
||||
CREATE TABLE `paypal_planified_payment_i18n`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL,
|
||||
`title` VARCHAR(255) NOT NULL,
|
||||
`description` LONGTEXT,
|
||||
PRIMARY KEY (`id`,`locale`),
|
||||
CONSTRAINT `paypal_planified_payment_i18n_fk_c9dfe7`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `paypal_planified_payment` (`id`)
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user