Version Notes
This extension implements Litle XML
Additional features include enhanced reporting on orders, transactions, and customers.
Download this release
Release Info
Developer | Litle |
Extension | Litle_Payments |
Version | 8.14.0 |
Comparing to | |
See all releases |
Code changes from version 8.13.3 to 8.14.0
- app/code/local/Litle/CreditCard/Model/PaymentLogic.php +138 -24
- app/code/local/Litle/CreditCard/etc/system.xml +9 -0
- app/code/local/Litle/LitleSDK/Communication.php +23 -1
- app/code/local/Litle/LitleSDK/LitleOnlineRequest.php +1 -1
- app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Failedtransactions.php +134 -0
- app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Failedtransactionshome.php +45 -0
- app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Failedtransactionsview.php +97 -0
- app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Grid.php +154 -0
- app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Tab.php +0 -2
- app/code/local/Litle/Palorus/Block/Adminhtml/Transaction.php +0 -1
- app/code/local/Litle/Palorus/Helper/Data.php +7 -13
- app/code/local/Litle/Palorus/Model/Failedtransactions.php +13 -0
- app/code/local/Litle/Palorus/Model/Mysql4/Failedtransactions.php +9 -0
- app/code/local/Litle/Palorus/Model/Mysql4/Failedtransactions/Collection.php +11 -0
- app/code/local/Litle/Palorus/Model/Mysql4/Failedtransactions/Grid/Collection.php +37 -0
- app/code/local/Litle/Palorus/Model/Vault.php +10 -0
- app/code/local/Litle/Palorus/controllers/Adminhtml/MyformController.php +41 -0
- app/code/local/Litle/Palorus/etc/config.xml +8 -1
- app/code/local/Litle/Palorus/sql/palorus_setup/mysql4-upgrade-8.13.2-8.13.3.php +57 -20
- app/code/local/Litle/Palorus/sql/palorus_setup/mysql4-upgrade-8.13.3-8.14.0.php +26 -0
- app/design/adminhtml/default/default/template/litle/form/failedtransactions.phtml +88 -0
- app/design/adminhtml/default/default/template/litle/form/failedtransactionsview.phtml +82 -0
- package.xml +2 -2
app/code/local/Litle/CreditCard/Model/PaymentLogic.php
CHANGED
@@ -62,7 +62,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
62 |
* can this method save cc info for later use?
|
63 |
*/
|
64 |
protected $_canSaveCc = false;
|
65 |
-
|
66 |
public function getConfigData($fieldToLookFor, $store = null)
|
67 |
{
|
68 |
$returnFromThisModel = Mage::getStoreConfig('payment/CreditCard/' . $fieldToLookFor);
|
@@ -265,7 +265,7 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
265 |
'password' => $this->getConfigData('password'),
|
266 |
'merchantId' => $this->getMerchantId($payment),
|
267 |
'version' => '8.10',
|
268 |
-
'merchantSdk' => 'Magento;8.
|
269 |
'reportGroup' => $this->getMerchantId($payment),
|
270 |
'customerId' => $order->getCustomerEmail(),
|
271 |
'url' => $this->getConfigData('url'),
|
@@ -470,28 +470,19 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
470 |
if (isset($litleResponse)) {
|
471 |
$litleResponseCode = XMLParser::getNode($litleResponse, 'response');
|
472 |
if ($litleResponseCode != '000') {
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
$
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
if ($isSale)
|
488 |
-
throw new Mage_Payment_Model_Info_Exception(
|
489 |
-
Mage::helper('core')->__(
|
490 |
-
'Transaction was not approved. Contact us or try again later.'));
|
491 |
-
else
|
492 |
-
throw new Mage_Payment_Model_Info_Exception(
|
493 |
-
Mage::helper('core')->__(
|
494 |
-
'Transaction was not approved. Contact Litle or try again later.'));
|
495 |
}
|
496 |
} else {
|
497 |
$payment->setStatus('Approved')
|
@@ -508,6 +499,129 @@ class Litle_CreditCard_Model_PaymentLogic extends Mage_Payment_Model_Method_Cc
|
|
508 |
Mage::throwException($message);
|
509 |
}
|
510 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
|
512 |
/**
|
513 |
* this method is called if we are just authorising a transaction
|
62 |
* can this method save cc info for later use?
|
63 |
*/
|
64 |
protected $_canSaveCc = false;
|
65 |
+
|
66 |
public function getConfigData($fieldToLookFor, $store = null)
|
67 |
{
|
68 |
$returnFromThisModel = Mage::getStoreConfig('payment/CreditCard/' . $fieldToLookFor);
|
265 |
'password' => $this->getConfigData('password'),
|
266 |
'merchantId' => $this->getMerchantId($payment),
|
267 |
'version' => '8.10',
|
268 |
+
'merchantSdk' => 'Magento;8.14.0',
|
269 |
'reportGroup' => $this->getMerchantId($payment),
|
270 |
'customerId' => $order->getCustomerEmail(),
|
271 |
'url' => $this->getConfigData('url'),
|
470 |
if (isset($litleResponse)) {
|
471 |
$litleResponseCode = XMLParser::getNode($litleResponse, 'response');
|
472 |
if ($litleResponseCode != '000') {
|
473 |
+
if ($isSale) {
|
474 |
+
if(Mage::getStoreConfig('payment/CreditCard/debug_enable')) {
|
475 |
+
Mage::log("Had an unsuccessful response in an authorization/sale - response code: " . $litleResponseCode, null, "litle.log");
|
476 |
+
}
|
477 |
+
$customerId = $payment->getOrder()->getCustomerId();
|
478 |
+
$orderId = $payment->getOrder()->getId();
|
479 |
+
$this->writeFailedTransactionToDatabase($customerId, null, $message, $litleResponse); //null order id because the order hasn't been created yet
|
480 |
+
|
481 |
+
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'));
|
482 |
+
|
483 |
+
}
|
484 |
+
else {
|
485 |
+
$this->handleResponseForNonSuccessfulBackendTransactions($payment, $litleResponse, $litleResponseCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
486 |
}
|
487 |
} else {
|
488 |
$payment->setStatus('Approved')
|
499 |
Mage::throwException($message);
|
500 |
}
|
501 |
}
|
502 |
+
|
503 |
+
public function writeFailedTransactionToDatabase($customerId, $orderId, $message, $xmlDocument) {
|
504 |
+
$orderNumber = 0;
|
505 |
+
if($orderId === null) {
|
506 |
+
$orderId = 0;
|
507 |
+
}
|
508 |
+
else {
|
509 |
+
$order = Mage::getModel("sales/order")->load($orderId);
|
510 |
+
$orderNumber = $order->getData("increment_id");
|
511 |
+
}
|
512 |
+
if($customerId === null) {
|
513 |
+
$customerId = 0;
|
514 |
+
}
|
515 |
+
$config = Mage::getResourceModel("sales/order")->getReadConnection()->getConfig();
|
516 |
+
$host = $config['host'];
|
517 |
+
$username = $config['username'];
|
518 |
+
$password = $config['password'];
|
519 |
+
$dbname = $config['dbname'];
|
520 |
+
|
521 |
+
$con = mysql_connect($host,$username,$password);
|
522 |
+
$fullXml = $xmlDocument->saveXML();
|
523 |
+
if (!$con)
|
524 |
+
{
|
525 |
+
Mage::log("Failed to write failed transaction to database. Transaction details: " . $fullXml, null, "litle_failed_transactions.log");
|
526 |
+
}
|
527 |
+
else {
|
528 |
+
$selectedDb = mysql_select_db($dbname, $con);
|
529 |
+
if(!$selectedDb) {
|
530 |
+
Mage::log("Can't use selected database " . $dbname, null, "litle.log");
|
531 |
+
}
|
532 |
+
$fullXml = mysql_real_escape_string($fullXml);
|
533 |
+
$litleTxnId = XMLParser::getNode($xmlDocument, 'litleTxnId');
|
534 |
+
$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 . ")";
|
535 |
+
$result = mysql_query($sql);
|
536 |
+
if(!$result) {
|
537 |
+
Mage::log("Insert failed with error message: " . mysql_error(), null, "litle.log");
|
538 |
+
Mage::log("Query executed: " . $sql, null, "litle.log");
|
539 |
+
}
|
540 |
+
mysql_close($con);
|
541 |
+
}
|
542 |
+
}
|
543 |
+
|
544 |
+
public function handleResponseForNonSuccessfulBackendTransactions(Varien_Object $payment, $litleResponse, $litleResponseCode) {
|
545 |
+
$order = $payment->getOrder();
|
546 |
+
$litleMessage = XMLParser::getNode($litleResponse, 'message');
|
547 |
+
$litleTxnId = XMLParser::getNode($litleResponse, 'litleTxnId');
|
548 |
+
$customerId = $order->getData('customer_id');
|
549 |
+
$orderId = $order->getId();
|
550 |
+
|
551 |
+
if($litleResponseCode === '306') {
|
552 |
+
|
553 |
+
$this->setOrderStatusAndCommentsForFailedTransaction( $payment, $litleTxnId,
|
554 |
+
Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID,
|
555 |
+
Mage_Sales_Model_Order::STATE_CANCELED,
|
556 |
+
Mage_Payment_Model_Method_Abstract::STATUS_VOID,
|
557 |
+
"Authorization has expired - no need to reverse. The original Authorization is no longer valid, because it has expired. You can not perform an Authorization Reversal for an expired Authorization.");
|
558 |
+
}
|
559 |
+
elseif($litleResponseCode === '311') {
|
560 |
+
$this->setOrderStatusAndCommentsForFailedTransaction( $payment, $litleTxnId,
|
561 |
+
Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND,
|
562 |
+
Mage_Sales_Model_Order::STATE_COMPLETE,
|
563 |
+
Mage_Payment_Model_Method_Abstract::STATUS_APPROVED,
|
564 |
+
"Deposit is already referenced by a chargeback. The deposit is already referenced by a chargeback; therefore, a refund cannot be processed against the original transaction.");
|
565 |
+
}
|
566 |
+
elseif($litleResponseCode === '316') {
|
567 |
+
$this->setOrderStatusAndCommentsForFailedTransaction( $payment, $litleTxnId,
|
568 |
+
Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND,
|
569 |
+
Mage_Sales_Model_Order::STATE_COMPLETE,
|
570 |
+
Mage_Payment_Model_Method_Abstract::STATUS_APPROVED,
|
571 |
+
"Automatic refund already issued. This refund transaction is a duplicate for one already processed automatically by the Litle Fraud Chargeback Prevention Service.");
|
572 |
+
}
|
573 |
+
elseif($litleResponseCode === '335') {
|
574 |
+
$descriptiveMessage = "This method of payment does not support authorization reversals. You can not perform an Authorization Reversal transaction for this payment type.";
|
575 |
+
$this->showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $descriptiveMessage, $litleTxnId);
|
576 |
+
}
|
577 |
+
elseif($litleResponseCode === '336') {
|
578 |
+
$descriptiveMessage = "Reversal amount does not match Authorization amount. For a merchant initiated reversal against an American Express authorization, the reversal amount must match the authorization amount exactly.";
|
579 |
+
$this->showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $descriptiveMessage, $litleTxnId);
|
580 |
+
}
|
581 |
+
elseif($litleResponseCode === '361') {
|
582 |
+
$descriptiveMessage = "Authorization no longer available. The authorization for this transaction is no longer available; the authorization has already been consumed by another capture.";
|
583 |
+
$this->showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $descriptiveMessage, $litleTxnId);
|
584 |
+
}
|
585 |
+
elseif($litleResponseCode === '362') {
|
586 |
+
$descriptiveMessage = "Transaction Not Voided - Already Settled. This transaction cannot be voided; it has already been delivered to the card networks. You may want to try a refund instead.";
|
587 |
+
$this->showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $descriptiveMessage, $litleTxnId);
|
588 |
+
}
|
589 |
+
elseif($litleResponseCode === '365') {
|
590 |
+
$descriptiveMessage = "Total credit amount exceeds capture amouont. The amount of the credit is greater than the capture, or the amount of this credit plus other credits already referencing this capture are greater than the capture amount.";
|
591 |
+
$this->showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $descriptiveMessage, $litleTxnId);
|
592 |
+
}
|
593 |
+
elseif($litleResponseCode === '370') {
|
594 |
+
$descriptiveMessage = "Internal System Error - Call Litle. There is a problem with the Litle System. Contact support@litle.com and provide the following transaction id: " . $litleTxnId;
|
595 |
+
$this->showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $descriptiveMessage, $litleTxnId);
|
596 |
+
}
|
597 |
+
else {
|
598 |
+
$descriptiveMessage = "Transaction was not approved and Litle's Magento extension can not tell why. Contact Litle at support@litle.com and provide the following transaction id: " . $litleTxnId;
|
599 |
+
$this->showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $descriptiveMessage, $litleTxnId);
|
600 |
+
}
|
601 |
+
|
602 |
+
}
|
603 |
+
|
604 |
+
public function setOrderStatusAndCommentsForFailedTransaction($payment, $litleTxnId, $transactionType, $orderState, $paymentStatus, $litleMessage) {
|
605 |
+
$paymentHelp = new Litle_CreditCard_Model_Lpayment();
|
606 |
+
$paymentHelp->setOrder($payment->getOrder());
|
607 |
+
$transaction = $paymentHelp->addTransaction(transactionType, null, true, $litleMessage);
|
608 |
+
$payment->setStatus($paymentStatus)
|
609 |
+
->setCcTransId($litleTxnId)
|
610 |
+
->setLastTransId($litleTxnId)
|
611 |
+
->setTransactionId($litleTxnId)
|
612 |
+
->setIsTransactionClosed(true)
|
613 |
+
->setTransactionAdditionalInfo('additional_information', $litleMessage);
|
614 |
+
}
|
615 |
+
|
616 |
+
public function showErrorForFailedTransaction($customerId, $orderId, $litleMessage, $litleResponse, $messageToShow, $litleTxnId) {
|
617 |
+
$this->writeFailedTransactionToDatabase($customerId, $orderId, $litleMessage, $litleResponse);
|
618 |
+
$resource = Mage::getSingleton('core/resource');
|
619 |
+
$conn = $resource->getConnection('core_read');
|
620 |
+
$query = 'select failed_transactions_id from litle_failed_transactions where litle_txn_id = ' . $litleTxnId;
|
621 |
+
$failedTransactionId = $conn->fetchOne($query);
|
622 |
+
$url = Mage::getUrl('palorus/adminhtml_myform/failedtransactionsview/') . 'failed_transactions_id/' . $failedTransactionId;
|
623 |
+
Mage::throwException($messageToShow . "For your reference, the transaction id is <a href='" . $url . "'>".$litleTxnId."</a>");
|
624 |
+
}
|
625 |
|
626 |
/**
|
627 |
* this method is called if we are just authorising a transaction
|
app/code/local/Litle/CreditCard/etc/system.xml
CHANGED
@@ -144,6 +144,15 @@
|
|
144 |
<show_in_website>1</show_in_website>
|
145 |
<show_in_store>0</show_in_store>
|
146 |
</vault_enable>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
</fields>
|
148 |
</CreditCard>
|
149 |
</groups>
|
144 |
<show_in_website>1</show_in_website>
|
145 |
<show_in_store>0</show_in_store>
|
146 |
</vault_enable>
|
147 |
+
<debug_enable translate="label">
|
148 |
+
<label>Debug Logging Enabled</label>
|
149 |
+
<frontend_type>select</frontend_type>
|
150 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
151 |
+
<sort_order>120</sort_order>
|
152 |
+
<show_in_default>1</show_in_default>
|
153 |
+
<show_in_website>1</show_in_website>
|
154 |
+
<show_in_store>0</show_in_store>
|
155 |
+
</debug_enable>
|
156 |
</fields>
|
157 |
</CreditCard>
|
158 |
</groups>
|
app/code/local/Litle/LitleSDK/Communication.php
CHANGED
@@ -36,7 +36,17 @@ class Communication{
|
|
36 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
37 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
|
38 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
$output = curl_exec($ch);
|
|
|
|
|
|
|
|
|
40 |
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
41 |
if (! $output){
|
42 |
throw new Exception (curl_error($ch));
|
@@ -46,6 +56,18 @@ class Communication{
|
|
46 |
curl_close($ch);
|
47 |
return $output;
|
48 |
}
|
49 |
-
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
36 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
37 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
|
38 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
39 |
+
if(Mage::getStoreConfig('payment/CreditCard/debug_enable')) {
|
40 |
+
$xmlToPrint = Communication::cleanseAccountNumber($req);
|
41 |
+
$xmlToPrint = Communication::cleanseCardValidationNum($xmlToPrint);
|
42 |
+
$xmlToPrint = Communication::cleansePassword($xmlToPrint);
|
43 |
+
Mage::log($xmlToPrint,null,"litle_transaction.log");
|
44 |
+
}
|
45 |
$output = curl_exec($ch);
|
46 |
+
if(Mage::getStoreConfig('payment/CreditCard/debug_enable')) {
|
47 |
+
$xmlToPrint = Communication::cleanseAccountNumber($output);
|
48 |
+
Mage::log($xmlToPrint,null,"litle_transaction.log");
|
49 |
+
}
|
50 |
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
51 |
if (! $output){
|
52 |
throw new Exception (curl_error($ch));
|
56 |
curl_close($ch);
|
57 |
return $output;
|
58 |
}
|
|
|
59 |
}
|
60 |
+
|
61 |
+
static public function cleanseAccountNumber($xml) {
|
62 |
+
return preg_replace("|<number>\d+(\d{4})</number>|", "<number>XXXX$1</number>",$xml);
|
63 |
+
}
|
64 |
+
|
65 |
+
static public function cleanseCardValidationNum($xml) {
|
66 |
+
return preg_replace("|<cardValidationNum>\d+</cardValidationNum>|", "<cardValidationNum>NEUTERED</cardValidationNum>",$xml);
|
67 |
+
}
|
68 |
+
|
69 |
+
static public function cleansePassword($xml) {
|
70 |
+
return preg_replace("|<password>.*?</password>|", "<password>NEUTERED</password>",$xml);
|
71 |
+
}
|
72 |
+
|
73 |
}
|
app/code/local/Litle/LitleSDK/LitleOnlineRequest.php
CHANGED
@@ -325,7 +325,7 @@ class LitleOnlineRequest
|
|
325 |
$hash_out['merchantSdk'] = $hash_in['merchantSdk'];
|
326 |
}
|
327 |
else {
|
328 |
-
$hash_out['merchantSdk'] = 'PHP;8.
|
329 |
}
|
330 |
if(isset($hash_in['id'])) {
|
331 |
$hash_out['id'] = $hash_in['id'];
|
325 |
$hash_out['merchantSdk'] = $hash_in['merchantSdk'];
|
326 |
}
|
327 |
else {
|
328 |
+
$hash_out['merchantSdk'] = 'PHP;8.14.0';
|
329 |
}
|
330 |
if(isset($hash_in['id'])) {
|
331 |
$hash_out['id'] = $hash_in['id'];
|
app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Failedtransactions.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Litle Palorus Module
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* Copyright (c) 2012 Litle & Co.
|
8 |
+
*
|
9 |
+
* Permission is hereby granted, free of charge, to any person
|
10 |
+
* obtaining a copy of this software and associated documentation
|
11 |
+
* files (the "Software"), to deal in the Software without
|
12 |
+
* restriction, including without limitation the rights to use,
|
13 |
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14 |
+
* copies of the Software, and to permit persons to whom the
|
15 |
+
* Software is furnished to do so, subject to the following
|
16 |
+
* conditions:
|
17 |
+
*
|
18 |
+
* The above copyright notice and this permission notice shall be
|
19 |
+
* included in all copies or substantial portions of the Software.
|
20 |
+
*
|
21 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
22 |
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
23 |
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
24 |
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
25 |
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
26 |
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
27 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
28 |
+
* OTHER DEALINGS IN THE SOFTWARE.
|
29 |
+
*
|
30 |
+
* @category Litle
|
31 |
+
* @package Litle_Palorus
|
32 |
+
* @copyright Copyright (c) 2012 Litle & Co.
|
33 |
+
* @license http://www.opensource.org/licenses/mit-license.php
|
34 |
+
* @author Litle & Co <sdksupport@litle.com> www.litle.com/developers
|
35 |
+
*/
|
36 |
+
class Litle_Palorus_Block_Adminhtml_Palorus_Insight_Failedtransactions
|
37 |
+
extends Mage_Adminhtml_Block_Widget_Grid
|
38 |
+
implements Mage_Adminhtml_Block_Widget_Tab_Interface {
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Set the template for the block
|
42 |
+
*
|
43 |
+
*/
|
44 |
+
|
45 |
+
public function _construct()
|
46 |
+
{
|
47 |
+
$this->setId('litle_customer_orders_grid');
|
48 |
+
$this->setDefaultSort('failed_transactions_id', 'desc');
|
49 |
+
$this->setUseAjax(true);
|
50 |
+
$this->setFilterVisibility(true);
|
51 |
+
$this->setPagerVisibility(true);
|
52 |
+
parent::_construct();
|
53 |
+
}
|
54 |
+
|
55 |
+
protected function _prepareColumns()
|
56 |
+
{
|
57 |
+
$this->addColumn('failed_transactions_id', array(
|
58 |
+
'header' => 'Failed Transactions ID',
|
59 |
+
'width' => '100',
|
60 |
+
'index' => 'failed_transactions_id',
|
61 |
+
'sortable' => false,
|
62 |
+
));
|
63 |
+
|
64 |
+
return parent::_prepareColumns();
|
65 |
+
}
|
66 |
+
|
67 |
+
public function getRowUrl($row)
|
68 |
+
{
|
69 |
+
return $this->getUrl('palorus/adminhtml_myform/failedtransactionsview/', array('failed_transactions_id' => $row->getFailedTransactionsId()));
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
protected function _prepareCollection()
|
74 |
+
{
|
75 |
+
$customerId = Mage::registry('current_customer')->getId();
|
76 |
+
$collection = Mage::getModel('palorus/subscription')
|
77 |
+
->getCollection()
|
78 |
+
->addFieldToFilter('customer_id',$customerId);
|
79 |
+
foreach ($collection as $order){
|
80 |
+
$productId = $order->getData();
|
81 |
+
$productName = $productId['product_id'];
|
82 |
+
$product = Mage::getModel('catalog/product')->load($productName);
|
83 |
+
$name = $product->getName();
|
84 |
+
$order->setData('name', $name);
|
85 |
+
$amount = money_format('%i', $productId['amount']/100);
|
86 |
+
$order->setData('price', '$'.$amount);
|
87 |
+
}
|
88 |
+
$this->setCollection($collection);
|
89 |
+
return parent::_prepareCollection();
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Retrieve the label used for the tab relating to this block
|
94 |
+
*
|
95 |
+
* @return string
|
96 |
+
*/
|
97 |
+
public function getTabLabel()
|
98 |
+
{
|
99 |
+
return $this->__('Litle & Co. Subscription');
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Retrieve the title used by this tab
|
104 |
+
*
|
105 |
+
* @return string
|
106 |
+
*/
|
107 |
+
public function getTabTitle()
|
108 |
+
{
|
109 |
+
return $this->__('Click here to view Litle & Co. Subscription');
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Determines whether to display the tab
|
114 |
+
* Add logic here to decide whether you want the tab to display
|
115 |
+
*
|
116 |
+
* @return bool
|
117 |
+
*/
|
118 |
+
public function canShowTab()
|
119 |
+
{
|
120 |
+
return true;
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Stops the tab being hidden
|
125 |
+
*
|
126 |
+
* @return bool
|
127 |
+
*/
|
128 |
+
public function isHidden()
|
129 |
+
{
|
130 |
+
return false;
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
}
|
app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Failedtransactionshome.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Litle_Palorus_Block_Adminhtml_Palorus_Insight_Failedtransactionshome extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setTemplate('litle/form/failedtransactionsview.phtml');
|
8 |
+
}
|
9 |
+
|
10 |
+
protected function _prepareLayout()
|
11 |
+
{
|
12 |
+
return parent::_prepareLayout();
|
13 |
+
}
|
14 |
+
|
15 |
+
private function getFailedTransactions(){
|
16 |
+
return Mage::getModel('palorus/failedtransactions')->getCollection();
|
17 |
+
}
|
18 |
+
|
19 |
+
public function getFailedTransactionsTable()
|
20 |
+
{
|
21 |
+
$collection = $this->getFailedTransactions();
|
22 |
+
$index=0;
|
23 |
+
$table = array();
|
24 |
+
foreach ($collection as $order){
|
25 |
+
$row = $order->getData();
|
26 |
+
$table[$index] = $row;
|
27 |
+
$index = $index+1;
|
28 |
+
}
|
29 |
+
return $table;
|
30 |
+
}
|
31 |
+
|
32 |
+
public function getProductName($subscriptionRow)
|
33 |
+
{
|
34 |
+
$productName = $subscriptionRow['product_id'];
|
35 |
+
$product = Mage::getModel('catalog/product')->load($productName);
|
36 |
+
return $product->getName();
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getRowUrl($row)
|
40 |
+
{
|
41 |
+
$failedTransactionId = $row['failed_transactions_id'];
|
42 |
+
return $this->getUrl('palorus/adminhtml_myform/failedtransactionsview/', array('failed_transactions_id' => $failedTransactionId));
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Failedtransactionsview.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Litle_Palorus_Block_Adminhtml_Palorus_Insight_Failedtransactionsview extends Mage_Adminhtml_Block_Widget_Form
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
parent::__construct();
|
8 |
+
$this->setTemplate('litle/form/failedtransactions.phtml');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareLayout()
|
12 |
+
{
|
13 |
+
return parent::_prepareLayout();
|
14 |
+
}
|
15 |
+
|
16 |
+
private function getFailedTransactionRow(){
|
17 |
+
$failureId = $this->getFailedTransactionsId();
|
18 |
+
return Mage::getModel('palorus/failedtransactions')->getCollection()->addFieldToFilter('failed_transactions_id', $failureId);
|
19 |
+
}
|
20 |
+
|
21 |
+
private function getFailedTransactionData($field)
|
22 |
+
{
|
23 |
+
$collection = $this->getFailedTransactionRow();
|
24 |
+
foreach ($collection as $failure){
|
25 |
+
$row = $failure->getData();
|
26 |
+
return $row[$field];
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
public function updateFailedTransaction(){
|
31 |
+
if($this->getFailedTransactionData('active')){
|
32 |
+
$this->setActive(false);
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
protected function setFailedTransactionsId($id){
|
37 |
+
$this->failedTransactions = $id;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function getFailedTransactionsId(){
|
41 |
+
if ($this->failedTransactionsId === Null){
|
42 |
+
$url = $this->helper("core/url")->getCurrentUrl();
|
43 |
+
$stringAfterFailedTransactionsId = explode('failed_transactions_id/', $url);
|
44 |
+
$stringBeforeKey = explode('/', $stringAfterFailedTransactionsId[1]);
|
45 |
+
return $stringBeforeKey[0];
|
46 |
+
}else {
|
47 |
+
return $this->failedTransactionsId;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
public function getLitleTxnId(){
|
52 |
+
return $this->getFailedTransactionData('litle_txn_id');
|
53 |
+
}
|
54 |
+
|
55 |
+
public function getMessage() {
|
56 |
+
return $this->getFailedTransactionData('message');
|
57 |
+
}
|
58 |
+
|
59 |
+
public function getFullXml() {
|
60 |
+
$orig = $this->getFailedTransactionData('full_xml');
|
61 |
+
$converted = htmlentities($orig);
|
62 |
+
$newLinesBecomeBreaks = str_replace("\n","<br/>", $converted);
|
63 |
+
return $newLinesBecomeBreaks;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getCustomerId() {
|
67 |
+
$customerId = $this->getFailedTransactionData('customer_id');
|
68 |
+
return $customerId;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function getCustomerUrl() {
|
72 |
+
$customerId = $this->getCustomerId();
|
73 |
+
if($customerId === '0') {
|
74 |
+
return "Customer was not logged in";
|
75 |
+
}
|
76 |
+
$url = $this->getUrl('adminhtml/customer/edit/') . 'id/' . $customerId;
|
77 |
+
return "<a href=" . $url . ">" . $customerId . "</a>";
|
78 |
+
}
|
79 |
+
|
80 |
+
public function getOrderId() {
|
81 |
+
return $this->getFailedTransactionData('order_id');
|
82 |
+
}
|
83 |
+
|
84 |
+
public function getOrderNum() {
|
85 |
+
return $this->getFailedTransactionData('order_num');
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getOrderUrl() {
|
89 |
+
$orderId = $this->getOrderId();
|
90 |
+
$orderNum = $this->getOrderNum();
|
91 |
+
if($orderId === "0") {
|
92 |
+
return "No order information available";
|
93 |
+
}
|
94 |
+
$url = $this->getUrl('adminhtml/sales_order') . 'view/order_id/' . $orderId;
|
95 |
+
return "<a href=" . $url . ">" . $orderNum . "</a>";
|
96 |
+
}
|
97 |
+
}
|
app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Grid.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Litle Palorus Module
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* Copyright (c) 2012 Litle & Co.
|
8 |
+
*
|
9 |
+
* Permission is hereby granted, free of charge, to any person
|
10 |
+
* obtaining a copy of this software and associated documentation
|
11 |
+
* files (the "Software"), to deal in the Software without
|
12 |
+
* restriction, including without limitation the rights to use,
|
13 |
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14 |
+
* copies of the Software, and to permit persons to whom the
|
15 |
+
* Software is furnished to do so, subject to the following
|
16 |
+
* conditions:
|
17 |
+
*
|
18 |
+
* The above copyright notice and this permission notice shall be
|
19 |
+
* included in all copies or substantial portions of the Software.
|
20 |
+
*
|
21 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
22 |
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
23 |
+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
24 |
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
25 |
+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
26 |
+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
27 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
28 |
+
* OTHER DEALINGS IN THE SOFTWARE.
|
29 |
+
*
|
30 |
+
* @category Litle
|
31 |
+
* @package Litle_Palorus
|
32 |
+
* @copyright Copyright (c) 2012 Litle & Co.
|
33 |
+
* @license http://www.opensource.org/licenses/mit-license.php
|
34 |
+
* @author Litle & Co <sdksupport@litle.com> www.litle.com/developers
|
35 |
+
*/
|
36 |
+
class Litle_Palorus_Block_Adminhtml_Palorus_Insight_Grid
|
37 |
+
extends Mage_Adminhtml_Block_Widget_Grid {
|
38 |
+
|
39 |
+
public function __construct()
|
40 |
+
{
|
41 |
+
parent::__construct();
|
42 |
+
$this->setId('sales_order_grid');
|
43 |
+
$this->setUseAjax(false);
|
44 |
+
$this->setDefaultSort('created_at');
|
45 |
+
$this->setDefaultDir('DESC');
|
46 |
+
$this->setSaveParametersInSession(true);
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Retrieve collection class
|
51 |
+
*
|
52 |
+
* @return string
|
53 |
+
*/
|
54 |
+
protected function _getCollectionClass()
|
55 |
+
{
|
56 |
+
return 'palorus/failedtransactions_collection';
|
57 |
+
}
|
58 |
+
|
59 |
+
protected function _prepareCollection()
|
60 |
+
{
|
61 |
+
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
62 |
+
$this->setCollection($collection);
|
63 |
+
return parent::_prepareCollection();
|
64 |
+
}
|
65 |
+
|
66 |
+
protected function _prepareColumns()
|
67 |
+
{
|
68 |
+
$this->addColumn('litle_txn_id', array(
|
69 |
+
'header'=> Mage::helper('sales')->__('Litle Transaction Id'),
|
70 |
+
'width' => '80px',
|
71 |
+
'type' => 'text',
|
72 |
+
'index' => 'litle_txn_id',
|
73 |
+
));
|
74 |
+
|
75 |
+
$this->addColumn('transaction_timestamp', array(
|
76 |
+
'header' => Mage::helper('sales')->__('Date/Time'),
|
77 |
+
'index' => 'transaction_timestamp',
|
78 |
+
'type' => 'datetime',
|
79 |
+
'width' => '140px',
|
80 |
+
));
|
81 |
+
|
82 |
+
$this->addColumn('order_num', array(
|
83 |
+
'header' => Mage::helper('sales')->__('Order Number'),
|
84 |
+
'index' => 'order_num',
|
85 |
+
));
|
86 |
+
|
87 |
+
$this->addColumn('customer_id', array(
|
88 |
+
'header' => Mage::helper('sales')->__('Customer Number'),
|
89 |
+
'index' => 'customer_id',
|
90 |
+
));
|
91 |
+
|
92 |
+
$this->addColumn('active', array(
|
93 |
+
'header' => Mage::helper('sales')->__('Status'),
|
94 |
+
'index' => 'active',
|
95 |
+
'type' => 'options',
|
96 |
+
'width' => '70px',
|
97 |
+
'options' => array('Action Taken','Pending'),
|
98 |
+
));
|
99 |
+
|
100 |
+
$this->addColumn('action',
|
101 |
+
array(
|
102 |
+
'header' => Mage::helper('sales')->__('Action'),
|
103 |
+
'width' => '50px',
|
104 |
+
'type' => 'action',
|
105 |
+
'getter' => 'getId',
|
106 |
+
'actions' => array(
|
107 |
+
array(
|
108 |
+
'caption' => Mage::helper('sales')->__('View'),
|
109 |
+
'url' => array('base'=>'palorus/adminhtml_myform/failedtransactionsview/'),
|
110 |
+
'field' => 'failed_transactions_id'
|
111 |
+
)
|
112 |
+
),
|
113 |
+
'filter' => false,
|
114 |
+
'sortable' => false,
|
115 |
+
'index' => 'stores',
|
116 |
+
'is_system' => true,
|
117 |
+
));
|
118 |
+
|
119 |
+
return parent::_prepareColumns();
|
120 |
+
}
|
121 |
+
|
122 |
+
protected function _prepareMassaction()
|
123 |
+
{
|
124 |
+
$this->setMassactionIdField('entity_id');
|
125 |
+
$this->getMassactionBlock()->setFormFieldName('failed_transactions_id');
|
126 |
+
$this->getMassactionBlock()->setUseSelectAll(false);
|
127 |
+
|
128 |
+
$actionTakenUrl = $this->getUrl('*/adminhtml_myform/massFailedTransactionsMarkActionTaken');
|
129 |
+
$this->getMassactionBlock()->addItem('mark_failed_transaction_inactive', array(
|
130 |
+
'label'=> Mage::helper('sales')->__('Mark Action Taken'),
|
131 |
+
'url' => $actionTakenUrl,
|
132 |
+
));
|
133 |
+
|
134 |
+
$actionNotTakenUrl = $this->getUrl('*/adminhtml_myform/massFailedTransactionsMarkActionNotTaken');
|
135 |
+
$this->getMassactionBlock()->addItem('mark_failed_transaction_active', array(
|
136 |
+
'label'=> Mage::helper('sales')->__('Mark Pending'),
|
137 |
+
'url' => $actionNotTakenUrl,
|
138 |
+
));
|
139 |
+
|
140 |
+
return $this;
|
141 |
+
}
|
142 |
+
|
143 |
+
public function getRowUrl($row)
|
144 |
+
{
|
145 |
+
return $this->getUrl('palorus/adminhtml_myform/failedtransactionsview/', array('failed_transactions_id' => $row->getId()));
|
146 |
+
}
|
147 |
+
|
148 |
+
public function getGridUrl()
|
149 |
+
{
|
150 |
+
$url = $this->getUrl('*/*/failedtransactions', array('_current'=>true));
|
151 |
+
return $url;
|
152 |
+
}
|
153 |
+
|
154 |
+
}
|
app/code/local/Litle/Palorus/Block/Adminhtml/Palorus/Insight/Tab.php
CHANGED
@@ -95,8 +95,6 @@ implements Mage_Adminhtml_Block_Widget_Tab_Interface {
|
|
95 |
|
96 |
public function getGridUrl()
|
97 |
{
|
98 |
-
// Mage::log("Get grid url");
|
99 |
-
// return $this->getUrl('*/*/orders', array('_current' => true));
|
100 |
}
|
101 |
|
102 |
/**
|
95 |
|
96 |
public function getGridUrl()
|
97 |
{
|
|
|
|
|
98 |
}
|
99 |
|
100 |
/**
|
app/code/local/Litle/Palorus/Block/Adminhtml/Transaction.php
CHANGED
@@ -46,7 +46,6 @@ class Litle_Palorus_Block_Adminhtml_Transaction extends Mage_Adminhtml_Block_Sal
|
|
46 |
$txnType = $this->_txn->getTxnType();
|
47 |
$method = $this->_txn->getOrderPaymentObject()->getMethod();
|
48 |
|
49 |
-
Mage::log("Litle_Palorus_Block_Adminhtml_Transaction:getTxnIdHtml - method: $method; txnType: $txnType; url: $url; litleTxnId: $litleTxnId", Zend_Log::DEBUG);
|
50 |
$html = Litle_Palorus_Block_Adminhtml_Transaction::_getTxnIdHtml($txnType, $method, $url, $litleTxnId);
|
51 |
if($html == NULL) {
|
52 |
return parent::getTxnIdHtml();
|
46 |
$txnType = $this->_txn->getTxnType();
|
47 |
$method = $this->_txn->getOrderPaymentObject()->getMethod();
|
48 |
|
|
|
49 |
$html = Litle_Palorus_Block_Adminhtml_Transaction::_getTxnIdHtml($txnType, $method, $url, $litleTxnId);
|
50 |
if($html == NULL) {
|
51 |
return parent::getTxnIdHtml();
|
app/code/local/Litle/Palorus/Helper/Data.php
CHANGED
@@ -37,12 +37,10 @@ class Litle_Palorus_Helper_Data extends Mage_Core_Helper_Abstract
|
|
37 |
}
|
38 |
|
39 |
public function getBaseUrl()
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
}
|
45 |
-
|
46 |
|
47 |
static public function getBaseUrlFrom($url)
|
48 |
{
|
@@ -161,18 +159,14 @@ class Litle_Palorus_Helper_Data extends Mage_Core_Helper_Abstract
|
|
161 |
|
162 |
static private function formatMoney($balance)
|
163 |
{
|
164 |
-
if ($balance === '' || $balance === NULL){
|
165 |
$available_balance = '';
|
166 |
-
}
|
167 |
-
|
168 |
-
$balance = str_pad($balance, 3, '0', STR_PAD_LEFT);
|
169 |
-
$available_balance = substr_replace($balance, '.', -2, 0);
|
170 |
-
$available_balance = '$' . $available_balance;
|
171 |
}
|
172 |
|
173 |
return $available_balance;
|
174 |
}
|
175 |
-
|
176 |
|
177 |
/**
|
178 |
* Returns the checkout session.
|
37 |
}
|
38 |
|
39 |
public function getBaseUrl()
|
40 |
+
{
|
41 |
+
$url = Mage::getModel('creditcard/paymentlogic')->getConfigData('url');
|
42 |
+
return self::getBaseUrlFrom($url);
|
43 |
+
}
|
|
|
|
|
44 |
|
45 |
static public function getBaseUrlFrom($url)
|
46 |
{
|
159 |
|
160 |
static private function formatMoney($balance)
|
161 |
{
|
162 |
+
if ($balance === '' || $balance === NULL) {
|
163 |
$available_balance = '';
|
164 |
+
} else {
|
165 |
+
$available_balance = '$' . number_format($balance, 2);
|
|
|
|
|
|
|
166 |
}
|
167 |
|
168 |
return $available_balance;
|
169 |
}
|
|
|
170 |
|
171 |
/**
|
172 |
* Returns the checkout session.
|
app/code/local/Litle/Palorus/Model/Failedtransactions.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Litle_Palorus_Model_Failedtransactions extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected $_model = NULL;
|
6 |
+
|
7 |
+
protected function _construct()
|
8 |
+
{
|
9 |
+
$this->_model = 'palorus/failedtransactions';
|
10 |
+
$this->_init($this->_model);
|
11 |
+
}
|
12 |
+
|
13 |
+
}
|
app/code/local/Litle/Palorus/Model/Mysql4/Failedtransactions.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Litle_Palorus_Model_Mysql4_Failedtransactions extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('palorus/failedtransactions', 'failed_transactions_id');
|
8 |
+
}
|
9 |
+
}
|
app/code/local/Litle/Palorus/Model/Mysql4/Failedtransactions/Collection.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Litle_Palorus_Model_Mysql4_Failedtransactions_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('palorus/failedtransactions');
|
9 |
+
}
|
10 |
+
|
11 |
+
}
|
app/code/local/Litle/Palorus/Model/Mysql4/Failedtransactions/Grid/Collection.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Sales
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Flat sales order grid collection
|
30 |
+
*
|
31 |
+
* @category Mage
|
32 |
+
* @package Mage_Sales
|
33 |
+
* @author Magento Core Team <core@magentocommerce.com>
|
34 |
+
*/
|
35 |
+
class Litle_Palorus_Model_Mysql4_Failedtransactions_Grid_Collection extends Mage_Sales_Model_Resource_Order_Grid_Collection
|
36 |
+
{
|
37 |
+
}
|
app/code/local/Litle/Palorus/Model/Vault.php
CHANGED
@@ -83,6 +83,16 @@ class Litle_Palorus_Model_Vault extends Mage_Core_Model_Abstract
|
|
83 |
|
84 |
return $vault;
|
85 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
/**
|
88 |
* Create a token with the minimum information.
|
83 |
|
84 |
return $vault;
|
85 |
}
|
86 |
+
|
87 |
+
public function proveArchitRight($foo, $bar, $foobar) {
|
88 |
+
// fetch write database connection that is used in Mage_Core module
|
89 |
+
$write = Mage::getSingleton('core/resource')->getConnection('core_setup');
|
90 |
+
//$write->beginTransaction();
|
91 |
+
|
92 |
+
// now $write is an instance of Zend_Db_Adapter_Abstract
|
93 |
+
$write->query("insert into litle_vault (vault_id, order_id, customer_id, last4, token, type, bin) values ($foo,$bar,0,1234,$foobar,'VI','123456')");
|
94 |
+
//$write->commit();
|
95 |
+
}
|
96 |
|
97 |
/**
|
98 |
* Create a token with the minimum information.
|
app/code/local/Litle/Palorus/controllers/Adminhtml/MyformController.php
CHANGED
@@ -66,4 +66,45 @@ class Litle_Palorus_Adminhtml_MyformController extends Mage_Adminhtml_Controller
|
|
66 |
{
|
67 |
$this->_redirectUrl(Mage::helper('palorus')->getBaseUrl() . '/ui/reports/chargebacks/compliance');
|
68 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
66 |
{
|
67 |
$this->_redirectUrl(Mage::helper('palorus')->getBaseUrl() . '/ui/reports/chargebacks/compliance');
|
68 |
}
|
69 |
+
|
70 |
+
public function failedtransactionsAction()
|
71 |
+
{
|
72 |
+
$this->loadLayout();
|
73 |
+
$block = $this->getLayout()->createBlock('palorus/adminhtml_palorus_insight_grid');
|
74 |
+
$this->getLayout()->getBlock('content')->append($block);
|
75 |
+
$this->renderLayout();
|
76 |
+
}
|
77 |
+
|
78 |
+
public function massFailedTransactionsMarkActionTakenAction() {
|
79 |
+
$request = $this->getRequest();
|
80 |
+
$params = $request->getParams();
|
81 |
+
$failedTransactions = $params['failed_transactions_id'];
|
82 |
+
foreach($failedTransactions as $failedTransactionToDelete) {
|
83 |
+
$row = Mage::getModel("palorus/failedtransactions")->load($failedTransactionToDelete);
|
84 |
+
$row->setActive(false);
|
85 |
+
$row->save();
|
86 |
+
}
|
87 |
+
$this->failedtransactionsAction();
|
88 |
+
}
|
89 |
+
|
90 |
+
public function massFailedTransactionsMarkActionNotTakenAction() {
|
91 |
+
$request = $this->getRequest();
|
92 |
+
$params = $request->getParams();
|
93 |
+
$failedTransactions = $params['failed_transactions_id'];
|
94 |
+
foreach($failedTransactions as $failedTransactionToDelete) {
|
95 |
+
$row = Mage::getModel("palorus/failedtransactions")->load($failedTransactionToDelete);
|
96 |
+
$row->setActive(true);
|
97 |
+
$row->save();
|
98 |
+
}
|
99 |
+
$this->failedtransactionsAction();
|
100 |
+
}
|
101 |
+
|
102 |
+
|
103 |
+
public function failedtransactionsviewAction()
|
104 |
+
{
|
105 |
+
$this->loadLayout();
|
106 |
+
$block = $this->getLayout()->createBlock('palorus/adminhtml_palorus_insight_failedtransactionsview');
|
107 |
+
$this->getLayout()->getBlock('content')->append($block);
|
108 |
+
$this->renderLayout();
|
109 |
+
}
|
110 |
}
|
app/code/local/Litle/Palorus/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Litle_Palorus>
|
5 |
-
<version>8.
|
6 |
</Litle_Palorus>
|
7 |
</modules>
|
8 |
<global>
|
@@ -20,6 +20,9 @@
|
|
20 |
<vault>
|
21 |
<table>litle_vault</table>
|
22 |
</vault>
|
|
|
|
|
|
|
23 |
</entities>
|
24 |
</palorus_mysql4>
|
25 |
</models>
|
@@ -151,6 +154,10 @@
|
|
151 |
<title>Chargebacks</title>
|
152 |
<action>palorus/adminhtml_myform/chargebacksearch</action>
|
153 |
</chargebacks>
|
|
|
|
|
|
|
|
|
154 |
</children>
|
155 |
</palorus_adminform>
|
156 |
</children>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Litle_Palorus>
|
5 |
+
<version>8.14.0</version>
|
6 |
</Litle_Palorus>
|
7 |
</modules>
|
8 |
<global>
|
20 |
<vault>
|
21 |
<table>litle_vault</table>
|
22 |
</vault>
|
23 |
+
<failedtransactions>
|
24 |
+
<table>litle_failed_transactions</table>
|
25 |
+
</failedtransactions>
|
26 |
</entities>
|
27 |
</palorus_mysql4>
|
28 |
</models>
|
154 |
<title>Chargebacks</title>
|
155 |
<action>palorus/adminhtml_myform/chargebacksearch</action>
|
156 |
</chargebacks>
|
157 |
+
<failedtransactions translate="title" module="palorus">
|
158 |
+
<title>Failed transactions</title>
|
159 |
+
<action>palorus/adminhtml_myform/failedtransactions</action>
|
160 |
+
</failedtransactions>
|
161 |
</children>
|
162 |
</palorus_adminform>
|
163 |
</children>
|
app/code/local/Litle/Palorus/sql/palorus_setup/mysql4-upgrade-8.13.2-8.13.3.php
CHANGED
@@ -1,16 +1,18 @@
|
|
1 |
<?php
|
2 |
-
Mage::log("Starting upgrade SQL 8.13.2 to 8.14.0");
|
3 |
-
$installer = $this;
|
4 |
|
|
|
|
|
5 |
$installer->startSetup();
|
6 |
|
7 |
$installer->getConnection()->addColumn($installer->getTable('sales/quote_payment'), 'litle_vault_id', 'int(10)');
|
|
|
8 |
$installer->getConnection()->addColumn($installer->getTable('sales/order_payment'), 'litle_vault_id', 'int(10)');
|
|
|
9 |
|
10 |
-
$
|
11 |
-
CREATE TABLE IF NOT EXISTS `{$installer->getTable('palorus/vault')}_tmp` (
|
12 |
`vault_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
13 |
-
`order_id` int(10) unsigned DEFAULT
|
14 |
`customer_id` int(10) unsigned NOT NULL DEFAULT '0',
|
15 |
`last4` varchar(4) DEFAULT NULL,
|
16 |
`token` varchar(25) DEFAULT NULL,
|
@@ -24,26 +26,61 @@ $installer->run("
|
|
24 |
PRIMARY KEY (`vault_id`),
|
25 |
UNIQUE KEY `customer_token` (`customer_id`, `token`)
|
26 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
27 |
-
"
|
28 |
-
|
29 |
-
$installer->run(
|
30 |
-
|
31 |
-
");
|
32 |
|
33 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
$installer->
|
36 |
-
|
37 |
-
|
|
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
$
|
|
|
|
|
|
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
-
$
|
|
|
|
|
|
|
48 |
|
|
|
49 |
$installer->endSetup();
|
1 |
<?php
|
|
|
|
|
2 |
|
3 |
+
$installer = $this;
|
4 |
+
Mage::log("About to start upgrade from 8.13.2 to 8.13.3", null, "litle_install.log");
|
5 |
$installer->startSetup();
|
6 |
|
7 |
$installer->getConnection()->addColumn($installer->getTable('sales/quote_payment'), 'litle_vault_id', 'int(10)');
|
8 |
+
Mage::log("Added column litle_vault_id to quote_payment", null, "litle_install.log");
|
9 |
$installer->getConnection()->addColumn($installer->getTable('sales/order_payment'), 'litle_vault_id', 'int(10)');
|
10 |
+
Mage::log("Added column litle_vault_id to order_payment", null, "litle_install.log");
|
11 |
|
12 |
+
$sql = "
|
13 |
+
CREATE TABLE IF NOT EXISTS `_{$installer->getTable('palorus/vault')}_tmp` (
|
14 |
`vault_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
15 |
+
`order_id` int(10) unsigned NOT NULL DEFAULT '0',
|
16 |
`customer_id` int(10) unsigned NOT NULL DEFAULT '0',
|
17 |
`last4` varchar(4) DEFAULT NULL,
|
18 |
`token` varchar(25) DEFAULT NULL,
|
26 |
PRIMARY KEY (`vault_id`),
|
27 |
UNIQUE KEY `customer_token` (`customer_id`, `token`)
|
28 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
29 |
+
";
|
30 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
31 |
+
$installer->run($sql);
|
32 |
+
Mage::log("Create table litle_vault_tmp", null, "litle_install.log");
|
|
|
33 |
|
34 |
+
$sql = "
|
35 |
+
INSERT INTO `_{$installer->getTable('palorus/vault')}_tmp`
|
36 |
+
(vault_id,customer_id,last4,token,`type`,`bin`,updated,created)
|
37 |
+
SELECT
|
38 |
+
v.vault_id,customer_id,last4,v.token,`type`,`bin`,NOW(), NOW()
|
39 |
+
FROM `{$installer->getTable('palorus/vault')}` v
|
40 |
+
JOIN (
|
41 |
+
SELECT MAX(vault_id) vault_id,token FROM `{$installer->getTable('palorus/vault')}` GROUP BY token
|
42 |
+
) v2 ON v.vault_id = v2.vault_id;
|
43 |
+
";
|
44 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
45 |
+
$installer->run($sql);
|
46 |
+
Mage::log("Copied contents of litle_vault to litle_vault_tmp", null, "litle_install.log");
|
47 |
|
48 |
+
$sql = "TRUNCATE TABLE `{$installer->getTable('palorus/vault')}`";
|
49 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
50 |
+
$installer->run($sql);
|
51 |
+
Mage::log("Truncated litle_vault", null, "litle_install.log");
|
52 |
|
53 |
+
$sql = "
|
54 |
+
ALTER TABLE `{$installer->getTable('palorus/vault')}`
|
55 |
+
ADD `expiration_month` TINYINT( 2 ) NULL DEFAULT NULL,
|
56 |
+
ADD `expiration_year` SMALLINT( 4 ) NULL DEFAULT NULL,
|
57 |
+
ADD `updated` DATETIME NULL DEFAULT NULL,
|
58 |
+
ADD `created` DATETIME NULL DEFAULT NULL,
|
59 |
+
ADD `is_visible` TINYINT( 1 ) NOT NULL DEFAULT '1',
|
60 |
+
ADD UNIQUE (`customer_id`, `token`)
|
61 |
+
";
|
62 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
63 |
+
$installer->run($sql);
|
64 |
+
Mage::log("Added expiration_month, expiration_year, updated, created, is_visible to litle_vault", null, "litle_install.log");
|
65 |
|
66 |
+
$sql = "INSERT INTO `{$installer->getTable('palorus/vault')}` SELECT * FROM `_{$installer->getTable('palorus/vault')}_tmp`;";
|
67 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
68 |
+
$installer->run($sql);
|
69 |
+
Mage::log("Loaded everything from litle_vault_tmp back into litle_vault", null, "litle_install.log");
|
70 |
|
71 |
+
$sql = "
|
72 |
+
UPDATE `{$installer->getTable('palorus/vault')}` v
|
73 |
+
LEFT JOIN `{$installer->getTable('sales/order')}` sfo ON sfo.entity_id=v.order_id
|
74 |
+
SET v.order_id = sfo.increment_id;
|
75 |
+
";
|
76 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
77 |
+
$installer->run($sql);
|
78 |
+
Mage::log("Updated litle_vault setting the order_id", null, "litle_install.log");
|
79 |
|
80 |
+
$sql = "DROP TABLE `_{$installer->getTable('palorus/vault')}_tmp`;";
|
81 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
82 |
+
$installer->run($sql);
|
83 |
+
Mage::log("Dropped temporary litle_vault_tmp table", null, "litle_install.log");
|
84 |
|
85 |
+
Mage::log("About to end upgrade from 8.13.2 to 8.13.3", null, "litle_install.log");
|
86 |
$installer->endSetup();
|
app/code/local/Litle/Palorus/sql/palorus_setup/mysql4-upgrade-8.13.3-8.14.0.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
Mage::log("About to start upgrade from 8.13.3 to 8.14.0", null, "litle_install.log");
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$sql = "
|
8 |
+
CREATE TABLE IF NOT EXISTS `{$installer->getTable('palorus/failedtransactions')}` (
|
9 |
+
`failed_transactions_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
10 |
+
`customer_id` int(10) unsigned,
|
11 |
+
`order_id` int(10) unsigned,
|
12 |
+
`message` varchar(255),
|
13 |
+
`full_xml` varchar(512),
|
14 |
+
`litle_txn_id` varchar(25),
|
15 |
+
`active` bool,
|
16 |
+
`transaction_timestamp` timestamp,
|
17 |
+
`order_num` int(10) unsigned,
|
18 |
+
PRIMARY KEY (`failed_transactions_id`)
|
19 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
20 |
+
";
|
21 |
+
Mage::log("SQL: " . $sql, null, "litle_install.log");
|
22 |
+
$installer->run($sql);
|
23 |
+
Mage::log("Created table litle_failed_transactions", null, "litle_install.log");
|
24 |
+
|
25 |
+
Mage::log("About to end upgrade from 8.13.3 to 8.14.0", null, "litle_install.log");
|
26 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/template/litle/form/failedtransactions.phtml
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<!-- Addresses list -->
|
28 |
+
|
29 |
+
<?php $active = $this->getActive();?>
|
30 |
+
<table cellspacing="0" class="form-edit">
|
31 |
+
<tr>
|
32 |
+
<td class="address-list">
|
33 |
+
<div class="content-header">
|
34 |
+
<h3 class="icon-head head-sales-order">
|
35 |
+
|
36 |
+
Failed Transaction Details
|
37 |
+
</h3>
|
38 |
+
</div>
|
39 |
+
<ul class="messages">
|
40 |
+
|
41 |
+
<?php if ($active === false):?>
|
42 |
+
<ul>
|
43 |
+
<li><span>Failed Transaction has already been dealt with.</span></li>
|
44 |
+
</ul>
|
45 |
+
<?php endif;?>
|
46 |
+
|
47 |
+
<div class="hor-scroll">
|
48 |
+
<table class="form-list" cellspacing="0">
|
49 |
+
<tbody>
|
50 |
+
<tr>
|
51 |
+
<td class="label"><label>Litle Transaction ID:</label></td>
|
52 |
+
<td class="value"><?php echo $this->getLitleTxnId()?></td>
|
53 |
+
</tr>
|
54 |
+
<tr>
|
55 |
+
<td class="label"><label>Customer ID:</label></td>
|
56 |
+
<td class="value"><?php echo $this->getCustomerUrl()?></td>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<td class="label"><label>Order Number:</label></td>
|
60 |
+
<td class="value"><?php echo $this->getOrderUrl()?></td>
|
61 |
+
</tr>
|
62 |
+
<tr>
|
63 |
+
<td class="label"><label>Message:</label></td>
|
64 |
+
<td class="value"><?php echo $this->getMessage()?></td>
|
65 |
+
</tr>
|
66 |
+
<tr>
|
67 |
+
<td class="label"><label>Raw XML:</label></td>
|
68 |
+
<td class="value"><?php echo $this->getFullXml()?></td>
|
69 |
+
</tr>
|
70 |
+
</tbody>
|
71 |
+
</table>
|
72 |
+
</div>
|
73 |
+
</td>
|
74 |
+
</tr>
|
75 |
+
<div align="right">
|
76 |
+
<?php if ($active === true):?>
|
77 |
+
<?php echo $this->getChildHtml('cancel_button') ?>  
|
78 |
+
<?php echo $this->getChildHtml('suspend_button') ?>  
|
79 |
+
<?php echo $this->getChildHtml('save_button') ?>  
|
80 |
+
<?php if ($this->showResumeButton()): ?>
|
81 |
+
<?php echo $this->getChildHtml('resume_button') ?>
|
82 |
+
<?php endif?>
|
83 |
+
<?php endif?>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
</table>
|
87 |
+
<br>
|
88 |
+
|
app/design/adminhtml/default/default/template/litle/form/failedtransactionsview.phtml
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package default_default
|
23 |
+
* @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $active = $this->getActive();?>
|
28 |
+
<table cellspacing="0" class="form-edit">
|
29 |
+
<tr>
|
30 |
+
<td class="address-list">
|
31 |
+
<div class="content-header">
|
32 |
+
<h3 class="icon-head head-sales-order">
|
33 |
+
Failed Transactions
|
34 |
+
</h3>
|
35 |
+
</div>
|
36 |
+
<?php $row = $this->getFailedTransactionsTable();?>
|
37 |
+
<div id="messages"></div>
|
38 |
+
<div id="failedTransactions">
|
39 |
+
<div class="grid">
|
40 |
+
<div class="hor-scroll">
|
41 |
+
<table id="failedTransactions_table" class="data"
|
42 |
+
cellspacing="0">
|
43 |
+
<colgroup>
|
44 |
+
<col width="100">
|
45 |
+
<col width="100">
|
46 |
+
<col width="100">
|
47 |
+
<col width="100">
|
48 |
+
</colgroup>
|
49 |
+
<thead>
|
50 |
+
<tr class="headings">
|
51 |
+
<th class=" no-link"><span class="nobr">Transaction Time</span>
|
52 |
+
</th>
|
53 |
+
<th class=" no-link"><span class="nobr">Customer ID</span>
|
54 |
+
</th>
|
55 |
+
<th class=" no-link"><span class="nobr">Order ID</span>
|
56 |
+
</th>
|
57 |
+
<th class=" no-link"><span class="nobr">Litle Transaction ID</span>
|
58 |
+
</th>
|
59 |
+
<th class=" no-link"><span class="nobr">Message</span>
|
60 |
+
</th>
|
61 |
+
</tr>
|
62 |
+
</thead>
|
63 |
+
<tbody>
|
64 |
+
<?php foreach ($row as $key => $value): ?>
|
65 |
+
<tr onclick='setLocation("<?php echo $this->getRowUrl($row[$key]);?>")' onMouseOver="this.bgColor='orange';"onMouseOut="this.bgColor='white';">
|
66 |
+
<td><?php echo $row[$key]["transaction_timestamp"];?></td>
|
67 |
+
<td><?php echo $row[$key]["customer_id"];?></td>
|
68 |
+
<td><?php echo $row[$key]["order_id"];?></td>
|
69 |
+
<td><?php echo $row[$key]["litle_txn_id"];?></td>
|
70 |
+
<td><?php echo $row[$key]["message"];?></td>
|
71 |
+
</tr>
|
72 |
+
<?php endforeach ?>
|
73 |
+
</tbody>
|
74 |
+
</table>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
|
79 |
+
|
80 |
+
</td>
|
81 |
+
</tr>
|
82 |
+
</table>
|
package.xml
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?><package><name>Litle_Payments</name><version>8.
|
2 |
&#13;
|
3 |
You will need to contact Litle to setup a merchant ID prior to processing your transaction. You can test your system against our sandbox without the need to contact Litle first.&#13;
|
4 |
&#13;
|
@@ -8,4 +8,4 @@ Why Litle?&#13;
|
|
8 |
&#13;
|
9 |
We deliver the most efficient and effective core processing available to digital and direct merchants. Relevant, value-added solutions help you drive more lasting and profitable customer relationships. We’ll also show you how payments intelligence can power your business and your relationships to greater success. We support you with the best customer experience in the business.&#13; </description><notes>This extension implements Litle XML&#13;
|
10 |
&#13;
|
11 |
-
Additional features include enhanced reporting on orders, transactions, and customers.</notes><authors><author><name>Litle</name><user>Litle</user><email>sdksupport@litle.com</email></author></authors><date>2012-
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?><package><name>Litle_Payments</name><version>8.14.0</version><stability>stable</stability><license>MIT</license><channel>community</channel><extends/><summary>This extension allows you to accept payments through Litle.</summary><description>Installation of this extension will allow you to easily accept payments through Litle. Once installed, you can choose to accept credit cards as well as eChecks to be processed by Litle.&#13;
|
2 |
&#13;
|
3 |
You will need to contact Litle to setup a merchant ID prior to processing your transaction. You can test your system against our sandbox without the need to contact Litle first.&#13;
|
4 |
&#13;
|
8 |
&#13;
|
9 |
We deliver the most efficient and effective core processing available to digital and direct merchants. Relevant, value-added solutions help you drive more lasting and profitable customer relationships. We’ll also show you how payments intelligence can power your business and your relationships to greater success. We support you with the best customer experience in the business.&#13; </description><notes>This extension implements Litle XML&#13;
|
10 |
&#13;
|
11 |
+
Additional features include enhanced reporting on orders, transactions, and customers.</notes><authors><author><name>Litle</name><user>Litle</user><email>sdksupport@litle.com</email></author></authors><date>2012-11-16</date><time>17:09:28</time><contents><target name="magelocal"><dir name="Litle"><dir><dir name="LEcheck"><dir name="Block"><dir name="Form"><file hash="a60f23cc46bd35a45aa682324155d3fe" name="LEcheck.php"/></dir></dir><dir name="Helper"><file hash="2c2664ab694e0ba70e45157061a01436" name="Data.php"/></dir><dir name="etc"><file hash="e54518d4e8d5b9c25d6e14068236ec4d" name="config.xml"/><file hash="daaf81623ceca045d3a3e56e296a29fc" name="system.xml"/></dir><dir name="Model"><file hash="1aa3e3e77c044e77154f9c24afcfc436" name="Transactiontypes.php"/><file hash="fe64d24b39251551b71e37937792b418" name="Config.php"/><file hash="cfc4ab4deb96affb632b7d6caf2b8b15" name="PaymentLogic.php"/><file hash="9e3d8ba06bcb9045abc82f20f18d5ef3" name="Url.php"/><file hash="6628bf9982d0d35341975d0bb83be5e1" name="Accounttypes.php"/><file hash="6a8d4d6f043976ad272c87a885d937f4" name="Validatehttp.php"/></dir></dir><dir name="LitleSDK"><file hash="17c64c7f34e5c84ab3461b92268ede46" name="LitleXmlMapper.php"/><file hash="e31de9a4933a78435cf5173650cb65c3" name="LitleOnlineRequest.php"/><file hash="212bd38b2507f0f890cf1a161456e45f" name="Communication.php"/><file hash="7344e369d0b1a639dc5cd26b9a1fdbea" name="Setup.php"/><file hash="d254c8a71ee20f59d7699c09d9c9c174" name="Obj2xml.php"/><file hash="9fb83575223778fad8eaee1bef16ab36" name="XmlParser.php"/><file hash="fb4806e06412b72ed5a6b96fc20cb18f" name="XmlFields.php"/><file hash="c7253201309ce7e91a41735410cb4f2d" name="LitleOnline.php"/><file hash="505ca6afdfbe3fd521848ea6f23b8d07" name="Checker.php"/><file hash="f7951fbf0fc218eaa041f0265b358499" name="UrlMapper.php"/></dir><dir name="CreditCard"><dir name="controllers"><dir name="Adminhtml"><file hash="ca1347dcfd4dc19b311b31e75c23891e" name="OrderController.php"/></dir></dir><dir name="Block"><dir name="Adminhtml"><file hash="c01fb8a142a89562c41a1a315f8f1529" name="Ordergrid.php"/><file hash="a60e3bb449e9001cab70968c0ee9373d" name="Orderview.php"/></dir><dir name="Form"><file hash="1cd0585e5d92329cf686e013b3a3870b" name="CreditCard.php"/></dir></dir><dir name="Helper"><file hash="5c022ff439721fabc61bc42fc51c6a51" name="Data.php"/></dir><dir name="etc"><file hash="6802cd6fcd4fb0ed9d0a9c73a904e56a" name="config.xml"/><file hash="86c5b777be1e8d9e7b5b4c1d3154ed22" name="system.xml"/></dir><dir name="Model"><file hash="00b1fdb98ecd344b76581fc98242c4e3" name="ValidateMerchantId.php"/><file hash="cf8f9d91ac8bf313aa8d97b865d719de" name="Cctypes.php"/><file hash="0626727ec55268fcaf6e33a55b3508d4" name="PaymentLogic.php"/><file hash="ce0ca23963d9eb05552528eb440d19fe" name="Url.php"/><dir name="Order"><file hash="7969e8ea26e6a721730465504d9271e8" name="Payment.php"/></dir><file hash="2ed8491cef39c7c17638e02b03b334b4" name="Lpayment.php"/><file hash="a4ba5179ecabffcbdecb70108b94f55a" name="Validatehttp.php"/></dir></dir><dir name="Palorus"><dir name="controllers"><dir name="Adminhtml"><file hash="717b8b9040d24b466b4b32df2434d95e" name="MyformController.php"/><file hash="4e12464add381a9ca0b8d4b09feb4082" name="VaultController.php"/></dir><file hash="08a1373697b6f3dd8c9e6508573e87d7" name="VaultController.php"/></dir><dir name="Block"><dir name="Vault"><file hash="79ee52a8a899feffeddd4ae036de6bc9" name="List.php"/></dir><dir name="Adminhtml"><file hash="ed5e2fe4884bd645549d52b5c84c7b8e" name="Transaction.php"/><dir name="Palorus"><dir name="Insight"><file hash="3d85f19b92c87365f56b356706e60dcb" name="Failedtransactionshome.php"/><file hash="d85debd2ff5d4cce14c948875f8c5f44" name="Tab.php"/><file hash="88480b417f99e8b93a22a5f060374db8" name="Failedtransactions.php"/><file hash="8c4cf7970444d3e51b93c548bb0c2aea" name="Failedtransactionsview.php"/><file hash="7ffd05ce801a49b4ab9cde9c970a6bda" name="Grid.php"/></dir></dir><dir name="Customer"><dir name="Edit"><dir name="Tab"><file hash="16f272c9d87b6172610a576b2f4912f1" name="Vault.php"/></dir></dir></dir></dir><file hash="135de819b38ce7ff878c16b48e6b6545" name="Vault.php"/></dir><dir name="Helper"><file hash="e4bf0aa1363f1879d4526b498a78f7d1" name="Data.php"/></dir><dir name="etc"><file hash="4a6db754e0a4c0784907725ea138c8b6" name="config.xml"/></dir><dir name="Model"><file hash="696fcdb15789c67dee56425c7131c87b" name="Failedtransactions.php"/><file hash="837fd9a46dc1d2a9362742299818aa9f" name="Insight.php"/><file hash="ac7ef488ca780e35ca93e4daac20bdb1" name="Vault.php"/><dir name="Mysql4"><dir name="Vault"><file hash="ed26a7b3761a82ab96f040d233dfdda0" name="Collection.php"/></dir><dir name="Insight"><file hash="ce93a4bc5c69a69967a5a48b8f6a0a6f" name="Collection.php"/></dir><file hash="5a542d03ff8287113711a1f54a86d51f" name="Failedtransactions.php"/><file hash="b8faca9944ba3ccd28505b36a8485e50" name="Insight.php"/><file hash="d468febf17e1ab53bcd2848329662b56" name="Vault.php"/><dir name="Failedtransactions"><dir name="Grid"><file hash="e595f99d9d45041976973969a160de65" name="Collection.php"/></dir><file hash="22ffa1993e6c83677718c523dbb26130" name="Collection.php"/></dir></dir></dir><dir name="sql"><dir name="palorus_setup"><file hash="65e2cda8318d2e986c5644a802e66bf3" name="mysql4-install-8.13.0.php"/><file hash="bc7b843786f6c71b2012cd64203ed2d4" name="mysql4-upgrade-8.13.3-8.14.0.php"/><file hash="66bc35e477c287ee27ecefe6c18fda41" name="mysql4-upgrade-8.13.2-8.13.3.php"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file hash="09fb485ff33fb8680e38742182d6d0ba" name="Litle_All.xml"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="litle"><dir name="vault"><file hash="365ad13b50baf79a310f0ce5fb593c98" name="list.phtml"/></dir><dir name="form"><file hash="2ea144a98a5e71d6c89b14623a021276" name="litleecheck.phtml"/><file hash="f47ebfd26147674f78b4d61fa150398c" name="litlecc.phtml"/><file hash="775224833051c1b7df7c32a626994ec0" name="litlejs.phtml"/></dir></dir></dir><dir name="layout"><file hash="2552fc3975e214bde25203cf16f66e7c" name="litlecreditcard.xml"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="litle"><dir name="form"><file hash="b9921c8126c2eab4a77bd4f120935753" name="litleecheck.phtml"/><file hash="c26146b155358c6a2e815f03a316b76b" name="litlecc.phtml"/><file hash="01ced0c103321c78a9aeb48780aedc3a" name="failedtransactions.phtml"/><file hash="6b65964f06d4ffc8bd73c5b0bc3a3487" name="failedtransactionsview.phtml"/></dir><dir name="customer"><dir name="tab"><file hash="33fd55b56e7a66011261eb4474dc3704" name="vault.phtml"/></dir></dir></dir></dir><dir name="layout"><file hash="b42e97feb8082098928265e136459ca2" name="litle.xml"/></dir></dir></dir></dir></target></contents><compatible/><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies></package>
|