Tray_CheckoutRedir - Version 1.0.0.0

Version Notes

Primeira versão liberada no Magento Connect

Download this release

Release Info

Developer Igor
Extension Tray_CheckoutRedir
Version 1.0.0.0
Comparing to
See all releases


Version 1.0.0.0

Files changed (51) hide show
  1. app/code/community/Tray/CheckoutRedir/Block/Adminhtml/System/Config/Fieldset/Label.php +43 -0
  2. app/code/community/Tray/CheckoutRedir/Block/Error.php +27 -0
  3. app/code/community/Tray/CheckoutRedir/Block/Form/Geral.php +27 -0
  4. app/code/community/Tray/CheckoutRedir/Block/Info/Geral.php +44 -0
  5. app/code/community/Tray/CheckoutRedir/Block/Link.php +23 -0
  6. app/code/community/Tray/CheckoutRedir/Block/Payment.php +50 -0
  7. app/code/community/Tray/CheckoutRedir/Block/Redirect.php +78 -0
  8. app/code/community/Tray/CheckoutRedir/Block/Return.php +28 -0
  9. app/code/community/Tray/CheckoutRedir/Helper/Data.php +131 -0
  10. app/code/community/Tray/CheckoutRedir/Model/Config.php +83 -0
  11. app/code/community/Tray/CheckoutRedir/Model/Geral.php +34 -0
  12. app/code/community/Tray/CheckoutRedir/Model/Mysql4/Setup.php +23 -0
  13. app/code/community/Tray/CheckoutRedir/Model/Observer.php +37 -0
  14. app/code/community/Tray/CheckoutRedir/Model/Source/Country.php +28 -0
  15. app/code/community/Tray/CheckoutRedir/Model/Source/Parcelas2.php +58 -0
  16. app/code/community/Tray/CheckoutRedir/Model/Source/Specificcountries.php +28 -0
  17. app/code/community/Tray/CheckoutRedir/Model/Source/Webcheckout.php +31 -0
  18. app/code/community/Tray/CheckoutRedir/Model/Standard.php +235 -0
  19. app/code/community/Tray/CheckoutRedir/controllers/StandardController.php +361 -0
  20. app/code/community/Tray/CheckoutRedir/etc/adminhtml.xml +45 -0
  21. app/code/community/Tray/CheckoutRedir/etc/config.xml +151 -0
  22. app/code/community/Tray/CheckoutRedir/etc/system.xml +148 -0
  23. app/code/community/Tray/CheckoutRedir/sql/checkoutredir_setup/mysql4-install-0.1.7.php +18 -0
  24. app/design/adminhtml/default/default/layout/tray_checkoutredir.xml +36 -0
  25. app/design/adminhtml/default/default/template/tray/checkoutredir/form/geral.phtml +30 -0
  26. app/design/adminhtml/default/default/template/tray/checkoutredir/getbaseurl.phtml +30 -0
  27. app/design/adminhtml/default/default/template/tray/checkoutredir/info/geral.phtml +25 -0
  28. app/design/frontend/base/default/layout/tray_checkoutredir.xml +56 -0
  29. app/design/frontend/base/default/template/tray/checkoutredir/error.phtml +32 -0
  30. app/design/frontend/base/default/template/tray/checkoutredir/form/geral.phtml +46 -0
  31. app/design/frontend/base/default/template/tray/checkoutredir/form/images/overlay.png +0 -0
  32. app/design/frontend/base/default/template/tray/checkoutredir/head.phtml +36 -0
  33. app/design/frontend/base/default/template/tray/checkoutredir/info/geral.phtml +25 -0
  34. app/design/frontend/base/default/template/tray/checkoutredir/overlay.phtml +28 -0
  35. app/design/frontend/base/default/template/tray/checkoutredir/payment.phtml +191 -0
  36. app/design/frontend/base/default/template/tray/checkoutredir/return.phtml +23 -0
  37. app/etc/modules/Tray_CheckoutRedir.xml +32 -0
  38. package.xml +18 -0
  39. skin/adminhtml/default/default/tray/checkoutredir/css/magentomodal.css +194 -0
  40. skin/adminhtml/default/default/tray/checkoutredir/images/btn_bg.gif +0 -0
  41. skin/adminhtml/default/default/tray/checkoutredir/images/content_bg.gif +0 -0
  42. skin/adminhtml/default/default/tray/checkoutredir/images/top_bg.gif +0 -0
  43. skin/adminhtml/default/default/tray/checkoutredir/images/window_close.png +0 -0
  44. skin/adminhtml/default/default/tray/checkoutredir/js/exibitionsettingswebcheckout.js +26 -0
  45. skin/frontend/base/default/tray/checkoutredir/css/styles.css +10 -0
  46. skin/frontend/base/default/tray/checkoutredir/images/BannerTrayCheckout890px.png +0 -0
  47. skin/frontend/base/default/tray/checkoutredir/images/banner_comlogo_formas.jpg +0 -0
  48. skin/frontend/base/default/tray/checkoutredir/images/banner_semlogo_formas.jpg +0 -0
  49. skin/frontend/base/default/tray/checkoutredir/images/banner_semlogo_formas.png +0 -0
  50. skin/frontend/base/default/tray/checkoutredir/images/close.png +0 -0
  51. skin/frontend/base/default/tray/checkoutredir/images/overlay.png +0 -0
