INSERT INTO `oxpayments` (`OXID`, `OXACTIVE`, `OXDESC`, `OXADDSUM`, `OXADDSUMTYPE`, `OXADDSUMRULES`, `OXFROMBONI`, `OXFROMAMOUNT`, `OXTOAMOUNT`, `OXVALDESC`, `OXCHECKED`, `OXDESC_1`, `OXVALDESC_1`, `OXDESC_2`, `OXVALDESC_2`, `OXDESC_3`, `OXVALDESC_3`, `OXLONGDESC`, `OXLONGDESC_1`, `OXLONGDESC_2`, `OXLONGDESC_3`, `OXSORT`)
VALUES ('bestitamazon', 1, 'Amazon Pay', 0, 'abs', 15, 0, 0, 99999999, '', 0, 'Amazon Pay', '', '', '', '', '', '', '', '', '', 0);

ALTER TABLE `oxorder` ADD `BESTITAMAZONORDERREFERENCEID` VARCHAR( 32 ) NOT NULL;
ALTER TABLE `oxorder` ADD `BESTITAMAZONAUTHORIZATIONID` VARCHAR( 32 ) NOT NULL;
ALTER TABLE `oxorder` ADD `BESTITAMAZONCAPTUREID` VARCHAR( 32 ) NOT NULL;
ALTER TABLE `oxorder` CHANGE `OXTRANSSTATUS`  `OXTRANSSTATUS` VARCHAR( 60 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT  '' COMMENT  'Order status: NOT_FINISHED, OK, ERROR';

CREATE TABLE IF NOT EXISTS `bestitamazonrefunds` (
  `ID` VARCHAR( 32 ) COLLATE utf8_unicode_ci NOT NULL,
  `OXORDERID` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `BESTITAMAZONREFUNDID` VARCHAR( 32 ) COLLATE utf8_unicode_ci NOT NULL,
  `AMOUNT` DOUBLE( 10, 2 ) NOT NULL,
  `STATE` VARCHAR( 32 ) COLLATE utf8_unicode_ci NOT NULL,
  `ERROR` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL,
  `TIMESTAMP` DATETIME NOT NULL,
  UNIQUE KEY `ID` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `bestitamazonobject2reference` (
  `OXOBJECTID` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `AMAZONORDERREFERENCEID` VARCHAR( 32 ) NOT NULL,
  PRIMARY KEY(`OXOBJECTID`, `AMAZONORDERREFERENCEID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

INSERT INTO `oxcontents` (`OXID`, `OXLOADID`, `OXSHOPID`, `OXSNIPPET`, `OXTYPE`, `OXACTIVE`, `OXACTIVE_1`, `OXPOSITION`, `OXTITLE`, `OXCONTENT`, `OXTITLE_1`, `OXCONTENT_1`, `OXACTIVE_2`, `OXTITLE_2`, `OXCONTENT_2`, `OXACTIVE_3`, `OXTITLE_3`, `OXCONTENT_3`, `OXCATID`, `OXFOLDER`, `OXTERMVERSION`, `OXTIMESTAMP`) VALUES
('bestitAmazonInvalidPaymentEmail', 'bestitAmazonInvalidPaymentEmail', 1, 1, 0, 1, 1, '', 'Amazon Pay Rejected Payment Email', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_THANKYOU"}] [{$shop->oxshops__oxname->value}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PAYMENTS_DECLINED"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_GOTO"}] <a href="[{$order->getAmazonChangePaymentLink()}]">[{$order->getAmazonChangePaymentLink()}]</a> [{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_UPDATE_PAYMENT"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', 'Amazon Pay Rejected Payment Email', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_THANKYOU"}] [{$shop->oxshops__oxname->value}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PAYMENTS_DECLINED"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_GOTO"}] <a href="[{$order->getAmazonChangePaymentLink()}]">[{$order->getAmazonChangePaymentLink()}]</a> [{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_UPDATE_PAYMENT"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', 1, 'Amazon Pays Rejected Payment Email', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_THANKYOU"}] [{$shop->oxshops__oxname->value}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PAYMENTS_DECLINED"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_GOTO"}] <a href="[{$order->getAmazonChangePaymentLink()}]">[{$order->getAmazonChangePaymentLink()}]</a> [{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_UPDATE_PAYMENT"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', 0, '', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_THANKYOU"}] [{$shop->oxshops__oxname->value}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PAYMENTS_DECLINED"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_GOTO"}] <a href="[{$order->getAmazonChangePaymentLink()}]">[{$order->getAmazonChangePaymentLink()}]</a> [{oxmultilang ident="BESTITAMAZONPAY_EMAIL_PLEASE_UPDATE_PAYMENT"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', '30e44ab83fdee7564.23264141', 'CMSFOLDER_EMAILS', '', '2015-06-19 13:18:56'),
('bestitAmazonRejectedPaymentEmail', 'bestitAmazonRejectedPaymentEmail', 1, 1, 0, 1, 1, '', 'Amazon Pay Invalid Payment Email', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_DECLINED_TEXT"}] [{$shop->oxshops__oxname->value}].\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_CONTACT_US"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', 'Amazon Pay Invalid Payment Email', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_DECLINED_TEXT"}] [{$shop->oxshops__oxname->value}].\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_CONTACT_US"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', 1, 'Amazon Pay Invalid Payment Email', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_DECLINED_TEXT"}] [{$shop->oxshops__oxname->value}].\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_CONTACT_US"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', 0, 'Amazon Pay Invalid Payment Email', '[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_VALUED_CUSUTOMER"}],<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_DECLINED_TEXT"}] [{$shop->oxshops__oxname->value}].\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_CONTACT_US"}].<br />\r\n<br />\r\n[{oxmultilang ident="BESTITAMAZONPAY_EMAIL_KIND_REGARDS"}],', '30e44ab83fdee7564.23264141', 'CMSFOLDER_EMAILS', '', '2015-06-19 13:18:29');

ALTER TABLE  `oxuser` ADD  `BESTITAMAZONID` VARCHAR( 50 ) NOT NULL;