Version Notes
Added billing state logic
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | Craig_Tco |
| Version | 2.1.1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.1.0 to 2.1.1
- app/code/local/Craig/Tco/Model/Checkout.php +10 -3
- app/code/local/Craig/Tco/controllers/RedirectController.php +0 -1
- app/code/local/Craig/Tco/etc/config.xml +2 -2
- app/design/frontend/base/default/template/tco/form.phtml +0 -23
- app/design/frontend/base/default/template/tco/info.phtml +0 -25
- package.xml +9 -16
app/code/local/Craig/Tco/Model/Checkout.php
CHANGED
|
@@ -161,6 +161,7 @@ class Craig_Tco_Model_Checkout extends Mage_Payment_Model_Method_Abstract {
|
|
| 161 |
$amount = round($order->getGrandTotal(), 2);
|
| 162 |
$a = $this->getQuote()->getShippingAddress();
|
| 163 |
$b = $this->getQuote()->getBillingAddress();
|
|
|
|
| 164 |
$currency_code = $this->getQuote()->getCurrencyCode();
|
| 165 |
$shipping = round($order->getShippingAmount(), 2);
|
| 166 |
$weight = round($order->getWeight(), 2);
|
|
@@ -173,7 +174,7 @@ class Craig_Tco_Model_Checkout extends Mage_Payment_Model_Method_Abstract {
|
|
| 173 |
|
| 174 |
$tcoFields = array();
|
| 175 |
$tcoFields['sid'] = $this->getSid();
|
| 176 |
-
$tcoFields['merchant_order_id']
|
| 177 |
$tcoFields['email'] = $order->getData('customer_email');
|
| 178 |
$tcoFields['first_name'] = $b->getFirstname();
|
| 179 |
$tcoFields['last_name'] = $b->getLastname();
|
|
@@ -182,8 +183,14 @@ class Craig_Tco_Model_Checkout extends Mage_Payment_Model_Method_Abstract {
|
|
| 182 |
$tcoFields['street_address'] = $b->getStreet1();
|
| 183 |
$tcoFields['street_address2'] = $b->getStreet2();
|
| 184 |
$tcoFields['city'] = $b->getCity();
|
| 185 |
-
|
| 186 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
if ($a) {
|
| 189 |
$tcoFields['ship_name'] = $a->getFirstname() . ' ' . $a->getLastname();
|
| 161 |
$amount = round($order->getGrandTotal(), 2);
|
| 162 |
$a = $this->getQuote()->getShippingAddress();
|
| 163 |
$b = $this->getQuote()->getBillingAddress();
|
| 164 |
+
$country = $b->getCountry();
|
| 165 |
$currency_code = $this->getQuote()->getCurrencyCode();
|
| 166 |
$shipping = round($order->getShippingAmount(), 2);
|
| 167 |
$weight = round($order->getWeight(), 2);
|
| 174 |
|
| 175 |
$tcoFields = array();
|
| 176 |
$tcoFields['sid'] = $this->getSid();
|
| 177 |
+
$tcoFields['merchant_order_id'] = $order_id;
|
| 178 |
$tcoFields['email'] = $order->getData('customer_email');
|
| 179 |
$tcoFields['first_name'] = $b->getFirstname();
|
| 180 |
$tcoFields['last_name'] = $b->getLastname();
|
| 183 |
$tcoFields['street_address'] = $b->getStreet1();
|
| 184 |
$tcoFields['street_address2'] = $b->getStreet2();
|
| 185 |
$tcoFields['city'] = $b->getCity();
|
| 186 |
+
|
| 187 |
+
if ($country == 'US' || $country == 'CA') {
|
| 188 |
+
$tcoFields['state'] = $b->getRegion();
|
| 189 |
+
} else {
|
| 190 |
+
$tcoFields['state'] = 'XX';
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
$tcoFields['zip'] = $b->getPostcode();
|
| 194 |
|
| 195 |
if ($a) {
|
| 196 |
$tcoFields['ship_name'] = $a->getFirstname() . ' ' . $a->getLastname();
|
app/code/local/Craig/Tco/controllers/RedirectController.php
CHANGED
|
@@ -40,7 +40,6 @@ class Craig_Tco_RedirectController extends Mage_Core_Controller_Front_Action {
|
|
| 40 |
->setBody($this->getLayout()
|
| 41 |
->createBlock('tco/redirect')
|
| 42 |
->toHtml());
|
| 43 |
-
|
| 44 |
}
|
| 45 |
|
| 46 |
public function successAction() {
|
| 40 |
->setBody($this->getLayout()
|
| 41 |
->createBlock('tco/redirect')
|
| 42 |
->toHtml());
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
public function successAction() {
|
app/code/local/Craig/Tco/etc/config.xml
CHANGED
|
@@ -24,7 +24,7 @@
|
|
| 24 |
<config>
|
| 25 |
<modules>
|
| 26 |
<Craig_Tco>
|
| 27 |
-
<version>2.1.
|
| 28 |
</Craig_Tco>
|
| 29 |
</modules>
|
| 30 |
<global>
|
|
@@ -108,7 +108,7 @@
|
|
| 108 |
<submit_url>1</submit_url>
|
| 109 |
<model>tco/checkout</model>
|
| 110 |
<title>2Checkout (Visa, MasterCard, Amex, Discover, JCB, Diners Club, Debit Card, PayPal)</title>
|
| 111 |
-
<sid>Enter
|
| 112 |
<secret_word>Enter your Secret Word</secret_word>
|
| 113 |
<submit_url>1</submit_url>
|
| 114 |
<demo>0</demo>
|
| 24 |
<config>
|
| 25 |
<modules>
|
| 26 |
<Craig_Tco>
|
| 27 |
+
<version>2.1.1</version>
|
| 28 |
</Craig_Tco>
|
| 29 |
</modules>
|
| 30 |
<global>
|
| 108 |
<submit_url>1</submit_url>
|
| 109 |
<model>tco/checkout</model>
|
| 110 |
<title>2Checkout (Visa, MasterCard, Amex, Discover, JCB, Diners Club, Debit Card, PayPal)</title>
|
| 111 |
+
<sid>Enter 2Checkout Account Number</sid>
|
| 112 |
<secret_word>Enter your Secret Word</secret_word>
|
| 113 |
<submit_url>1</submit_url>
|
| 114 |
<demo>0</demo>
|
app/design/frontend/base/default/template/tco/form.phtml
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
<?php
|
| 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 license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
-
*
|
| 16 |
-
* @category Craig Christenson
|
| 17 |
-
* @package Tco (2Checkout.com)
|
| 18 |
-
* @copyright Copyright (c) 2010 Craig Christenson
|
| 19 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
-
*/
|
| 21 |
-
|
| 22 |
-
echo $this->__('You will be redirected to 2Checkout to complete your order.')
|
| 23 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/tco/info.phtml
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
<?php
|
| 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 license@magentocommerce.com so we can send you a copy immediately.
|
| 15 |
-
*
|
| 16 |
-
* @category Craig Christenson
|
| 17 |
-
* @package Tco (2Checkout.com)
|
| 18 |
-
* @copyright Copyright (c) 2010 Craig Christenson
|
| 19 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 20 |
-
*/
|
| 21 |
-
|
| 22 |
-
echo $this->__('2Checkout (Credit Card, Debit Card, PayPal)');
|
| 23 |
-
?>
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
|
@@ -1,25 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Craig_Tco</name>
|
| 4 |
-
<version>2.1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
-
<summary>2Checkout Payment Extension</summary>
|
| 10 |
-
<description>2Checkout Payment Extension</description>
|
| 11 |
-
<notes>Added
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
Added invoicing observer for marking sales as shipped
|
| 17 |
-
Added order comments for 2Checkout sale status messages
|
| 18 |
-
Added Pass though Products parameters</notes>
|
| 19 |
-
<authors><author><name>Craig Christenson</name><user>undeadzed</user><email>christensoncraig@gmail.com</email></author></authors>
|
| 20 |
-
<date>2011-08-27</date>
|
| 21 |
-
<time>19:43:33</time>
|
| 22 |
-
<contents><target name="magelocal"><dir name="Craig"><dir name="Tco"><dir name="Block"><file name="Form.php" hash="b552018543f57090c42784d939004dd4"/><file name="Info.php" hash="ceb4ec03e4de3e4f1dafaf5d7da9b982"/><file name="Redirect.php" hash="e2809d56d51bdc74367dad8da77ac563"/></dir><dir name="controllers"><file name="NotificationController.php" hash="2bbb8caf512b8bcdea2855842a56539b"/><file name="RedirectController.php" hash="8691223ed4038ee2ca013a6cd54febae"/></dir><dir name="etc"><file name="config.xml" hash="82a0f26f2c34fb0eb05bd6c91b52ba38"/><file name="system.xml" hash="4bf8199f530281ba446d9c943fcb6932"/></dir><dir name="Helper"><file name="Data.php" hash="de7680011db7d6821c1f68d70a8fa684"/></dir><dir name="Model"><file name="Checkout.php" hash="f76baa1c39c87bc9ee470d4014fea794"/><file name="Observer.php" hash="727312c017289346a6c9a4aedb5fcc4f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Craig_Tco.xml" hash="4a6e92678d9b2a310af880d35a4c355f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="tco"><file name="form.phtml" hash="08ae585e158550d0a5dccbed3d37758d"/><file name="info.phtml" hash="b714a7398773adc71ea086024dfc96b1"/></dir></dir></dir></dir></dir></target></contents>
|
| 23 |
<compatible/>
|
| 24 |
-
<dependencies
|
| 25 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Craig_Tco</name>
|
| 4 |
+
<version>2.1.1</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
+
<summary>Official 2Checkout Payment Extension</summary>
|
| 10 |
+
<description>Official 2Checkout Payment Extension</description>
|
| 11 |
+
<notes>Added billing state logic</notes>
|
| 12 |
+
<authors><author><name>Craig Christenson</name><user>auto-converted</user><email>christensoncraig@gmail.com</email></author></authors>
|
| 13 |
+
<date>2012-03-25</date>
|
| 14 |
+
<time>04:01:44</time>
|
| 15 |
+
<contents><target name="magelocal"><dir name="Craig"><dir name="Tco"><dir name="Block"><file name="Form.php" hash="b552018543f57090c42784d939004dd4"/><file name="Info.php" hash="ceb4ec03e4de3e4f1dafaf5d7da9b982"/><file name="Redirect.php" hash="e2809d56d51bdc74367dad8da77ac563"/></dir><dir name="Model"><file name="Observer.php" hash="727312c017289346a6c9a4aedb5fcc4f"/><file name="Checkout.php" hash="78ba967c187bc769abd44894a9c28598"/></dir><dir name="controllers"><file name="NotificationController.php" hash="2bbb8caf512b8bcdea2855842a56539b"/><file name="RedirectController.php" hash="197de0df037cf5ae45531ef735abfed1"/></dir><dir name="etc"><file name="config.xml" hash="874b628a4759b11ddffd73692a1def1d"/><file name="system.xml" hash="4bf8199f530281ba446d9c943fcb6932"/></dir><dir name="Helper"><file name="Data.php" hash="de7680011db7d6821c1f68d70a8fa684"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Craig_Tco.xml" hash="4a6e92678d9b2a310af880d35a4c355f"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><file name="form.phtml" hash=""/><file name="info.phtml" hash=""/></dir></dir></dir></dir></target></contents>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
<compatible/>
|
| 17 |
+
<dependencies/>
|
| 18 |
</package>
|