app/code/community/Tray/CheckoutRedir/Block/Adminhtml/System/Config/Fieldset/Label.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Adminhtml_System_Config_Fieldset_Label extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
21
+ {
22
+ public function render(Varien_Data_Form_Element_Abstract $element)
23
+ {
24
+ $id = $element->getHtmlId();
25
+ $html = sprintf('
26
+ <tr class="system-fieldset-sub-head" id="row_%s">
27
+ <td colspan="5">
28
+ <h4 id="%s">%s</h4>
29
+ <p class="note">
30
+ <span>%s</span>
31
+ </p>
32
+ </td>
33
+ </tr>',
34
+ $element->getHtmlId(), $element->getHtmlId(), $element->getLabel(), $element->getComment()
35
+ );
36
+
37
+ $html .= <<<HTML
38
+
39
+ HTML;
40
+
41
+ return $html;
42
+ }
43
+ }
app/code/community/Tray/CheckoutRedir/Block/Error.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Error extends Mage_Core_Block_Template
21
+ {
22
+
23
+ protected function getError()
24
+ {
25
+
26
+ }
27
+ }
app/code/community/Tray/CheckoutRedir/Block/Form/Geral.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Form_Geral extends Mage_Payment_Block_Form
21
+ {
22
+ protected function _construct()
23
+ {
24
+ $this->setTemplate('tray/checkoutredir/form/geral.phtml');
25
+ parent::_construct();
26
+ }
27
+ }
app/code/community/Tray/CheckoutRedir/Block/Info/Geral.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Info_Geral extends Mage_Payment_Block_Info
21
+ {
22
+ protected function _construct()
23
+ {
24
+ parent::_construct();
25
+ $this->setTemplate('tray/checkoutredir/info/geral.phtml');
26
+ }
27
+
28
+ public function getLinkPayment($order)
29
+ {
30
+ if ($this->getRequest()->getRouteName() != 'checkout') {
31
+ $_order = $order;
32
+ $incrementid = $_order->getData('increment_id');
33
+ $quoteid = $_order->getData('quote_id');
34
+
35
+ $hash = Mage::getModel('core/encryption')->encrypt($incrementid . ":" . $quoteid);
36
+ $method = $_order->getPayment()->getMethod();
37
+ switch ($method) {
38
+ case 'checkoutredir_geral':
39
+ return '<span>Para efetuar o pagamento, <a href="' . Mage::getBaseUrl() . 'checkoutredir/standard/paymentbackend/order/' . $hash . '">clique aqui</a>.</span>';
40
+ break;
41
+ }
42
+ }
43
+ }
44
+ }
app/code/community/Tray/CheckoutRedir/Block/Link.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Link extends Mage_Core_Block_Template
21
+ {
22
+
23
+ }
app/code/community/Tray/CheckoutRedir/Block/Payment.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Payment extends Mage_Core_Block_Template
21
+ {
22
+
23
+ protected function getPayment()
24
+ {
25
+ $standard = Mage::getModel('checkoutredir/'.$this->getRequest()->getParam("type"));
26
+
27
+ $form = new Varien_Data_Form();
28
+
29
+ $form->setAction($standard->getCheckoutRedirUrl())
30
+ ->setId('form_tc')
31
+ ->setName('form_tc')
32
+ ->setMethod('POST')
33
+ ->setUseContainer(true);
34
+
35
+ $xx= 0;
36
+ foreach ($standard->getCheckoutFormFields() as $field => $value)
37
+ {
38
+ if($field =="transaction_products"){
39
+ $xx= $value;
40
+ }
41
+ $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
42
+ }
43
+
44
+ $html = $form->toHtml();
45
+ for($yy=0; $yy< $xx; $yy++){
46
+ $html = str_replace("transaction_product[$yy]", "transaction_product[]", $html);
47
+ }
48
+ echo utf8_decode($html);
49
+ }
50
+ }
app/code/community/Tray/CheckoutRedir/Block/Redirect.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Redirect extends Mage_Core_Block_Abstract
21
+ {
22
+
23
+ protected function _toHtml()
24
+ {
25
+ $standard = Mage::getModel('checkoutredir/'.$this->getRequest()->getParam("type"));
26
+
27
+ $form = new Varien_Data_Form();
28
+
29
+ $form->setAction($standard->getCheckoutRedirUrl())
30
+ ->setId('checkoutredir_payment_checkout')
31
+ ->setName('checkoutredir_payment_checkout')
32
+ ->setMethod('POST')
33
+ ->setUseContainer(true);
34
+
35
+ $xx= 0;
36
+ foreach ($standard->getCheckoutFormFields() as $field => $value)
37
+ {
38
+ if($field =="transaction_products"){
39
+ $xx= $value;
40
+ }
41
+ $form->addField($field, 'hidden', array('name' => $field, 'value' => $value));
42
+ }
43
+
44
+ $xhtml = $form->toHtml();
45
+ for($yy=0; $yy< $xx; $yy++){
46
+ $xhtml = str_replace("transaction_product[$yy]", "transaction_product[]", $xhtml);
47
+ }
48
+
49
+ $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
50
+ $html .= '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="pt-BR">';
51
+ $html .= '<head>';
52
+ $html .= '<meta http-equiv="Content-Language" content="pt-br" />';
53
+ $html .= '<meta name="language" content="pt-br" />';
54
+ $html .= '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>';
55
+ $html .= '<body>';
56
+ $html .= '<div align="center">';
57
+ $html .= '<font size="4">Sua compra está em processo de finalização.<br /><br />';
58
+ $html .= ''.$this->__('Aguarde ... você será redirecionado para o TrayCheckout em <span id="tempo">5</span> segundos.</font>');
59
+ $html .= '<div>';
60
+ $html .=$xhtml;
61
+ $html .= '<script type="text/javascript">
62
+ function setTempo(){
63
+ var tempo = eval(document.getElementById("tempo").innerHTML);
64
+ if (tempo - 1 < 0){
65
+ document.getElementById("checkoutredir_payment_checkout").submit();
66
+ }else{
67
+ document.getElementById("tempo").innerHTML = tempo - 1;
68
+ setTimeout("setTempo()",1000);
69
+ }
70
+
71
+ }
72
+ setTimeout("setTempo()",1000);
73
+ </script>';
74
+ $html .= '</body></html>';
75
+
76
+ return utf8_decode($html);
77
+ }
78
+ }
app/code/community/Tray/CheckoutRedir/Block/Return.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Block_Return extends Mage_Core_Block_Template
21
+ {
22
+
23
+ protected function getReturn()
24
+ {
25
+
26
+ }
27
+
28
+ }
app/code/community/Tray/CheckoutRedir/Helper/Data.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Helper_Data extends Mage_Core_Helper_Data
21
+ {
22
+ public function prepareLineItems(Mage_Core_Model_Abstract $salesEntity, $discountTotalAsItem = true, $shippingTotalAsItem = false)
23
+ {
24
+ $items = array();
25
+
26
+ foreach ($salesEntity->getAllItems() as $item) {
27
+
28
+ if (!$item->getParentItem()) {
29
+ $items[] = new Varien_Object($this->_prepareLineItemFields($salesEntity, $item));
30
+ }
31
+ }
32
+
33
+ $discountAmount = 0;
34
+
35
+ $shippingDescription = '';
36
+
37
+ if ($salesEntity instanceof Mage_Sales_Model_Order) {
38
+
39
+ $discountAmount = abs(1 * $salesEntity->getBaseDiscountAmount());
40
+
41
+ $shippingDescription = $salesEntity->getShippingDescription();
42
+
43
+ $totals = array(
44
+ 'subtotal' => $salesEntity->getBaseSubtotal() - $discountAmount,
45
+ 'tax' => $salesEntity->getBaseTaxAmount(),
46
+ 'shipping' => $salesEntity->getBaseShippingAmount(),
47
+ 'discount' => $discountAmount
48
+ );
49
+ } else {
50
+
51
+ $address = $salesEntity->getIsVirtual() ? $salesEntity->getBillingAddress() : $salesEntity->getShippingAddress();
52
+
53
+ $discountAmount = abs(1 * $address->getBaseDiscountAmount());
54
+
55
+ $shippingDescription = $address->getShippingDescription();
56
+
57
+ $totals = array (
58
+ 'subtotal' => $salesEntity->getBaseSubtotal() - $discountAmount,
59
+ 'tax' => $address->getBaseTaxAmount(),
60
+ 'shipping' => $address->getBaseShippingAmount(),
61
+ 'discount' => $discountAmount
62
+ );
63
+ }
64
+
65
+ // discount total as line item (negative)
66
+ if ($discountTotalAsItem && $discountAmount) {
67
+ $items[] = new Varien_Object(array(
68
+ 'name' => Mage::helper('checkoutredir')->__('Discount'),
69
+ 'qty' => 1,
70
+ 'amount' => -1.00 * $discountAmount,
71
+ ));
72
+ }
73
+
74
+ // shipping total as line item
75
+ if ($shippingTotalAsItem && (!$salesEntity->getIsVirtual()) && (float)$totals['shipping']) {
76
+ $items[] = new Varien_Object(array(
77
+ 'id' => Mage::helper('checkoutredir')->__('Shipping'),
78
+ 'name' => $shippingDescription,
79
+ 'qty' => 1,
80
+ 'amount' => (float) $totals['shipping'],
81
+ ));
82
+ }
83
+
84
+ $hiddenTax = (float) $salesEntity->getBaseHiddenTaxAmount();
85
+
86
+ if ($hiddenTax) {
87
+ $items[] = new Varien_Object(array(
88
+ 'name' => Mage::helper('checkoutredir')->__('Discount Tax'),
89
+ 'qty' => 1,
90
+ 'amount' => (float)$hiddenTax,
91
+ ));
92
+ }
93
+
94
+ return array($items, $totals, $discountAmount, $totals['shipping']);
95
+ }
96
+
97
+ /**
98
+ * Get one line item key-value array
99
+ *
100
+ * @param Mage_Core_Model_Abstract $salesEntity
101
+ * @param Varien_Object $item
102
+ * @return array
103
+ */
104
+ protected function _prepareLineItemFields(Mage_Core_Model_Abstract $salesEntity, Varien_Object $item)
105
+ {
106
+ if ($salesEntity instanceof Mage_Sales_Model_Order) {
107
+ $qty = $item->getQtyOrdered();
108
+ $amount = $item->getBasePrice();
109
+ // TODO: nominal item for order
110
+ } else {
111
+ $qty = $item->getTotalQty();
112
+ $amount = $item->isNominal() ? 0 : $item->getBaseCalculationPrice();
113
+ }
114
+
115
+ // workaround in case if item subtotal precision is not compatible with PayPal (.2)
116
+ $subAggregatedLabel = '';
117
+
118
+ if ((float) $amount - round((float) $amount, 2)) {
119
+ $amount = $amount * $qty;
120
+ $subAggregatedLabel = ' x' . $qty;
121
+ $qty = 1;
122
+ }
123
+
124
+ return array(
125
+ 'id' => $item->getSku(),
126
+ 'name' => $item->getName() . $subAggregatedLabel,
127
+ 'qty' => $qty,
128
+ 'amount' => (float)$amount,
129
+ );
130
+ }
131
+ }
app/code/community/Tray/CheckoutRedir/Model/Config.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Config extends Varien_Object
21
+ {
22
+ const XML_PATH = 'payment/checkoutredir_geral/';
23
+
24
+ const XML_PATH_CONFIG = 'checkoutredir/settings/';
25
+
26
+ protected $_config = array();
27
+
28
+ protected $_config_settings = array();
29
+
30
+ public function getConfigData($key, $storeId = null)
31
+ {
32
+ if (!isset($this->_config[$key][$storeId])) {
33
+ $value = Mage::getStoreConfig(self::XML_PATH . $key, $storeId);
34
+ $this->_config[$key][$storeId] = $value;
35
+ }
36
+ return $this->_config[$key][$storeId];
37
+ }
38
+
39
+ public function getConfigDataSettings($key, $storeId = null)
40
+ {
41
+ if (!isset($this->_config_settings[$key][$storeId])) {
42
+ $value = Mage::getStoreConfig(self::XML_PATH_CONFIG . $key, $storeId);
43
+ $this->_config_settings[$key][$storeId] = $value;
44
+ }
45
+ return $this->_config_settings[$key][$storeId];
46
+ }
47
+
48
+ /* public function getAccount($store = null)
49
+ {
50
+ if (!$this->hasData('checkoutredir_account')) {
51
+ $this->setData('checkoutredir_account', $this->getConfigData('account', $storeId));
52
+ }
53
+
54
+ return $this->getData('checkoutredir_account');
55
+ }
56
+
57
+ public function getToken($store = null)
58
+ {
59
+ if (!$this->hasData('checkoutredir_token')) {
60
+ $this->setData('checkoutredir_token', $this->getConfigData('token', $storeId));
61
+ }
62
+
63
+ return $this->getData('checkoutredir_token');
64
+ }
65
+
66
+ public function getUrl($store = null)
67
+ {
68
+ if (!$this->hasData('checkoutredir_url')) {
69
+ $this->setData('checkoutredir_url', $this->getConfigData('url', $storeId));
70
+ }
71
+
72
+ return $this->getData('checkoutredir_url');
73
+ }
74
+ */
75
+ public function getExibitionWebCheckout($storeId = null)
76
+ {
77
+ if (!$this->hasData('exibitionmodal')) {
78
+ $this->setData('exibitionmodal', $this->getConfigData('exibitionmodal', $storeId));
79
+ }
80
+ return $this->getData('exibitionmodal');
81
+ }
82
+
83
+ }
app/code/community/Tray/CheckoutRedir/Model/Geral.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Geral extends Tray_CheckoutRedir_Model_Standard
21
+ {
22
+ protected $_code = 'checkoutredir_geral';
23
+
24
+ protected $_formBlockType = 'checkoutredir/form_geral';
25
+
26
+ protected $_blockType = 'checkoutredir/geral';
27
+
28
+ protected $_infoBlockType = 'checkoutredir/info_geral';
29
+
30
+ public function getOrderPlaceRedirectUrl()
31
+ {
32
+ return Mage::getUrl('checkoutredir/standard/payment', array('_secure' => true, 'type' => 'geral'));
33
+ }
34
+ }
app/code/community/Tray/CheckoutRedir/Model/Mysql4/Setup.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
21
+ {
22
+
23
+ }
app/code/community/Tray/CheckoutRedir/Model/Observer.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Observer extends Varien_Object
21
+ {
22
+ public function sendEmailFrontend()
23
+ {
24
+ $session = Mage::getSingleton('checkout/session');
25
+ $lastSuccessOrderId = $session->getData('last_real_order_id');
26
+
27
+ $order = Mage::getModel('sales/order')->loadByAttribute('increment_id',$lastSuccessOrderId);
28
+
29
+ // $sendNewOrderEmail = Mage::getStoreConfig('sales_email/order/enabled');
30
+ // if ($sendNewOrderEmail && !$order->getData('email_sent')) {
31
+ // $order->sendNewOrderEmail();
32
+ // $order->setEmailSent(true);
33
+ // $order->save();
34
+ // }
35
+ }
36
+
37
+ }
app/code/community/Tray/CheckoutRedir/Model/Source/Country.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Source_Country
21
+ {
22
+ public function toOptionArray()
23
+ {
24
+ return array(
25
+ array('value' => 'BR', 'label'=>Mage::helper('adminhtml')->__('Brasil')),
26
+ );
27
+ }
28
+ }
app/code/community/Tray/CheckoutRedir/Model/Source/Parcelas2.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ //class Tray_CheckoutRedir_Model_Source_Parcelas
21
+ //{
22
+ //
23
+ // /**
24
+ // * Options getter
25
+ // *
26
+ // * @return array
27
+ // */
28
+ // public function toOptionArray()
29
+ // {
30
+ // return array(
31
+ // array('value' => 1, 'label'=>Mage::helper('adminhtml')->__('01')),
32
+ // array('value' => 2, 'label'=>Mage::helper('adminhtml')->__('02')),
33
+ // array('value' => 3, 'label'=>Mage::helper('adminhtml')->__('03')),
34
+ // array('value' => 4, 'label'=>Mage::helper('adminhtml')->__('04')),
35
+ // array('value' => 5, 'label'=>Mage::helper('adminhtml')->__('05')),
36
+ // array('value' => 6, 'label'=>Mage::helper('adminhtml')->__('06')),
37
+ // array('value' => 7, 'label'=>Mage::helper('adminhtml')->__('07')),
38
+ // array('value' => 8, 'label'=>Mage::helper('adminhtml')->__('08')),
39
+ // array('value' => 9, 'label'=>Mage::helper('adminhtml')->__('09')),
40
+ // array('value' => 10, 'label'=>Mage::helper('adminhtml')->__('10')),
41
+ // array('value' => 11, 'label'=>Mage::helper('adminhtml')->__('11')),
42
+ // array('value' => 12, 'label'=>Mage::helper('adminhtml')->__('12')),
43
+ // array('value' => 13, 'label'=>Mage::helper('adminhtml')->__('13')),
44
+ // array('value' => 14, 'label'=>Mage::helper('adminhtml')->__('14')),
45
+ // array('value' => 15, 'label'=>Mage::helper('adminhtml')->__('15')),
46
+ // array('value' => 16, 'label'=>Mage::helper('adminhtml')->__('16')),
47
+ // array('value' => 17, 'label'=>Mage::helper('adminhtml')->__('17')),
48
+ // array('value' => 18, 'label'=>Mage::helper('adminhtml')->__('18')),
49
+ // array('value' => 19, 'label'=>Mage::helper('adminhtml')->__('19')),
50
+ // array('value' => 20, 'label'=>Mage::helper('adminhtml')->__('20')),
51
+ // array('value' => 21, 'label'=>Mage::helper('adminhtml')->__('21')),
52
+ // array('value' => 22, 'label'=>Mage::helper('adminhtml')->__('22')),
53
+ // array('value' => 23, 'label'=>Mage::helper('adminhtml')->__('23')),
54
+ // array('value' => 24, 'label'=>Mage::helper('adminhtml')->__('24')),
55
+ // );
56
+ // }
57
+ //
58
+ //}
app/code/community/Tray/CheckoutRedir/Model/Source/Specificcountries.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Source_Specificcountries
21
+ {
22
+ public function toOptionArray()
23
+ {
24
+ return array(
25
+ array('value'=>1, 'label'=>Mage::helper('adminhtml')->__('Specific Countries')),
26
+ );
27
+ }
28
+ }
app/code/community/Tray/CheckoutRedir/Model/Source/Webcheckout.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Source_Webcheckout
21
+ {
22
+ public function toOptionArray()
23
+ {
24
+ return array(
25
+ array('value' => '', 'label' => ''),
26
+ array('value' => '1', 'label' => 'Modal'),
27
+ array('value' => '2', 'label' => 'Iframe'),
28
+ array('value' => '3', 'label' => 'Redirect (Nova janela)'),
29
+ );
30
+ }
31
+ }
app/code/community/Tray/CheckoutRedir/Model/Standard.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_Model_Standard extends Mage_Payment_Model_Method_Abstract
21
+ {
22
+ const PAYMENT_TYPE_AUTH = 'AUTHORIZATION'; //retirar
23
+ const PAYMENT_TYPE_SALE = 'SALE'; //retirar
24
+
25
+ protected $_allowCurrencyCode = array('BRL');
26
+
27
+ /**
28
+ * Availability options
29
+ */
30
+
31
+
32
+ /**
33
+ * Can be edit order (renew order)
34
+ *
35
+ * @return bool
36
+ */
37
+ public function canEdit()
38
+ {
39
+ return false;
40
+ }
41
+
42
+ /**
43
+ * Return Order Place Redirect URL
44
+ *
45
+ * @return string Order Redirect URL
46
+ */
47
+ public function getOrderPlaceRedirectUrl()
48
+ {
49
+ return Mage::getUrl('checkoutredir/redirect');
50
+ }
51
+
52
+ /**
53
+ * Get checkoutredir session namespace
54
+ *
55
+ * @return Tray_CheckoutRedir_Model_Session
56
+ */
57
+ public function getSession()
58
+ {
59
+ return Mage::getSingleton('checkoutredir/session');
60
+ }
61
+
62
+ /**
63
+ * Get checkout session namespace
64
+ *
65
+ * @return Mage_Checkout_Model_Session
66
+ */
67
+ public function getCheckout()
68
+ {
69
+ return Mage::getSingleton('checkout/session');
70
+ }
71
+
72
+ /**
73
+ * Get current quote
74
+ *
75
+ * @return Mage_Sales_Model_Quote
76
+ */
77
+ public function getQuote()
78
+ {
79
+ return $this->getCheckout()->getQuote();
80
+ }
81
+
82
+ /**
83
+ * Using for multiple shipping address
84
+ *
85
+ * @return bool
86
+ */
87
+ public function canUseForMultishipping()
88
+ {
89
+ return false;
90
+ }
91
+
92
+ public function createFormBlock($name)
93
+ {
94
+ $block = $this->getLayout()->createBlock($_formBlockType, $name)
95
+ ->setMethod('checkoutredir')
96
+ ->setPayment($this->getPayment())
97
+ ->setTemplate('tray/checkoutredir/form.phtml');
98
+ return $block;
99
+ }
100
+
101
+ public function validate()
102
+ {
103
+ parent::validate();
104
+ $currency_code = $this->getQuote()->getBaseCurrencyCode();
105
+ if (!$currency_code){
106
+ $session = Mage::getSingleton('adminhtml/session_quote');
107
+ $currency_code = $session->getQuote()->getBaseCurrencyCode();
108
+ }
109
+ if (!in_array($currency_code,$this->_allowCurrencyCode)) {
110
+ Mage::throwException(Mage::helper('checkoutredir')->__('A moeda selecionada ('.$currency_code.') não é compatível com o Tray'));
111
+ }
112
+ return $this;
113
+ }
114
+
115
+ public function onOrderValidate(Mage_Sales_Model_Order_Payment $payment)
116
+ {
117
+ return $this;
118
+ }
119
+
120
+ public function onInvoiceCreate(Mage_Sales_Model_Invoice_Payment $payment)
121
+ {
122
+ return $this;
123
+ }
124
+
125
+ public function canCapture()
126
+ {
127
+ return true;
128
+ }
129
+
130
+ public function getCheckoutFormFields()
131
+ {
132
+ $orderIncrementId = $this->getCheckout()->getLastRealOrderId();
133
+
134
+ if (!$orderIncrementId) {
135
+ $quoteidbackend = $this->getCheckout()->getData('checkoutredir_quote_id');
136
+ $order = Mage::getModel('sales/order')->loadByAttribute('quote_id', $quoteidbackend);
137
+ $orderIncrementId = $order->getData('increment_id');
138
+ }
139
+ else {
140
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
141
+ }
142
+
143
+ $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
144
+
145
+ // Envia email de confirmação ao cliente
146
+ if(!$order->getEmailSent()) {
147
+ $order->sendNewOrderEmail();
148
+ $order->setEmailSent(true);
149
+ $order->save();
150
+ }
151
+
152
+ $isOrderVirtual = $order->getIsVirtual();
153
+ $a = $isOrderVirtual ? $order->getBillingAddress() : $order->getShippingAddress();
154
+ $currency_code = $order->getBaseCurrencyCode();
155
+
156
+ list($items, $totals, $discountAmount, $shippingAmount) = Mage::helper('checkoutredir')->prepareLineItems($order, false, false);
157
+
158
+ $postal_code = trim(str_replace("-", "", $a->getPostcode()));
159
+
160
+ $payment_type = $order->getPayment()->getData('cc_type');
161
+
162
+ $shipping_description = $order->getData('shipping_description');
163
+
164
+ $sArr = array();
165
+ $number = substr(str_replace(" ","",str_replace("(","",str_replace(")","",str_replace("-","",$a->getTelephone())))),0,2) . substr(str_replace(" ","",str_replace("-","",$a->getTelephone())),-8);
166
+
167
+ $sArr['token_account']= $this->getConfigData('token');
168
+ $sArr['order_number']= $this->getConfigData('prefixo').$orderIncrementId;
169
+
170
+ $sArr['customer[name]']= $a->getFirstname() . ' ' . str_replace("(pj)", "", $a->getLastname());
171
+ $sArr['customer[addresses][][postal_code]']= $postal_code;
172
+ $sArr['customer[addresses][][street]']= $a->getStreet(1);
173
+ $sArr['customer[addresses][][completion]']= "";
174
+ $sArr['customer[addresses][][neighborhood]']=$a->getStreet(2);
175
+ $sArr['customer[addresses][][city]']= $a->getCity();
176
+ $sArr['customer[addresses][][state]']= $a->getRegionCode();
177
+ $sArr['customer[contacts][][number_contact]']= $number;
178
+ $sArr['customer[email]']= $a->getEmail();
179
+ $sArr['payment[payment_method_id]']= $payment_type;
180
+
181
+ if ($items) {
182
+ $i = 0;
183
+ foreach($items as $item) {
184
+ if ($item->getAmount() > 0) {
185
+ $sArr ["transaction_product[$i][code]"] = $item->getId();
186
+ $i++;
187
+ $sArr ["transaction_product[$i][description]"] = $item->getName();
188
+ $i++;
189
+ $sArr ["transaction_product[$i][quantity]"] = $item->getQty();
190
+ $i++;
191
+ $sArr ["transaction_product[$i][price_unit]"] = sprintf('%.2f',$item->getAmount());
192
+ $i++;
193
+ $sArr ["transaction_product[$i][sku_code]"] = $item->getId();
194
+ $i++;
195
+ }
196
+ }
197
+ $sArr ["transaction_products"]=$i;
198
+
199
+ $sArr["price_discount"] = is_numeric( $discountAmount ) ? sprintf('%.2f',$discountAmount) : 0;
200
+ $sArr["price_additional"] = is_numeric( $order->getData("base_tax_amount") ) ? sprintf('%.2f',$order->getData("base_tax_amount")) : 0;
201
+ }
202
+ $totalArr = $order->getBaseGrandTotal(); //retirar
203
+ $shipping = sprintf('%.2f',$shippingAmount) ;
204
+
205
+ $sArr['shipping_type']= $shipping_description;
206
+ $sArr['shipping_price']= $shipping;
207
+
208
+ $sArr = array_merge($sArr, array('url_process' => Mage::getUrl('checkoutredir/standard/success', array('_secure' => true, 'type' => 'geral'))));
209
+ $sArr = array_merge($sArr, array('url_cancel' => Mage::getUrl('checkoutredir/standard/success', array('_secure' => true, 'type' => 'geral'))));
210
+ $sArr = array_merge($sArr, array('url_success' => Mage::getUrl('checkoutredir/standard/success', array('_secure' => true, 'type' => 'geral'))));
211
+ $sArr = array_merge($sArr, array('url_notification' => Mage::getUrl('checkoutredir/standard/success', array('_secure' => true, 'type' => 'geral'))));
212
+
213
+ $sReq = '';
214
+ $rArr = array();
215
+ foreach ($sArr as $k=>$v) {
216
+ $value = str_replace("&","and",$v);
217
+ $rArr[$k] = $value;
218
+ $sReq .= '&'.$k.'='.$value;
219
+ }
220
+ return $rArr;
221
+ }
222
+
223
+ public function getCheckoutRedirUrl()
224
+ {
225
+ if ($this->getConfigData('sandbox') == '1')
226
+ {
227
+ return 'http://checkout.sandbox.tray.com.br/payment/transaction';
228
+ } else {
229
+ return 'https://checkout.tray.com.br/payment/transaction';
230
+ // return 'http://gpereira.checkout.traycheckout.desenvolvimento.tray.intranet/payment/transaction';
231
+ }
232
+
233
+ }
234
+
235
+ }
app/code/community/Tray/CheckoutRedir/controllers/StandardController.php ADDED
@@ -0,0 +1,361 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+
20
+ class Tray_CheckoutRedir_StandardController extends Mage_Core_Controller_Front_Action
21
+ {
22
+
23
+ /**
24
+ * Order instance
25
+ */
26
+ protected $_order;
27
+
28
+
29
+ public function paymentAction()
30
+ {
31
+ $this->loadLayout();
32
+ $this->renderLayout();
33
+ }
34
+
35
+ public function returnAction()
36
+ {
37
+ $this->loadLayout();
38
+ $this->renderLayout();
39
+ }
40
+
41
+ public function paymentbackendAction()
42
+ {
43
+ $this->loadLayout();
44
+ $this->renderLayout();
45
+
46
+ $hash = explode("/order/", $this->getRequest()->getOriginalRequest()->getRequestUri());
47
+ $hashdecode = explode(":", Mage::getModel('core/encryption')->decrypt($hash[1]));
48
+
49
+ $order = Mage::getModel('sales/order')
50
+ ->getCollection()
51
+ ->addFieldToFilter('increment_id', $hashdecode[0])
52
+ ->addFieldToFilter('quote_id', $hashdecode[1])
53
+ ->getFirstItem();
54
+
55
+ if ($order) {
56
+ $session = Mage::getSingleton('checkout/session');
57
+ $session->setLastQuoteId($order->getData('quote_id'));
58
+ $session->setLastOrderId($order->getData('entity_id'));
59
+ $session->setLastSuccessQuoteId($order->getData('quote_id'));
60
+ $session->setLastRealOrderId($order->getData('increment_id'));
61
+ $session->setCheckoutRedirQuoteId($order->getData('quote_id'));
62
+ $this->_redirect('checkoutredir/standard/payment/type/geral');
63
+ } else {
64
+ Mage::getSingleton('checkout/session')->addError('URL informada é inválida!');
65
+ $this->_redirect('checkout/cart');
66
+ }
67
+ }
68
+
69
+ public function errorAction()
70
+ {
71
+ $this->loadLayout();
72
+ $this->renderLayout();
73
+ }
74
+
75
+ /**
76
+ * Get order
77
+ *
78
+ * @return Mage_Sales_Model_Order
79
+ */
80
+ public function getOrder() {
81
+
82
+ if ($this->_order == null) {
83
+
84
+ }
85
+
86
+ return $this->_order;
87
+ }
88
+
89
+ protected function _expireAjax() {
90
+ if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
91
+ $this->getResponse()->setHeader('HTTP/1.1', '403 Session Expired');
92
+ exit;
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Get singleton with pagamento digital standard order transaction information
98
+ *
99
+ * @return Tray_CheckoutRedir_Model_Api
100
+ */
101
+ public function getApi()
102
+ {
103
+ return Mage::getSingleton('checkoutredir/'.$this->getRequest()->getParam("type"));
104
+ }
105
+
106
+ /**
107
+ * When a customer chooses Tray on Checkout/Payment page
108
+ *
109
+ */
110
+ public function redirectAction()
111
+ {
112
+ /*
113
+ * caso precise para identificar o tipo de modelo.
114
+ * Ex: $this->getResponse()->setBody($this->getLayout()->createBlock('checkoutredir/redirect_{$type}}')->toHtml());
115
+ */
116
+
117
+ $type = $this->getRequest()->getParam('type', false);
118
+
119
+ $session = Mage::getSingleton('checkout/session');
120
+
121
+ $session->setCheckoutRedirQuoteId($session->getQuoteId());
122
+
123
+ $this->getResponse()->setHeader("Content-Type", "text/html; charset=ISO-8859-1", true);
124
+
125
+ $this->getResponse()->setBody($this->getLayout()->createBlock('checkoutredir/redirect')->toHtml());
126
+
127
+ $session->unsQuoteId();
128
+ }
129
+
130
+ /**
131
+ * When a customer cancel payment from pagamento digital.
132
+ */
133
+ public function cancelAction()
134
+ {
135
+
136
+ $session = Mage::getSingleton('checkout/session');
137
+
138
+ $session->setQuoteId($session->getCheckoutRedirQuoteId(true));
139
+
140
+ // cancel order
141
+ if ($session->getLastRealOrderId()) {
142
+
143
+ $order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());
144
+
145
+ if ($order->getId()) {
146
+ $order->cancel()->save();
147
+ }
148
+ }
149
+
150
+ $this->_redirect('checkout/cart');
151
+ }
152
+
153
+ private function getUrlPostCheckoutRedir($sandbox)
154
+ {
155
+ if ($sandbox == '1')
156
+ {
157
+ return "http://api.sandbox.checkout.tray.com.br/api/transactions/get_by_token";
158
+ } else {
159
+ return "http://api.checkout.tray.com.br/api/transactions/get_by_token";
160
+ }
161
+ }
162
+
163
+ /**
164
+ * when pagamento_digital returns
165
+ * The order information at this point is in POST
166
+ * variables. However, you don't want to "process" the order until you
167
+ * get validation from the return post.
168
+ */
169
+ public function successAction()
170
+ {
171
+ $_type = $this->getRequest()->getParam('type', false);
172
+ $token = $this->getApi()->getConfigData('token');;
173
+
174
+ $urlPost = $this->getUrlPostCheckoutRedir($this->getApi()->getConfigData('sandbox'));
175
+
176
+ $dados_post = $this->getRequest()->getPost();
177
+
178
+ $order_number_conf = utf8_encode(str_replace($this->getApi()->getConfigData('prefixo'),'',$dados_post['transaction']['order_number']));
179
+ $transaction_token= $dados_post['transaction']['transaction_token'];
180
+
181
+ ob_start();
182
+ $ch = curl_init();
183
+ curl_setopt($ch, CURLOPT_URL, $urlPost);
184
+ curl_setopt($ch, CURLOPT_POST, 1);
185
+ curl_setopt($ch, CURLOPT_POSTFIELDS, array("token"=>trim($transaction_token), "type_response"=>"J"));
186
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Expect:"));
187
+ curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
188
+ curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
189
+ curl_exec ($ch);
190
+
191
+ /* XML ou Json de retorno */
192
+ $resposta = ob_get_contents();
193
+ ob_end_clean();
194
+
195
+ /* Capturando o http code para tratamento dos erros na requisi��o*/
196
+ $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
197
+ curl_close($ch);
198
+ $arrResponse = json_decode($resposta,TRUE);
199
+
200
+ $xml = simplexml_load_string($resposta);
201
+ if($httpCode != "200" ){
202
+ $codigo_erro = $xml->codigo;
203
+ $descricao_erro = $xml->descricao;
204
+ if ($codigo_erro == ''){
205
+ $codigo_erro = '0000000';
206
+ }
207
+ if ($descricao_erro == ''){
208
+ $descricao_erro = 'Erro Desconhecido';
209
+ }
210
+ $this->_redirect('checkoutredir/standard/error', array('_secure' => true , 'descricao' => urlencode(utf8_encode($descricao_erro)),'codigo' => urlencode($codigo_erro)));
211
+ }else{
212
+
213
+ $transaction = $arrResponse['data_response']['transaction'];
214
+ $order_number = str_replace($this->getApi()->getConfigData('prefixo'),'',$transaction['order_number']);
215
+ if($order_number != $order_number_conf) {
216
+ $codigo_erro = '0000000';
217
+ $descricao_erro = "Pedido: " . $order_number_conf . " não corresponte com a pedido consultado: ".$order_number."!";
218
+ $this->_redirect('checkoutredir/standard/error', array('_secure' => true , 'descricao' => urlencode(utf8_encode($descricao_erro)),'codigo' => urlencode($codigo_erro)));
219
+ }
220
+
221
+ if (isset($transaction['status_id'])) {
222
+ $comment .= " " . $transaction['status_id'];
223
+ }
224
+
225
+ if (isset($transaction['status_name'])) {
226
+ $comment .= " - " . $transaction['status_name'];
227
+ }
228
+ echo "Pedido: $order_number - $comment - ID: ".$dados_post['transaction']['transaction_id'];
229
+ $order = Mage::getModel('sales/order');
230
+
231
+ $order->loadByIncrementId($order_number);
232
+
233
+ if ($order->getId()) {
234
+
235
+ if ($transaction['price_original'] != $order->getGrandTotal()) {
236
+
237
+ $frase = 'Total pago à Tray é diferente do valor original.';
238
+
239
+ $order->addStatusToHistory(
240
+ $order->getStatus(), //continue setting current order status
241
+ Mage::helper('checkoutredir')->__($frase), true
242
+ );
243
+
244
+ $order->sendOrderUpdateEmail(true, $frase);
245
+ } else {
246
+ $cod_status = $transaction['status_id'];
247
+
248
+ switch ($cod_status){
249
+ case '4':
250
+ case '5':
251
+ case '88':
252
+ $order->addStatusToHistory(
253
+ Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, Mage::helper('checkoutredir')->__('Tray enviou automaticamente o status: %s', $comment)
254
+
255
+ );
256
+ break;
257
+ case '6':
258
+ $items = $order->getAllItems();
259
+
260
+ $thereIsVirtual = false;
261
+
262
+ foreach ($items as $itemId => $item) {
263
+ if ($item["is_virtual"] == "1" || $item["is_downloadable"] == "1") {
264
+ $thereIsVirtual = true;
265
+ }
266
+ }
267
+
268
+ // what to do - from admin
269
+ $toInvoice = $this->getApi()->getConfigData('acaopadraovirtual') == "1" ? true : false;
270
+
271
+ if ($thereIsVirtual && !$toInvoice) {
272
+
273
+ $frase = 'Tray - Aprovado. Pagamento (fatura) confirmado automaticamente.';
274
+
275
+ $order->addStatusToHistory(
276
+ $order->getStatus(), //continue setting current order status
277
+ Mage::helper('checkoutredir')->__($frase), true
278
+ );
279
+
280
+ $order->sendOrderUpdateEmail(true, $frase);
281
+ } else {
282
+
283
+ if (!$order->canInvoice()) {
284
+ $isHolded = ( $order->getStatus() == Mage_Sales_Model_Order::STATE_HOLDED );
285
+
286
+ $status = ($isHolded) ? Mage_Sales_Model_Order::STATE_PROCESSING : $order->getStatus();
287
+ $frase = ($isHolded) ? 'Tray - Aprovado. Confirmado automaticamente o pagamento do pedido.' : 'Erro ao criar pagamento (fatura).';
288
+
289
+ //when order cannot create invoice, need to have some logic to take care
290
+ $order->addStatusToHistory(
291
+ $status, //continue setting current order status
292
+ Mage::helper('checkoutredir')->__( $frase )
293
+ );
294
+
295
+ } else {
296
+
297
+ //need to save transaction id
298
+ $order->getPayment()->setTransactionId($dados_post['transaction']['transaction_id']);
299
+
300
+ //need to convert from order into invoice
301
+ $invoice = $order->prepareInvoice();
302
+
303
+ if ($this->getApi()->canCapture()) {
304
+ $invoice->register()->capture();
305
+ }
306
+
307
+ Mage::getModel('core/resource_transaction')
308
+ ->addObject($invoice)
309
+ ->addObject($invoice->getOrder())
310
+ ->save();
311
+
312
+ $frase = 'Pagamento (fatura) ' . $invoice->getIncrementId() . ' foi criado. Tray - Aprovado. Confirmado automaticamente o pagamento do pedido.';
313
+
314
+ if ($thereIsVirtual) {
315
+
316
+ $order->addStatusToHistory(
317
+ $order->getStatus(), Mage::helper('checkoutredir')->__($frase), true
318
+ );
319
+
320
+ } else {
321
+
322
+ $order->addStatusToHistory(
323
+ Mage_Sales_Model_Order::STATE_PROCESSING, //update order status to processing after creating an invoice
324
+ Mage::helper('checkoutredir')->__($frase), true
325
+ );
326
+ }
327
+
328
+ $invoice->sendEmail(true, $frase);
329
+ }
330
+ }
331
+ break;
332
+ case '24':
333
+ $order->addStatusToHistory(
334
+ Mage_Sales_Model_Order::STATE_HOLDED, Mage::helper('checkoutredir')->__('Tray enviou automaticamente o status: %s', $comment)
335
+ );
336
+ break;
337
+ case '7':
338
+ case '89':
339
+ $frase = 'Tray - Cancelado. Pedido cancelado automaticamente (transação foi cancelada, pagamento foi negado, pagamento foi estornado ou ocorreu um chargeback).';
340
+
341
+ $order->addStatusToHistory(
342
+ Mage_Sales_Model_Order::STATE_CANCELED, Mage::helper('checkoutredir')->__($frase), true
343
+ );
344
+
345
+ $order->sendOrderUpdateEmail(true, $frase);
346
+
347
+ $order->cancel();
348
+ break;
349
+ case '87':
350
+ $order->addStatusToHistory(
351
+ Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW, Mage::helper('checkoutredir')->__('Tray enviou automaticamente o status: %s', $comment)
352
+ );
353
+ break;
354
+ }
355
+ }
356
+ $order->save();
357
+ }
358
+ }
359
+ }
360
+
361
+ }
app/code/community/Tray/CheckoutRedir/etc/adminhtml.xml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to suporte@tray.net.br so we can send you a copy immediately.
15
+ *
16
+ * @category Tray
17
+ * @package Tray_CheckoutRedir
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+
22
+ <config>
23
+ <acl>
24
+ <resources>
25
+ <all>
26
+ <title>Allow Everything</title>
27
+ </all>
28
+ <admin>
29
+ <children>
30
+ <system>
31
+ <children>
32
+ <config>
33
+ <children>
34
+ <checkoutredir>
35
+ <title>Tray - Settings</title>
36
+ </checkoutredir>
37
+ </children>
38
+ </config>
39
+ </children>
40
+ </system>
41
+ </children>
42
+ </admin>
43
+ </resources>
44
+ </acl>
45
+ </config>
app/code/community/Tray/CheckoutRedir/etc/config.xml ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to suporte@tray.net.br so we can send you a copy immediately.
15
+ *
16
+ * @category Tray
17
+ * @package Tray_CheckoutRedir
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+ <config>
22
+ <modules>
23
+ <Tray_CheckoutRedir>
24
+ <version>0.1.10</version>
25
+ </Tray_CheckoutRedir>
26
+ </modules>
27
+ <global>
28
+ <models>
29
+ <checkoutredir>
30
+ <class>Tray_CheckoutRedir_Model</class>
31
+ <resourceModel>checkoutredir_mysql4</resourceModel>
32
+ </checkoutredir>
33
+ <checkoutredir_mysql4>
34
+ <class>Tray_CheckoutRedir_Model_Mysql4</class>
35
+ <entities>
36
+ <api_debug>
37
+ <table>checkoutredir_api_debug</table>
38
+ </api_debug>
39
+ </entities>
40
+ </checkoutredir_mysql4>
41
+ </models>
42
+ <resources>
43
+ <checkoutredir_write>
44
+ <connection>
45
+ <use>core_write</use>
46
+ </connection>
47
+ </checkoutredir_write>
48
+ <checkoutredir_read>
49
+ <connection>
50
+ <use>core_read</use>
51
+ </connection>
52
+ </checkoutredir_read>
53
+ </resources>
54
+ <blocks>
55
+ <checkoutredir>
56
+ <class>Tray_CheckoutRedir_Block</class>
57
+ </checkoutredir>
58
+ </blocks>
59
+ <helpers>
60
+ <checkoutredir>
61
+ <class>Tray_CheckoutRedir_Helper</class>
62
+ </checkoutredir>
63
+ </helpers>
64
+ <events>
65
+ <checkout_onepage_controller_success_action>
66
+ <observers>
67
+ <checkoutredir_observer>
68
+ <type>singleton</type>
69
+ <class>checkoutredir/observer</class>
70
+ <method>sendEmailFrontend</method>
71
+ </checkoutredir_observer>
72
+ </observers>
73
+ </checkout_onepage_controller_success_action>
74
+ <checkout_multishipping_controller_success_action>
75
+ <observers>
76
+ <checkoutredir_observer>
77
+ <type>singleton</type>
78
+ <class>checkoutredir/observer</class>
79
+ <method>sendEmailFrontend</method>
80
+ </checkoutredir_observer>
81
+ </observers>
82
+ </checkout_multishipping_controller_success_action>
83
+ </events>
84
+ </global>
85
+ <frontend>
86
+ <secure_url>
87
+ <checkoutredir>/checkoutredir/standard</checkoutredir>
88
+ </secure_url>
89
+ <routers>
90
+ <checkoutredir>
91
+ <use>standard</use>
92
+ <args>
93
+ <module>Tray_CheckoutRedir</module>
94
+ <frontName>checkoutredir</frontName>
95
+ </args>
96
+ </checkoutredir>
97
+ </routers>
98
+ <translate>
99
+ <modules>
100
+ <checkoutredir>
101
+ <files>
102
+ <default>Tray_CheckoutRedir.csv</default>
103
+ </files>
104
+ </checkoutredir>
105
+ </modules>
106
+ </translate>
107
+ <layout>
108
+ <updates>
109
+ <checkoutredir>
110
+ <file>tray_checkoutredir.xml</file>
111
+ </checkoutredir>
112
+ </updates>
113
+ </layout>
114
+ </frontend>
115
+ <adminhtml>
116
+ <translate>
117
+ <modules>
118
+ <checkoutredir>
119
+ <files>
120
+ <default>Tray_CheckoutRedir.csv</default>
121
+ </files>
122
+ </checkoutredir>
123
+ </modules>
124
+ </translate>
125
+ <layout>
126
+ <updates>
127
+ <checkoutredir>
128
+ <file>tray_checkoutredir.xml</file>
129
+ </checkoutredir>
130
+ </updates>
131
+ </layout>
132
+ </adminhtml>
133
+ <default>
134
+ <!-- incluir as configurações de acordo com cada modelo -->
135
+ <payment>
136
+ <checkoutredir_geral>
137
+ <active>0</active>
138
+ <model>Tray_CheckoutRedir_Model_Geral</model>
139
+ <order_status>pending</order_status>
140
+ <title>Tray Checkout</title>
141
+ <allowspecific>1</allowspecific>
142
+ <retorno>http://www.urldoseusite.com.br/index.php/CheckoutRedir_PdGeral/standard/success/</retorno>
143
+ </checkoutredir_geral>
144
+ </payment>
145
+ <checkoutredir>
146
+ <settings>
147
+ <exibitionmodal>1</exibitionmodal>
148
+ </settings>
149
+ </checkoutredir>
150
+ </default>
151
+ </config>
app/code/community/Tray/CheckoutRedir/etc/system.xml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to suporte@tray.net.br so we can send you a copy immediately.
15
+ *
16
+ * @category Tray
17
+ * @package Tray_CheckoutRedir
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+ <config>
22
+ <tabs>
23
+ <tray translate="label" module="checkoutredir">
24
+ <label>Tray Commerce</label>
25
+ <sort_order>100</sort_order>
26
+ </tray>
27
+ </tabs>
28
+ <sections>
29
+ <payment translate="label" module="checkoutredir">
30
+ <groups>
31
+ <checkoutredir_geral translate="label">
32
+ <label>Tray Checkout</label>
33
+ <sort_order>670</sort_order>
34
+ <show_in_default>1</show_in_default>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>0</show_in_store>
37
+ <fields>
38
+ <active translate="label">
39
+ <label>Enabled</label>
40
+ <frontend_type>select</frontend_type>
41
+ <source_model>adminhtml/system_config_source_yesno</source_model>
42
+ <sort_order>1</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>0</show_in_store>
46
+ </active>
47
+ <title translate="label">
48
+ <label>Título</label>
49
+ <frontend_type>text</frontend_type>
50
+ <sort_order>2</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>0</show_in_store>
54
+ </title>
55
+ <order_status translate="label">
56
+ <label>Status dos novos pedidos</label>
57
+ <frontend_type>select</frontend_type>
58
+ <source_model>adminhtml/system_config_source_order_status_new</source_model>
59
+ <sort_order>3</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>0</show_in_store>
63
+ </order_status>
64
+ <token translate="label">
65
+ <label>Token</label>
66
+ <frontend_type>text</frontend_type>
67
+ <sort_order>6</sort_order>
68
+ <show_in_default>1</show_in_default>
69
+ <show_in_website>1</show_in_website>
70
+ <show_in_store>0</show_in_store>
71
+ </token>
72
+ <acaopadraovirtual translate="label">
73
+ <label>Gerar Fatura automaticamente para pedidos com produtos virtuais? (Completar)</label>
74
+ <frontend_type>select</frontend_type>
75
+ <sort_order>8</sort_order>
76
+ <source_model>adminhtml/system_config_source_yesno</source_model>
77
+ <show_in_default>1</show_in_default>
78
+ <show_in_website>1</show_in_website>
79
+ <show_in_store>0</show_in_store>
80
+ </acaopadraovirtual>
81
+ <allowspecific translate="label">
82
+ <label>Tipos de Países Permitidos</label>
83
+ <frontend_type>select</frontend_type>
84
+ <sort_order>10</sort_order>
85
+ <source_model>checkoutredir/source_specificcountries</source_model>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ </allowspecific>
90
+ <specificcountry translate="label">
91
+ <label>Permitir Pagamento de Países Específicos</label>
92
+ <frontend_type>select</frontend_type>
93
+ <sort_order>11</sort_order>
94
+ <source_model>checkoutredir/source_country</source_model>
95
+ <show_in_default>1</show_in_default>
96
+ <show_in_website>1</show_in_website>
97
+ <show_in_store>1</show_in_store>
98
+ </specificcountry>
99
+ <prefixo translate="label">
100
+ <label>Prefixo do Pedido</label>
101
+ <frontend_type>text</frontend_type>
102
+ <sort_order>15</sort_order>
103
+ <show_in_default>1</show_in_default>
104
+ <show_in_website>1</show_in_website>
105
+ <show_in_store>1</show_in_store>
106
+ </prefixo>
107
+ <sort_order translate="label">
108
+ <label>Ordem de Exibição</label>
109
+ <frontend_type>text</frontend_type>
110
+ <sort_order>100</sort_order>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>1</show_in_store>
114
+ </sort_order>
115
+ <sandbox translate="label">
116
+ <label>Ambiente de Teste(Sandbox)</label>
117
+ <frontend_type>select</frontend_type>
118
+ <source_model>adminhtml/system_config_source_yesno</source_model>
119
+ <sort_order>200</sort_order>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>0</show_in_store>
123
+ </sandbox>
124
+ <masklabel>
125
+ <label>Exibição do WebCheckout</label>
126
+ <!-- <comment>descriptionnnnnn.</comment> -->
127
+ <!-- <button_label>Adicionar</button_label> -->
128
+ <frontend_model>checkoutredir/adminhtml_system_config_fieldset_label</frontend_model>
129
+ <sort_order>1000</sort_order>
130
+ <show_in_default>1</show_in_default>
131
+ <show_in_website>1</show_in_website>
132
+ <show_in_store>1</show_in_store>
133
+ </masklabel>
134
+ <exibitionmodal translate="label">
135
+ <label>Tipo de exibição</label>
136
+ <frontend_type>select</frontend_type>
137
+ <source_model>checkoutredir/source_webcheckout</source_model>
138
+ <sort_order>1001</sort_order>
139
+ <show_in_default>1</show_in_default>
140
+ <show_in_website>1</show_in_website>
141
+ <show_in_store>1</show_in_store>
142
+ </exibitionmodal>
143
+ </fields>
144
+ </checkoutredir_geral>
145
+ </groups>
146
+ </payment>
147
+ </sections>
148
+ </config>
app/code/community/Tray/CheckoutRedir/sql/checkoutredir_setup/mysql4-install-0.1.7.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
app/design/adminhtml/default/default/layout/tray_checkoutredir.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to suporte@tray.net.br so we can send you a copy immediately.
15
+ *
16
+ * @category Tray
17
+ * @package Tray_CheckoutRedir
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+ <layout version="1.0.0">
22
+ <adminhtml_system_config_edit>
23
+ <reference name="head">
24
+ <action method="addItem">
25
+ <type>skin_js</type>
26
+ <script>tray/checkoutredir/js/exibitionsettingswebcheckout.js</script>
27
+ </action>
28
+ <action method="addCss">
29
+ <stylesheet>tray/checkoutredir/css/magentomodal.css</stylesheet>
30
+ </action>
31
+ </reference>
32
+ <reference name="content">
33
+ <block type="page/html" name="getbaseurl" template="tray/checkoutredir/getbaseurl.phtml" />
34
+ </reference>
35
+ </adminhtml_system_config_edit>
36
+ </layout>
app/design/adminhtml/default/default/template/tray/checkoutredir/form/geral.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+ <fieldset class="form-list">
21
+ <?php
22
+ $_code = $this->getMethodCode();
23
+ $_standardPD = Mage::getSingleton('checkoutredir/geral');
24
+
25
+ $totals = Mage::getSingleton('adminhtml/session_quote')->getQuote()->collectTotals();
26
+ ?>
27
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
28
+ <ul class="forma_pagamento"></ul>
29
+ </ul>
30
+ </fieldset>
app/design/adminhtml/default/default/template/tray/checkoutredir/getbaseurl.phtml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Itwin
22
+ * @package Itwin_PostcodeComplete
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+ ?>
26
+
27
+ <script type="text/javascript">
28
+ var checkoutredir_baseurl = "<?php echo $this->getBaseUrl(); ?>";
29
+ </script>
30
+
app/design/adminhtml/default/default/template/tray/checkoutredir/info/geral.phtml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+ <p>
21
+ <strong>
22
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
23
+ </strong>
24
+ </p>
25
+ <?php echo $this->getLinkPayment($this->getInfo()->getOrder()); ?>
app/design/frontend/base/default/layout/tray_checkoutredir.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to suporte@tray.net.br so we can send you a copy immediately.
15
+ *
16
+ * @category Tray
17
+ * @package Tray_CheckoutRedir
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+ <layout version="0.1.0">
22
+ <checkoutredir_standard_payment>
23
+ <reference name="head">
24
+ <action method="addCss">
25
+ <stylesheet>tray/checkoutredir/css/styles.css</stylesheet>
26
+ </action>
27
+ </reference>
28
+ <remove name="left"/>
29
+ <reference name="root">
30
+ <action method="setTemplate"><template>page/1column.phtml</template></action>
31
+ </reference>
32
+ <reference name="content">
33
+ <block type="checkoutredir/payment" name="payment" template="tray/checkoutredir/payment.phtml" />
34
+ </reference>
35
+ </checkoutredir_standard_payment>
36
+
37
+ <checkoutredir_standard_return>
38
+ <remove name="left"/>
39
+ <reference name="root">
40
+ <action method="setTemplate"><template>page/empty.phtml</template></action>
41
+ </reference>
42
+ <reference name="content">
43
+ <block type="checkoutredir/return" name="return" template="tray/checkoutredir/return.phtml" />
44
+ </reference>
45
+ </checkoutredir_standard_return>
46
+
47
+ <checkoutredir_standard_error>
48
+ <remove name="left"/>
49
+ <reference name="root">
50
+ <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
51
+ </reference>
52
+ <reference name="content">
53
+ <block type="checkoutredir/error" name="error" template="tray/checkoutredir/error.phtml" />
54
+ </reference>
55
+ </checkoutredir_standard_error>
56
+ </layout>
app/design/frontend/base/default/template/tray/checkoutredir/error.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+ <div class="page-head">
21
+ <h2 class="sub-title">Erro ao realizar o Retorno Autom&aacute;tico</h2>
22
+ </div>
23
+ <table style="width:100%;">
24
+ <tr>
25
+ <td style="width:100%">
26
+ Ocorreu um erro ao realizar o retorno autom&aacute;tico.<br /><br />
27
+ Dados do Erro:<br />
28
+ C&oacute;digo: <?php echo utf8_decode($this->getRequest()->getParam("codigo")); ?><br />
29
+ Descri&ccedil;&atilde;o: <?php echo utf8_decode($this->getRequest()->getParam("descricao")); ?><br />
30
+ </td>
31
+ </tr>
32
+ </table>
app/design/frontend/base/default/template/tray/checkoutredir/form/geral.phtml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+ <fieldset class="form-list">
21
+ <?php
22
+ $_code = $this->getMethodCode();
23
+ $_standardPD = Mage::getSingleton('checkoutredir/geral');
24
+
25
+ $totals = Mage::getSingleton('checkout/session')->getQuote()->collectTotals();
26
+ //$shippingAmount = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingAmount();
27
+
28
+ ?>
29
+ <ul id="payment_form_<?php echo $_code ?>" style="display:none">
30
+ <ul class="forma_pagamento">
31
+ <li style="float:left;;">
32
+ <ul>
33
+ <li>
34
+ <img src="<?php echo $this->getSkinUrl('tray/checkoutredir/images/banner_semlogo_formas.png'); ?>" />
35
+ </li>
36
+
37
+ <li>
38
+ <ul>
39
+ <li><label >Você será redirecionado para o Tray Checkout.</label></li>
40
+ </ul>
41
+ </li>
42
+ </ul>
43
+ </li>
44
+ </ul>
45
+ </ul>
46
+ </fieldset>
app/design/frontend/base/default/template/tray/checkoutredir/form/images/overlay.png ADDED
Binary file
app/design/frontend/base/default/template/tray/checkoutredir/head.phtml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+ <title><?php echo $this->getTitle() ?></title>
21
+ <meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
22
+ <meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
23
+ <meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
24
+ <meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
25
+ <link rel="icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />
26
+ <link rel="shortcut icon" href="<?php echo $this->getSkinUrl('favicon.ico') ?>" type="image/x-icon" />
27
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
30
+ var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
31
+ //]]>
32
+ </script>
33
+ <?php echo $this->getCssJsHtml() ?>
34
+ <?php echo $this->getChildHtml() ?>
35
+ <?php echo $this->helper('core/js')->getTranslatorScript() ?>
36
+ <?php echo $this->getIncludes() ?>
app/design/frontend/base/default/template/tray/checkoutredir/info/geral.phtml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+ <p>
21
+ <strong>
22
+ <?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?>
23
+ </strong>
24
+ </p>
25
+ <?php echo $this->getLinkPayment($this->getInfo()->getOrder()); ?>
app/design/frontend/base/default/template/tray/checkoutredir/overlay.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+
21
+ <div id="overlay-tc">
22
+ <center>
23
+ <div id="lightboxpd" style="padding: 10px;background-color: #fff;width: 980px;margin-top: 50px" >
24
+ <img src="<?php echo $this->getSkinUrl('tray/checkoutredir/images/close.png'); ?>" style="position: relative;margin-left: 970px;margin-top: -20px;" />
25
+ <iframe name="tc_frame" width="970" height="700" style="border:0px" ></iframe>
26
+ </div>
27
+ </center>
28
+ </div>
app/design/frontend/base/default/template/tray/checkoutredir/payment.phtml ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+
21
+ <div class="page-head">
22
+ <h2 class="sub-title">Finalizando sua compra com Tray Checkout</h2>
23
+ </div>
24
+
25
+ <?php $config = Mage::getModel('checkoutredir/config')->getExibitionWebCheckout(); ?>
26
+
27
+ <?php
28
+ switch($config)
29
+ {
30
+ case 1:
31
+ ?>
32
+ <script type="text/javascript">
33
+ var div_pd = document.createElement("div");
34
+ var center_frame = document.createElement("center");
35
+ var div_frame = document.createElement("div");
36
+ var img_close = document.createElement("img");
37
+ var form_tc = document.createElement("iframe");
38
+
39
+ form_tc.setAttribute("style","border:0px");
40
+ form_tc.setAttribute("width","970");
41
+ form_tc.setAttribute("height","700");
42
+ form_tc.setAttribute("name","tc_frame");
43
+
44
+ img_close.setAttribute("style","position: relative;margin-left: 970px;margin-top: -20px;");
45
+ img_close.setAttribute("src","<?php echo $this->getSkinUrl('tray/checkoutredir/images/close.png'); ?>");
46
+
47
+ div_frame.setAttribute("style","padding: 10px;background-color: #fff;width: 980px;margin-top: 50px");
48
+ div_frame.setAttribute("id","lightbox");
49
+
50
+ div_pd.setAttribute("id","overlay-tc");
51
+
52
+ div_frame.appendChild(img_close);
53
+ div_frame.appendChild(form_tc);
54
+
55
+ center_frame.appendChild(div_frame);
56
+
57
+ div_pd.appendChild(center_frame);
58
+
59
+ document.body.appendChild(div_pd);
60
+ </script>
61
+
62
+ <table style="width:100%;">
63
+ <tr>
64
+ <td style="width:100%">
65
+ Sua compra est&aacute; em processo de finaliza&ccedil;&atilde;o.<br />
66
+ Caso a p&aacute;gina de finaliza&ccedil;&atilde;o de pagamento n&atilde;o se inicie automaticamente, <a href="#" id="tc_lightbox">Clique Aqui</a>
67
+ <br />
68
+ <br />
69
+
70
+ <img src="<?php echo $this->getSkinUrl('tray/checkoutredir/images/BannerTrayCheckout890px.png'); ?>" />
71
+ <?php $this->getPayment(); ?>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+
76
+ <script type="text/javascript">
77
+ document.getElementById('form_tc').setAttribute("target", "tc_frame");
78
+ document.getElementById('form_tc').submit();
79
+ document.getElementById('overlay-tc').onclick = function (){
80
+ this.style.display = "none";
81
+ };
82
+ document.getElementById('tc_lightbox').onclick = function (){
83
+ document.getElementById('overlay-tc').style.display = "block";
84
+ };
85
+ </script>
86
+ <?php
87
+ break;
88
+ case 2:
89
+ ?>
90
+ <table style="width:100%;">
91
+ <tr>
92
+ <td style="width:100%">
93
+ Sua compra est&aacute; em processo de finaliza&ccedil;&atilde;o.
94
+ <br />
95
+ <br />
96
+ <iframe name="tc_frame" width="100%" height="900" style="border:0px; overflow-x:hidden" ></iframe>
97
+ <img src="<?php echo $this->getSkinUrl('tray/checkoutredir/images/BannerTrayCheckout890px.png'); ?>" />
98
+ <?php $this->getPayment(); ?>
99
+ </td>
100
+ </tr>
101
+ </table>
102
+
103
+ <script type="text/javascript">
104
+ document.getElementById('form_tc').setAttribute("target", "tc_frame");
105
+ document.getElementById('form_tc').submit();
106
+ </script>
107
+ <?php
108
+ break;
109
+ case 3:
110
+ ?>
111
+ <table style="width:100%;">
112
+ <tr>
113
+ <td style="width:100%">
114
+ Sua compra est&aacute; em processo de finaliza&ccedil;&atilde;o.<br />
115
+ Você será redirecionado para o Tray Checkout. Caso a p&aacute;gina de finaliza&ccedil;&atilde;o de pagamento n&atilde;o se inicie automaticamente, <a href="#" id="tc_lightbox">Clique Aqui</a>
116
+ <br />
117
+ <br />
118
+ <img src="<?php echo $this->getSkinUrl('tray/checkoutredir/images/BannerTrayCheckout890px.png'); ?>" />
119
+ <?php $this->getPayment(); ?>
120
+ </td>
121
+ </tr>
122
+ </table>
123
+
124
+ <script type="text/javascript">
125
+ document.getElementById('form_tc').setAttribute("target", "_blank");
126
+ document.getElementById('form_tc').submit();
127
+ document.getElementById('tc_lightbox').onclick = function (){
128
+ document.getElementById('form_tc').submit();
129
+ };
130
+ </script>
131
+ <?php
132
+ break;
133
+ default:
134
+ ?>
135
+ <script type="text/javascript">
136
+ var div_pd = document.createElement("div");
137
+ var center_frame = document.createElement("center");
138
+ var div_frame = document.createElement("div");
139
+ var img_close = document.createElement("img");
140
+ var form_tc = document.createElement("iframe");
141
+
142
+ form_tc.setAttribute("style","border:0px");
143
+ form_tc.setAttribute("width","970");
144
+ form_tc.setAttribute("height","700");
145
+ form_tc.setAttribute("name","tc_frame");
146
+
147
+ img_close.setAttribute("style","position: relative;margin-left: 970px;margin-top: -20px;");
148
+ img_close.setAttribute("src","<?php echo $this->getSkinUrl('tray/checkoutredir/images/close.png'); ?>");
149
+
150
+ div_frame.setAttribute("style","padding: 10px;background-color: #fff;width: 980px;margin-top: 50px");
151
+ div_frame.setAttribute("id","lightbox");
152
+
153
+ div_pd.setAttribute("id","overlay-tc");
154
+
155
+ div_frame.appendChild(img_close);
156
+ div_frame.appendChild(form_tc);
157
+
158
+ center_frame.appendChild(div_frame);
159
+
160
+ div_pd.appendChild(center_frame);
161
+
162
+ document.body.appendChild(div_pd);
163
+ </script>
164
+
165
+ <table style="width:100%;">
166
+ <tr>
167
+ <td style="width:100%">
168
+ Sua compra est&aacute; em processo de finaliza&ccedil;&atilde;o.<br />
169
+ Caso a p&aacute;gina de finaliza&ccedil;&atilde;o de pagamento n&atilde;o se inicie automaticamente, <a href="#" id="tc_lightbox">Clique Aqui</a>
170
+ <br />
171
+ <br />
172
+ <img src="<?php echo $this->getSkinUrl('tray/checkoutredir/images/BannerTrayCheckout890px.png'); ?>" />
173
+ <?php $this->getPayment(); ?>
174
+ </td>
175
+ </tr>
176
+ </table>
177
+
178
+ <script type="text/javascript">
179
+ document.getElementById('form_tc').setAttribute("target", "tc_frame");
180
+ document.getElementById('form_tc').submit();
181
+ document.getElementById('overlay-tc').onclick = function (){
182
+ this.style.display = "none";
183
+ };
184
+ document.getElementById('tc_lightbox').onclick = function (){
185
+ document.getElementById('overlay-tc').style.display = "block";
186
+ };
187
+ </script>
188
+ <?php
189
+ break;
190
+ }
191
+ ?>
app/design/frontend/base/default/template/tray/checkoutredir/return.phtml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to suporte@tray.net.br so we can send you a copy immediately.
14
+ *
15
+ * @category Tray
16
+ * @package Tray_CheckoutRedir
17
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
+ */
19
+ ?>
20
+
21
+ <script type="text/javascript">
22
+ parent.window.location = "<?php echo Mage::getUrl('checkout/onepage/success', array('_secure' => true));?>";
23
+ </script>
app/etc/modules/Tray_CheckoutRedir.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to suporte@tray.net.br so we can send you a copy immediately.
15
+ *
16
+ * @category Tray
17
+ * @package Tray_CheckoutRedir
18
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
+ */
20
+ -->
21
+ <config>
22
+ <modules>
23
+ <Tray_CheckoutRedir>
24
+ <active>true</active>
25
+ <codePool>community</codePool>
26
+ </Tray_CheckoutRedir>
27
+ <depends>
28
+ <Mage_Payment />
29
+ <Mage_Checkout/>
30
+ </depends>
31
+ </modules>
32
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Tray_CheckoutRedir</name>
4
+ <version>1.0.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Extens&#xE3;o Tray Checkout para Magento</summary>
10
+ <description>O TrayCheckout &#xE9; um facilitador de pagamento que oferece benef&#xED;cios aos lojistas e aos compradores. Focado em praticidade e convers&#xE3;o, possibilita que as lojas virtuais ofere&#xE7;am diversas formas de pagamento, sem burocracia ou necessidade de contrato com operadoras financeiras. </description>
11
+ <notes>Primeira vers&#xE3;o liberada no Magento Connect</notes>
12
+ <authors><author><name>Igor</name><user>igor</user><email>ifredi@tray.net.br</email></author></authors>
13
+ <date>2013-02-06</date>
14
+ <time>17:49:24</time>
15
+ <contents><target name="magecommunity"><dir name="Tray"><dir name="CheckoutRedir"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Label.php" hash="4b644caa67c70bbea2762ba16db35779"/></dir></dir></dir></dir><file name="Error.php" hash="eabab960a3c44358762cf531d04831fb"/><dir name="Form"><file name="Geral.php" hash="3964d2e6a2db70bc5a909009feb60103"/></dir><dir name="Info"><file name="Geral.php" hash="66bff552a355e90fefff155de67e043a"/></dir><file name="Link.php" hash="a019874d3407309ea721c818ae9dcf16"/><file name="Payment.php" hash="3f5291e1f400fee64fee340646648971"/><file name="Redirect.php" hash="a37c21f8d17b84c1c0cf61bfa1332fc9"/><file name="Return.php" hash="55c255d083acaff20252ba2ee99424d5"/></dir><dir name="Helper"><file name="Data.php" hash="25e24f25c063cb6af3085f59974ba7ec"/></dir><dir name="Model"><file name="Config.php" hash="7d91c6ebe4952f0a7c02339f8cb7c6ab"/><file name="Geral.php" hash="ff8e60aa1208f9e3a8f4561e94e97e25"/><dir name="Mysql4"><file name="Setup.php" hash="762ac20737d9a60e706458e2f0af4129"/></dir><file name="Observer.php" hash="1089a6badfbd0a6d49e9920730ecf123"/><dir name="Source"><file name="Country.php" hash="0d88f7c80aa95e3bce20e36364aba098"/><file name="Parcelas2.php" hash="e568d310c3cd99d5a60ba6799da7beb0"/><file name="Specificcountries.php" hash="c1ed7900cdb7400f40f63bd6aefdddf0"/><file name="Webcheckout.php" hash="f513de61d0582f7b541872cf8a0bbfaa"/></dir><file name="Standard.php" hash="8533d1ed9785cc401ba38189ea4d7407"/></dir><dir name="controllers"><file name="StandardController.php" hash="b4a5a49a117d1702f11a276b6cb3eecb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e8d5be5396fdb8177a327597cb863d94"/><file name="config.xml" hash="9e6990549a3b2406dfecee42c1cff83a"/><file name="system.xml" hash="1ff80e5e11c22d8ad825edff02c342b2"/></dir><dir name="sql"><dir name="checkoutredir_setup"><file name="mysql4-install-0.1.7.php" hash="5c2f7dbc2f38eea387c7bea0a53cae28"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="tray"><dir name="checkoutredir"><file name="error.phtml" hash="575e0c286c99e173619eb2be6ee9fde2"/><dir name="form"><file name="geral.phtml" hash="a2c7e26734d1082a4db9706ff785f560"/><dir name="images"><file name="overlay.png" hash="143d209e15051311fdae758b295036b5"/></dir></dir><file name="head.phtml" hash="1f4103303b8c7de8daf1fe23e118fadf"/><dir name="info"><file name="geral.phtml" hash="f7eb257a40bdf69931ba5514859de82a"/></dir><file name="overlay.phtml" hash="83785591a6614a1b6e83714db1725c13"/><file name="payment.phtml" hash="a8d5d3d2f7014711c8360c9dfc35ea92"/><file name="return.phtml" hash="07a60f0d3549e4fb49d7b3ab27917530"/></dir></dir></dir><dir name="layout"><file name="tray_checkoutredir.xml" hash="801629ab06f617f64f7a468ad06f80a6"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="tray"><dir name="checkoutredir"><dir name="form"><file name="geral.phtml" hash="7ea2cacf9c9eef1be914599bf6d00d23"/></dir><file name="getbaseurl.phtml" hash="17ceee44d6bb7af60e69baa39f031b0c"/><dir name="info"><file name="geral.phtml" hash="f7eb257a40bdf69931ba5514859de82a"/></dir></dir></dir></dir><dir name="layout"><file name="tray_checkoutredir.xml" hash="9215e9445b80df8e86c45383af64ab05"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="tray"><dir name="checkoutredir"><dir name="css"><file name="styles.css" hash="5d09463e234fd2f20622f63795019be6"/></dir><dir name="images"><file name="BannerTrayCheckout890px.png" hash="535d5a4a4f190d03df38664dcb6463f8"/><file name="banner_comlogo_formas.jpg" hash="e02a16c32109746786c24db177ddad3a"/><file name="banner_semlogo_formas.jpg" hash="4f13591f17ed96347f136eab09343121"/><file name="banner_semlogo_formas.png" hash="84a82c3d7ed9a42ade9660b8dd16511d"/><file name="close.png" hash="6e2879a324a76e9972ebc98201aae1d8"/><file name="overlay.png" hash="143d209e15051311fdae758b295036b5"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="tray"><dir name="checkoutredir"><dir name="css"><file name="magentomodal.css" hash="2c6dd38e421f644475a121b8d6c96503"/></dir><dir name="images"><file name="btn_bg.gif" hash="37c51a4d48a92da9648dcd3ca011039f"/><file name="content_bg.gif" hash="21278ea0da2d4256f4ced96b6080ba2e"/><file name="top_bg.gif" hash="26f28090de87d64f9b01bf624f89bfe2"/><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><dir name="js"><file name="exibitionsettingswebcheckout.js" hash="430c1ce2ecaab27f4ae1ab9a649667cd"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Tray_CheckoutRedir.xml" hash="7d1a3d97b6c809036a887699f05dc24a"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7</max></package></required></dependencies>
18
+ </package>
skin/adminhtml/default/default/tray/checkoutredir/css/magentomodal.css ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .overlay_dialog {
2
+ background-color: #666666;
3
+ filter:alpha(opacity=60);
4
+ -moz-opacity: 0.6;
5
+ opacity: 0.6;
6
+ }
7
+
8
+ .overlay___invisible__ {
9
+ background-color: #666666;
10
+ filter:alpha(opacity=0);
11
+ -moz-opacity: 0;
12
+ opacity: 0;
13
+ }
14
+
15
+ .dialog_nw {
16
+ width: 9px;
17
+ height: 23px;
18
+ background: transparent url(../images/top_left.gif) no-repeat 0 0;
19
+ }
20
+
21
+ .dialog_n {
22
+ background: transparent url(../images/top_mid.gif) repeat-x 0 0;
23
+ height: 23px;
24
+ }
25
+
26
+ .dialog_ne {
27
+ width: 9px;
28
+ height: 23px;
29
+ background: transparent url(../images/top_right.gif) no-repeat 0 0;
30
+ }
31
+
32
+ .dialog_e {
33
+ width: 2px;
34
+ background: transparent url(../images/center_right.gif) repeat-y 0 0;
35
+ }
36
+
37
+ .dialog_w {
38
+ width: 2px;
39
+ background: transparent url(../images/center_left.gif) repeat-y 0 0;
40
+ }
41
+
42
+ .dialog_sw {
43
+ width: 9px;
44
+ height: 19px;
45
+ background: transparent url(../images/bottom_left.gif) no-repeat 0 0;
46
+ }
47
+
48
+ .dialog_s {
49
+ background: transparent url(../images/bottom_mid.gif) repeat-x 0 0;
50
+ height: 19px;
51
+ }
52
+
53
+ .dialog_se {
54
+ width: 9px;
55
+ height: 19px;
56
+ background: transparent url(../images/bottom_right.gif) no-repeat 0 0;
57
+ }
58
+
59
+ .dialog_sizer {
60
+ width: 9px;
61
+ height: 19px;
62
+ background: transparent url(../images/sizer.gif) no-repeat 0 0;
63
+ cursor:se-resize;
64
+ }
65
+
66
+ .dialog_close {
67
+ width: 14px;
68
+ height: 14px;
69
+ background: transparent url(../images/close.gif) no-repeat 0 0;
70
+ position:absolute;
71
+ top:5px;
72
+ left:8px;
73
+ cursor:pointer;
74
+ z-index:2000;
75
+ }
76
+
77
+ .dialog_minimize {
78
+ width: 14px;
79
+ height: 15px;
80
+ background: transparent url(../images/minimize.gif) no-repeat 0 0;
81
+ position:absolute;
82
+ top:5px;
83
+ left:28px;
84
+ cursor:pointer;
85
+ z-index:2000;
86
+ }
87
+
88
+ .dialog_maximize {
89
+ width: 14px;
90
+ height: 15px;
91
+ background: transparent url(../images/maximize.gif) no-repeat 0 0;
92
+ position:absolute;
93
+ top:5px;
94
+ left:49px;
95
+ cursor:pointer;
96
+ z-index:2000;
97
+ }
98
+
99
+ .dialog_title {
100
+ float:left;
101
+ height:14px;
102
+ font-family: Tahoma, Arial, sans-serif;
103
+ font-size:12px;
104
+ text-align:center;
105
+ width:100%;
106
+ color:#000;
107
+ }
108
+
109
+ .dialog_content {
110
+ overflow:auto;
111
+ color: #DDD;
112
+ font-family: Tahoma, Arial, sans-serif;
113
+ font-size: 10px;
114
+ background-color:#123;
115
+ }
116
+
117
+ .top_draggable, .bottom_draggable {
118
+ cursor:move;
119
+ }
120
+
121
+ .status_bar {
122
+ font-size:12px;
123
+ }
124
+ .status_bar input{
125
+ font-size:12px;
126
+ }
127
+
128
+ .wired_frame {
129
+ display: block;
130
+ position: absolute;
131
+ border: 1px #000 dashed;
132
+ }
133
+
134
+ /* DO NOT CHANGE THESE VALUES*/
135
+ .dialog {
136
+ display: block;
137
+ position: absolute;
138
+ }
139
+
140
+ .dialog table.table_window {
141
+ border-collapse: collapse;
142
+ border-spacing: 0;
143
+ width: 100%;
144
+ margin: 0px;
145
+ padding:0px;
146
+ }
147
+
148
+ .dialog table.table_window td , .dialog table.table_window th {
149
+ padding: 0;
150
+ }
151
+
152
+ .dialog .title_window {
153
+ -moz-user-select:none;
154
+ }
155
+
156
+ .dialog { border:1px solid #555; }
157
+ .dialog .bot { display:none !important; }
158
+ .overlay_magento { background-color:#000; filter:alpha(opacity=60); -moz-opacity:.6; opacity:.6; -webkit-opacity:.6; }
159
+ .top.table_window { border-bottom:1px solid #e6e6e6; background:#6a838b url(../images/top_bg.gif) 0 100% repeat-x; }
160
+
161
+ .magento_nw { width:6px; height:28px; }
162
+ .magento_n { height:28px; }
163
+ .magento_ne { width:6px; height:28px; }
164
+
165
+ .magento_w { width:6px; }
166
+ .magento_e { width:6px; }
167
+ .magento_w,
168
+ .magento_e,
169
+ .magento_content { background: #fafafa url(../images/content_bg.gif) 0 0 repeat-x; }
170
+
171
+ .magento_sw { background:#deebf0; width:5px; height:3px; }
172
+ .magento_s { background:#deebf0; height:3px; }
173
+ .magento_se,
174
+
175
+ .magento_sizer { background:#deebf0; width:5px; height:3px; }
176
+ .magento_sizer { cursor:se-resize; }
177
+
178
+ .magento_close { width:16px; height:16px; background:url(../images/window_close.png) no-repeat 0 0; position:absolute; top:5px; right:7px; cursor:pointer; z-index:1000; }
179
+ .magento_minimize { width:16px; height:16px; background:url(../images/window_minimize.png) 0 0 no-repeat; position:absolute; top:5px; right:28px; cursor:pointer; z-index:1000; }
180
+ .magento_maximize { width:16px; height:16px; background:url(../images/window_maximize.png)0 0 no-repeat; position:absolute; top:5px; right:49px; cursor:pointer; z-index:1000; }
181
+
182
+ .magento_title { float:left; width:100%; font:bold 12px/28px Arial, Helvetica, sans-serif; color:#fff; text-align:left; }
183
+
184
+ .magento_content { overflow:auto; font-size:12px; }
185
+ .magento_content,
186
+ .magento_content label { color:#333; font-family:Arial, sans-serif; }
187
+
188
+ .magento_buttons { padding:10px; text-align:right; }
189
+ .magento_buttons input.button { border-width:1px; border-style:solid; border-color:#ed6502 #a04300 #a04300 #ed6502; background:#ffac47 url(../images/btn_bg.gif) 0 100% repeat-x; padding:0 7px 1px 7px; font:bold 12px/18px Arial, Helvetica, sans-serif; color:#fff; cursor:pointer; text-align:center; white-space:nowrap; }
190
+
191
+ /* FOR IE */
192
+ * html .magento_close { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../images/window_maximize.png", sizingMethod="crop"); }
193
+ * html .magento_minimize { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../images/window_close.png", sizingMethod="crop");}
194
+ * html .magento_maximize { background-image:none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../images/window_minimize.png", sizingMethod="crop"); }
skin/adminhtml/default/default/tray/checkoutredir/images/btn_bg.gif ADDED
Binary file
skin/adminhtml/default/default/tray/checkoutredir/images/content_bg.gif ADDED
Binary file
skin/adminhtml/default/default/tray/checkoutredir/images/top_bg.gif ADDED
Binary file
skin/adminhtml/default/default/tray/checkoutredir/images/window_close.png ADDED
Binary file
skin/adminhtml/default/default/tray/checkoutredir/js/exibitionsettingswebcheckout.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ function openModalTray(url, txtTitle)
3
+ {
4
+ var _url = checkoutredir_baseurl + url;
5
+
6
+ if(txtTitle === null || txtTitle === '') {
7
+ txtTitle = 'Validação das informações do Anúncio';
8
+ }
9
+ winCompare = new Window({
10
+ className:'magento',
11
+ title:txtTitle,
12
+ url:_url,
13
+ width:820,
14
+ height:600,
15
+ minimizable:false,
16
+ maximizable:false,
17
+ showEffectOptions:{
18
+ duration:0.4
19
+ },
20
+ hideEffectOptions:{
21
+ duration:0.4
22
+ }
23
+ });
24
+ winCompare.setZIndex(100000);
25
+ winCompare.showCenter(true);
26
+ }
skin/frontend/base/default/tray/checkoutredir/css/styles.css ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ #overlay-tc {
2
+ background-image: url('../images/overlay.png');
3
+ display:block;
4
+ position: absolute;
5
+ top: 0px;
6
+ left: 0px;
7
+ width: 100%;
8
+ height: 100%;
9
+ z-index: 2147483647;
10
+ }
skin/frontend/base/default/tray/checkoutredir/images/BannerTrayCheckout890px.png ADDED
Binary file
skin/frontend/base/default/tray/checkoutredir/images/banner_comlogo_formas.jpg ADDED
Binary file
skin/frontend/base/default/tray/checkoutredir/images/banner_semlogo_formas.jpg ADDED
Binary file
skin/frontend/base/default/tray/checkoutredir/images/banner_semlogo_formas.png ADDED
Binary file
skin/frontend/base/default/tray/checkoutredir/images/close.png ADDED
Binary file
skin/frontend/base/default/tray/checkoutredir/images/overlay.png ADDED
Binary file