Version Notes
Fixes:-
Static page images issue fixed.
Some minior fixes.
Feature:-
Implement Tier price feature.
Shipping on the base of country id.
Download this release
Release Info
| Developer | mss |
| Extension | Mss_Connector |
| Version | 2.5.1 |
| Comparing to | |
| See all releases | |
Code changes from version 2.5.0 to 2.5.1
- app/code/local/Mss/Connector/controllers/CartController.php +33 -51
- app/code/local/Mss/Connector/controllers/ProductsController.php +66 -29
- app/code/local/Mss/Connector/controllers/StaticpagesController.php +3 -4
- app/code/local/Mss/Connector/etc/config.xml +1 -1
- app/code/local/Mss/Twocheckout/Block/Form.php +32 -0
- app/code/local/Mss/Twocheckout/Block/Form.php@@ +32 -0
- app/code/local/Mss/Twocheckout/Block/Iframe.php +42 -0
- app/code/local/Mss/Twocheckout/Block/Info.php +36 -0
- app/code/local/Mss/Twocheckout/Block/Redirect.php +49 -0
- app/code/local/Mss/Twocheckout/Helper/Data.php +25 -0
- app/code/local/Mss/Twocheckout/Model/Checkout.php +289 -0
- app/code/local/Mss/Twocheckout/Model/Observer.php +128 -0
- app/code/local/Mss/Twocheckout/Model/Twocheckout.php +289 -0
- app/code/local/Mss/Twocheckout/controllers/NotificationController.php +109 -0
- app/code/local/Mss/Twocheckout/controllers/RedirectController.php +96 -0
- app/code/local/Mss/Twocheckout/etc/config.xml +102 -0
- package.xml +10 -7
app/code/local/Mss/Connector/controllers/CartController.php
CHANGED
|
@@ -863,56 +863,32 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
| 863 |
|
| 864 |
####get all enabled shipping methods
|
| 865 |
public function getshippingmethodsAction(){
|
|
|
|
|
|
|
| 866 |
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 871 |
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
if( $carrierMethods = $shippingModel->getAllowedMethods() )
|
| 876 |
-
{
|
| 877 |
-
foreach ($carrierMethods as $methodCode => $method)
|
| 878 |
-
{
|
| 879 |
-
$code= $shippigCode.'_'.$methodCode;
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
if($shippigCode == 'freeshipping'):
|
| 883 |
-
if(Mage::getStoreConfig('carriers/'.$shippigCode.'/free_shipping_subtotal') < Mage::helper('checkout/cart')->getQuote()->getBaseSubtotalWithDiscount()):
|
| 884 |
-
$shippingTitle = Mage::getStoreConfig('carriers/'.$shippigCode.'/title');
|
| 885 |
-
$shippingPrice = Mage::getStoreConfig('carriers/'.$shippigCode.'/price');
|
| 886 |
-
$shipMethods[]=array(
|
| 887 |
-
'code'=>$shippigCode.'_'.$shippigCode,
|
| 888 |
-
'value'=>$shippingTitle,
|
| 889 |
-
'price'=>number_format ( Mage::helper ( 'directory' )
|
| 890 |
-
->currencyConvert ( $shippingPrice,
|
| 891 |
-
$baseCurrency,
|
| 892 |
-
$currentCurrency ), 2, '.', '' )
|
| 893 |
-
);
|
| 894 |
-
endif;
|
| 895 |
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
$shippingPrice = Mage::getStoreConfig('carriers/'.$shippigCode.'/price');
|
| 899 |
-
$shipMethods[]=array(
|
| 900 |
-
'code'=>$code,
|
| 901 |
-
'value'=>$shippingTitle,
|
| 902 |
-
'price'=>number_format ( Mage::helper ( 'directory' )
|
| 903 |
-
->currencyConvert ( $shippingPrice,
|
| 904 |
-
$baseCurrency,
|
| 905 |
-
$currentCurrency ), 2, '.', '' )
|
| 906 |
-
);
|
| 907 |
-
endif;
|
| 908 |
-
}
|
| 909 |
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
|
|
|
|
|
|
| 913 |
}
|
| 914 |
-
|
| 915 |
-
echo json_encode($shipMethods);
|
| 916 |
}
|
| 917 |
|
| 918 |
|
|
@@ -1101,8 +1077,8 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
| 1101 |
$json_shipping1 = $json_data['1'];
|
| 1102 |
$json_shipping = json_decode($json_shipping1,1);
|
| 1103 |
|
| 1104 |
-
$paymentmethod = $
|
| 1105 |
-
$shipping_method = $
|
| 1106 |
$card_details = $this->getRequest()->getParam('cards_details');
|
| 1107 |
$save_cc = $this->getRequest()->getParam('save_cc');
|
| 1108 |
if($paymentmethod == 'authorizenet')
|
|
@@ -1147,6 +1123,11 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
| 1147 |
'is_default_billing' =>$json_billing['is_default_billing'],
|
| 1148 |
|
| 1149 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1150 |
$shippingAddress = array(
|
| 1151 |
'firstname' => $json_shipping['firstname'],
|
| 1152 |
'lastname' => $json_shipping['lastname'],
|
|
@@ -1168,10 +1149,11 @@ class Mss_Connector_CartController extends Mage_Core_Controller_Front_Action {
|
|
| 1168 |
'is_default_shipping' =>$json_shipping['is_default_shipping'],
|
| 1169 |
'is_default_billing' =>$json_shipping['is_default_billing'],
|
| 1170 |
);
|
| 1171 |
-
|
| 1172 |
-
$
|
| 1173 |
-
else
|
| 1174 |
-
$
|
|
|
|
| 1175 |
|
| 1176 |
$quote->getBillingAddress()
|
| 1177 |
->addData($billingAddress);
|
| 863 |
|
| 864 |
####get all enabled shipping methods
|
| 865 |
public function getshippingmethodsAction(){
|
| 866 |
+
$shipMethods = array();
|
| 867 |
+
$country = $this->getRequest()->getParam('country_id');
|
| 868 |
|
| 869 |
+
if (!Zend_Validate::is($$country, 'NotEmpty')):
|
| 870 |
+
echo json_encode(array('status'=>'error','message'=> $this->__('country id should not be empty')));
|
| 871 |
+
exit;
|
| 872 |
+
endif;
|
| 873 |
+
$cart = Mage::getSingleton('checkout/cart');
|
| 874 |
+
$address = $cart->getQuote()->getShippingAddress();
|
| 875 |
+
$address->setCountryId($country)
|
| 876 |
+
->setCollectShippingrates(true);
|
| 877 |
+
$cart->save();
|
| 878 |
|
| 879 |
+
$rates = $address->collectShippingRates()
|
| 880 |
+
->getGroupedAllShippingRates();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 881 |
|
| 882 |
+
foreach ($rates as $carrier) {
|
| 883 |
+
foreach ($carrier as $rate) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 884 |
|
| 885 |
+
$shipMethods[] =array('code'=>$rate->getData('code'),
|
| 886 |
+
'value'=>$rate->getData('carrier_title'),
|
| 887 |
+
'price'=>$rate->getData('price')
|
| 888 |
+
);
|
| 889 |
+
}
|
| 890 |
}
|
| 891 |
+
echo json_encode($shipMethods);
|
|
|
|
| 892 |
}
|
| 893 |
|
| 894 |
|
| 1077 |
$json_shipping1 = $json_data['1'];
|
| 1078 |
$json_shipping = json_decode($json_shipping1,1);
|
| 1079 |
|
| 1080 |
+
$paymentmethod = $getParam['paymentmethod'];
|
| 1081 |
+
$shipping_method = $getParam['shippingmethod'];
|
| 1082 |
$card_details = $this->getRequest()->getParam('cards_details');
|
| 1083 |
$save_cc = $this->getRequest()->getParam('save_cc');
|
| 1084 |
if($paymentmethod == 'authorizenet')
|
| 1123 |
'is_default_billing' =>$json_billing['is_default_billing'],
|
| 1124 |
|
| 1125 |
);
|
| 1126 |
+
if(isset($json_billing['region'])):
|
| 1127 |
+
$billingAddress['region']=$json_billing['region'];
|
| 1128 |
+
else:
|
| 1129 |
+
$billingAddress['region_id']=$json_billing['region_id'];
|
| 1130 |
+
endif;
|
| 1131 |
$shippingAddress = array(
|
| 1132 |
'firstname' => $json_shipping['firstname'],
|
| 1133 |
'lastname' => $json_shipping['lastname'],
|
| 1149 |
'is_default_shipping' =>$json_shipping['is_default_shipping'],
|
| 1150 |
'is_default_billing' =>$json_shipping['is_default_billing'],
|
| 1151 |
);
|
| 1152 |
+
if(isset($json_shipping['region'])):
|
| 1153 |
+
$shippingAddress['region']=$json_shipping['region'];
|
| 1154 |
+
else:
|
| 1155 |
+
$shippingAddress['region_id']=$json_shipping['region_id'];
|
| 1156 |
+
endif;
|
| 1157 |
|
| 1158 |
$quote->getBillingAddress()
|
| 1159 |
->addData($billingAddress);
|
app/code/local/Mss/Connector/controllers/ProductsController.php
CHANGED
|
@@ -114,6 +114,27 @@ class Mss_Connector_ProductsController extends Mage_Core_Controller_Front_Action
|
|
| 114 |
$avg = 0;
|
| 115 |
$ratings = array();
|
| 116 |
$rdetails=array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
$all_custom_option_array = array();
|
| 118 |
|
| 119 |
if (count($reviews) > 0):
|
|
@@ -289,6 +310,7 @@ class Mss_Connector_ProductsController extends Mage_Core_Controller_Front_Action
|
|
| 289 |
true, null, null, null, null, false),
|
| 290 |
$baseCurrency, $currentCurrency ), 2, '.', '' ),
|
| 291 |
'storeUrl' => $storeUrl,
|
|
|
|
| 292 |
'description' => $description,
|
| 293 |
'short_description'=>nl2br ($product->getShortDescription()),
|
| 294 |
'symbol' => Mage::helper('connector')->getCurrencysymbolByCode($this->currency),
|
|
@@ -402,6 +424,7 @@ class Mss_Connector_ProductsController extends Mage_Core_Controller_Front_Action
|
|
| 402 |
'short_description'=>nl2br ($product->getShortDescription()),
|
| 403 |
'symbol' => Mage::helper('connector')->getCurrencysymbolByCode($this->currency) ,
|
| 404 |
'weight'=>$product->getWeight(),
|
|
|
|
| 405 |
'qty'=>(int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId())->getQty(),
|
| 406 |
'review'=>$reviews,
|
| 407 |
'rating'=>$rating,
|
|
@@ -483,34 +506,30 @@ class Mss_Connector_ProductsController extends Mage_Core_Controller_Front_Action
|
|
| 483 |
|
| 484 |
|
| 485 |
public function _getAditional(array $excludeAttr = array()) {
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
}
|
| 511 |
-
|
| 512 |
-
return $data;
|
| 513 |
-
}
|
| 514 |
|
| 515 |
###Getting price range
|
| 516 |
|
|
@@ -595,7 +614,24 @@ class Mss_Connector_ProductsController extends Mage_Core_Controller_Front_Action
|
|
| 595 |
$product = Mage::getModel ( 'catalog/product' )->load ( $product ['entity_id'] );
|
| 596 |
$rating = Mage::getModel('rating/rating')->getEntitySummary($product->getId());
|
| 597 |
$rating_final = ($rating->getSum()/$rating->getCount())/20;
|
| 598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 599 |
|
| 600 |
$productlist [] = array (
|
| 601 |
'entity_id' => $product->getId (),
|
|
@@ -607,6 +643,7 @@ class Mss_Connector_ProductsController extends Mage_Core_Controller_Front_Action
|
|
| 607 |
'special_to_date' => $product->getSpecialToDate (),
|
| 608 |
'image_url' => Mage::helper('connector')-> Imageresize($product->getImage(),'product','300','300'),
|
| 609 |
'url_key' => $product->getProductUrl (),
|
|
|
|
| 610 |
'regular_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert ( $product->getPrice (), $baseCurrency, $currentCurrency ), 2, '.', '' ),
|
| 611 |
'final_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert (
|
| 612 |
Mage::helper('tax')->getPrice($product, $product->getFinalPrice(),
|
| 114 |
$avg = 0;
|
| 115 |
$ratings = array();
|
| 116 |
$rdetails=array();
|
| 117 |
+
|
| 118 |
+
$productPrice = $product->getPrice();
|
| 119 |
+
$block = new Mage_Catalog_Block_Product_Price();
|
| 120 |
+
|
| 121 |
+
$product_tier_prices = $block->getTierPrices($product);
|
| 122 |
+
if(count($product_tier_prices) > 0){
|
| 123 |
+
$product_tier_prices = (object)$product_tier_prices;
|
| 124 |
+
$tier_prices = '';
|
| 125 |
+
foreach ($product_tier_prices as $_index => $_price){
|
| 126 |
+
|
| 127 |
+
$product_qty = $_price['price_qty'];
|
| 128 |
+
$tier_price = number_format($_price['price'], 2, '.' ,'');
|
| 129 |
+
$discount = ceil(100 - ((100 / $productPrice) * $_price['price']));
|
| 130 |
+
$symbol = Mage::helper('connector')->getCurrencysymbolByCode($this->currency);
|
| 131 |
+
$tier = 'Buy '.$product_qty .' for '.$symbol.$tier_price .' each and save '. $discount .'%';
|
| 132 |
+
|
| 133 |
+
$tier_prices .= '<span>' .$tier.'</span>';
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
|
| 138 |
$all_custom_option_array = array();
|
| 139 |
|
| 140 |
if (count($reviews) > 0):
|
| 310 |
true, null, null, null, null, false),
|
| 311 |
$baseCurrency, $currentCurrency ), 2, '.', '' ),
|
| 312 |
'storeUrl' => $storeUrl,
|
| 313 |
+
'tier_price'=> $tier_prices,
|
| 314 |
'description' => $description,
|
| 315 |
'short_description'=>nl2br ($product->getShortDescription()),
|
| 316 |
'symbol' => Mage::helper('connector')->getCurrencysymbolByCode($this->currency),
|
| 424 |
'short_description'=>nl2br ($product->getShortDescription()),
|
| 425 |
'symbol' => Mage::helper('connector')->getCurrencysymbolByCode($this->currency) ,
|
| 426 |
'weight'=>$product->getWeight(),
|
| 427 |
+
'tier_price'=> $tier_prices,
|
| 428 |
'qty'=>(int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId())->getQty(),
|
| 429 |
'review'=>$reviews,
|
| 430 |
'rating'=>$rating,
|
| 506 |
|
| 507 |
|
| 508 |
public function _getAditional(array $excludeAttr = array()) {
|
| 509 |
+
$data = array ();
|
| 510 |
+
$productId = ( int ) $this->getRequest ()->getParam ( 'productid' );
|
| 511 |
+
$product = Mage::getModel ( "catalog/product" )->load ( $productId );
|
| 512 |
+
$attributes = $product->getAttributes ();
|
| 513 |
+
foreach ( $attributes as $attribute ) {
|
| 514 |
+
|
| 515 |
+
if ($attribute->getIsVisibleOnFront () && ! in_array ( $attribute->getAttributeCode (), $excludeAttr )) {
|
| 516 |
+
|
| 517 |
+
$value = $attribute->getFrontend ()->getValue ( $product );
|
| 518 |
+
if ($attribute->getFrontendInput () == 'price' && is_string ( $value )) {
|
| 519 |
+
$value = Mage::app ()->getStore ()->convertPrice ( $value, true );
|
| 520 |
+
}
|
| 521 |
+
if (is_string ( $value ) && strlen ( $value )) {
|
| 522 |
+
$data [] = array (
|
| 523 |
+
'label' => $attribute->getStoreLabel (),
|
| 524 |
+
'value' => $value,
|
| 525 |
+
'code' => $attribute->getAttributeCode ()
|
| 526 |
+
);
|
| 527 |
+
}
|
| 528 |
+
}
|
| 529 |
+
}
|
| 530 |
+
|
| 531 |
+
return $data;
|
| 532 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 533 |
|
| 534 |
###Getting price range
|
| 535 |
|
| 614 |
$product = Mage::getModel ( 'catalog/product' )->load ( $product ['entity_id'] );
|
| 615 |
$rating = Mage::getModel('rating/rating')->getEntitySummary($product->getId());
|
| 616 |
$rating_final = ($rating->getSum()/$rating->getCount())/20;
|
| 617 |
+
$productPrice = $product->getPrice();
|
| 618 |
+
$block = new Mage_Catalog_Block_Product_Price();
|
| 619 |
+
|
| 620 |
+
$product_tier_prices = $block->getTierPrices($product);
|
| 621 |
+
if(count($product_tier_prices) > 0){
|
| 622 |
+
$product_tier_prices = (object)$product_tier_prices;
|
| 623 |
+
$tier_prices = '';
|
| 624 |
+
foreach ($product_tier_prices as $_index => $_price){
|
| 625 |
+
|
| 626 |
+
$product_qty = $_price['price_qty'];
|
| 627 |
+
$tier_price = number_format($_price['price'], 2, '.' ,'');
|
| 628 |
+
$discount = ceil(100 - ((100 / $productPrice) * $_price['price']));
|
| 629 |
+
$symbol = Mage::helper('connector')->getCurrencysymbolByCode($this->currency);
|
| 630 |
+
$tier = 'Buy '.$product_qty .' for '.$symbol.$tier_price .' each and save '. $discount .'%';
|
| 631 |
+
|
| 632 |
+
$tier_prices .= '<span>' .$tier.'</span>';
|
| 633 |
+
}
|
| 634 |
+
}
|
| 635 |
|
| 636 |
$productlist [] = array (
|
| 637 |
'entity_id' => $product->getId (),
|
| 643 |
'special_to_date' => $product->getSpecialToDate (),
|
| 644 |
'image_url' => Mage::helper('connector')-> Imageresize($product->getImage(),'product','300','300'),
|
| 645 |
'url_key' => $product->getProductUrl (),
|
| 646 |
+
'tier'=> $tier_prices,
|
| 647 |
'regular_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert ( $product->getPrice (), $baseCurrency, $currentCurrency ), 2, '.', '' ),
|
| 648 |
'final_price_with_tax' => number_format ( Mage::helper ( 'directory' )->currencyConvert (
|
| 649 |
Mage::helper('tax')->getPrice($product, $product->getFinalPrice(),
|
app/code/local/Mss/Connector/controllers/StaticpagesController.php
CHANGED
|
@@ -44,6 +44,8 @@ class Mss_Connector_StaticpagesController extends Mage_Core_Controller_Front_Act
|
|
| 44 |
);
|
| 45 |
$data = array();
|
| 46 |
|
|
|
|
|
|
|
| 47 |
foreach($pages as $page):
|
| 48 |
|
| 49 |
if($page):
|
|
@@ -51,7 +53,7 @@ class Mss_Connector_StaticpagesController extends Mage_Core_Controller_Front_Act
|
|
| 51 |
$page_model = Mage::getModel('cms/page')->load($identifier, 'identifier');
|
| 52 |
|
| 53 |
$data [] = array('page_title'=>$page_model->getTitle(),
|
| 54 |
-
'page_content'=>$page_model->getContent());
|
| 55 |
endif;
|
| 56 |
endforeach;
|
| 57 |
|
|
@@ -67,10 +69,7 @@ class Mss_Connector_StaticpagesController extends Mage_Core_Controller_Front_Act
|
|
| 67 |
|
| 68 |
echo json_encode(array('status'=>'error','message'=> $this->__('Problem in loading data.')));
|
| 69 |
exit;
|
| 70 |
-
|
| 71 |
}
|
| 72 |
-
|
| 73 |
-
|
| 74 |
}
|
| 75 |
|
| 76 |
}
|
| 44 |
);
|
| 45 |
$data = array();
|
| 46 |
|
| 47 |
+
$helper = Mage::helper('cms');
|
| 48 |
+
$processor = $helper->getPageTemplateProcessor();
|
| 49 |
foreach($pages as $page):
|
| 50 |
|
| 51 |
if($page):
|
| 53 |
$page_model = Mage::getModel('cms/page')->load($identifier, 'identifier');
|
| 54 |
|
| 55 |
$data [] = array('page_title'=>$page_model->getTitle(),
|
| 56 |
+
'page_content'=>$processor->filter($page_model->getContent()));
|
| 57 |
endif;
|
| 58 |
endforeach;
|
| 59 |
|
| 69 |
|
| 70 |
echo json_encode(array('status'=>'error','message'=> $this->__('Problem in loading data.')));
|
| 71 |
exit;
|
|
|
|
| 72 |
}
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
|
| 75 |
}
|
app/code/local/Mss/Connector/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Mss_Connector>
|
| 5 |
-
<version>2.5.
|
| 6 |
</Mss_Connector>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Mss_Connector>
|
| 5 |
+
<version>2.5.1</version>
|
| 6 |
</Mss_Connector>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
app/code/local/Mss/Twocheckout/Block/Form.php
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Craig_Tco_Block_Form extends Mage_Payment_Block_Form
|
| 23 |
+
{
|
| 24 |
+
protected function _construct()
|
| 25 |
+
{
|
| 26 |
+
parent::_construct();
|
| 27 |
+
$this->setTemplate('tco/form.phtml');
|
| 28 |
+
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
?>
|
app/code/local/Mss/Twocheckout/Block/Form.php@@
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Mss_Twocheckout_Block_Form extends Mage_Payment_Block_Form
|
| 23 |
+
{
|
| 24 |
+
protected function _construct()
|
| 25 |
+
{
|
| 26 |
+
parent::_construct();
|
| 27 |
+
$this->setTemplate('twocheckout/form.phtml');
|
| 28 |
+
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
?>
|
app/code/local/Mss/Twocheckout/Block/Iframe.php
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Craig_Tco_Block_Iframe extends Mage_Core_Block_Template
|
| 23 |
+
{
|
| 24 |
+
protected $_params = array();
|
| 25 |
+
|
| 26 |
+
protected function _construct()
|
| 27 |
+
{
|
| 28 |
+
parent::_construct();
|
| 29 |
+
$this->setTemplate('tco/iframe.phtml');
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
public function setParams($params)
|
| 33 |
+
{
|
| 34 |
+
$this->_params = $params;
|
| 35 |
+
return $this;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
public function getParams()
|
| 39 |
+
{
|
| 40 |
+
return $this->_params;
|
| 41 |
+
}
|
| 42 |
+
}
|
app/code/local/Mss/Twocheckout/Block/Info.php
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Craig_Tco_Block_Info extends Mage_Payment_Block_Info {
|
| 23 |
+
|
| 24 |
+
protected function _construct() {
|
| 25 |
+
parent::_construct();
|
| 26 |
+
$this->setTemplate('tco/info.phtml');
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
public function getMethodCode()
|
| 30 |
+
{
|
| 31 |
+
return $this->getInfo()->getMethodInstance()->getCode();
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
?>
|
app/code/local/Mss/Twocheckout/Block/Redirect.php
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
|
| 23 |
+
|
| 24 |
+
class Craig_Tco_Block_Redirect extends Mage_Core_Block_Abstract
|
| 25 |
+
{
|
| 26 |
+
protected function _toHtml()
|
| 27 |
+
{
|
| 28 |
+
$tco = Mage::getModel('tco/checkout');
|
| 29 |
+
|
| 30 |
+
$form = new Varien_Data_Form();
|
| 31 |
+
$form->setAction($tco->getUrl())
|
| 32 |
+
->setId('tcopay')
|
| 33 |
+
->setName('tcopay')
|
| 34 |
+
->setMethod('POST')
|
| 35 |
+
->setUseContainer(true);
|
| 36 |
+
$tco->getFormFields();
|
| 37 |
+
foreach ($tco->getFormFields() as $field=>$value) {
|
| 38 |
+
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value, 'size'=>200));
|
| 39 |
+
}
|
| 40 |
+
$form->addField('tcosubmit', 'submit', array('name'=>'tcosubmit'));
|
| 41 |
+
|
| 42 |
+
$html = '<style> #tcosubmit {display:none;} </style>';
|
| 43 |
+
$html .= $form->toHtml();
|
| 44 |
+
|
| 45 |
+
return $html;
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
?>
|
app/code/local/Mss/Twocheckout/Helper/Data.php
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Craig_Tco_Helper_Data extends Mage_Core_Helper_Abstract
|
| 23 |
+
{
|
| 24 |
+
|
| 25 |
+
}
|
app/code/local/Mss/Twocheckout/Model/Checkout.php
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Craig_Tco_Model_Checkout extends Mage_Payment_Model_Method_Abstract {
|
| 23 |
+
|
| 24 |
+
protected $_code = 'tco';
|
| 25 |
+
protected $_paymentMethod = 'shared';
|
| 26 |
+
|
| 27 |
+
public function getCheckout() {
|
| 28 |
+
return Mage::getSingleton('checkout/session');
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
public function getOrderPlaceRedirectUrl() {
|
| 32 |
+
return Mage::getUrl('tco/redirect');
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
//get SID
|
| 36 |
+
public function getSid() {
|
| 37 |
+
$sid = $this->getConfigData('sid');
|
| 38 |
+
return $sid;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
//get Demo Setting
|
| 42 |
+
public function getDemo() {
|
| 43 |
+
if ($this->getConfigData('demo') == '1') {
|
| 44 |
+
$demo = 'Y';
|
| 45 |
+
} else {
|
| 46 |
+
$demo = 'N';
|
| 47 |
+
}
|
| 48 |
+
return $demo;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
//get Checkout Display
|
| 52 |
+
public function getDisplay() {
|
| 53 |
+
if ($this->getConfigData('inline') == '1') {
|
| 54 |
+
$display = true;
|
| 55 |
+
} else {
|
| 56 |
+
$display = false;
|
| 57 |
+
}
|
| 58 |
+
return $display;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
//get purchase routine URL
|
| 62 |
+
public function getUrl() {
|
| 63 |
+
$url = "https://www.2checkout.com/checkout/purchase";
|
| 64 |
+
return $url;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
//get checkout language
|
| 68 |
+
public function getLanguage() {
|
| 69 |
+
$lang = $this->getConfigData('checkout_language');
|
| 70 |
+
return $lang;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
//get custom checkout message
|
| 74 |
+
public function getRedirectMessage() {
|
| 75 |
+
$redirect_message = $this->getConfigData('redirect_message');
|
| 76 |
+
return $redirect_message;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
//get order
|
| 80 |
+
public function getQuote() {
|
| 81 |
+
$orderIncrementId = $this->getCheckout()->getLastRealOrderId();
|
| 82 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
|
| 83 |
+
return $order;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
//get product data
|
| 87 |
+
public function getProductData() {
|
| 88 |
+
$products = array();
|
| 89 |
+
$items = $this->getQuote()->getAllItems();
|
| 90 |
+
if ($items) {
|
| 91 |
+
$i = 1;
|
| 92 |
+
foreach($items as $item){
|
| 93 |
+
if ($item->getParentItem()) {
|
| 94 |
+
continue;
|
| 95 |
+
}
|
| 96 |
+
$products['c_name_'.$i] = $item->getName();
|
| 97 |
+
$products['c_description_'.$i] = $item->getSku();
|
| 98 |
+
$products['c_price_'.$i] = number_format($item->getPrice(), 2, '.', '');
|
| 99 |
+
$products['c_prod_'.$i] = $item->getSku() . ',' . $item->getQtyToInvoice();
|
| 100 |
+
$i++;
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
return $products;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
//get lineitem data
|
| 107 |
+
public function getLineitemData() {
|
| 108 |
+
$lineitems = array();
|
| 109 |
+
$items = $this->getQuote()->getAllItems();
|
| 110 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 111 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 112 |
+
$taxFull = $order->getFullTaxInfo();
|
| 113 |
+
$ship_method = $order->getShipping_description();
|
| 114 |
+
$coupon = $order->getCoupon_code();
|
| 115 |
+
$lineitem_total = 0;
|
| 116 |
+
$i = 1;
|
| 117 |
+
//get products
|
| 118 |
+
if ($items) {
|
| 119 |
+
foreach($items as $item){
|
| 120 |
+
if ($item->getParentItem()) {
|
| 121 |
+
continue;
|
| 122 |
+
}
|
| 123 |
+
$lineitems['li_'.$i.'_type'] = 'product';
|
| 124 |
+
$lineitems['li_'.$i.'_product_id'] = $item->getSku();
|
| 125 |
+
$lineitems['li_'.$i.'_quantity'] = $item->getQtyToInvoice();
|
| 126 |
+
$lineitems['li_'.$i.'_name'] = $item->getName();
|
| 127 |
+
$lineitems['li_'.$i.'_description'] = $item->getDescription();
|
| 128 |
+
$lineitems['li_'.$i.'_price'] = number_format($item->getPrice(), 2, '.', '');
|
| 129 |
+
$lineitem_total += number_format($item->getPrice(), 2, '.', '');
|
| 130 |
+
$i++;
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
//get taxes
|
| 134 |
+
if ($taxFull) {
|
| 135 |
+
foreach($taxFull as $rate){
|
| 136 |
+
$lineitems['li_'.$i.'_type'] = 'tax';
|
| 137 |
+
$lineitems['li_'.$i.'_name'] = $rate['rates']['0']['code'];
|
| 138 |
+
$lineitems['li_'.$i.'_price'] = round($rate['amount'], 2);
|
| 139 |
+
$lineitem_total += round($rate['amount'], 2);
|
| 140 |
+
$i++;
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
//get shipping
|
| 144 |
+
if ($ship_method) {
|
| 145 |
+
$lineitems['li_'.$i.'_type'] = 'shipping';
|
| 146 |
+
$lineitems['li_'.$i.'_name'] = $order->getShipping_description();
|
| 147 |
+
$lineitems['li_'.$i.'_price'] = round($order->getShippingAmount(), 2);
|
| 148 |
+
$lineitem_total += round($order->getShippingAmount(), 2);
|
| 149 |
+
$i++;
|
| 150 |
+
}
|
| 151 |
+
//get coupons
|
| 152 |
+
if ($coupon) {
|
| 153 |
+
$lineitems['li_'.$i.'_type'] = 'coupon';
|
| 154 |
+
$lineitems['li_'.$i.'_name'] = $order->getCoupon_code();
|
| 155 |
+
$lineitems['li_'.$i.'_price'] = trim(round($order->getBase_discount_amount(), 2), '-');
|
| 156 |
+
$lineitem_total -= trim(round($order->getBase_discount_amount(), 2), '-');
|
| 157 |
+
$i++;
|
| 158 |
+
}
|
| 159 |
+
return $lineitems;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
//check total
|
| 163 |
+
public function checkTotal() {
|
| 164 |
+
$items = $this->getQuote()->getAllItems();
|
| 165 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 166 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 167 |
+
$taxFull = $order->getFullTaxInfo();
|
| 168 |
+
$ship_method = $order->getShipping_description();
|
| 169 |
+
$coupon = $order->getCoupon_code();
|
| 170 |
+
$lineitem_total = 0;
|
| 171 |
+
$i = 1;
|
| 172 |
+
//get products
|
| 173 |
+
if ($items) {
|
| 174 |
+
foreach($items as $item){
|
| 175 |
+
if ($item->getParentItem()) {
|
| 176 |
+
continue;
|
| 177 |
+
}
|
| 178 |
+
$lineitem_total += number_format($item->getPrice(), 2, '.', '');
|
| 179 |
+
}
|
| 180 |
+
}
|
| 181 |
+
//get taxes
|
| 182 |
+
if ($taxFull) {
|
| 183 |
+
foreach($taxFull as $rate){
|
| 184 |
+
$lineitem_total += round($rate['amount'], 2);
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
//get shipping
|
| 188 |
+
if ($ship_method) {
|
| 189 |
+
$lineitem_total += round($order->getShippingAmount(), 2);
|
| 190 |
+
}
|
| 191 |
+
//get coupons
|
| 192 |
+
if ($coupon) {
|
| 193 |
+
$lineitem_total -= trim(round($order->getBase_discount_amount(), 2), '-');
|
| 194 |
+
}
|
| 195 |
+
return $lineitem_total;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
//get tax data
|
| 199 |
+
public function getTaxData() {
|
| 200 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 201 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 202 |
+
$taxes = array();
|
| 203 |
+
$taxFull = $order->getFullTaxInfo();
|
| 204 |
+
if ($taxFull) {
|
| 205 |
+
$i = 1;
|
| 206 |
+
foreach($taxFull as $rate){
|
| 207 |
+
$taxes['tax_id_'.$i] = $rate['rates']['0']['code'];
|
| 208 |
+
$taxes['tax_amount_'.$i] = round($rate['amount'], 2);
|
| 209 |
+
$i++;
|
| 210 |
+
}
|
| 211 |
+
}
|
| 212 |
+
return $taxes;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
//get HTML form data
|
| 216 |
+
public function getFormFields() {
|
| 217 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 218 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 219 |
+
$amount = round($order->getGrandTotal(), 2);
|
| 220 |
+
$a = $this->getQuote()->getShippingAddress();
|
| 221 |
+
$b = $this->getQuote()->getBillingAddress();
|
| 222 |
+
$country = $b->getCountry();
|
| 223 |
+
$currency_code = $order->getOrderCurrencyCode();
|
| 224 |
+
$shipping = round($order->getShippingAmount(), 2);
|
| 225 |
+
$weight = round($order->getWeight(), 2);
|
| 226 |
+
$ship_method = $order->getShipping_description();
|
| 227 |
+
$tax = trim(round($order->getTaxAmount(), 2));
|
| 228 |
+
$productData = $this->getProductData();
|
| 229 |
+
$taxData = $this->getTaxData();
|
| 230 |
+
$cart_order_id = $order_id;
|
| 231 |
+
$lineitemData = $this->getLineitemData();
|
| 232 |
+
|
| 233 |
+
$tcoFields = array();
|
| 234 |
+
$tcoFields['sid'] = $this->getSid();
|
| 235 |
+
$tcoFields['lang'] = $this->getLanguage();
|
| 236 |
+
$tcoFields['purchase_step'] = 'payment-method';
|
| 237 |
+
$tcoFields['merchant_order_id'] = $order_id;
|
| 238 |
+
$tcoFields['email'] = $order->getData('customer_email');
|
| 239 |
+
$tcoFields['first_name'] = $b->getFirstname();
|
| 240 |
+
$tcoFields['last_name'] = $b->getLastname();
|
| 241 |
+
$tcoFields['phone'] = $b->getTelephone();
|
| 242 |
+
$tcoFields['country'] = $b->getCountry();
|
| 243 |
+
$tcoFields['street_address'] = $b->getStreet1();
|
| 244 |
+
$tcoFields['street_address2'] = $b->getStreet2();
|
| 245 |
+
$tcoFields['city'] = $b->getCity();
|
| 246 |
+
|
| 247 |
+
if ($country == 'US' || $country == 'CA') {
|
| 248 |
+
$tcoFields['state'] = $b->getRegion();
|
| 249 |
+
} else {
|
| 250 |
+
$tcoFields['state'] = 'XX';
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
$tcoFields['zip'] = $b->getPostcode();
|
| 254 |
+
|
| 255 |
+
if ($a) {
|
| 256 |
+
$tcoFields['ship_name'] = $a->getFirstname() . ' ' . $a->getLastname();
|
| 257 |
+
$tcoFields['ship_country'] = $a->getCountry();
|
| 258 |
+
$tcoFields['ship_street_address'] = $a->getStreet1();
|
| 259 |
+
$tcoFields['ship_street_address2'] = $a->getStreet2();
|
| 260 |
+
$tcoFields['ship_city'] = $a->getCity();
|
| 261 |
+
$tcoFields['ship_state'] = $a->getRegion();
|
| 262 |
+
$tcoFields['ship_zip'] = $a->getPostcode();
|
| 263 |
+
$tcoFields['sh_cost'] = $shipping;
|
| 264 |
+
$tcoFields['sh_weight'] = $weight;
|
| 265 |
+
$tcoFields['ship_method'] = $ship_method;
|
| 266 |
+
}
|
| 267 |
+
$tcoFields['2co_tax'] = $tax;
|
| 268 |
+
$tcoFields['2co_cart_type'] = 'magento';
|
| 269 |
+
$tcoFields['x_Receipt_Link_URL'] = Mage::getUrl('tco/redirect/success', array('_secure' => true));
|
| 270 |
+
$tcoFields['return_url'] = Mage::getUrl('tco/redirect/cart', array('_secure' => true));
|
| 271 |
+
$tcoFields['demo'] = $this->getDemo();
|
| 272 |
+
$tcoFields['currency_code'] = $currency_code;
|
| 273 |
+
|
| 274 |
+
//Check Integration mode
|
| 275 |
+
$lineitem_total = $this->checkTotal();
|
| 276 |
+
if ($lineitem_total != $amount) {
|
| 277 |
+
$tcoFields['id_type'] = '1';
|
| 278 |
+
$tcoFields['total'] = $amount;
|
| 279 |
+
$tcoFields['cart_order_id'] = $order_id;
|
| 280 |
+
$result = $productData + $taxData + $tcoFields;
|
| 281 |
+
} else {
|
| 282 |
+
$tcoFields['mode'] = '2CO';
|
| 283 |
+
$result = $tcoFields + $lineitemData;
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
return $result;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
}
|
app/code/local/Mss/Twocheckout/Model/Observer.php
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class Craig_Tco_Model_Observer extends Mage_Core_Block_Abstract {
|
| 4 |
+
|
| 5 |
+
public function issue_creditmemo_refund(Varien_Object $payment) {
|
| 6 |
+
|
| 7 |
+
$refund = Mage::getStoreConfig('payment/tco/refund');
|
| 8 |
+
|
| 9 |
+
if ($refund == '1') {
|
| 10 |
+
$order = $payment->getCreditmemo()->getOrder();
|
| 11 |
+
$creditmemo = $payment->getCreditmemo()->getOrder()->getData();
|
| 12 |
+
$creditmemo_amount = $payment->getCreditmemo()->getData();
|
| 13 |
+
$creditmemo_comment = $payment->getCreditmemo()->getCommentsCollection()->toArray();
|
| 14 |
+
|
| 15 |
+
if(isset($creditmemo_comment['items'][0]['comment'])) {
|
| 16 |
+
$comment = $creditmemo_comment['items'][0]['comment'];
|
| 17 |
+
} else {
|
| 18 |
+
$comment = 'Refund issued by seller';
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
$username = Mage::getStoreConfig('payment/tco/username');
|
| 22 |
+
$password = Mage::getStoreConfig('payment/tco/password');
|
| 23 |
+
$auth = 'Basic ' . base64_encode($username . ':' . $password);
|
| 24 |
+
|
| 25 |
+
$data = array();
|
| 26 |
+
$data['sale_id'] = $creditmemo['ext_order_id'];
|
| 27 |
+
$data['comment'] = $comment;
|
| 28 |
+
$data['category'] = '5';
|
| 29 |
+
$data['amount'] = $creditmemo_amount['grand_total'];
|
| 30 |
+
$data['currency'] = 'vendor';
|
| 31 |
+
|
| 32 |
+
$headers = array(
|
| 33 |
+
'Authorization: ' . $auth,
|
| 34 |
+
'Accept: application/json'
|
| 35 |
+
);
|
| 36 |
+
|
| 37 |
+
$url = 'https://www.2checkout.com/api/sales/refund_invoice';
|
| 38 |
+
|
| 39 |
+
$config = array(
|
| 40 |
+
'timeout' => 30
|
| 41 |
+
);
|
| 42 |
+
|
| 43 |
+
try {
|
| 44 |
+
$http = new Varien_Http_Adapter_Curl();
|
| 45 |
+
$http->setConfig($config);
|
| 46 |
+
$http->write(Zend_Http_Client::POST, $url, '1.1', $headers, $data);
|
| 47 |
+
$response = $http->read();
|
| 48 |
+
$order->addStatusHistoryComment($response);
|
| 49 |
+
$order->save();
|
| 50 |
+
} catch (Exception $e) {
|
| 51 |
+
Mage::throwException(Mage::helper('core')->__($e->getMessage()));
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
public function output_tco_redirect(Varien_Object $observer) {
|
| 58 |
+
if (isset($_POST['payment']['method']) && $_POST['payment']['method'] == "tco") {
|
| 59 |
+
$controller = $observer->getEvent()->getData('controller_action');
|
| 60 |
+
$result = Mage::helper('core')->jsonDecode(
|
| 61 |
+
$controller->getResponse()->getBody('default'),
|
| 62 |
+
Zend_Json::TYPE_ARRAY
|
| 63 |
+
);
|
| 64 |
+
|
| 65 |
+
if (Mage::getStoreConfig('payment/tco/inline') == '1') {
|
| 66 |
+
$js = '<script>
|
| 67 |
+
document.getElementById("review-please-wait").style["display"] = "block";
|
| 68 |
+
if ($$("a.top-link-cart")) {
|
| 69 |
+
$$("a.top-link-cart")[0].href = "'.Mage::getUrl('tco/redirect/cart', array('_secure' => true)).'";
|
| 70 |
+
}
|
| 71 |
+
if ($$("p.f-left").length !== 0) {
|
| 72 |
+
$$("p.f-left")[0].style["display"] = "none";
|
| 73 |
+
}
|
| 74 |
+
function formSubmit() {
|
| 75 |
+
$("tcosubmit").click();
|
| 76 |
+
}
|
| 77 |
+
var tcohead = $$("head")[0];
|
| 78 |
+
var tcoscript = new Element("script", { type: "text/javascript", src: "https://www.2checkout.com/static/checkout/javascript/direct.min.js" });
|
| 79 |
+
tcohead.appendChild(tcoscript);
|
| 80 |
+
var checkoutOrderBtn = $$("button.btn-checkout");
|
| 81 |
+
checkoutOrderBtn[0].removeAttribute("onclick");
|
| 82 |
+
checkoutOrderBtn[0].observe("click", formSubmit);
|
| 83 |
+
new PeriodicalExecuter(function(pe) {
|
| 84 |
+
if (typeof window["inline_2Checkout"] != "undefined")
|
| 85 |
+
{
|
| 86 |
+
formSubmit();
|
| 87 |
+
pe.stop();
|
| 88 |
+
}
|
| 89 |
+
}, 0.50);
|
| 90 |
+
</script>';
|
| 91 |
+
} else {
|
| 92 |
+
$js = '<script>
|
| 93 |
+
document.getElementById("review-please-wait").style["display"] = "block";
|
| 94 |
+
if ($$("a.top-link-cart")) {
|
| 95 |
+
$$("a.top-link-cart")[0].href = "'.Mage::getUrl('tco/redirect/cart', array('_secure' => true)).'";
|
| 96 |
+
}
|
| 97 |
+
if ($$("p.f-left").length !== 0) {
|
| 98 |
+
$$("p.f-left")[0].style["display"] = "none";
|
| 99 |
+
}
|
| 100 |
+
function formSubmit() {
|
| 101 |
+
$("tcosubmit").click();
|
| 102 |
+
}
|
| 103 |
+
var checkoutOrderBtn = $$("button.btn-checkout");
|
| 104 |
+
checkoutOrderBtn[0].removeAttribute("onclick");
|
| 105 |
+
checkoutOrderBtn[0].observe("click", formSubmit);
|
| 106 |
+
formSubmit();
|
| 107 |
+
</script>';
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
if (empty($result['error'])) {
|
| 111 |
+
$controller->loadLayout('checkout_onepage_review');
|
| 112 |
+
$html = $controller->getLayout()->createBlock('tco/redirect')->toHtml();
|
| 113 |
+
$html .= $js;
|
| 114 |
+
$result['update_section'] = array(
|
| 115 |
+
'name' => 'tcoiframe',
|
| 116 |
+
'html' => $html
|
| 117 |
+
);
|
| 118 |
+
$result['redirect'] = false;
|
| 119 |
+
$result['success'] = false;
|
| 120 |
+
$controller->getResponse()->clearHeader('Location');
|
| 121 |
+
$controller->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
return $this;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
}
|
| 128 |
+
?>
|
app/code/local/Mss/Twocheckout/Model/Twocheckout.php
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Mss_Twocheckout_Model_Twocheckout extends Mage_Payment_Model_Method_Abstract {
|
| 23 |
+
|
| 24 |
+
protected $_code = 'twocheckout';
|
| 25 |
+
protected $_paymentMethod = 'shared';
|
| 26 |
+
|
| 27 |
+
public function getCheckout() {
|
| 28 |
+
return Mage::getSingleton('checkout/session');
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
public function getOrderPlaceRedirectUrl() {
|
| 32 |
+
return Mage::getUrl('twocheckout/redirect');
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
//get SID
|
| 36 |
+
public function getSid() {
|
| 37 |
+
$sid = $this->getConfigData('sid');
|
| 38 |
+
return $sid;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
//get Demo Setting
|
| 42 |
+
public function getDemo() {
|
| 43 |
+
if ($this->getConfigData('demo') == '1') {
|
| 44 |
+
$demo = 'Y';
|
| 45 |
+
} else {
|
| 46 |
+
$demo = 'N';
|
| 47 |
+
}
|
| 48 |
+
return $demo;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
//get Checkout Display
|
| 52 |
+
public function getDisplay() {
|
| 53 |
+
if ($this->getConfigData('inline') == '1') {
|
| 54 |
+
$display = true;
|
| 55 |
+
} else {
|
| 56 |
+
$display = false;
|
| 57 |
+
}
|
| 58 |
+
return $display;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
//get purchase routine URL
|
| 62 |
+
public function getUrl() {
|
| 63 |
+
$url = "https://www.2checkout.com/checkout/purchase";
|
| 64 |
+
return $url;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
//get checkout language
|
| 68 |
+
public function getLanguage() {
|
| 69 |
+
$lang = $this->getConfigData('checkout_language');
|
| 70 |
+
return $lang;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
//get custom checkout message
|
| 74 |
+
public function getRedirectMessage() {
|
| 75 |
+
$redirect_message = $this->getConfigData('redirect_message');
|
| 76 |
+
return $redirect_message;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
//get order
|
| 80 |
+
public function getQuote() {
|
| 81 |
+
$orderIncrementId = $this->getCheckout()->getLastRealOrderId();
|
| 82 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
|
| 83 |
+
return $order;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
//get product data
|
| 87 |
+
public function getProductData() {
|
| 88 |
+
$products = array();
|
| 89 |
+
$items = $this->getQuote()->getAllItems();
|
| 90 |
+
if ($items) {
|
| 91 |
+
$i = 1;
|
| 92 |
+
foreach($items as $item){
|
| 93 |
+
if ($item->getParentItem()) {
|
| 94 |
+
continue;
|
| 95 |
+
}
|
| 96 |
+
$products['c_name_'.$i] = $item->getName();
|
| 97 |
+
$products['c_description_'.$i] = $item->getSku();
|
| 98 |
+
$products['c_price_'.$i] = number_format($item->getPrice(), 2, '.', '');
|
| 99 |
+
$products['c_prod_'.$i] = $item->getSku() . ',' . $item->getQtyToInvoice();
|
| 100 |
+
$i++;
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
return $products;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
//get lineitem data
|
| 107 |
+
public function getLineitemData() {
|
| 108 |
+
$lineitems = array();
|
| 109 |
+
$items = $this->getQuote()->getAllItems();
|
| 110 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 111 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 112 |
+
$taxFull = $order->getFullTaxInfo();
|
| 113 |
+
$ship_method = $order->getShipping_description();
|
| 114 |
+
$coupon = $order->getCoupon_code();
|
| 115 |
+
$lineitem_total = 0;
|
| 116 |
+
$i = 1;
|
| 117 |
+
//get products
|
| 118 |
+
if ($items) {
|
| 119 |
+
foreach($items as $item){
|
| 120 |
+
if ($item->getParentItem()) {
|
| 121 |
+
continue;
|
| 122 |
+
}
|
| 123 |
+
$lineitems['li_'.$i.'_type'] = 'product';
|
| 124 |
+
$lineitems['li_'.$i.'_product_id'] = $item->getSku();
|
| 125 |
+
$lineitems['li_'.$i.'_quantity'] = $item->getQtyToInvoice();
|
| 126 |
+
$lineitems['li_'.$i.'_name'] = $item->getName();
|
| 127 |
+
$lineitems['li_'.$i.'_description'] = $item->getDescription();
|
| 128 |
+
$lineitems['li_'.$i.'_price'] = number_format($item->getPrice(), 2, '.', '');
|
| 129 |
+
$lineitem_total += number_format($item->getPrice(), 2, '.', '');
|
| 130 |
+
$i++;
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
//get taxes
|
| 134 |
+
if ($taxFull) {
|
| 135 |
+
foreach($taxFull as $rate){
|
| 136 |
+
$lineitems['li_'.$i.'_type'] = 'tax';
|
| 137 |
+
$lineitems['li_'.$i.'_name'] = $rate['rates']['0']['code'];
|
| 138 |
+
$lineitems['li_'.$i.'_price'] = round($rate['amount'], 2);
|
| 139 |
+
$lineitem_total += round($rate['amount'], 2);
|
| 140 |
+
$i++;
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
//get shipping
|
| 144 |
+
if ($ship_method) {
|
| 145 |
+
$lineitems['li_'.$i.'_type'] = 'shipping';
|
| 146 |
+
$lineitems['li_'.$i.'_name'] = $order->getShipping_description();
|
| 147 |
+
$lineitems['li_'.$i.'_price'] = round($order->getShippingAmount(), 2);
|
| 148 |
+
$lineitem_total += round($order->getShippingAmount(), 2);
|
| 149 |
+
$i++;
|
| 150 |
+
}
|
| 151 |
+
//get coupons
|
| 152 |
+
if ($coupon) {
|
| 153 |
+
$lineitems['li_'.$i.'_type'] = 'coupon';
|
| 154 |
+
$lineitems['li_'.$i.'_name'] = $order->getCoupon_code();
|
| 155 |
+
$lineitems['li_'.$i.'_price'] = trim(round($order->getBase_discount_amount(), 2), '-');
|
| 156 |
+
$lineitem_total -= trim(round($order->getBase_discount_amount(), 2), '-');
|
| 157 |
+
$i++;
|
| 158 |
+
}
|
| 159 |
+
return $lineitems;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
//check total
|
| 163 |
+
public function checkTotal() {
|
| 164 |
+
$items = $this->getQuote()->getAllItems();
|
| 165 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 166 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 167 |
+
$taxFull = $order->getFullTaxInfo();
|
| 168 |
+
$ship_method = $order->getShipping_description();
|
| 169 |
+
$coupon = $order->getCoupon_code();
|
| 170 |
+
$lineitem_total = 0;
|
| 171 |
+
$i = 1;
|
| 172 |
+
//get products
|
| 173 |
+
if ($items) {
|
| 174 |
+
foreach($items as $item){
|
| 175 |
+
if ($item->getParentItem()) {
|
| 176 |
+
continue;
|
| 177 |
+
}
|
| 178 |
+
$lineitem_total += number_format($item->getPrice(), 2, '.', '');
|
| 179 |
+
}
|
| 180 |
+
}
|
| 181 |
+
//get taxes
|
| 182 |
+
if ($taxFull) {
|
| 183 |
+
foreach($taxFull as $rate){
|
| 184 |
+
$lineitem_total += round($rate['amount'], 2);
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
//get shipping
|
| 188 |
+
if ($ship_method) {
|
| 189 |
+
$lineitem_total += round($order->getShippingAmount(), 2);
|
| 190 |
+
}
|
| 191 |
+
//get coupons
|
| 192 |
+
if ($coupon) {
|
| 193 |
+
$lineitem_total -= trim(round($order->getBase_discount_amount(), 2), '-');
|
| 194 |
+
}
|
| 195 |
+
return $lineitem_total;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
//get tax data
|
| 199 |
+
public function getTaxData() {
|
| 200 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 201 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 202 |
+
$taxes = array();
|
| 203 |
+
$taxFull = $order->getFullTaxInfo();
|
| 204 |
+
if ($taxFull) {
|
| 205 |
+
$i = 1;
|
| 206 |
+
foreach($taxFull as $rate){
|
| 207 |
+
$taxes['tax_id_'.$i] = $rate['rates']['0']['code'];
|
| 208 |
+
$taxes['tax_amount_'.$i] = round($rate['amount'], 2);
|
| 209 |
+
$i++;
|
| 210 |
+
}
|
| 211 |
+
}
|
| 212 |
+
return $taxes;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
//get HTML form data
|
| 216 |
+
public function getFormFields() {
|
| 217 |
+
$order_id = $this->getCheckout()->getLastRealOrderId();
|
| 218 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
|
| 219 |
+
$amount = round($order->getGrandTotal(), 2);
|
| 220 |
+
$a = $this->getQuote()->getShippingAddress();
|
| 221 |
+
$b = $this->getQuote()->getBillingAddress();
|
| 222 |
+
$country = $b->getCountry();
|
| 223 |
+
$currency_code = $order->getOrderCurrencyCode();
|
| 224 |
+
$shipping = round($order->getShippingAmount(), 2);
|
| 225 |
+
$weight = round($order->getWeight(), 2);
|
| 226 |
+
$ship_method = $order->getShipping_description();
|
| 227 |
+
$tax = trim(round($order->getTaxAmount(), 2));
|
| 228 |
+
$productData = $this->getProductData();
|
| 229 |
+
$taxData = $this->getTaxData();
|
| 230 |
+
$cart_order_id = $order_id;
|
| 231 |
+
$lineitemData = $this->getLineitemData();
|
| 232 |
+
|
| 233 |
+
$tcoFields = array();
|
| 234 |
+
$tcoFields['sid'] = $this->getSid();
|
| 235 |
+
$tcoFields['lang'] = $this->getLanguage();
|
| 236 |
+
$tcoFields['purchase_step'] = 'payment-method';
|
| 237 |
+
$tcoFields['merchant_order_id'] = $order_id;
|
| 238 |
+
$tcoFields['email'] = $order->getData('customer_email');
|
| 239 |
+
$tcoFields['first_name'] = $b->getFirstname();
|
| 240 |
+
$tcoFields['last_name'] = $b->getLastname();
|
| 241 |
+
$tcoFields['phone'] = $b->getTelephone();
|
| 242 |
+
$tcoFields['country'] = $b->getCountry();
|
| 243 |
+
$tcoFields['street_address'] = $b->getStreet1();
|
| 244 |
+
$tcoFields['street_address2'] = $b->getStreet2();
|
| 245 |
+
$tcoFields['city'] = $b->getCity();
|
| 246 |
+
|
| 247 |
+
if ($country == 'US' || $country == 'CA') {
|
| 248 |
+
$tcoFields['state'] = $b->getRegion();
|
| 249 |
+
} else {
|
| 250 |
+
$tcoFields['state'] = 'XX';
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
$tcoFields['zip'] = $b->getPostcode();
|
| 254 |
+
|
| 255 |
+
if ($a) {
|
| 256 |
+
$tcoFields['ship_name'] = $a->getFirstname() . ' ' . $a->getLastname();
|
| 257 |
+
$tcoFields['ship_country'] = $a->getCountry();
|
| 258 |
+
$tcoFields['ship_street_address'] = $a->getStreet1();
|
| 259 |
+
$tcoFields['ship_street_address2'] = $a->getStreet2();
|
| 260 |
+
$tcoFields['ship_city'] = $a->getCity();
|
| 261 |
+
$tcoFields['ship_state'] = $a->getRegion();
|
| 262 |
+
$tcoFields['ship_zip'] = $a->getPostcode();
|
| 263 |
+
$tcoFields['sh_cost'] = $shipping;
|
| 264 |
+
$tcoFields['sh_weight'] = $weight;
|
| 265 |
+
$tcoFields['ship_method'] = $ship_method;
|
| 266 |
+
}
|
| 267 |
+
$tcoFields['2co_tax'] = $tax;
|
| 268 |
+
$tcoFields['2co_cart_type'] = 'magento';
|
| 269 |
+
$tcoFields['x_Receipt_Link_URL'] = Mage::getUrl('twocheckout/redirect/success', array('_secure' => true));
|
| 270 |
+
$tcoFields['return_url'] = Mage::getUrl('twocheckout/redirect/cart', array('_secure' => true));
|
| 271 |
+
$tcoFields['demo'] = $this->getDemo();
|
| 272 |
+
$tcoFields['currency_code'] = $currency_code;
|
| 273 |
+
|
| 274 |
+
//Check Integration mode
|
| 275 |
+
$lineitem_total = $this->checkTotal();
|
| 276 |
+
if ($lineitem_total != $amount) {
|
| 277 |
+
$tcoFields['id_type'] = '1';
|
| 278 |
+
$tcoFields['total'] = $amount;
|
| 279 |
+
$tcoFields['cart_order_id'] = $order_id;
|
| 280 |
+
$result = $productData + $taxData + $tcoFields;
|
| 281 |
+
} else {
|
| 282 |
+
$tcoFields['mode'] = '2CO';
|
| 283 |
+
$result = $tcoFields + $lineitemData;
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
return $result;
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
}
|
app/code/local/Mss/Twocheckout/controllers/NotificationController.php
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Craig_Tco_NotificationController extends Mage_Core_Controller_Front_Action {
|
| 23 |
+
|
| 24 |
+
public function indexAction() {
|
| 25 |
+
if (!$this->getRequest()->isPost()) {
|
| 26 |
+
return;
|
| 27 |
+
$insMessage = $this->getRequest()->getPost();
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
public function insAction() {
|
| 33 |
+
$insMessage = $this->getRequest()->getPost();
|
| 34 |
+
foreach ($_REQUEST as $k => $v) {
|
| 35 |
+
$v = htmlspecialchars($v);
|
| 36 |
+
$v = stripslashes($v);
|
| 37 |
+
$insMessage[$k] = $v;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
$order = Mage::getModel('sales/order');
|
| 41 |
+
$order->loadByIncrementId($insMessage['vendor_order_id']);
|
| 42 |
+
$invoice_on_fraud = Mage::getStoreConfig('payment/tco/invoice_on_fraud');
|
| 43 |
+
$invoice_on_order = Mage::getStoreConfig('payment/tco/invoice_on_order');
|
| 44 |
+
$hashSecretWord = Mage::getStoreConfig('payment/tco/secret_word');
|
| 45 |
+
$hashSid = $insMessage['vendor_id'];
|
| 46 |
+
$hashOrder = $insMessage['sale_id'];
|
| 47 |
+
$hashInvoice = $insMessage['invoice_id'];
|
| 48 |
+
$StringToHash = strtoupper(md5($hashOrder . $hashSid . $hashInvoice . $hashSecretWord));
|
| 49 |
+
|
| 50 |
+
if ($StringToHash != $insMessage['md5_hash'] && number_format($order->getGrandTotal(), 2, '.', '') != $insMessage['invoice_list_amount']) {
|
| 51 |
+
$order->addStatusHistoryComment('Hash or total did not match!');
|
| 52 |
+
$order->save();
|
| 53 |
+
die('Hash Incorrect');
|
| 54 |
+
} else {
|
| 55 |
+
if ($insMessage['message_type'] == 'FRAUD_STATUS_CHANGED') {
|
| 56 |
+
if ($insMessage['fraud_status'] == 'fail') {
|
| 57 |
+
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true)->addStatusHistoryComment('Order failed fraud review.')->save();
|
| 58 |
+
} else if ($insMessage['fraud_status'] == 'pass') {
|
| 59 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->addStatusHistoryComment('Order passed fraud review.')->save();
|
| 60 |
+
if ($invoice_on_fraud == '1') {
|
| 61 |
+
try {
|
| 62 |
+
if(!$order->canInvoice()) {
|
| 63 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));
|
| 64 |
+
}
|
| 65 |
+
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
| 66 |
+
if (!$invoice->getTotalQty()) {
|
| 67 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
|
| 68 |
+
}
|
| 69 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 70 |
+
$invoice->register();
|
| 71 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
| 72 |
+
->addObject($invoice)
|
| 73 |
+
->addObject($invoice->getOrder());
|
| 74 |
+
$transactionSave->save();
|
| 75 |
+
} catch (Mage_Core_Exception $e) {
|
| 76 |
+
echo $e;
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
} else if ($insMessage['fraud_status'] == 'wait') {
|
| 80 |
+
$order->addStatusHistoryComment('Order undergoing additional fraud investigation.');
|
| 81 |
+
$order->save();
|
| 82 |
+
}
|
| 83 |
+
} else if ($insMessage['message_type'] == 'ORDER_CREATED') {
|
| 84 |
+
if ($invoice_on_order == '1') {
|
| 85 |
+
try {
|
| 86 |
+
if(!$order->canInvoice()) {
|
| 87 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));
|
| 88 |
+
}
|
| 89 |
+
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
| 90 |
+
if (!$invoice->getTotalQty()) {
|
| 91 |
+
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
| 95 |
+
$invoice->register();
|
| 96 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
| 97 |
+
->addObject($invoice)
|
| 98 |
+
->addObject($invoice->getOrder());
|
| 99 |
+
$transactionSave->save();
|
| 100 |
+
} catch (Mage_Core_Exception $e) {
|
| 101 |
+
echo $e;
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
?>
|
app/code/local/Mss/Twocheckout/controllers/RedirectController.php
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
class Craig_Tco_RedirectController extends Mage_Core_Controller_Front_Action {
|
| 23 |
+
|
| 24 |
+
public function getCheckout() {
|
| 25 |
+
return Mage::getSingleton('checkout/session');
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
protected $order;
|
| 29 |
+
|
| 30 |
+
protected function _expireAjax() {
|
| 31 |
+
if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {
|
| 32 |
+
$this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');
|
| 33 |
+
exit;
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
public function indexAction() {
|
| 38 |
+
$this->loadLayout();
|
| 39 |
+
$block = $this->getLayout()->createBlock('tco/redirect');
|
| 40 |
+
$this->getLayout()->getBlock('content')->append($block);
|
| 41 |
+
$this->renderLayout();
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
public function successAction() {
|
| 45 |
+
$post = $this->getRequest()->getPost();
|
| 46 |
+
foreach ($_REQUEST as $k => $v) {
|
| 47 |
+
$v = htmlspecialchars($v);
|
| 48 |
+
$v = stripslashes($v);
|
| 49 |
+
$post[$k] = $v;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
$session = Mage::getSingleton('checkout/session');
|
| 53 |
+
$session->setQuoteId($post['merchant_order_id']);
|
| 54 |
+
Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();
|
| 55 |
+
$order = Mage::getModel('sales/order');
|
| 56 |
+
$order->loadByIncrementId($session->getLastRealOrderId());
|
| 57 |
+
$hashSecretWord = Mage::getStoreConfig('payment/tco/secret_word');
|
| 58 |
+
$hashSid = Mage::getStoreConfig('payment/tco/sid');
|
| 59 |
+
$hashTotal = number_format($order->getGrandTotal(), 2, '.', '');
|
| 60 |
+
|
| 61 |
+
if (Mage::getStoreConfig('payment/tco/demo') == '1') {
|
| 62 |
+
$hashOrder = '1';
|
| 63 |
+
} else {
|
| 64 |
+
$hashOrder = $post['order_number'];
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
$StringToHash = strtoupper(md5($hashSecretWord . $hashSid . $hashOrder . $hashTotal));
|
| 68 |
+
|
| 69 |
+
if ($StringToHash == $post['key']) {
|
| 70 |
+
$this->_redirect('checkout/onepage/success');
|
| 71 |
+
$order->sendNewOrderEmail();
|
| 72 |
+
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true)->save();
|
| 73 |
+
$order->setData('ext_order_id',$post['order_number'] );
|
| 74 |
+
$order->save();
|
| 75 |
+
} else {
|
| 76 |
+
$this->_redirect('checkout/onepage/success');
|
| 77 |
+
$order->addStatusHistoryComment($hashTotal);
|
| 78 |
+
$order->addStatusHistoryComment('Hash did not match, check secret word.');
|
| 79 |
+
$order->save();
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
public function cartAction() {
|
| 84 |
+
$session = Mage::getSingleton('checkout/session');
|
| 85 |
+
if ($session->getLastRealOrderId()) {
|
| 86 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($session->getLastRealOrderId());
|
| 87 |
+
if ($order->getId()) {
|
| 88 |
+
$order->cancel()->save();
|
| 89 |
+
}
|
| 90 |
+
$quote = Mage::getModel('sales/quote')->load($order->getQuoteId());
|
| 91 |
+
$quote->setIsActive(true)->save();
|
| 92 |
+
}
|
| 93 |
+
$this->_redirect('checkout/cart');
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
}
|
app/code/local/Mss/Twocheckout/etc/config.xml
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Mss_Twocheckout>
|
| 5 |
+
<version>2.4.4</version>
|
| 6 |
+
</Mss_Twocheckout>
|
| 7 |
+
</modules>
|
| 8 |
+
<global>
|
| 9 |
+
<models>
|
| 10 |
+
<twocheckout>
|
| 11 |
+
<class>Mss_Twocheckout_Model</class>
|
| 12 |
+
</twocheckout>
|
| 13 |
+
</models>
|
| 14 |
+
<helpers>
|
| 15 |
+
<twocheckout>
|
| 16 |
+
<class>Mss_Twocheckout_Helper</class>
|
| 17 |
+
</twocheckout>
|
| 18 |
+
</helpers>
|
| 19 |
+
<blocks>
|
| 20 |
+
<twocheckout>
|
| 21 |
+
<class>Mss_Twocheckout_Block</class>
|
| 22 |
+
</twocheckout>
|
| 23 |
+
</blocks>
|
| 24 |
+
<resources>
|
| 25 |
+
<twocheckout_setup>
|
| 26 |
+
<setup>
|
| 27 |
+
<module>Mss_Twocheckout</module>
|
| 28 |
+
</setup>
|
| 29 |
+
<connection>
|
| 30 |
+
<use>directory_setup</use>
|
| 31 |
+
</connection>
|
| 32 |
+
</twocheckout_setup>
|
| 33 |
+
<twocheckout_write>
|
| 34 |
+
<connection>
|
| 35 |
+
<use>local_write</use>
|
| 36 |
+
</connection>
|
| 37 |
+
</twocheckout_write>
|
| 38 |
+
<twocheckout_read>
|
| 39 |
+
<connection>
|
| 40 |
+
<use>local_read</use>
|
| 41 |
+
</connection>
|
| 42 |
+
</twocheckout_read>
|
| 43 |
+
</resources>
|
| 44 |
+
<events>
|
| 45 |
+
<controller_action_postdispatch_checkout_onepage_saveOrder>
|
| 46 |
+
<observers>
|
| 47 |
+
<output_twocheckout_redirect>
|
| 48 |
+
<type>singleton</type>
|
| 49 |
+
<class>Mss_Twocheckout_Model_Observer</class>
|
| 50 |
+
<method>output_mss_twocheckout</method>
|
| 51 |
+
</output_twocheckout_redirect>
|
| 52 |
+
</observers>
|
| 53 |
+
</controller_action_postdispatch_checkout_onepage_saveOrder>
|
| 54 |
+
<sales_order_creditmemo_refund>
|
| 55 |
+
<observers>
|
| 56 |
+
<issue_creditmemo_refund>
|
| 57 |
+
<type>singleton</type>
|
| 58 |
+
<class>Mss_Twocheckout_Model_Observer</class>
|
| 59 |
+
<method>issue_creditmemo_refund</method>
|
| 60 |
+
</issue_creditmemo_refund>
|
| 61 |
+
</observers>
|
| 62 |
+
</sales_order_creditmemo_refund>
|
| 63 |
+
</events>
|
| 64 |
+
</global>
|
| 65 |
+
<frontend>
|
| 66 |
+
<layout>
|
| 67 |
+
<updates>
|
| 68 |
+
<twocheckout>
|
| 69 |
+
<file>twocheckout.xml</file>
|
| 70 |
+
</twocheckout>
|
| 71 |
+
</updates>
|
| 72 |
+
</layout>
|
| 73 |
+
<routers>
|
| 74 |
+
<twocheckout>
|
| 75 |
+
<use>standard</use>
|
| 76 |
+
<args>
|
| 77 |
+
<module>Mss_Twocheckout</module>
|
| 78 |
+
<frontName>twocheckout</frontName>
|
| 79 |
+
</args>
|
| 80 |
+
</twocheckout>
|
| 81 |
+
</routers>
|
| 82 |
+
<secure_url>
|
| 83 |
+
<twocheckout_redirect>/twocheckout/redirect/</twocheckout_redirect>
|
| 84 |
+
</secure_url>
|
| 85 |
+
</frontend>
|
| 86 |
+
<!-- <default>
|
| 87 |
+
<payment>
|
| 88 |
+
<twocheckout>
|
| 89 |
+
<twocheckout_active>1</twocheckout_active>
|
| 90 |
+
<twocheckout_submit_url>1</twocheckout_submit_url>
|
| 91 |
+
<model>twocheckout/checkout</twocheckout_model>
|
| 92 |
+
<twocheckout_title>2Checkout (Visa, MasterCard, Amex, Discover, JCB, Diners Club, Debit Card, PayPal)
|
| 93 |
+
</twocheckout_title>
|
| 94 |
+
<twocheckout_sid>Enter 2Checkout Account Number</twocheckout_sid>
|
| 95 |
+
<twocheckout_secret_word>Enter your Secret Word</twocheckout_secret_word>
|
| 96 |
+
<twocheckout_submit_url>1</twocheckout_submit_url>
|
| 97 |
+
<twocheckout_demo>0</twocheckout_demo>
|
| 98 |
+
<twocheckout_sort_order>1</twocheckout_sort_order>
|
| 99 |
+
</twocheckout>
|
| 100 |
+
</payment>
|
| 101 |
+
</default> -->
|
| 102 |
+
</config>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Mss_Connector</name>
|
| 4 |
-
<version>2.5.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv1.0</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -9,13 +9,16 @@
|
|
| 9 |
<summary>Mobile Multi store app for Android and Iphone</summary>
|
| 10 |
<description>Mobile Multi store app for Android and Iphone</description>
|
| 11 |
<notes>Fixes:- 
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
<authors><author><name>mss</name><user>mss</user><email>mss.yogendra@gmail.com</email></author></authors>
|
| 16 |
-
<date>2016-11-
|
| 17 |
-
<time>
|
| 18 |
-
<contents><target name="magelocal"><dir name="Mss"><dir name="Bannersliderapp"><dir name="Block"><dir name="Adminhtml"><dir name="Bannersliderapp"><dir name="Edit"><file name="Form.php" hash="c55bbba3b00c98a068bec9b9b12c4a40"/><dir name="Tab"><file name="Form.php" hash="486798bdd6429c53886bd15fb0fcf12b"/></dir><file name="Tabs.php" hash="ec6e540fda2b39feedc0a4c1192a3c7d"/></dir><file name="Edit.php" hash="010f4999a1ddc53e411562d83c3ad3f8"/><file name="Grid.php" hash="28c70476bdd3d44aa2cac9dc9f423ebb"/><dir name="Helper"><file name="Image.php" hash="d2ce47b0d7ab6ef5c31d0989fcc05f78"/></dir></dir><file name="Grid.php" hash="9c86bf7a2daa24e9416ff254396b2aa0"/><dir name="Renderer"><file name="Image.php" hash="0a9b4358a9409e7933e96c1eb157717e"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="db48c09c76d16ad7c094d32224329276"/></dir><dir name="Model"><file name="Bannersliderapp.php" hash="61f481ac93c5c494889d5ea7cb306bc0"/><dir name="Mysql4"><dir name="Bannersliderapp"><file name="Collection.php" hash="5d6543bbf3dee4d17b73244dbd0f843f"/></dir><file name="Bannersliderapp.php" hash="e000805a295e083e81f7163df7b92197"/></dir><file name="Observer.php" hash="65004e950e366b77a2cd1cb177d0f1ab"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannersliderappController.php" hash="6f9f94fd96e35225ed3bd8fdf7a3dc22"/></dir><file name="BannerController.php" hash="f20def146a84a727835d9cc827702367"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dab3fdde55b6523faadc3fad70702c28"/><file name="config.xml" hash="1b31db628fae02e58e48c0e961351c2a"/></dir><dir name="sql"><dir name="bannersliderapp_setup"><file name="mysql4-install-0.1.1.php" hash="bbc6f32eb101c83a52cdef67c8b6a806"/></dir></dir></dir><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="6f24014b5a24a4f56410e9754b8aa2d5"/><file name="Support.php" hash="d120e7f8945a01d791d0f3d2c32dcfcf"/></dir><dir name="System"><dir name="Config"><file name="About.php" hash="2e9dc040ee2d42a57d5c9411f0b999e4"/><file name="Authorizenet.php" hash="ed644e9814fef74147bdddf24cfd75c1"/><file name="Banktransfer.php" hash="77f6ebf2074462cdadf4bccbe2f0d19a"/><file name="Checkmo.php" hash="edfc0fc0b233cd349392e563eeac57ed"/><file name="Cod.php" hash="37d1757764340fd02b8be7ac32434967"/><file name="Mpaypal.php" hash="e69d6a2d58618cf741d4cf503ede70ca"/><file name="Payu.php" hash="d0307013bdf58700a29aa7838ee94e51"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2b2b667df63e7cd32c974d21620c6a91"/></dir><dir name="Model"><file name="Connector.php" hash="e9a927bc0a5974d092ab3af257ee7607"/><dir name="Mysql4"><dir name="Connector"><file name="Collection.php" hash="1f3bb37f160abdf974859f7419a19b65"/></dir><file name="Connector.php" hash="185189264d3275af813349e721ee46fb"/></dir><file name="Observer.php" hash="e6dacba5f08eaa4d02434ed50509ee8e"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SupportController.php" hash="0f5afef5730673f0145cd5c8bbf1ed77"/></dir><file name="CartController.php" hash="1d72a22b74e7bf4ccdaef1b697ca8086"/><file name="CreditController.php" hash="a489dd0ed95914fb2b58491410f6f92f"/><file name="CustomerController.php" hash="5d2cd6f582560e777ad55f3d8e82038f"/><file name="FeedbackController.php" hash="2b9e092984c0c64397cd25fe1d2266d5"/><file name="IndexController.php" hash="097b645c1cd1ec9c2e9a93d74af3c172"/><file name="ItemsController.php" hash="03aeb9fceec3173e1aa678e03582b226"/><file name="ProductsController.php" hash="c0d8d3ee1b8fd1c31b9fc439a74d3314"/><file name="StaticpagesController.php" hash="86bfe2d07268507d60c4ee3c8834de08"/><file name="StoreinfoController.php" hash="c7600983d865fe529e020344e485cbed"/><file name="TokenController.php" hash="30e09062bb6f613c2ec3167da27cd571"/><file name="WishlistController.php" hash="082445ed48fde71569305aba02177337"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dace418dcc6eee76831169b5c70176e7"/><file name="config.xml" hash="fefe81a8e5d9f1414b57f13afbfc1e68"/><file name="system.xml" hash="09be5e92b65afa6e91d062b3f7082e57"/></dir><dir name="sql"><dir name="connector_setup"><file name="mysql4-install-0.1.0.php" hash="4325ba30b21f9680b11d4b124b9e8181"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="eaa00e880b38ba41580b67785b33ed10"/></dir></dir></dir><dir name="Mpaypal"><dir name="Helper"><file name="Data.php" hash="c3ba57e7cc86210346b1b3f279083c0f"/></dir><dir name="Model"><file name="Mpaypal.php" hash="f49b32aad7d7bed49333534139fd07b7"/><file name="Observer.php" hash="4b92aaf547f0b080d8495cf064574d10"/></dir><dir name="controllers"><file name="IndexController.php" hash="c12439366cff0f0d0813543a2fd90f7f"/></dir><dir name="etc"><file name="config.xml" hash="9ed76ff53b5e0232b4ea442a7e046b14"/><file name="system.xml" hash="2f51ad686858a69e07e8c21baf5d690e"/></dir></dir><dir name="Payu"><dir name="Block"><file name="Index.php" hash="f6a324c1ac4b0c1dcfac775c51c2a34c"/></dir><dir name="Helper"><file name="Data.php" hash="7800e0e58258b78d0f23a7fec482d120"/></dir><dir name="controllers"><file name="IndexController.php" hash="46ec9fef2d62fa7c4e67f937f40685af"/></dir><dir name="etc"><file name="config.xml" hash="c6867fb0cc7efdde39c32a3ecbf62433"/></dir></dir><dir name="Pushnotification"><dir name="Block"><dir name="Adminhtml"><file name="Pushnotificationbackend.php" hash="6b9e143ee7b5fe4fc2642eee977b44bf"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d84a29d3aa0fb6655300cab13a70f0cd"/></dir><dir name="Model"><dir name="Entity"><file name="Resource.php" hash="93b6a261762541433fa601aefb60d0a7"/></dir><dir name="Mysql4"><dir name="Pushnotification"><file name="Collection.php" hash="392612adedcb14ec5dcaaa4ea9858091"/></dir><file name="Pushnotification.php" hash="77f6cadb7682377a1de6b275310c1cf6"/></dir><file name="Pushnotification.php" hash="ad5fe0f74049c61402ff99fc32d8164a"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="File.php" hash="d7c74e49b78bb9da3453bd5f414a445f"/><file name="Image.php" hash="e1d98dbf511fe16581b37a8b7b43f5b4"/><file name="Iosmode.php" hash="ff1794ef4844019b7af64192fbd4e122"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="PushnotificationbackendController.php" hash="ec4ebd0ad1cfee78d2e67a69698a14e5"/></dir></dir><dir name="etc"><file name="config.xml" hash="daafb506dc1ed6bd54d8f8049e2e9595"/><file name="system.xml" hash="23a622dec8250a355bbaed9e83f1f82d"/></dir><dir name="sql"><dir name="pushnotification_setup"><file name="mysql4-install-0.1.0.php" hash="418e997bb72afa725389593d4ca2f111"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="e5939f147e797d9d8b7a9643f8cda7d8"/></dir></dir></dir><dir name="Sociallogin"><dir name="Helper"><file name="Data.php" hash="8965f0b6a0127d0965d99987aa0a300c"/></dir><dir name="Model"><dir name="Mysql4"><file name="Sociallogin.php" hash="b881bc47c5ee70b1c4c02b59501ffbc5"/></dir><file name="Sociallogin.php" hash="0ba90dadb0f34528c2296704c5cea233"/></dir><dir name="etc"><file name="config.xml" hash="eac1dc2364bc283a9cd5326eb7e852a9"/></dir><dir name="sql"><dir name="sociallogin_setup"><file name="mysql4-install-0.1.0.php" hash="163332cb130dae297af332cbefde58f3"/></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="pushnotification"><file name="pushnotificationbackend.phtml" hash="138add7171fdd7fb326abc4a4f9dbe5a"/></dir><dir name="connector"><file name="landing.phtml" hash="6efda7cca18e7bc62ce40c9f25a9510b"/><file name="notification.phtml" hash="164e5f9e7dcfc5c2d2451f0e77776d77"/><file name="support.phtml" hash="7c799c058795eafbf96239e16e3326ca"/></dir></dir><dir name="layout"><file name="bannersliderapp.xml" hash="f18034448b9f74646c870a23bfc0b6fd"/><file name="pushnotification.xml" hash="f7fd974e63c4c7eb5ffac7b059470946"/><file name="connector.xml" hash="003166428e55a52301f71826a37f8283"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payu.xml" hash="473595488f536cb588c5588a744915a3"/><file name="mpaypal.xml" hash="7b75c5bed6f3142c8bc9e4c1233bf1e9"/></dir><dir name="template"><dir name="payu"><file name="index.phtml" hash="5f9e2dfb00a991707e31a00b39cfebef"/><file name="test.phtml" hash="da4701ff5b2c64444a49f77571e8a00c"/></dir><dir name="mpaypal"><file name="index.phtml" hash="df077c063b2006b9321c96cd6744b19f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Mss_Bannersliderapp.xml" hash="de3e077185056246492c3a2ff01a531f"/><file name="Mss_Connector.xml" hash="ba8a5609c9c8c3636f183c5bfe04d664"/><file name="Mss_Payu.xml" hash="5feac03d698b481473223fbe6a8814b1"/><file name="Mss_Pushnotification.xml" hash="2e8e9bc56a5f0ff8bb42f43fb5a3a3db"/><file name="Mss_Sociallogin.xml" hash="8671199bdad3bdecbfe0c47ce9ff05e6"/><file name="Mss_Mpaypal.xml" hash="4d6a7f8d862de8c449b1366727ef0a6d"/></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="magentomobileshop"><file name="magento_logo.png" hash="d1800a3c95de49500f158bfb6ca9c70c"/><file name="magentomobileshop_loader.gif" hash="453272c9cacd32efe6465961ea8a61dd"/></dir></dir></dir></dir></dir></dir></target></contents>
|
| 19 |
<compatible/>
|
| 20 |
<dependencies><required><php><min>5.3.0</min><max>7.0.5</max></php></required></dependencies>
|
| 21 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Mss_Connector</name>
|
| 4 |
+
<version>2.5.1</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv1.0</license>
|
| 7 |
<channel>community</channel>
|
| 9 |
<summary>Mobile Multi store app for Android and Iphone</summary>
|
| 10 |
<description>Mobile Multi store app for Android and Iphone</description>
|
| 11 |
<notes>Fixes:- 
|
| 12 |
+
Static page images issue fixed.
|
| 13 |
+
Some minior fixes.
|
| 14 |
+
Feature:-
|
| 15 |
+
Implement Tier price feature.
|
| 16 |
+
Shipping on the base of country id.
|
| 17 |
+
</notes>
|
| 18 |
<authors><author><name>mss</name><user>mss</user><email>mss.yogendra@gmail.com</email></author></authors>
|
| 19 |
+
<date>2016-11-19</date>
|
| 20 |
+
<time>13:08:06</time>
|
| 21 |
+
<contents><target name="magelocal"><dir name="Mss"><dir name="Bannersliderapp"><dir name="Block"><dir name="Adminhtml"><dir name="Bannersliderapp"><dir name="Edit"><file name="Form.php" hash="c55bbba3b00c98a068bec9b9b12c4a40"/><dir name="Tab"><file name="Form.php" hash="486798bdd6429c53886bd15fb0fcf12b"/></dir><file name="Tabs.php" hash="ec6e540fda2b39feedc0a4c1192a3c7d"/></dir><file name="Edit.php" hash="010f4999a1ddc53e411562d83c3ad3f8"/><file name="Grid.php" hash="28c70476bdd3d44aa2cac9dc9f423ebb"/><dir name="Helper"><file name="Image.php" hash="d2ce47b0d7ab6ef5c31d0989fcc05f78"/></dir></dir><file name="Grid.php" hash="9c86bf7a2daa24e9416ff254396b2aa0"/><dir name="Renderer"><file name="Image.php" hash="0a9b4358a9409e7933e96c1eb157717e"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="db48c09c76d16ad7c094d32224329276"/></dir><dir name="Model"><file name="Bannersliderapp.php" hash="61f481ac93c5c494889d5ea7cb306bc0"/><dir name="Mysql4"><dir name="Bannersliderapp"><file name="Collection.php" hash="5d6543bbf3dee4d17b73244dbd0f843f"/></dir><file name="Bannersliderapp.php" hash="e000805a295e083e81f7163df7b92197"/></dir><file name="Observer.php" hash="65004e950e366b77a2cd1cb177d0f1ab"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="BannersliderappController.php" hash="6f9f94fd96e35225ed3bd8fdf7a3dc22"/></dir><file name="BannerController.php" hash="f20def146a84a727835d9cc827702367"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dab3fdde55b6523faadc3fad70702c28"/><file name="config.xml" hash="1b31db628fae02e58e48c0e961351c2a"/></dir><dir name="sql"><dir name="bannersliderapp_setup"><file name="mysql4-install-0.1.1.php" hash="bbc6f32eb101c83a52cdef67c8b6a806"/></dir></dir></dir><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="6f24014b5a24a4f56410e9754b8aa2d5"/><file name="Support.php" hash="d120e7f8945a01d791d0f3d2c32dcfcf"/></dir><dir name="System"><dir name="Config"><file name="About.php" hash="2e9dc040ee2d42a57d5c9411f0b999e4"/><file name="Authorizenet.php" hash="ed644e9814fef74147bdddf24cfd75c1"/><file name="Banktransfer.php" hash="77f6ebf2074462cdadf4bccbe2f0d19a"/><file name="Checkmo.php" hash="edfc0fc0b233cd349392e563eeac57ed"/><file name="Cod.php" hash="37d1757764340fd02b8be7ac32434967"/><file name="Mpaypal.php" hash="e69d6a2d58618cf741d4cf503ede70ca"/><file name="Payu.php" hash="d0307013bdf58700a29aa7838ee94e51"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="2b2b667df63e7cd32c974d21620c6a91"/></dir><dir name="Model"><file name="Connector.php" hash="e9a927bc0a5974d092ab3af257ee7607"/><dir name="Mysql4"><dir name="Connector"><file name="Collection.php" hash="1f3bb37f160abdf974859f7419a19b65"/></dir><file name="Connector.php" hash="185189264d3275af813349e721ee46fb"/></dir><file name="Observer.php" hash="e6dacba5f08eaa4d02434ed50509ee8e"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SupportController.php" hash="0f5afef5730673f0145cd5c8bbf1ed77"/></dir><file name="CartController.php" hash="e1f4e59624f3047712fe23969b9c04df"/><file name="CreditController.php" hash="a489dd0ed95914fb2b58491410f6f92f"/><file name="CustomerController.php" hash="5d2cd6f582560e777ad55f3d8e82038f"/><file name="FeedbackController.php" hash="2b9e092984c0c64397cd25fe1d2266d5"/><file name="IndexController.php" hash="097b645c1cd1ec9c2e9a93d74af3c172"/><file name="ItemsController.php" hash="03aeb9fceec3173e1aa678e03582b226"/><file name="ProductsController.php" hash="2f5accecae640a77426e082b41d644b0"/><file name="StaticpagesController.php" hash="9931b8663599c304c3b4517d6fdff55b"/><file name="StoreinfoController.php" hash="c7600983d865fe529e020344e485cbed"/><file name="TokenController.php" hash="30e09062bb6f613c2ec3167da27cd571"/><file name="WishlistController.php" hash="082445ed48fde71569305aba02177337"/></dir><dir name="etc"><file name="adminhtml.xml" hash="dace418dcc6eee76831169b5c70176e7"/><file name="config.xml" hash="4799485f5520a1c0828da629c09a793f"/><file name="system.xml" hash="09be5e92b65afa6e91d062b3f7082e57"/></dir><dir name="sql"><dir name="connector_setup"><file name="mysql4-install-0.1.0.php" hash="4325ba30b21f9680b11d4b124b9e8181"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="eaa00e880b38ba41580b67785b33ed10"/></dir></dir></dir><dir name="Mpaypal"><dir name="Helper"><file name="Data.php" hash="c3ba57e7cc86210346b1b3f279083c0f"/></dir><dir name="Model"><file name="Mpaypal.php" hash="f49b32aad7d7bed49333534139fd07b7"/><file name="Observer.php" hash="4b92aaf547f0b080d8495cf064574d10"/></dir><dir name="controllers"><file name="IndexController.php" hash="c12439366cff0f0d0813543a2fd90f7f"/></dir><dir name="etc"><file name="config.xml" hash="9ed76ff53b5e0232b4ea442a7e046b14"/><file name="system.xml" hash="2f51ad686858a69e07e8c21baf5d690e"/></dir></dir><dir name="Payu"><dir name="Block"><file name="Index.php" hash="f6a324c1ac4b0c1dcfac775c51c2a34c"/></dir><dir name="Helper"><file name="Data.php" hash="7800e0e58258b78d0f23a7fec482d120"/></dir><dir name="controllers"><file name="IndexController.php" hash="46ec9fef2d62fa7c4e67f937f40685af"/></dir><dir name="etc"><file name="config.xml" hash="c6867fb0cc7efdde39c32a3ecbf62433"/></dir></dir><dir name="Pushnotification"><dir name="Block"><dir name="Adminhtml"><file name="Pushnotificationbackend.php" hash="6b9e143ee7b5fe4fc2642eee977b44bf"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d84a29d3aa0fb6655300cab13a70f0cd"/></dir><dir name="Model"><dir name="Entity"><file name="Resource.php" hash="93b6a261762541433fa601aefb60d0a7"/></dir><dir name="Mysql4"><dir name="Pushnotification"><file name="Collection.php" hash="392612adedcb14ec5dcaaa4ea9858091"/></dir><file name="Pushnotification.php" hash="77f6cadb7682377a1de6b275310c1cf6"/></dir><file name="Pushnotification.php" hash="ad5fe0f74049c61402ff99fc32d8164a"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="File.php" hash="d7c74e49b78bb9da3453bd5f414a445f"/><file name="Image.php" hash="e1d98dbf511fe16581b37a8b7b43f5b4"/><file name="Iosmode.php" hash="ff1794ef4844019b7af64192fbd4e122"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="PushnotificationbackendController.php" hash="ec4ebd0ad1cfee78d2e67a69698a14e5"/></dir></dir><dir name="etc"><file name="config.xml" hash="daafb506dc1ed6bd54d8f8049e2e9595"/><file name="system.xml" hash="23a622dec8250a355bbaed9e83f1f82d"/></dir><dir name="sql"><dir name="pushnotification_setup"><file name="mysql4-install-0.1.0.php" hash="418e997bb72afa725389593d4ca2f111"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="e5939f147e797d9d8b7a9643f8cda7d8"/></dir></dir></dir><dir name="Sociallogin"><dir name="Helper"><file name="Data.php" hash="8965f0b6a0127d0965d99987aa0a300c"/></dir><dir name="Model"><dir name="Mysql4"><file name="Sociallogin.php" hash="b881bc47c5ee70b1c4c02b59501ffbc5"/></dir><file name="Sociallogin.php" hash="0ba90dadb0f34528c2296704c5cea233"/></dir><dir name="etc"><file name="config.xml" hash="eac1dc2364bc283a9cd5326eb7e852a9"/></dir><dir name="sql"><dir name="sociallogin_setup"><file name="mysql4-install-0.1.0.php" hash="163332cb130dae297af332cbefde58f3"/></dir></dir></dir><dir name="Twocheckout"><dir name="Block"><file name="Form.php" hash="b552018543f57090c42784d939004dd4"/><file name="Form.php@@" hash="21ceeab9ffedd1d35f399b053218ade8"/><file name="Iframe.php" hash="c8a410448492f2722d8f9891d8470ef7"/><file name="Info.php" hash="ceb4ec03e4de3e4f1dafaf5d7da9b982"/><file name="Redirect.php" hash="3e14d21923564ffebbda371461904895"/></dir><dir name="Helper"><file name="Data.php" hash="de7680011db7d6821c1f68d70a8fa684"/></dir><dir name="Model"><file name="Checkout.php" hash="9471947098baeba75bc1a6c285e2842d"/><file name="Observer.php" hash="ec961a9b67110ae344d6a3fc0165748c"/><file name="Twocheckout.php" hash="6001c873587a81d9f8b7d4e36e860b63"/></dir><dir name="controllers"><file name="NotificationController.php" hash="5bf12db9cfc0719deea1f82dfe3fe1a2"/><file name="RedirectController.php" hash="116f9d6b3a5bf6386a00486ccfabdb63"/></dir><dir name="etc"><file name="config.xml" hash="3b319f9ce10e4df17d046ae0521b5b1c"/></dir></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="pushnotification"><file name="pushnotificationbackend.phtml" hash="138add7171fdd7fb326abc4a4f9dbe5a"/></dir><dir name="connector"><file name="landing.phtml" hash="6efda7cca18e7bc62ce40c9f25a9510b"/><file name="notification.phtml" hash="164e5f9e7dcfc5c2d2451f0e77776d77"/><file name="support.phtml" hash="7c799c058795eafbf96239e16e3326ca"/></dir></dir><dir name="layout"><file name="bannersliderapp.xml" hash="f18034448b9f74646c870a23bfc0b6fd"/><file name="pushnotification.xml" hash="f7fd974e63c4c7eb5ffac7b059470946"/><file name="connector.xml" hash="003166428e55a52301f71826a37f8283"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="payu.xml" hash="473595488f536cb588c5588a744915a3"/><file name="mpaypal.xml" hash="7b75c5bed6f3142c8bc9e4c1233bf1e9"/></dir><dir name="template"><dir name="payu"><file name="index.phtml" hash="5f9e2dfb00a991707e31a00b39cfebef"/><file name="test.phtml" hash="da4701ff5b2c64444a49f77571e8a00c"/></dir><dir name="mpaypal"><file name="index.phtml" hash="df077c063b2006b9321c96cd6744b19f"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Mss_Bannersliderapp.xml" hash="de3e077185056246492c3a2ff01a531f"/><file name="Mss_Connector.xml" hash="ba8a5609c9c8c3636f183c5bfe04d664"/><file name="Mss_Payu.xml" hash="5feac03d698b481473223fbe6a8814b1"/><file name="Mss_Pushnotification.xml" hash="2e8e9bc56a5f0ff8bb42f43fb5a3a3db"/><file name="Mss_Sociallogin.xml" hash="8671199bdad3bdecbfe0c47ce9ff05e6"/><file name="Mss_Mpaypal.xml" hash="4d6a7f8d862de8c449b1366727ef0a6d"/></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><dir name="magentomobileshop"><file name="magento_logo.png" hash="d1800a3c95de49500f158bfb6ca9c70c"/><file name="magentomobileshop_loader.gif" hash="453272c9cacd32efe6465961ea8a61dd"/></dir></dir></dir></dir></dir></dir></target></contents>
|
| 22 |
<compatible/>
|
| 23 |
<dependencies><required><php><min>5.3.0</min><max>7.0.5</max></php></required></dependencies>
|
| 24 |
</package>
|
