Version Notes
Fixed Prelive URLS
Fixed Line item data decimal points
Fixed Eval vulnerability bug
Fixed failed transaction exception bug
Added dupe checking support
Download this release
Release Info
| Developer | Litle |
| Extension | Litle_Payments |
| Version | 8.15.6 |
| Comparing to | |
| See all releases | |
Code changes from version 8.15.5 to 8.15.6
- app/code/local/Litle/CreditCard/Block/Adminhtml/Orderview.php +29 -22
- app/code/local/Litle/CreditCard/Block/Form/CreditCard.php +3 -4
- app/code/local/Litle/CreditCard/Helper/Data.php +137 -43
- app/code/local/Litle/CreditCard/Model/Order/Payment.php +20 -2
- app/code/local/Litle/CreditCard/Model/PaymentLogic.php +19 -75
- app/code/local/Litle/CreditCard/Model/ValidateMerchantId.php +1 -2
- app/code/local/Litle/CreditCard/etc/config.xml +1 -1
- app/code/local/Litle/LEcheck/Model/PaymentLogic.php +7 -2
- app/code/local/Litle/LEcheck/etc/config.xml +1 -1
- app/code/local/Litle/LEcheck/etc/system.xml +1 -1
- app/code/local/Litle/LitleSDK/Communication.php +1 -1
- app/code/local/Litle/Palorus/Helper/Data.php +12 -13
- app/code/local/Litle/Palorus/etc/config.xml +1 -1
- package.xml +10 -5
app/code/local/Litle/CreditCard/Block/Adminhtml/Orderview.php
CHANGED
|
@@ -33,22 +33,28 @@ class Litle_CreditCard_Block_Adminhtml_Orderview extends Mage_Adminhtml_Block_Sa
|
|
| 33 |
|
| 34 |
public function __construct() {
|
| 35 |
parent::__construct();
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
$order = $this->getOrder();
|
| 39 |
if(Mage::helper("creditcard")->isMOPLitle($order->getPayment()))
|
| 40 |
{
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
// check if Void-Refund needs to be shown
|
| 51 |
-
|
| 52 |
{
|
| 53 |
$onclickJs = 'deleteConfirm(\''
|
| 54 |
. Mage::helper('sales')->__('Are you sure? The refund request will be canceled.')
|
|
@@ -60,13 +66,13 @@ class Litle_CreditCard_Block_Adminhtml_Orderview extends Mage_Adminhtml_Block_Sa
|
|
| 60 |
));
|
| 61 |
}
|
| 62 |
//check if void capture or void sale needs to be shown
|
| 63 |
-
|
| 64 |
-
$this->
|
| 65 |
{
|
| 66 |
$mop = $order->getPayment()->getData('method');
|
| 67 |
//check if paying with a credit card
|
| 68 |
-
if(Mage::helper("creditcard")->isMOPLitleCC($mop)){
|
| 69 |
-
|
| 70 |
. Mage::helper('sales')->__('Are you sure? If any previous partial captures were done on this order, or if capture was not done today then do a refund instead.')
|
| 71 |
. '\', \'' . $this->getVoidPaymentUrl() . '\');';
|
| 72 |
|
|
@@ -82,22 +88,23 @@ class Litle_CreditCard_Block_Adminhtml_Orderview extends Mage_Adminhtml_Block_Sa
|
|
| 82 |
. '\', \'' . $this->getVoidPaymentUrl() . '\');';
|
| 83 |
|
| 84 |
$this->_addButton('void_sale', array(
|
| 85 |
-
|
| 86 |
-
|
| 87 |
));
|
| 88 |
}
|
| 89 |
}
|
|
|
|
| 90 |
}
|
| 91 |
}
|
| 92 |
|
| 93 |
-
public function
|
| 94 |
{
|
| 95 |
$lastTxnId = $payment->getLastTransId();
|
| 96 |
$lastTxn = $payment->getTransaction($lastTxnId);
|
| 97 |
$timeOfLastTxn = $lastTxn->getData('created_at');
|
| 98 |
|
| 99 |
-
//check if last txn was less than
|
| 100 |
-
return ((time()-strtotime($timeOfLastTxn)) <
|
| 101 |
}
|
| 102 |
|
| 103 |
}
|
| 33 |
|
| 34 |
public function __construct() {
|
| 35 |
parent::__construct();
|
| 36 |
+
|
| 37 |
+
$order = $this->getOrder();
|
|
|
|
| 38 |
if(Mage::helper("creditcard")->isMOPLitle($order->getPayment()))
|
| 39 |
{
|
| 40 |
+
$authTransaction = $order->getPayment()->lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
| 41 |
+
// check if Auth-Reversal need to be shown
|
| 42 |
+
if (!(Mage::helper("creditcard")->isMOPLitleECheck($order->getPayment()->getData('method')))){
|
| 43 |
+
if($authTransaction && !$authTransaction->getIsClosed())
|
| 44 |
+
{
|
| 45 |
+
if ($order->getPayment()->getAmountPaid() == 0){
|
| 46 |
+
$message = 'Are you sure you want to reverse the authorization?';
|
| 47 |
+
$this->_updateButton('void_payment', 'label','Auth-Reversal');
|
| 48 |
+
$this->_updateButton('void_payment', 'onclick', "confirmSetLocation('{$message}', '{$this->getVoidPaymentUrl()}')");
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
else{
|
| 52 |
+
$this->removeButton('order_invoice');
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
// check if Void-Refund needs to be shown
|
| 57 |
+
if( Mage::helper("creditcard")->isStateOfOrderEqualTo($order, Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND))
|
| 58 |
{
|
| 59 |
$onclickJs = 'deleteConfirm(\''
|
| 60 |
. Mage::helper('sales')->__('Are you sure? The refund request will be canceled.')
|
| 66 |
));
|
| 67 |
}
|
| 68 |
//check if void capture or void sale needs to be shown
|
| 69 |
+
if(Mage::helper("creditcard")->isStateOfOrderEqualTo($order, Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE) &&
|
| 70 |
+
$this->wasLastTxnLessThan24HrsAgo($order->getPayment()))
|
| 71 |
{
|
| 72 |
$mop = $order->getPayment()->getData('method');
|
| 73 |
//check if paying with a credit card
|
| 74 |
+
if(Mage::helper("creditcard")->isMOPLitleCC($mop) || Mage::helper("creditcard")->isMOPLitlePaypal($mop)){
|
| 75 |
+
$onclickJs = 'deleteConfirm(\''
|
| 76 |
. Mage::helper('sales')->__('Are you sure? If any previous partial captures were done on this order, or if capture was not done today then do a refund instead.')
|
| 77 |
. '\', \'' . $this->getVoidPaymentUrl() . '\');';
|
| 78 |
|
| 88 |
. '\', \'' . $this->getVoidPaymentUrl() . '\');';
|
| 89 |
|
| 90 |
$this->_addButton('void_sale', array(
|
| 91 |
+
'label' => 'Void Sale',
|
| 92 |
+
'onclick' => $onclickJs,
|
| 93 |
));
|
| 94 |
}
|
| 95 |
}
|
| 96 |
+
|
| 97 |
}
|
| 98 |
}
|
| 99 |
|
| 100 |
+
public function wasLastTxnLessThan24HrsAgo(Varien_Object $payment)
|
| 101 |
{
|
| 102 |
$lastTxnId = $payment->getLastTransId();
|
| 103 |
$lastTxn = $payment->getTransaction($lastTxnId);
|
| 104 |
$timeOfLastTxn = $lastTxn->getData('created_at');
|
| 105 |
|
| 106 |
+
//check if last txn was less than 24 hrs ago (86400 seconds == 24 hrs)
|
| 107 |
+
return ((time()-strtotime($timeOfLastTxn)) < 86400);
|
| 108 |
}
|
| 109 |
|
| 110 |
}
|
app/code/local/Litle/CreditCard/Block/Form/CreditCard.php
CHANGED
|
@@ -59,9 +59,9 @@ class Litle_CreditCard_Block_Form_CreditCard extends Mage_Payment_Block_Form
|
|
| 59 |
|
| 60 |
public function getReportGroup()
|
| 61 |
{
|
| 62 |
-
$
|
| 63 |
-
$merchant_map = eval($string2Eval);
|
| 64 |
$reportGroup = $merchant_map[$this->getCurrency()];
|
|
|
|
| 65 |
return $reportGroup;
|
| 66 |
}
|
| 67 |
|
|
@@ -211,5 +211,4 @@ class Litle_CreditCard_Block_Form_CreditCard extends Mage_Payment_Block_Form
|
|
| 211 |
));
|
| 212 |
return parent::_toHtml();
|
| 213 |
}
|
| 214 |
-
}
|
| 215 |
-
|
| 59 |
|
| 60 |
public function getReportGroup()
|
| 61 |
{
|
| 62 |
+
$merchant_map = Mage::helper('creditcard')->parseMerchantIdMap($this->getMerchantIdMap());
|
|
|
|
| 63 |
$reportGroup = $merchant_map[$this->getCurrency()];
|
| 64 |
+
|
| 65 |
return $reportGroup;
|
| 66 |
}
|
| 67 |
|
| 211 |
));
|
| 212 |
return parent::_toHtml();
|
| 213 |
}
|
| 214 |
+
}
|
|
|
app/code/local/Litle/CreditCard/Helper/Data.php
CHANGED
|
@@ -1,47 +1,141 @@
|
|
| 1 |
<?php
|
| 2 |
class Litle_CreditCard_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
{
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 1 |
<?php
|
| 2 |
class Litle_CreditCard_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
{
|
| 4 |
+
public function isStateOfOrderEqualTo($order, $inOrderState){
|
| 5 |
+
$payment = $order->getPayment();
|
| 6 |
+
$lastTxnId = $payment->getLastTransId();
|
| 7 |
+
Mage::log("Last txn id test: " . $lastTxnId);
|
| 8 |
+
$lastTxn = $payment->getTransaction($lastTxnId);
|
| 9 |
+
|
| 10 |
+
if( $lastTxn != null && $lastTxn->getTxnType() === $inOrderState )
|
| 11 |
+
return true;
|
| 12 |
+
else
|
| 13 |
+
return false;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
// TODO:: Needs to be implemented.
|
| 17 |
+
public function isMOPLitleCC($mop){
|
| 18 |
+
return ($mop === "creditcard");
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
// TODO:: Needs to be implemented.
|
| 22 |
+
public function isMOPLitleECheck($mop){
|
| 23 |
+
return ($mop === "lecheck");
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
public function isMOPLitlePaypal($mop)
|
| 27 |
+
{
|
| 28 |
+
return ($mop === "lpaypal");
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
public function isMOPLitle($payment){
|
| 32 |
+
$mop = $payment->getData('method');
|
| 33 |
+
return ($this->isMOPLitleCC($mop) || $this->isMOPLitleECheck($mop) || $this->isMOPLitlePaypal($mop));
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
// This method converts dollars to cents, and takes care of trailing decimals if any.
|
| 37 |
+
public function formatAmount($amountInDecimal, $roundUp) {
|
| 38 |
+
|
| 39 |
+
return (Mage::app()->getStore()->roundPrice($amountInDecimal) * 100);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/**
|
| 43 |
+
* Are we using the sandbox?
|
| 44 |
+
*
|
| 45 |
+
* @return boolean
|
| 46 |
+
*/
|
| 47 |
+
public function isSandbox()
|
| 48 |
+
{
|
| 49 |
+
$url = Mage::getStoreConfig('payment/CreditCard/url');
|
| 50 |
+
return (stristr($url, '.testlitle.com/sandbox') !== false);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
public function writeFailedTransactionToDatabase($customerId, $orderId, $message, $xmlDocument, $txnType) {
|
| 54 |
+
$orderNumber = 0;
|
| 55 |
+
$isOrderIdNull = ($orderId === null) ? true : false;
|
| 56 |
+
if($orderId === null) {
|
| 57 |
+
$orderId = 0;
|
| 58 |
+
}
|
| 59 |
+
else {
|
| 60 |
+
$order = Mage::getModel("sales/order")->load($orderId);
|
| 61 |
+
$orderNumber = $order->getData("increment_id");
|
| 62 |
+
}
|
| 63 |
+
if($customerId === null) {
|
| 64 |
+
$customerId = 0;
|
| 65 |
+
}
|
| 66 |
+
$config = Mage::getResourceModel("sales/order")->getReadConnection()->getConfig();
|
| 67 |
+
$host = $config['host'];
|
| 68 |
+
$username = $config['username'];
|
| 69 |
+
$password = $config['password'];
|
| 70 |
+
$dbname = $config['dbname'];
|
| 71 |
+
|
| 72 |
+
$con = mysql_connect($host,$username,$password);
|
| 73 |
+
$fullXml = $xmlDocument->saveXML();
|
| 74 |
+
if (!$con)
|
| 75 |
+
{
|
| 76 |
+
Mage::log("Failed to write failed transaction to database. Transaction details: " . $fullXml, null, "litle_failed_transactions.log");
|
| 77 |
+
}
|
| 78 |
+
else {
|
| 79 |
+
$selectedDb = mysql_select_db($dbname, $con);
|
| 80 |
+
if(!$selectedDb) {
|
| 81 |
+
Mage::log("Can't use selected database " . $dbname, null, "litle.log");
|
| 82 |
+
}
|
| 83 |
+
$fullXml = mysql_real_escape_string($fullXml);
|
| 84 |
+
$litleTxnId = XMLParser::getNode($xmlDocument, 'litleTxnId');
|
| 85 |
+
$sql = "insert into litle_failed_transactions (customer_id, order_id, message, full_xml, litle_txn_id, active, transaction_timestamp, order_num) values (" . $customerId . ", " . $orderId . ", '" . $message . "', '" . $fullXml . "', '" . $litleTxnId . "', true, now()," . $orderNumber . ")";
|
| 86 |
+
Mage::log("Sql to execute is: " . $sql, null, "litle.log");
|
| 87 |
+
$result = mysql_query($sql);
|
| 88 |
+
if(!$result) {
|
| 89 |
+
Mage::log("Insert failed with error message: " . mysql_error(), null, "litle.log");
|
| 90 |
+
Mage::log("Query executed: " . $sql, null, "litle.log");
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
if(!$isOrderIdNull) {
|
| 94 |
+
$sql = "select * from sales_payment_transaction where order_id = " . $orderId . " order by created_at asc";
|
| 95 |
+
$result = mysql_query($sql);
|
| 96 |
+
Mage::log("Executed sql: " . $sql, null, "litle.log");
|
| 97 |
+
Mage::log($result, null, "litle.log");
|
| 98 |
+
while($row = mysql_fetch_assoc($result)) {
|
| 99 |
+
Mage::log($row['transaction_id'], null, "litle.log");
|
| 100 |
+
$sql = "insert into sales_payment_transaction (parent_id, order_id, payment_id, txn_id, parent_txn_id, txn_type, is_closed, created_at, additional_information) values (".$row['transaction_id'].", ".$orderId.", ".$orderId.", ".$litleTxnId.", ".$row['txn_id'].", '".$txnType."', 0,now(),'".serialize(array('message'=>message))."')";
|
| 101 |
+
}
|
| 102 |
+
Mage::log("Sql to execute is: " . $sql, null, "litle.log");
|
| 103 |
+
$result = mysql_query($sql);
|
| 104 |
+
if(!$result) {
|
| 105 |
+
Mage::log("Insert failed with error message: " . mysql_error(), null, "litle.log");
|
| 106 |
+
Mage::log("Query executed: " . $sql, null, "litle.log");
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
$sql = "insert into sales_flat_order_status_history (parent_id, is_customer_notified, is_visible_on_front, comment, status, created_at, entity_name) values (".$orderId.", 2, 0,'".$message.". Transaction ID: ".$litleTxnId."','processing',now(),'".$txnType."')";
|
| 110 |
+
Mage::log("Sql to execute is: " . $sql, null, "litle.log");
|
| 111 |
+
$result = mysql_query($sql);
|
| 112 |
+
if(!$result) {
|
| 113 |
+
Mage::log("Insert failed with error message: " . mysql_error(), null, "litle.log");
|
| 114 |
+
Mage::log("Query executed: " . $sql, null, "litle.log");
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
mysql_close($con);
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
public function parseMerchantIdMap($IdMapString)
|
| 123 |
+
{
|
| 124 |
+
$regex_output = array();
|
| 125 |
+
$validate_regex = "/\(( *(\"[A-Z]+\"|'[A-Z]+') *=> *(\"\d+\"|'\d+') *,?)+ *\)/";
|
| 126 |
+
$parse_regex = "/(?P<cur>(\"[A-Z]+\"|'[A-Z]+')) *=> *(?P<id>(\"\d+\"|'\d+'))/";
|
| 127 |
+
$validate_res = preg_match($validate_regex, $IdMapString, $regex_output);
|
| 128 |
+
if ($validate_res) {
|
| 129 |
+
$num_res = preg_match_all($parse_regex, $IdMapString, $regex_output);
|
| 130 |
+
$merchant_map = array();
|
| 131 |
+
$cur_array = $regex_output["cur"];
|
| 132 |
+
$id_array = $regex_output["id"];
|
| 133 |
+
for ($i = 0; $i < $num_res; $i++) {
|
| 134 |
+
$merchant_map[substr($cur_array[$i], 1, -1)] = substr($id_array[$i], 1, -1);
|
| 135 |
+
}
|
| 136 |
+
return $merchant_map;
|
| 137 |
+
} else {
|
| 138 |
+
return false;
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
}
|
app/code/local/Litle/CreditCard/Model/Order/Payment.php
CHANGED
|
@@ -22,6 +22,11 @@ class Litle_CreditCard_Model_Order_Payment extends Mage_Sales_Model_Order_Paymen
|
|
| 22 |
// return $this;
|
| 23 |
// }
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
protected function _reverseRefund($isOnline, $amount = null, $gatewayCallback = 'void')
|
| 26 |
{
|
| 27 |
$order = $this->getOrder();
|
|
@@ -120,10 +125,23 @@ class Litle_CreditCard_Model_Order_Payment extends Mage_Sales_Model_Order_Paymen
|
|
| 120 |
$invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_CANCELED)->save();
|
| 121 |
}
|
| 122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
$message = $this->hasMessage() ? $this->getMessage() : "Voided Capture.";
|
| 128 |
$message = $this->_prependMessage($message);
|
| 129 |
$message = $this->_appendTransactionToMessage($transaction, $message);
|
| 22 |
// return $this;
|
| 23 |
// }
|
| 24 |
|
| 25 |
+
public function authorizeForLPaypal($isOnline, $amount)
|
| 26 |
+
{
|
| 27 |
+
parent::_authorize($isOnline, $amount);
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
protected function _reverseRefund($isOnline, $amount = null, $gatewayCallback = 'void')
|
| 31 |
{
|
| 32 |
$order = $this->getOrder();
|
| 125 |
$invoice->setState(Mage_Sales_Model_Order_Invoice::STATE_CANCELED)->save();
|
| 126 |
}
|
| 127 |
|
| 128 |
+
// update transactions, order state and add comments
|
| 129 |
+
// if it's a credit card or paypal transaction, find the original auth and reopen it; if it's an echeck
|
| 130 |
+
// transaction, there is no auth transaction.
|
| 131 |
+
$authTransaction = $this->_lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
| 132 |
|
| 133 |
+
if($authTransaction){
|
| 134 |
+
$authTransaction->setIsClosed(0)->save();
|
| 135 |
+
}
|
| 136 |
+
// reopen the order transaction for Paypal transaction
|
| 137 |
+
$orderTransaction = $this->_lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER);
|
| 138 |
|
| 139 |
+
if($orderTransaction){
|
| 140 |
+
$orderTransaction->setIsClosed(0)->save();
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
// $authTransaction->setIsClosed(0)->save();
|
| 144 |
+
$transaction = $this->_addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID, null, true);
|
| 145 |
$message = $this->hasMessage() ? $this->getMessage() : "Voided Capture.";
|
| 146 |
$message = $this->_prependMessage($message);
|
| 147 |
$message = $this->_appendTransactionToMessage($transaction, $message);
|
app/code/local/Litle/CreditCard/Model/PaymentLogic.php
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?php
|
| 2 |
require_once ('Litle/LitleSDK/LitleOnline.php');
|
| 3 |
|
| 4 |
-
class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
| 5 |
{
|
| 6 |
|
| 7 |
/**
|
|
@@ -273,11 +273,12 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 273 |
public function merchantData(Varien_Object $payment)
|
| 274 |
{
|
| 275 |
$order = $payment->getOrder();
|
| 276 |
-
|
|
|
|
| 277 |
'user' => $this->getConfigData('user'),
|
| 278 |
'password' => $this->getConfigData('password'),
|
| 279 |
'merchantId' => $this->getMerchantId($payment),
|
| 280 |
-
'merchantSdk' => 'Magento;
|
| 281 |
'reportGroup' => $this->getMerchantId($payment),
|
| 282 |
'customerId' => $order->getCustomerEmail(),
|
| 283 |
'url' => $this->getConfigData('url'),
|
|
@@ -364,7 +365,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 364 |
'productCode' => $ids,
|
| 365 |
'quantity' => $qty,
|
| 366 |
'lineItemTotal' => Mage::helper('creditcard')->formatAmount(($unitPrice * $qty), true),
|
| 367 |
-
'unitCost' => Mage::
|
| 368 |
);
|
| 369 |
$i ++;
|
| 370 |
}
|
|
@@ -488,6 +489,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 488 |
{
|
| 489 |
$this->accountUpdater($payment, $litleResponse);
|
| 490 |
|
|
|
|
| 491 |
$message = XmlParser::getAttribute($litleResponse, 'litleOnlineResponse', 'message');
|
| 492 |
if ($message == 'Valid Format') {
|
| 493 |
$isSale = ($payment->getCcTransId() != null) ? false : true;
|
|
@@ -500,8 +502,8 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 500 |
}
|
| 501 |
$customerId = $payment->getOrder()->getCustomerId();
|
| 502 |
$orderId = $payment->getOrder()->getId();
|
| 503 |
-
|
| 504 |
-
|
| 505 |
Mage::throwException("The order was not approved. Please try again later or contact us. For your reference, the transaction id is " . XMLParser::getNode($litleResponse, 'litleTxnId'));
|
| 506 |
|
| 507 |
}
|
|
@@ -516,6 +518,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 516 |
->setIsTransactionClosed(0)
|
| 517 |
->setTransactionAdditionalInfo('additional_information',
|
| 518 |
XMLParser::getNode($litleResponse, 'message'));
|
|
|
|
| 519 |
}
|
| 520 |
return true;
|
| 521 |
}
|
|
@@ -523,71 +526,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 523 |
Mage::throwException($message);
|
| 524 |
}
|
| 525 |
}
|
| 526 |
-
|
| 527 |
-
public function writeFailedTransactionToDatabase($customerId, $orderId, $message, $xmlDocument, $txnType) {
|
| 528 |
-
$orderNumber = 0;
|
| 529 |
-
if($orderId === null) {
|
| 530 |
-
$orderId = 0;
|
| 531 |
-
}
|
| 532 |
-
else {
|
| 533 |
-
$order = Mage::getModel("sales/order")->load($orderId);
|
| 534 |
-
$orderNumber = $order->getData("increment_id");
|
| 535 |
-
}
|
| 536 |
-
if($customerId === null) {
|
| 537 |
-
$customerId = 0;
|
| 538 |
-
}
|
| 539 |
-
$config = Mage::getResourceModel("sales/order")->getReadConnection()->getConfig();
|
| 540 |
-
$host = $config['host'];
|
| 541 |
-
$username = $config['username'];
|
| 542 |
-
$password = $config['password'];
|
| 543 |
-
$dbname = $config['dbname'];
|
| 544 |
|
| 545 |
-
$con = mysql_connect($host,$username,$password);
|
| 546 |
-
$fullXml = $xmlDocument->saveXML();
|
| 547 |
-
if (!$con)
|
| 548 |
-
{
|
| 549 |
-
Mage::log("Failed to write failed transaction to database. Transaction details: " . $fullXml, null, "litle_failed_transactions.log");
|
| 550 |
-
}
|
| 551 |
-
else {
|
| 552 |
-
$selectedDb = mysql_select_db($dbname, $con);
|
| 553 |
-
if(!$selectedDb) {
|
| 554 |
-
Mage::log("Can't use selected database " . $dbname, null, "litle.log");
|
| 555 |
-
}
|
| 556 |
-
$fullXml = mysql_real_escape_string($fullXml);
|
| 557 |
-
$litleTxnId = XMLParser::getNode($xmlDocument, 'litleTxnId');
|
| 558 |
-
$sql = "insert into litle_failed_transactions (customer_id, order_id, message, full_xml, litle_txn_id, active, transaction_timestamp, order_num) values (" . $customerId . ", " . $orderId . ", '" . $message . "', '" . $fullXml . "', '" . $litleTxnId . "', true, now()," . $orderNumber . ")";
|
| 559 |
-
$result = mysql_query($sql);
|
| 560 |
-
if(!$result) {
|
| 561 |
-
Mage::log("Insert failed with error message: " . mysql_error(), null, "litle.log");
|
| 562 |
-
Mage::log("Query executed: " . $sql, null, "litle.log");
|
| 563 |
-
}
|
| 564 |
-
$sql = "select * from sales_payment_transaction where order_id = " . $orderId . " order by created_at asc";
|
| 565 |
-
$result = mysql_query($sql);
|
| 566 |
-
Mage::log("Executed sql: " . $sql, null, "litle.log");
|
| 567 |
-
Mage::log($result, null, "litle.log");
|
| 568 |
-
while($row = mysql_fetch_assoc($result)) {
|
| 569 |
-
Mage::log($row['transaction_id'], null, "litle.log");
|
| 570 |
-
$sql = "insert into sales_payment_transaction (parent_id, order_id, payment_id, txn_id, parent_txn_id, txn_type, is_closed, created_at, additional_information) values (".$row['transaction_id'].", ".$orderId.", ".$orderId.", ".$litleTxnId.", ".$row['txn_id'].", '".$txnType."', 0,now(),'".serialize(array('message'=>message))."')";
|
| 571 |
-
}
|
| 572 |
-
Mage::log("Sql to execute is: " . $sql, null, "litle.log");
|
| 573 |
-
$result = mysql_query($sql);
|
| 574 |
-
if(!$result) {
|
| 575 |
-
Mage::log("Insert failed with error message: " . mysql_error(), null, "litle.log");
|
| 576 |
-
Mage::log("Query executed: " . $sql, null, "litle.log");
|
| 577 |
-
}
|
| 578 |
-
|
| 579 |
-
$sql = "insert into sales_flat_order_status_history (parent_id, is_customer_notified, is_visible_on_front, comment, status, created_at, entity_name) values (".$orderId.", 2, 0,'".$message.". Transaction ID: ".$litleTxnId."','processing',now(),'".$txnType."')";
|
| 580 |
-
Mage::log("Sql to execute is: " . $sql, null, "litle.log");
|
| 581 |
-
$result = mysql_query($sql);
|
| 582 |
-
if(!$result) {
|
| 583 |
-
Mage::log("Insert failed with error message: " . mysql_error(), null, "litle.log");
|
| 584 |
-
Mage::log("Query executed: " . $sql, null, "litle.log");
|
| 585 |
-
}
|
| 586 |
-
|
| 587 |
-
mysql_close($con);
|
| 588 |
-
}
|
| 589 |
-
}
|
| 590 |
-
|
| 591 |
public function handleResponseForNonSuccessfulBackendTransactions(Varien_Object $payment, $litleResponse, $litleResponseCode) {
|
| 592 |
$order = $payment->getOrder();
|
| 593 |
$litleMessage = XMLParser::getNode($litleResponse, 'message');
|
|
@@ -654,7 +593,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 654 |
public function setOrderStatusAndCommentsForFailedTransaction($payment, $litleTxnId, $transactionType, $orderState, $paymentStatus, $litleMessage, $closed) {
|
| 655 |
$paymentHelp = new Litle_CreditCard_Model_Lpayment();
|
| 656 |
$paymentHelp->setOrder($payment->getOrder());
|
| 657 |
-
$transaction = $paymentHelp->addTransaction(transactionType, null, true, $litleMessage);
|
| 658 |
$payment->setStatus($paymentStatus)
|
| 659 |
->setCcTransId($litleTxnId)
|
| 660 |
->setLastTransId($litleTxnId)
|
|
@@ -664,8 +603,9 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 664 |
}
|
| 665 |
|
| 666 |
public function showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $messageToShow, $litleTxnId, $txnType) {
|
| 667 |
-
$this->writeFailedTransactionToDatabase($customerId, $orderId, $litleMessage, $litleResponse, $txnType);
|
| 668 |
-
|
|
|
|
| 669 |
$conn = $resource->getConnection('core_read');
|
| 670 |
$query = 'select failed_transactions_id from litle_failed_transactions where litle_txn_id = ' . $litleTxnId;
|
| 671 |
$failedTransactionId = $conn->fetchOne($query);
|
|
@@ -743,6 +683,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 743 |
*/
|
| 744 |
public function capture(Varien_Object $payment, $amount)
|
| 745 |
{
|
|
|
|
| 746 |
if (preg_match('/sales_order_create/i', $_SERVER['REQUEST_URI']) &&
|
| 747 |
($this->getConfigData('paypage_enable') == '1')) {
|
| 748 |
$payment->setStatus('N/A')
|
|
@@ -778,6 +719,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 778 |
} else {
|
| 779 |
$hash_temp = array(
|
| 780 |
'orderId' => $orderId,
|
|
|
|
| 781 |
'amount' => $amountToPass,
|
| 782 |
'orderSource' => $info->getAdditionalInformation('orderSource'),
|
| 783 |
'billToAddress' => $this->getBillToAddress($payment),
|
|
@@ -854,11 +796,13 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
| 854 |
$hash_in = array_merge($hash, $merchantData);
|
| 855 |
$litleRequest = new LitleOnlineRequest();
|
| 856 |
|
| 857 |
-
if (Mage::helper('creditcard')->isStateOfOrderEqualTo($order,
|
| 858 |
-
Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH))
|
|
|
|
| 859 |
$litleResponse = $litleRequest->authReversalRequest($hash_in);
|
| 860 |
} else {
|
| 861 |
$litleResponse = $litleRequest->voidRequest($hash_in);
|
|
|
|
| 862 |
}
|
| 863 |
}
|
| 864 |
$this->processResponse($payment, $litleResponse);
|
| 1 |
<?php
|
| 2 |
require_once ('Litle/LitleSDK/LitleOnline.php');
|
| 3 |
|
| 4 |
+
class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
| 5 |
{
|
| 6 |
|
| 7 |
/**
|
| 273 |
public function merchantData(Varien_Object $payment)
|
| 274 |
{
|
| 275 |
$order = $payment->getOrder();
|
| 276 |
+
$version = Mage::getModel('core_resource/resource')->getDbVersion($this->getCode() . '_setup');
|
| 277 |
+
$hash = array(
|
| 278 |
'user' => $this->getConfigData('user'),
|
| 279 |
'password' => $this->getConfigData('password'),
|
| 280 |
'merchantId' => $this->getMerchantId($payment),
|
| 281 |
+
'merchantSdk' => 'Magento;' . $version,
|
| 282 |
'reportGroup' => $this->getMerchantId($payment),
|
| 283 |
'customerId' => $order->getCustomerEmail(),
|
| 284 |
'url' => $this->getConfigData('url'),
|
| 365 |
'productCode' => $ids,
|
| 366 |
'quantity' => $qty,
|
| 367 |
'lineItemTotal' => Mage::helper('creditcard')->formatAmount(($unitPrice * $qty), true),
|
| 368 |
+
'unitCost' => Mage::app()->getStore()->roundPrice($unitPrice)
|
| 369 |
);
|
| 370 |
$i ++;
|
| 371 |
}
|
| 489 |
{
|
| 490 |
$this->accountUpdater($payment, $litleResponse);
|
| 491 |
|
| 492 |
+
|
| 493 |
$message = XmlParser::getAttribute($litleResponse, 'litleOnlineResponse', 'message');
|
| 494 |
if ($message == 'Valid Format') {
|
| 495 |
$isSale = ($payment->getCcTransId() != null) ? false : true;
|
| 502 |
}
|
| 503 |
$customerId = $payment->getOrder()->getCustomerId();
|
| 504 |
$orderId = $payment->getOrder()->getId();
|
| 505 |
+
Mage::helper('creditcard')->writeFailedTransactionToDatabase($customerId, null, $message, $litleResponse, null); //null order id because the order hasn't been created yet
|
| 506 |
+
|
| 507 |
Mage::throwException("The order was not approved. Please try again later or contact us. For your reference, the transaction id is " . XMLParser::getNode($litleResponse, 'litleTxnId'));
|
| 508 |
|
| 509 |
}
|
| 518 |
->setIsTransactionClosed(0)
|
| 519 |
->setTransactionAdditionalInfo('additional_information',
|
| 520 |
XMLParser::getNode($litleResponse, 'message'));
|
| 521 |
+
|
| 522 |
}
|
| 523 |
return true;
|
| 524 |
}
|
| 526 |
Mage::throwException($message);
|
| 527 |
}
|
| 528 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 530 |
public function handleResponseForNonSuccessfulBackendTransactions(Varien_Object $payment, $litleResponse, $litleResponseCode) {
|
| 531 |
$order = $payment->getOrder();
|
| 532 |
$litleMessage = XMLParser::getNode($litleResponse, 'message');
|
| 593 |
public function setOrderStatusAndCommentsForFailedTransaction($payment, $litleTxnId, $transactionType, $orderState, $paymentStatus, $litleMessage, $closed) {
|
| 594 |
$paymentHelp = new Litle_CreditCard_Model_Lpayment();
|
| 595 |
$paymentHelp->setOrder($payment->getOrder());
|
| 596 |
+
$transaction = $paymentHelp->addTransaction($transactionType, null, true, $litleMessage);
|
| 597 |
$payment->setStatus($paymentStatus)
|
| 598 |
->setCcTransId($litleTxnId)
|
| 599 |
->setLastTransId($litleTxnId)
|
| 603 |
}
|
| 604 |
|
| 605 |
public function showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $messageToShow, $litleTxnId, $txnType) {
|
| 606 |
+
// $this->writeFailedTransactionToDatabase($customerId, $orderId, $litleMessage, $litleResponse, $txnType);
|
| 607 |
+
Mage::helper('creditcard')->writeFailedTransactionToDatabase($customerId, $orderId, $litleMessage, $litleResponse, $txnType);
|
| 608 |
+
$resource = Mage::getSingleton('core/resource');
|
| 609 |
$conn = $resource->getConnection('core_read');
|
| 610 |
$query = 'select failed_transactions_id from litle_failed_transactions where litle_txn_id = ' . $litleTxnId;
|
| 611 |
$failedTransactionId = $conn->fetchOne($query);
|
| 683 |
*/
|
| 684 |
public function capture(Varien_Object $payment, $amount)
|
| 685 |
{
|
| 686 |
+
// throw new Exception('who calls me?');
|
| 687 |
if (preg_match('/sales_order_create/i', $_SERVER['REQUEST_URI']) &&
|
| 688 |
($this->getConfigData('paypage_enable') == '1')) {
|
| 689 |
$payment->setStatus('N/A')
|
| 719 |
} else {
|
| 720 |
$hash_temp = array(
|
| 721 |
'orderId' => $orderId,
|
| 722 |
+
'id' => $orderId,
|
| 723 |
'amount' => $amountToPass,
|
| 724 |
'orderSource' => $info->getAdditionalInformation('orderSource'),
|
| 725 |
'billToAddress' => $this->getBillToAddress($payment),
|
| 796 |
$hash_in = array_merge($hash, $merchantData);
|
| 797 |
$litleRequest = new LitleOnlineRequest();
|
| 798 |
|
| 799 |
+
// if (Mage::helper('creditcard')->isStateOfOrderEqualTo($order,
|
| 800 |
+
// Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH))
|
| 801 |
+
if ($order->getPayment()->getAuthorizationTransaction() && $payment->getAmountPaid() == 0){
|
| 802 |
$litleResponse = $litleRequest->authReversalRequest($hash_in);
|
| 803 |
} else {
|
| 804 |
$litleResponse = $litleRequest->voidRequest($hash_in);
|
| 805 |
+
$payment->setParentTransactionId($payment->getLastTransId());
|
| 806 |
}
|
| 807 |
}
|
| 808 |
$this->processResponse($payment, $litleResponse);
|
app/code/local/Litle/CreditCard/Model/ValidateMerchantId.php
CHANGED
|
@@ -17,9 +17,8 @@ class Litle_CreditCard_Model_ValidateMerchantId extends Mage_Core_Model_Config_D
|
|
| 17 |
}
|
| 18 |
|
| 19 |
public static function validate($merchantId) {
|
| 20 |
-
$string2Eval = 'return array' . $merchantId . ';';
|
| 21 |
$currency = "USD";//assumed that the base currency is USD
|
| 22 |
-
|
| 23 |
|
| 24 |
if(!is_array($merchant_map)){
|
| 25 |
Mage::throwException('Merchant ID must be of the form ("Currency" => "Code"), '. PHP_EOL . 'i.e. ("USD" => "101","GBP" => "102")');
|
| 17 |
}
|
| 18 |
|
| 19 |
public static function validate($merchantId) {
|
|
|
|
| 20 |
$currency = "USD";//assumed that the base currency is USD
|
| 21 |
+
$merchant_map = Mage::helper('creditcard')->parseMerchantIdMap($merchantId);
|
| 22 |
|
| 23 |
if(!is_array($merchant_map)){
|
| 24 |
Mage::throwException('Merchant ID must be of the form ("Currency" => "Code"), '. PHP_EOL . 'i.e. ("USD" => "101","GBP" => "102")');
|
app/code/local/Litle/CreditCard/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Litle_CreditCard>
|
| 5 |
-
<version>8.15.
|
| 6 |
</Litle_CreditCard>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Litle_CreditCard>
|
| 5 |
+
<version>8.15.6</version>
|
| 6 |
</Litle_CreditCard>
|
| 7 |
</modules>
|
| 8 |
<global>
|
app/code/local/Litle/LEcheck/Model/PaymentLogic.php
CHANGED
|
@@ -164,11 +164,14 @@ class Litle_LEcheck_Model_PaymentLogic extends Mage_Payment_Model_Method_Abstrac
|
|
| 164 |
|
| 165 |
public function merchantData(Varien_Object $payment)
|
| 166 |
{
|
| 167 |
-
|
|
|
|
|
|
|
| 168 |
'password'=> $this->getConfigData("password"),
|
| 169 |
'merchantId'=>$this->getMerchantId($payment),
|
| 170 |
-
'merchantSdk' => 'Magento;
|
| 171 |
'reportGroup'=>$this->getMerchantId($payment),
|
|
|
|
| 172 |
'url'=>$this->getConfigData("url"),
|
| 173 |
'proxy'=>$this->getConfigData("proxy"),
|
| 174 |
'timeout'=>$this->getConfigData("timeout"),
|
|
@@ -241,6 +244,7 @@ class Litle_LEcheck_Model_PaymentLogic extends Mage_Payment_Model_Method_Abstrac
|
|
| 241 |
if (!empty($order)){
|
| 242 |
$hash = array(
|
| 243 |
'orderId'=> $orderId,
|
|
|
|
| 244 |
'amount'=> $amountToPass,
|
| 245 |
'orderSource'=> "ecommerce",
|
| 246 |
'verify'=>'true',
|
|
@@ -268,6 +272,7 @@ class Litle_LEcheck_Model_PaymentLogic extends Mage_Payment_Model_Method_Abstrac
|
|
| 268 |
if (!empty($order)){
|
| 269 |
$hash = array(
|
| 270 |
'orderId'=> $orderId,
|
|
|
|
| 271 |
'amount'=> $amountToPass,
|
| 272 |
'orderSource'=> "ecommerce",
|
| 273 |
'billToAddress'=> $this->getBillToAddress($payment),
|
| 164 |
|
| 165 |
public function merchantData(Varien_Object $payment)
|
| 166 |
{
|
| 167 |
+
$order = $payment->getOrder();
|
| 168 |
+
$version = Mage::getModel('core_resource/resource')->getDbVersion($this->getCode() . '_setup');
|
| 169 |
+
$hash = array('user'=> $this->getConfigData("user"),
|
| 170 |
'password'=> $this->getConfigData("password"),
|
| 171 |
'merchantId'=>$this->getMerchantId($payment),
|
| 172 |
+
'merchantSdk' => 'Magento;' . $version,
|
| 173 |
'reportGroup'=>$this->getMerchantId($payment),
|
| 174 |
+
'customerId' => $order->getCustomerEmail(),
|
| 175 |
'url'=>$this->getConfigData("url"),
|
| 176 |
'proxy'=>$this->getConfigData("proxy"),
|
| 177 |
'timeout'=>$this->getConfigData("timeout"),
|
| 244 |
if (!empty($order)){
|
| 245 |
$hash = array(
|
| 246 |
'orderId'=> $orderId,
|
| 247 |
+
'id'=> $orderId,
|
| 248 |
'amount'=> $amountToPass,
|
| 249 |
'orderSource'=> "ecommerce",
|
| 250 |
'verify'=>'true',
|
| 272 |
if (!empty($order)){
|
| 273 |
$hash = array(
|
| 274 |
'orderId'=> $orderId,
|
| 275 |
+
'id'=> $orderId,
|
| 276 |
'amount'=> $amountToPass,
|
| 277 |
'orderSource'=> "ecommerce",
|
| 278 |
'billToAddress'=> $this->getBillToAddress($payment),
|
app/code/local/Litle/LEcheck/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Litle_LEcheck>
|
| 5 |
-
<version>8.15.
|
| 6 |
</Litle_LEcheck>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Litle_LEcheck>
|
| 5 |
+
<version>8.15.6</version>
|
| 6 |
</Litle_LEcheck>
|
| 7 |
</modules>
|
| 8 |
<global>
|
app/code/local/Litle/LEcheck/etc/system.xml
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
<LEcheck translate="label" module="paygate">
|
| 7 |
<label>Litle - Echeck</label>
|
| 8 |
<frontend_type>text</frontend_type>
|
| 9 |
-
<sort_order>
|
| 10 |
<show_in_default>1</show_in_default>
|
| 11 |
<show_in_website>1</show_in_website>
|
| 12 |
<show_in_store>1</show_in_store>
|
| 6 |
<LEcheck translate="label" module="paygate">
|
| 7 |
<label>Litle - Echeck</label>
|
| 8 |
<frontend_type>text</frontend_type>
|
| 9 |
+
<sort_order>2</sort_order>
|
| 10 |
<show_in_default>1</show_in_default>
|
| 11 |
<show_in_website>1</show_in_website>
|
| 12 |
<show_in_store>1</show_in_store>
|
app/code/local/Litle/LitleSDK/Communication.php
CHANGED
|
@@ -41,7 +41,7 @@ class Communication{
|
|
| 41 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
| 42 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
|
| 43 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
| 44 |
-
curl_setopt($ch, CURLOPT_SSLVERSION,
|
| 45 |
if(Mage::getStoreConfig('payment/CreditCard/debug_enable')) {
|
| 46 |
$xmlToPrint = Communication::cleanseAccountNumber($req);
|
| 47 |
$xmlToPrint = Communication::cleanseCardValidationNum($xmlToPrint);
|
| 41 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
| 42 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
|
| 43 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
| 44 |
+
curl_setopt($ch, CURLOPT_SSLVERSION, 6);
|
| 45 |
if(Mage::getStoreConfig('payment/CreditCard/debug_enable')) {
|
| 46 |
$xmlToPrint = Communication::cleanseAccountNumber($req);
|
| 47 |
$xmlToPrint = Communication::cleanseCardValidationNum($xmlToPrint);
|
app/code/local/Litle/Palorus/Helper/Data.php
CHANGED
|
@@ -46,18 +46,17 @@ class Litle_Palorus_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 46 |
{
|
| 47 |
if (preg_match('/payments/', $url)) {
|
| 48 |
$baseUrl = 'https://reports.litle.com';
|
| 49 |
-
} else
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
}
|
| 61 |
return $baseUrl;
|
| 62 |
}
|
| 63 |
|
|
@@ -209,4 +208,4 @@ class Litle_Palorus_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 209 |
{
|
| 210 |
return $this->getQuote()->getCustomer();
|
| 211 |
}
|
| 212 |
-
}
|
| 46 |
{
|
| 47 |
if (preg_match('/payments/', $url)) {
|
| 48 |
$baseUrl = 'https://reports.litle.com';
|
| 49 |
+
} else if (preg_match('/sandbox/', $url)) {
|
| 50 |
+
$baseUrl = 'https://www.testlitle.com/sandbox';
|
| 51 |
+
} else if (preg_match('/prelive/', $url)) {
|
| 52 |
+
$baseUrl = 'https://reports-prelive.litle.com';
|
| 53 |
+
} else if (preg_match('/precert/', $url)) {
|
| 54 |
+
$baseUrl = 'https://reports.precert.litle.com';
|
| 55 |
+
} else if (preg_match('/cert/', $url)) {
|
| 56 |
+
$baseUrl = 'https://reports.cert.litle.com';
|
| 57 |
+
} else {
|
| 58 |
+
$baseUrl = 'http://localhost:2190';
|
| 59 |
+
}
|
|
|
|
| 60 |
return $baseUrl;
|
| 61 |
}
|
| 62 |
|
| 208 |
{
|
| 209 |
return $this->getQuote()->getCustomer();
|
| 210 |
}
|
| 211 |
+
}
|
app/code/local/Litle/Palorus/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Litle_Palorus>
|
| 5 |
-
<version>8.15.
|
| 6 |
</Litle_Palorus>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Litle_Palorus>
|
| 5 |
+
<version>8.15.6</version>
|
| 6 |
</Litle_Palorus>
|
| 7 |
</modules>
|
| 8 |
<global>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Litle_Payments</name>
|
| 4 |
-
<version>8.15.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MIT</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -34,11 +34,16 @@ If you need any help or technical help with our extension, please contact <st
|
|
| 34 |
<p>
|
| 35 |
Visit <a href="http://www.vantiv.com/developers">www.vantiv.com/developers</a> for more information.
|
| 36 |
</p></description>
|
| 37 |
-
<notes>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
<authors><author><name>Litle</name><user>Litle</user><email>sdksupport@litle.com</email></author></authors>
|
| 39 |
-
<date>2015-
|
| 40 |
-
<time>15:
|
| 41 |
-
<contents><target name="magelocal"><dir name="Litle"><dir name="CreditCard"><dir name="Block"><dir name="Adminhtml"><file name="Ordergrid.php" hash="c01fb8a142a89562c41a1a315f8f1529"/><file name="Orderview.php" hash="
|
| 42 |
<compatible/>
|
| 43 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 44 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Litle_Payments</name>
|
| 4 |
+
<version>8.15.6</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>MIT</license>
|
| 7 |
<channel>community</channel>
|
| 34 |
<p>
|
| 35 |
Visit <a href="http://www.vantiv.com/developers">www.vantiv.com/developers</a> for more information.
|
| 36 |
</p></description>
|
| 37 |
+
<notes>Fixed Prelive URLS
|
| 38 |
+
Fixed Line item data decimal points
|
| 39 |
+
Fixed Eval vulnerability bug
|
| 40 |
+
Fixed failed transaction exception bug
|
| 41 |
+
Added dupe checking support
|
| 42 |
+
</notes>
|
| 43 |
<authors><author><name>Litle</name><user>Litle</user><email>sdksupport@litle.com</email></author></authors>
|
| 44 |
+
<date>2015-06-19</date>
|
| 45 |
+
<time>15:27:51</time>
|
| 46 |
+
<contents><target name="magelocal"><dir name="Litle"><dir name="CreditCard"><dir name="Block"><dir name="Adminhtml"><file name="Ordergrid.php" hash="c01fb8a142a89562c41a1a315f8f1529"/><file name="Orderview.php" hash="788311c0a0f467aeee0fc98291f57297"/></dir><dir name="Form"><file name="CreditCard.php" hash="0efbcd620e9d398220c5a2ada129bcce"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c83965715fa7640923ab5a1bef4431fd"/></dir><dir name="Model"><file name="Cctypes.php" hash="cf8f9d91ac8bf313aa8d97b865d719de"/><file name="Lpayment.php" hash="2ed8491cef39c7c17638e02b03b334b4"/><dir name="Order"><file name="Payment.php" hash="68352568d5a701cb595df957ce3abcef"/></dir><file name="PaymentLogic.php" hash="b260703389435d51a9bb0060286ae34f"/><file name="Url.php" hash="eeccd22ae56935be54845f7f94dcb1d9"/><file name="ValidateMerchantId.php" hash="dedf119de0b57dea43c338bcbf7c8b92"/><file name="Validatehttp.php" hash="a4ba5179ecabffcbdecb70108b94f55a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderController.php" hash="aaa09ae9433af2710bd8649eb7524b69"/></dir></dir><dir name="etc"><file name="config.xml" hash="f8ae22059fbb44c69b6fef35292321cf"/><file name="system.xml" hash="86c5b777be1e8d9e7b5b4c1d3154ed22"/></dir></dir><dir name="LEcheck"><dir name="Block"><dir name="Form"><file name="LEcheck.php" hash="a60f23cc46bd35a45aa682324155d3fe"/></dir></dir><dir name="Helper"><file name="Data.php" hash="2c2664ab694e0ba70e45157061a01436"/></dir><dir name="Model"><file name="Accounttypes.php" hash="6628bf9982d0d35341975d0bb83be5e1"/><file name="Config.php" hash="fe64d24b39251551b71e37937792b418"/><file name="PaymentLogic.php" hash="3fe62ff0dc9667caf0d9314c3fc66cb6"/><file name="Transactiontypes.php" hash="9225c936b6e13d031ae5c3486647e924"/><file name="Url.php" hash="9e3d8ba06bcb9045abc82f20f18d5ef3"/><file name="Validatehttp.php" hash="6a8d4d6f043976ad272c87a885d937f4"/></dir><dir name="etc"><file name="config.xml" hash="22880c205488da386568ae5e2216fcf5"/><file name="system.xml" hash="7dc1a35b78e93b28386ecea1f694f576"/></dir></dir><dir name="LitleSDK"><file name="BatchRequest.php" hash="957d131cb89db268b47c79af587bac70"/><file name="Checker.php" hash="92a5bd2ca530f13f8f88f2918591b154"/><file name="Communication.php" hash="420a4513e4b85c535a33f3dced9124c7"/><file name="LitleOnline.php" hash="d07a435544cedda61747935e78a96792"/><file name="LitleOnlineRequest.php" hash="19ecf7c64433597600deec3896aea48a"/><file name="LitleRequest.php" hash="d3b8df472f383037bf6d0a66ee60542d"/><file name="LitleResponseProcessor.php" hash="337b482959fc361ef96260778147c5ce"/><file name="LitleXmlMapper.php" hash="d500aae393dede8302f8e37c6bf40f09"/><file name="Obj2xml.php" hash="d6eb72a2116f5fbb15de876711b34da5"/><file name="Setup.php" hash="659fa98551445bcf427ead7c3a67e2f7"/><file name="Transactions.php" hash="6dab146ff70973c7553911d549bb433d"/><file name="UrlMapper.php" hash="f7951fbf0fc218eaa041f0265b358499"/><file name="XmlFields.php" hash="f7a91505f091fcdb4e35f152d71efe16"/><file name="XmlParser.php" hash="14b1d57edb7f633d034bb7b119eff02c"/></dir><dir name="Palorus"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Vault.php" hash="16f272c9d87b6172610a576b2f4912f1"/></dir></dir></dir><dir name="Palorus"><dir name="Insight"><file name="Failedtransactions.php" hash="88480b417f99e8b93a22a5f060374db8"/><file name="Failedtransactionshome.php" hash="3d85f19b92c87365f56b356706e60dcb"/><file name="Failedtransactionsview.php" hash="8c4cf7970444d3e51b93c548bb0c2aea"/><file name="Grid.php" hash="7ffd05ce801a49b4ab9cde9c970a6bda"/><file name="Tab.php" hash="d85debd2ff5d4cce14c948875f8c5f44"/></dir></dir><file name="Transaction.php" hash="ed5e2fe4884bd645549d52b5c84c7b8e"/></dir><dir name="Vault"><file name="List.php" hash="79ee52a8a899feffeddd4ae036de6bc9"/></dir><file name="Vault.php" hash="135de819b38ce7ff878c16b48e6b6545"/></dir><dir name="Helper"><file name="Data.php" hash="f4bfa5fa76879a1bc70d1e3a8d583874"/></dir><dir name="Model"><file name="Avscid.php" hash="629147b50abf52af5486a0b1e75c63c2"/><file name="Failedtransactions.php" hash="696fcdb15789c67dee56425c7131c87b"/><file name="Insight.php" hash="837fd9a46dc1d2a9362742299818aa9f"/><dir name="Mysql4"><dir name="Avscid"><file name="Collection.php" hash="eae536081b0d5d94fc15ac0f27187bbd"/></dir><file name="Avscid.php" hash="5f03c8999b97d3c60c738f316d1ae036"/><dir name="Failedtransactions"><file name="Collection.php" hash="22ffa1993e6c83677718c523dbb26130"/><dir name="Grid"><file name="Collection.php" hash="e595f99d9d45041976973969a160de65"/></dir></dir><file name="Failedtransactions.php" hash="5a542d03ff8287113711a1f54a86d51f"/><dir name="Insight"><file name="Collection.php" hash="ce93a4bc5c69a69967a5a48b8f6a0a6f"/></dir><file name="Insight.php" hash="b8faca9944ba3ccd28505b36a8485e50"/><dir name="Vault"><file name="Collection.php" hash="ed26a7b3761a82ab96f040d233dfdda0"/></dir><file name="Vault.php" hash="d468febf17e1ab53bcd2848329662b56"/></dir><file name="Vault.php" hash="0017a27143e561e97fed7f98c253deca"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="MyformController.php" hash="717b8b9040d24b466b4b32df2434d95e"/><file name="VaultController.php" hash="4e12464add381a9ca0b8d4b09feb4082"/></dir><file name="VaultController.php" hash="08a1373697b6f3dd8c9e6508573e87d7"/></dir><dir name="etc"><file name="config.xml" hash="5ede64f44fb07ef61a237fd3211211c8"/></dir><dir name="sql"><dir name="palorus_setup"><file name="mysql4-install-8.13.0.php" hash="65e2cda8318d2e986c5644a802e66bf3"/><file name="mysql4-upgrade-8.13.2-8.13.3.php" hash="66bc35e477c287ee27ecefe6c18fda41"/><file name="mysql4-upgrade-8.13.3-8.14.0.php" hash="bc7b843786f6c71b2012cd64203ed2d4"/><file name="mysql4-upgrade-8.14.0-8.15.0.php" hash="bed4a00dc51fe364260fa5549edd3c16"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="litle.xml" hash="b42e97feb8082098928265e136459ca2"/></dir><dir name="template"><dir name="litle"><dir name="customer"><dir name="tab"><file name="vault.phtml" hash="33fd55b56e7a66011261eb4474dc3704"/></dir></dir><dir name="form"><file name="failedtransactions.phtml" hash="01ced0c103321c78a9aeb48780aedc3a"/><file name="failedtransactionsview.phtml" hash="6b65964f06d4ffc8bd73c5b0bc3a3487"/><file name="litlecc.phtml" hash="370e821b104941654a13e90825dbb244"/><file name="litleecheck.phtml" hash="b9921c8126c2eab4a77bd4f120935753"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="litlecreditcard.xml" hash="2552fc3975e214bde25203cf16f66e7c"/></dir><dir name="template"><dir name="litle"><dir name="form"><file name="litlecc.phtml" hash="4013e1351d1e1b69d916e0bb053f038a"/><file name="litleecheck.phtml" hash="2ea144a98a5e71d6c89b14623a021276"/><file name="litlejs.phtml" hash="775224833051c1b7df7c32a626994ec0"/></dir><dir name="vault"><file name="list.phtml" hash="365ad13b50baf79a310f0ce5fb593c98"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Litle_All.xml" hash="09fb485ff33fb8680e38742182d6d0ba"/></dir></target></contents>
|
| 47 |
<compatible/>
|
| 48 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 49 |
</package>
|
