Cardsave_Cardsaveonlinepayments - Version 1.9.4

Version Notes

Fixed the following bugs:
- payment form validation
- empty cart on failed payment
- wrong Payment Method wording in email confirmation

Download this release

Release Info

Developer Magento Core Team
Extension Cardsave_Cardsaveonlinepayments
Version 1.9.4
Comparing to
See all releases


Code changes from version 1.9.3 to 1.9.4

app/code/local/Cardsave/Cardsaveonlinepayments/Model/Direct.php CHANGED
@@ -319,6 +319,7 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
319
  {
320
  $szLogMessage = "Transaction could not be completed for OrderID: ".$szOrderID.". Result details: ";
321
  $szNotificationMessage = 'Payment Processor Response: '.$cdtrCardDetailsTransactionResult->getMessage();
 
322
 
323
  switch ($cdtrCardDetailsTransactionResult->getStatusCode())
324
  {
@@ -333,7 +334,6 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
333
  $szNotificationMessage = '';
334
 
335
  $szPaReq = $todTransactionOutputData->getThreeDSecureOutputData()->getPaREQ();
336
- $szCrossReference = $todTransactionOutputData->getCrossReference();
337
  $szACSURL = $todTransactionOutputData->getThreeDSecureOutputData()->getACSURL();
338
 
339
  Mage::getSingleton('checkout/session')->setMd($szCrossReference)
@@ -394,8 +394,7 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
394
  if($error)
395
  {
396
  $payment->setStatus('FAIL')
397
- ->setCcApproval('FAIL')
398
- ->setAdditionalData($cdtrCardDetailsTransactionResult->getMessage());
399
  }
400
  else
401
  {
@@ -405,6 +404,12 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
405
  }
406
  }
407
 
 
 
 
 
 
 
408
  return $error;
409
  }
410
 
@@ -789,8 +794,7 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
789
  }
790
  else
791
  {
792
- $payment->setStatus(self::STATUS_APPROVED)
793
- ->setAdditionalData($message);
794
 
795
  if($nVersion == 1324 || $nVersion == 1330)
796
  {
@@ -802,7 +806,7 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
802
  return $this;
803
  }
804
 
805
- public function _runRedirectedPaymentComplete(Varien_Object $payment, $boIsHostedPaymentAction, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage, $szOrderID)
806
  {
807
  $error = false;
808
  $message;
@@ -819,14 +823,15 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
819
  }
820
 
821
  $message = "Payment Processor Response: ".$szMessage;
822
- switch ($szStatusCode)
 
823
  {
824
  case "0":
825
  Mage::log($szWording."transaction successfully completed. ".$message);
826
  break;
827
  case "20":
828
  Mage::log("Duplicate ".$szWording."transaction. ".$message);
829
- $message = $message.". A duplicate transaction means that a transaction with these details has already been processed by the payment provider. The details of the original transaction - Previous Transaction Response: ".szPreviousMessage;
830
  if($szPreviousStatusCode != "0")
831
  {
832
  $error = true;
@@ -841,6 +846,12 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
841
  }
842
 
843
  $session->setPaymentprocessorresponse($message);
 
 
 
 
 
 
844
  if($error == true)
845
  {
846
  $message = Mage::helper('cardsaveonlinepayments')->__($message);
@@ -848,8 +859,7 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
848
  }
849
  else
850
  {
851
- $payment->setStatus(self::STATUS_APPROVED)
852
- ->setAdditionalData($message);
853
 
854
  if($nVersion == 1324 || $nVersion ==1330)
855
  {
@@ -943,12 +953,12 @@ class Cardsave_Cardsaveonlinepayments_Model_Direct extends Mage_Payment_Model_Me
943
  return $szISO3Code;
944
  }
945
 
946
- /**
947
- * Transform the string Magento version number into an integer ready for comparison
948
- *
949
- * @param unknown_type $magentoVersion
950
- * @return unknown
951
- */
952
  public function getVersion()
953
  {
954
  $magentoVersion = Mage::getVersion();
319
  {
320
  $szLogMessage = "Transaction could not be completed for OrderID: ".$szOrderID.". Result details: ";
321
  $szNotificationMessage = 'Payment Processor Response: '.$cdtrCardDetailsTransactionResult->getMessage();
322
+ $szCrossReference = $todTransactionOutputData->getCrossReference();
323
 
324
  switch ($cdtrCardDetailsTransactionResult->getStatusCode())
325
  {
334
  $szNotificationMessage = '';
335
 
336
  $szPaReq = $todTransactionOutputData->getThreeDSecureOutputData()->getPaREQ();
 
337
  $szACSURL = $todTransactionOutputData->getThreeDSecureOutputData()->getACSURL();
338
 
339
  Mage::getSingleton('checkout/session')->setMd($szCrossReference)
394
  if($error)
395
  {
396
  $payment->setStatus('FAIL')
397
+ ->setCcApproval('FAIL');
 
398
  }
399
  else
400
  {
404
  }
405
  }
406
 
407
+ if($szCrossReference)
408
+ {
409
+ $szAdditionalData = "CrossReference=".$szCrossReference;
410
+ $payment->setAdditionalData($szAdditionalData);
411
+ }
412
+
413
  return $error;
414
  }
415
 
794
  }
795
  else
796
  {
797
+ $payment->setStatus(self::STATUS_APPROVED);
 
798
 
799
  if($nVersion == 1324 || $nVersion == 1330)
800
  {
806
  return $this;
807
  }
808
 
809
+ public function _runRedirectedPaymentComplete(Varien_Object $payment, $boIsHostedPaymentAction, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage, $szOrderID, $szCrossReference)
810
  {
811
  $error = false;
812
  $message;
823
  }
824
 
825
  $message = "Payment Processor Response: ".$szMessage;
826
+
827
+ switch ($szStatusCode)
828
  {
829
  case "0":
830
  Mage::log($szWording."transaction successfully completed. ".$message);
831
  break;
832
  case "20":
833
  Mage::log("Duplicate ".$szWording."transaction. ".$message);
834
+ $message = $message.". A duplicate transaction means that a transaction with these details has already been processed by the payment provider. The details of the original transaction - Previous Transaction Response: ".$szPreviousMessage;
835
  if($szPreviousStatusCode != "0")
836
  {
837
  $error = true;
846
  }
847
 
848
  $session->setPaymentprocessorresponse($message);
849
+ if($szCrossReference)
850
+ {
851
+ $szAdditionalData = "CrossReference=".$szCrossReference;
852
+ $payment->setAdditionalData($szAdditionalData);
853
+ }
854
+
855
  if($error == true)
856
  {
857
  $message = Mage::helper('cardsaveonlinepayments')->__($message);
859
  }
860
  else
861
  {
862
+ $payment->setStatus(self::STATUS_APPROVED);
 
863
 
864
  if($nVersion == 1324 || $nVersion ==1330)
865
  {
953
  return $szISO3Code;
954
  }
955
 
956
+ /**
957
+ * Transform the string Magento version number into an integer ready for comparison
958
+ *
959
+ * @param unknown_type $magentoVersion
960
+ * @return unknown
961
+ */
962
  public function getVersion()
963
  {
964
  $magentoVersion = Mage::getVersion();
app/code/local/Cardsave/Cardsaveonlinepayments/controllers/PaymentController.php CHANGED
@@ -134,7 +134,7 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
134
  if($order)
135
  {
136
  $orderState = 'pending_payment';
137
- $orderStatus = 'cardsave_failed_threed_secure';
138
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('3D Secure Authentication Failed'));
139
  $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);
140
  $order->save();
@@ -241,7 +241,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
241
  $this->getRequest()->getPost('Message'),
242
  $this->getRequest()->getPost('PreviousStatusCode'),
243
  $this->getRequest()->getPost('PreviousMessage'),
244
- $this->getRequest()->getPost('OrderID'));
 
245
  }
246
  }
247
  catch (Exception $exc)
@@ -260,12 +261,14 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
260
  $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;
261
  }
262
 
 
 
263
  if($nVersion >= 1410)
264
  {
265
  if($order)
266
  {
267
  $orderState = 'pending_payment';
268
- $orderStatus = 'cardsave_failed_hosted_payment';
269
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Hosted Payment Failed'));
270
  $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);
271
  $order->save();
@@ -279,6 +282,7 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
279
  {
280
  Mage::getSingleton('core/session')->addError($szNotificationMessage);
281
  }
 
282
 
283
  $this->_clearSessionVariables();
284
  $this->_redirect('checkout/onepage/failure');
@@ -332,7 +336,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
332
  $szMessage,
333
  $this->getRequest()->getPost('PreviousStatusCode'),
334
  $this->getRequest()->getPost('PreviousMessage'),
335
- $this->getRequest()->getPost('OrderID'));
 
336
  }
337
  catch (Exception $exc)
338
  {
@@ -479,7 +484,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
479
  $szMessage,
480
  $szPreviousStatusCode,
481
  $szPreviousMessage,
482
- $szOrderID);
 
483
  }
484
  }
485
  catch(Exception $exc)
@@ -494,12 +500,14 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
494
 
495
  if($szErrorMessage)
496
  {
 
 
497
  if($nVersion >= 1410)
498
  {
499
  if($order)
500
  {
501
  $orderState = 'pending_payment';
502
- $orderStatus = 'cardsave_failed_hosted_payment';
503
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Hosted Payment Failed'));
504
  $order->setState($orderState, $orderStatus, $szErrorMessage, false);
505
  $order->save();
@@ -513,6 +521,7 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
513
  {
514
  Mage::getSingleton('core/session')->addError($szErrorMessage);
515
  }
 
516
 
517
  $this->_clearSessionVariables();
518
  $this->_redirect('checkout/onepage/failure');
@@ -590,7 +599,7 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
590
  if($order)
591
  {
592
  $orderState = 'pending_payment';
593
- $orderStatus = 'cardsave_failed_hosted_payment';
594
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Transparent Redirect Payment Failed'));
595
  $order->setState($orderState, $orderStatus, $exc->getMessage(), false);
596
  $order->save();
@@ -725,7 +734,8 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
725
  $this->getRequest()->getPost('Message'),
726
  $this->getRequest()->getPost('PreviousStatusCode'),
727
  $this->getRequest()->getPost('PreviousMessage'),
728
- $this->getRequest()->getPost('OrderID'));
 
729
  }
730
  }
731
  catch(Exception $exc)
@@ -744,15 +754,16 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
744
  $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;
745
  }
746
 
 
 
747
  if($nVersion >= 1410)
748
  {
749
  if($order)
750
  {
751
  $orderState = 'pending_payment';
752
- $orderStatus = 'cardsave_failed_hosted_payment';
753
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Transparent Redirect Payment Failed'));
754
  $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);
755
- $order->save();
756
  }
757
  }
758
  if($nVersion == 1324 || $nVersion == 1330)
@@ -763,6 +774,7 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
763
  {
764
  Mage::getSingleton('core/session')->addError($szNotificationMessage);
765
  }
 
766
 
767
  $this->_clearSessionVariables();
768
  $this->_redirect('checkout/onepage/failure');
@@ -883,6 +895,11 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
883
  ->setCardsaveonlinepaymentsOrderId(null);
884
  }
885
 
 
 
 
 
 
886
  private function _updateInvoices($order, $message)
887
  {
888
  $invoices = $order->getInvoiceCollection();
@@ -895,7 +912,7 @@ class Cardsave_Cardsaveonlinepayments_PaymentController extends Mage_Core_Contro
895
  }
896
  // add a comment to the order comments
897
  //$order->addStatusToHistory($status, $message, false);
898
- $order->setState($orderState, 'cardsave_paid', $message, false);
899
  $order->save();
900
  }
901
  }
134
  if($order)
135
  {
136
  $orderState = 'pending_payment';
137
+ $orderStatus = 'csv_failed_threed_secure';
138
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('3D Secure Authentication Failed'));
139
  $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);
140
  $order->save();
241
  $this->getRequest()->getPost('Message'),
242
  $this->getRequest()->getPost('PreviousStatusCode'),
243
  $this->getRequest()->getPost('PreviousMessage'),
244
+ $this->getRequest()->getPost('OrderID'),
245
+ $this->getRequest()->getPost('CrossReference'));
246
  }
247
  }
248
  catch (Exception $exc)
261
  $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;
262
  }
263
 
264
+ $order->getPayment()->setAdditionalData("CrossReference=".$this->getRequest()->getPost('CrossReference'));
265
+
266
  if($nVersion >= 1410)
267
  {
268
  if($order)
269
  {
270
  $orderState = 'pending_payment';
271
+ $orderStatus = 'csv_failed_hosted_payment';
272
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Hosted Payment Failed'));
273
  $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);
274
  $order->save();
282
  {
283
  Mage::getSingleton('core/session')->addError($szNotificationMessage);
284
  }
285
+ $order->save();
286
 
287
  $this->_clearSessionVariables();
288
  $this->_redirect('checkout/onepage/failure');
336
  $szMessage,
337
  $this->getRequest()->getPost('PreviousStatusCode'),
338
  $this->getRequest()->getPost('PreviousMessage'),
339
+ $this->getRequest()->getPost('OrderID'),
340
+ $this->getRequest()->getPost('CrossReference'));
341
  }
342
  catch (Exception $exc)
343
  {
484
  $szMessage,
485
  $szPreviousStatusCode,
486
  $szPreviousMessage,
487
+ $szOrderID,
488
+ $szCrossReference);
489
  }
490
  }
491
  catch(Exception $exc)
500
 
501
  if($szErrorMessage)
502
  {
503
+ $order->getPayment()->setAdditionalData("CrossReference=".$szCrossReference);
504
+
505
  if($nVersion >= 1410)
506
  {
507
  if($order)
508
  {
509
  $orderState = 'pending_payment';
510
+ $orderStatus = 'csv_failed_hosted_payment';
511
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Hosted Payment Failed'));
512
  $order->setState($orderState, $orderStatus, $szErrorMessage, false);
513
  $order->save();
521
  {
522
  Mage::getSingleton('core/session')->addError($szErrorMessage);
523
  }
524
+ $order->save();
525
 
526
  $this->_clearSessionVariables();
527
  $this->_redirect('checkout/onepage/failure');
599
  if($order)
600
  {
601
  $orderState = 'pending_payment';
602
+ $orderStatus = 'csv_failed_hosted_payment';
603
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Transparent Redirect Payment Failed'));
604
  $order->setState($orderState, $orderStatus, $exc->getMessage(), false);
605
  $order->save();
734
  $this->getRequest()->getPost('Message'),
735
  $this->getRequest()->getPost('PreviousStatusCode'),
736
  $this->getRequest()->getPost('PreviousMessage'),
737
+ $this->getRequest()->getPost('OrderID'),
738
+ $this->getRequest()->getPost('CrossReference'));
739
  }
740
  }
741
  catch(Exception $exc)
754
  $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;
755
  }
756
 
757
+ $order->getPayment()->setAdditionalData("CrossReference=".$this->getRequest()->getPost('CrossReference'));
758
+
759
  if($nVersion >= 1410)
760
  {
761
  if($order)
762
  {
763
  $orderState = 'pending_payment';
764
+ $orderStatus = 'csv_failed_hosted_payment';
765
  $order->setCustomerNote(Mage::helper('cardsaveonlinepayments')->__('Transparent Redirect Payment Failed'));
766
  $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);
 
767
  }
768
  }
769
  if($nVersion == 1324 || $nVersion == 1330)
774
  {
775
  Mage::getSingleton('core/session')->addError($szNotificationMessage);
776
  }
777
+ $order->save();
778
 
779
  $this->_clearSessionVariables();
780
  $this->_redirect('checkout/onepage/failure');
895
  ->setCardsaveonlinepaymentsOrderId(null);
896
  }
897
 
898
+ /**
899
+ * Set the invoice status to "Paid" after a successful payment
900
+ *
901
+ * @param unknown_type $order
902
+ */
903
  private function _updateInvoices($order, $message)
904
  {
905
  $invoices = $order->getInvoiceCollection();
912
  }
913
  // add a comment to the order comments
914
  //$order->addStatusToHistory($status, $message, false);
915
+ $order->setState($status, 'csv_paid', $message, false);
916
  $order->save();
917
  }
918
  }
app/code/local/Cardsave/Cardsaveonlinepayments/etc/config.xml CHANGED
@@ -16,6 +16,7 @@
16
  <cardsaveonlinepayments_setup>
17
  <setup>
18
  <module>Cardsave_Cardsaveonlinepayments</module>
 
19
  </setup>
20
  <connection>
21
  <use>core_setup</use>
16
  <cardsaveonlinepayments_setup>
17
  <setup>
18
  <module>Cardsave_Cardsaveonlinepayments</module>
19
+ <class>Cardsave_Cardsaveonlinepayments_Model_Resource_Eav_Mysql4_Setup</class>
20
  </setup>
21
  <connection>
22
  <use>core_setup</use>
app/code/local/Cardsave/Checkout/Model/Type/Onepage.php CHANGED
@@ -2,21 +2,6 @@
2
 
3
  class Cardsave_Checkout_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
4
  {
5
- // TODO : REMOVE - old representation
6
- /*public function getVersion($magentoVersion)
7
- {
8
- $pattern = '/[^\d]/';
9
- $magentoVersion = preg_replace($pattern, '', $magentoVersion);
10
-
11
- while(strlen($magentoVersion) < 4)
12
- {
13
- $magentoVersion .= '0';
14
- }
15
- $magentoVersion = (int)$magentoVersion;
16
-
17
- return $magentoVersion;
18
- }
19
-
20
  /**
21
  * Create an order
22
  *
@@ -826,7 +811,7 @@ class Cardsave_Checkout_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onep
826
  * @param unknown_type $szOrderID
827
  * @return unknown
828
  */
829
- public function saveOrderAfterRedirectedPaymentAction($boIsHostedPaymentAction, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage, $szOrderID)
830
  {
831
  $nVersion = Mage::getModel('cardsaveonlinepayments/direct')->getVersion();
832
 
@@ -848,7 +833,7 @@ class Cardsave_Checkout_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onep
848
  ->setOrderid($szOrderID);
849
 
850
  $method = Mage::getSingleton('checkout/session')->getRedirectionmethod();
851
- $_order->getPayment()->getMethodInstance()->{$method}($_order->getPayment(), $boIsHostedPaymentAction, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage, $szOrderID);
852
 
853
  if ($_order->getFailedThreed() !== true &&
854
  $_order->getPayment()->getMethodInstance()->getCode() == 'cardsaveonlinepayments' &&
@@ -1013,4 +998,4 @@ class Cardsave_Checkout_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onep
1013
 
1014
  return $this;
1015
  }
1016
- }
2
 
3
  class Cardsave_Checkout_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
4
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  /**
6
  * Create an order
7
  *
811
  * @param unknown_type $szOrderID
812
  * @return unknown
813
  */
814
+ public function saveOrderAfterRedirectedPaymentAction($boIsHostedPaymentAction, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage, $szOrderID, $szCrossReference)
815
  {
816
  $nVersion = Mage::getModel('cardsaveonlinepayments/direct')->getVersion();
817
 
833
  ->setOrderid($szOrderID);
834
 
835
  $method = Mage::getSingleton('checkout/session')->getRedirectionmethod();
836
+ $_order->getPayment()->getMethodInstance()->{$method}($_order->getPayment(), $boIsHostedPaymentAction, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage, $szOrderID, $szCrossReference);
837
 
838
  if ($_order->getFailedThreed() !== true &&
839
  $_order->getPayment()->getMethodInstance()->getCode() == 'cardsaveonlinepayments' &&
998
 
999
  return $this;
1000
  }
1001
+ }
app/code/local/Cardsave/Sales/Model/Order/Payment.php CHANGED
@@ -11,7 +11,7 @@ class Cardsave_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payment
11
  {
12
  $nVersion = Mage::getModel('cardsaveonlinepayments/direct')->getVersion();
13
 
14
- if($nVersion == 1411 || $nVersion == 1410)
15
  {
16
  if (is_null($invoice))
17
  {
@@ -176,7 +176,7 @@ class Cardsave_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payment
176
  {
177
  $nVersion = Mage::getModel('cardsaveonlinepayments/direct')->getVersion();
178
 
179
- if($nVersion == 1411 || $nVersion == 1410 || $nVersion == 1401 || $nVersion == 1400)
180
  {
181
  Mage::dispatchEvent('sales_order_payment_place_start', array('payment' => $this));
182
  $order = $this->getOrder();
@@ -228,7 +228,7 @@ class Cardsave_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payment
228
  }
229
  }
230
 
231
- if($nVersion == 1411 || $nVersion == 1410)
232
  {
233
  $this->_createBillingAgreement();
234
  $orderStateHelper = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
@@ -248,15 +248,16 @@ class Cardsave_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payment
248
  else if($order->getIsThreeDSecurePending())
249
  {
250
  $orderState = 'pending_payment';
251
- $orderStatus = 'cardsave_pending_threed_secure';
252
  $message = '3D Secure authentication need to be completed';
253
  $orderIsNotified = false;
254
  }
255
  else if($order->getIsHostedPaymentPending())
256
  {
257
  $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();
 
258
  $orderState = 'pending_payment';
259
- $orderStatus = 'cardsave_pending_hosted_payment';
260
  $message = 'Hosted Payment need to be completed';
261
  $orderIsNotified = false;
262
  }
@@ -286,7 +287,7 @@ class Cardsave_Sales_Model_Order_Payment extends Mage_Sales_Model_Order_Payment
286
  $order->addStatusToHistory($order->getStatus(), $message, $isCustomerNotified);
287
  }
288
 
289
- if($nVersion == 1400 || $nVersion == 1401)
290
  {
291
  $order->setHoldBeforeState($orderState);
292
  $order->setHoldBeforeStatus($orderStatus);
11
  {
12
  $nVersion = Mage::getModel('cardsaveonlinepayments/direct')->getVersion();
13
 
14
+ if($nVersion >= 1411 || $nVersion == 1410)
15
  {
16
  if (is_null($invoice))
17
  {
176
  {
177
  $nVersion = Mage::getModel('cardsaveonlinepayments/direct')->getVersion();
178
 
179
+ if($nVersion >= 1411 || $nVersion == 1410 || $nVersion == 1401 || $nVersion == 1400)
180
  {
181
  Mage::dispatchEvent('sales_order_payment_place_start', array('payment' => $this));
182
  $order = $this->getOrder();
228
  }
229
  }
230
 
231
+ if($nVersion >= 1411 || $nVersion == 1410)
232
  {
233
  $this->_createBillingAgreement();
234
  $orderStateHelper = Mage_Sales_Model_Order::STATE_PAYMENT_REVIEW;
248
  else if($order->getIsThreeDSecurePending())
249
  {
250
  $orderState = 'pending_payment';
251
+ $orderStatus = 'csv_pending_threed_secure';
252
  $message = '3D Secure authentication need to be completed';
253
  $orderIsNotified = false;
254
  }
255
  else if($order->getIsHostedPaymentPending())
256
  {
257
  $order->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true)->save();
258
+ $orderStateHelper = Mage_Sales_Model_Order::STATE_PENDING_PAYMENT;
259
  $orderState = 'pending_payment';
260
+ $orderStatus = 'csv_pending_hosted_payment';
261
  $message = 'Hosted Payment need to be completed';
262
  $orderIsNotified = false;
263
  }
287
  $order->addStatusToHistory($order->getStatus(), $message, $isCustomerNotified);
288
  }
289
 
290
+ if($nVersion >= 1400 || $nVersion == 1401)
291
  {
292
  $order->setHoldBeforeState($orderState);
293
  $order->setHoldBeforeStatus($orderStatus);
app/code/local/Cardsave/Sales/Model/Service/Quote.php CHANGED
@@ -56,7 +56,8 @@ class Cardsave_Sales_Model_Service_Quote extends Mage_Sales_Model_Service_Quote
56
  }
57
  $order->addItem($orderItem);
58
  }
59
- $quote->setIsActive(false);
 
60
 
61
  $transaction->addObject($order);
62
  $transaction->addCommitCallback(array($order, 'place'));
56
  }
57
  $order->addItem($orderItem);
58
  }
59
+ // make sure the customer can still use the quote if payment is failed
60
+ //$quote->setIsActive(false);
61
 
62
  $transaction->addObject($order);
63
  $transaction->addCommitCallback(array($order, 'place'));
app/code/local/Cardsave/Sales/etc/config.xml CHANGED
@@ -19,24 +19,24 @@
19
  <sales>
20
  <order>
21
  <statuses>
22
- <cardsave_paid translate="label">
23
  <label>CardSave - Successful Payment</label>
24
- </cardsave_paid>
25
- <cardsave_pending_threed_secure translate="label">
26
  <label>CardSave - Pending 3D Secure</label>
27
- </cardsave_pending_threed_secure>
28
- <cardsave_failed_threed_secure translate="label">
29
  <label>CardSave - Failed 3D Secure</label>
30
- </cardsave_failed_threed_secure>
31
- <cardsave_pending translate="label">
32
  <label>CardSave - Pending Hosted Payment</label>
33
- </cardsave_pending>
34
- <cardsave_pending_hosted_payment translate="label">
35
  <label>CardSave - Pending Hosted Payment</label>
36
- </cardsave_pending_hosted_payment>
37
- <cardsave_failed_hosted_payment translate="label">
38
  <label>CardSave - Failed Payment</label>
39
- </cardsave_failed_hosted_payment>
40
  </statuses>
41
  </order>
42
  </sales>
19
  <sales>
20
  <order>
21
  <statuses>
22
+ <csv_paid translate="label">
23
  <label>CardSave - Successful Payment</label>
24
+ </csv_paid>
25
+ <csv_pending_threed_secure translate="label">
26
  <label>CardSave - Pending 3D Secure</label>
27
+ </csv_pending_threed_secure>
28
+ <csv_failed_threed_secure translate="label">
29
  <label>CardSave - Failed 3D Secure</label>
30
+ </csv_failed_threed_secure>
31
+ <csv_pending translate="label">
32
  <label>CardSave - Pending Hosted Payment</label>
33
+ </csv_pending>
34
+ <csv_pending_hosted_payment translate="label">
35
  <label>CardSave - Pending Hosted Payment</label>
36
+ </csv_pending_hosted_payment>
37
+ <csv_failed_hosted_payment translate="label">
38
  <label>CardSave - Failed Payment</label>
39
+ </csv_failed_hosted_payment>
40
  </statuses>
41
  </order>
42
  </sales>
app/design/adminhtml/base/default/template/cardsaveonlinepayments/form.phtml CHANGED
@@ -1,7 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
 
 
 
2
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
3
  <fieldset class="form-list">
4
- <?php $_code=$this->getMethodCode() ?>
5
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
6
  <li>
7
  <?php echo $this->__('You will be redirected to a secure page where you can complete your payment.') ?>
@@ -10,25 +12,24 @@
10
  </fieldset>
11
  <?php } else {?>
12
  <fieldset class="form-list">
13
- <?php $_code = $this->getMethodCode(); ?>
14
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
15
  <li>
16
  <div class="input-box">
17
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
18
- <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
19
  </div>
20
  </li>
21
  <li>
22
  <div class="input-box">
23
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
24
- <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="required-entry input-text" value=""/>
25
  </div>
26
  </li>
27
  <li>
28
- <div class="input-box">
29
- <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br/>
30
  <div class="v-fix">
31
- <select id="<?php echo $_code; ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
32
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
33
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
34
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
@@ -36,9 +37,9 @@
36
  </select>
37
  </div>
38
 
39
- <div class="v-fix" style="padding-left:5px;">
40
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
41
- <select id="<?php echo $_code; ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
42
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
43
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
44
  <?php endforeach ?>
@@ -47,19 +48,19 @@
47
  </div>
48
  </li>
49
  <li>
50
- <div class="input-box">
51
- <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
52
  <div class="v-fix">
53
- <select id="<?php echo $_code; ?>_cc_ss_start_month" style="width:140px;" name="payment[cc_ss_start_month]" class="validate-cc-start">
54
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
55
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
56
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
57
  <?php endforeach ?>
58
  </select>
59
  </div>
60
- <div class="v-fix" style="padding-left:5px;">
61
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
62
- <select id="<?php echo $_code ?>_cc_ss_start_year" style="width:103px;" name="payment[cc_ss_start_year]">
63
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
64
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
65
  <?php endforeach ?>
@@ -70,13 +71,13 @@
70
  <li>
71
  <div class="input-box">
72
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
73
- <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text" id="<?php echo $_code ?>_cc_ss_issue" name="payment[cc_ss_issue]" style="width:3em;" value="" /></div>
74
  </div>
75
  </li>
76
  <li>
77
  <div class="input-box">
78
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
79
- <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value=""/></div>
80
  &nbsp;
81
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
82
  </div>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
+ <?php $_code = $this->getMethodCode() ?>
3
+ <?php $route = $this->getRequest()->getRequestedRouteName(); if($route == 'onestepcheckout'){ $fieldCode = '['.$_code.']'; } else { $fieldCode = ''; }?>
4
+
5
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
6
  <fieldset class="form-list">
 
7
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
8
  <li>
9
  <?php echo $this->__('You will be redirected to a secure page where you can complete your payment.') ?>
12
  </fieldset>
13
  <?php } else {?>
14
  <fieldset class="form-list">
 
15
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
16
  <li>
17
  <div class="input-box">
18
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
19
+ <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="input-text required-entry validate-length maximum-length-100" id="<?php echo $_code; ?>_cc_owner" name="payment<?php echo $fieldCode; ?>[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
20
  </div>
21
  </li>
22
  <li>
23
  <div class="input-box">
24
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
25
+ <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment<?php echo $fieldCode; ?>[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="input-text required-entry validate-digits validate-length maximum-length-20" value=""/>
26
  </div>
27
  </li>
28
  <li>
29
+ <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br/>
30
+ <div class="input-box">
31
  <div class="v-fix">
32
+ <select id="<?php echo $_code; ?>_expiration" name="payment<?php echo $fieldCode; ?>[cc_exp_month]" class="month validate-cc-exp required-entry">
33
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
34
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
35
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
37
  </select>
38
  </div>
39
 
40
+ <div class="v-fix">
41
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
42
+ <select id="<?php echo $_code; ?>_expiration_yr" name="payment<?php echo $fieldCode; ?>[cc_exp_year]" class="year required-entry">
43
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
44
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
45
  <?php endforeach ?>
48
  </div>
49
  </li>
50
  <li>
51
+ <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
52
+ <div class="input-box">
53
  <div class="v-fix">
54
+ <select id="<?php echo $_code; ?>_cc_ss_start_month" name="payment<?php echo $fieldCode; ?>[cc_ss_start_month]" class="month">
55
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
56
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
57
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
58
  <?php endforeach ?>
59
  </select>
60
  </div>
61
+ <div class="v-fix">
62
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
63
+ <select id="<?php echo $_code ?>_cc_ss_start_year" name="payment<?php echo $fieldCode; ?>[cc_ss_start_year]" class="year">
64
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
65
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
66
  <?php endforeach ?>
71
  <li>
72
  <div class="input-box">
73
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
74
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text validate-digits validate-length maximum-length-2" style="width:50px;" id="<?php echo $_code ?>_cc_ss_issue" name="payment<?php echo $fieldCode; ?>[cc_ss_issue]" value="" /></div>
75
  </div>
76
  </li>
77
  <li>
78
  <div class="input-box">
79
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
80
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="input-text required-entry validate-digits validate-length maximum-length-4" id="<?php echo $_code; ?>_cc_cid" name="payment<?php echo $fieldCode; ?>[cc_cid]" style="width:50px;" value=""/></div>
81
  &nbsp;
82
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
83
  </div>
app/design/adminhtml/base/default/template/cardsaveonlinepayments/info.phtml CHANGED
@@ -1,9 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
- <?php echo $this->__('You will be redirected to a secure payment page'); ?>
5
  <?php } else {?>
6
- <?php echo $this->__('No card information is available'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
+ <?php echo $this->__('CardSave Hosted Payment'); ?>
5
  <?php } else {?>
6
+ <?php echo $this->__('CardSave Transparent Redirect'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
app/design/adminhtml/default/default/template/cardsaveonlinepayments/form.phtml CHANGED
@@ -1,7 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
 
 
 
2
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
3
  <fieldset class="form-list">
4
- <?php $_code=$this->getMethodCode() ?>
5
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
6
  <li>
7
  <?php echo $this->__('You will be redirected to a secure page where you can complete your payment.') ?>
@@ -10,25 +12,24 @@
10
  </fieldset>
11
  <?php } else {?>
12
  <fieldset class="form-list">
13
- <?php $_code = $this->getMethodCode(); ?>
14
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
15
  <li>
16
  <div class="input-box">
17
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
18
- <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
19
  </div>
20
  </li>
21
  <li>
22
  <div class="input-box">
23
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
24
- <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="required-entry input-text" value=""/>
25
  </div>
26
  </li>
27
  <li>
28
- <div class="input-box">
29
- <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br/>
30
  <div class="v-fix">
31
- <select id="<?php echo $_code; ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
32
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
33
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
34
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
@@ -36,9 +37,9 @@
36
  </select>
37
  </div>
38
 
39
- <div class="v-fix" style="padding-left:5px;">
40
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
41
- <select id="<?php echo $_code; ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
42
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
43
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
44
  <?php endforeach ?>
@@ -47,19 +48,19 @@
47
  </div>
48
  </li>
49
  <li>
50
- <div class="input-box">
51
- <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
52
  <div class="v-fix">
53
- <select id="<?php echo $_code; ?>_cc_ss_start_month" style="width:140px;" name="payment[cc_ss_start_month]" class="validate-cc-start">
54
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
55
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
56
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
57
  <?php endforeach ?>
58
  </select>
59
  </div>
60
- <div class="v-fix" style="padding-left:5px;">
61
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
62
- <select id="<?php echo $_code ?>_cc_ss_start_year" style="width:103px;" name="payment[cc_ss_start_year]">
63
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
64
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
65
  <?php endforeach ?>
@@ -70,13 +71,13 @@
70
  <li>
71
  <div class="input-box">
72
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
73
- <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text" id="<?php echo $_code ?>_cc_ss_issue" name="payment[cc_ss_issue]" style="width:3em;" value="" /></div>
74
  </div>
75
  </li>
76
  <li>
77
  <div class="input-box">
78
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
79
- <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value=""/></div>
80
  &nbsp;
81
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
82
  </div>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
+ <?php $_code = $this->getMethodCode() ?>
3
+ <?php $route = $this->getRequest()->getRequestedRouteName(); if($route == 'onestepcheckout'){ $fieldCode = '['.$_code.']'; } else { $fieldCode = ''; }?>
4
+
5
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
6
  <fieldset class="form-list">
 
7
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
8
  <li>
9
  <?php echo $this->__('You will be redirected to a secure page where you can complete your payment.') ?>
12
  </fieldset>
13
  <?php } else {?>
14
  <fieldset class="form-list">
 
15
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
16
  <li>
17
  <div class="input-box">
18
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
19
+ <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="input-text required-entry validate-length maximum-length-100" id="<?php echo $_code; ?>_cc_owner" name="payment<?php echo $fieldCode; ?>[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
20
  </div>
21
  </li>
22
  <li>
23
  <div class="input-box">
24
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
25
+ <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment<?php echo $fieldCode; ?>[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="input-text required-entry validate-digits validate-length maximum-length-20" value=""/>
26
  </div>
27
  </li>
28
  <li>
29
+ <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiration Date') ?> <span class="required">*</span></label><br/>
30
+ <div class="input-box">
31
  <div class="v-fix">
32
+ <select id="<?php echo $_code; ?>_expiration" name="payment<?php echo $fieldCode; ?>[cc_exp_month]" class="month validate-cc-exp required-entry">
33
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
34
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
35
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
37
  </select>
38
  </div>
39
 
40
+ <div class="v-fix">
41
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
42
+ <select id="<?php echo $_code; ?>_expiration_yr" name="payment<?php echo $fieldCode; ?>[cc_exp_year]" class="year required-entry">
43
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
44
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
45
  <?php endforeach ?>
48
  </div>
49
  </li>
50
  <li>
51
+ <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
52
+ <div class="input-box">
53
  <div class="v-fix">
54
+ <select id="<?php echo $_code; ?>_cc_ss_start_month" name="payment<?php echo $fieldCode; ?>[cc_ss_start_month]" class="month">
55
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
56
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
57
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
58
  <?php endforeach ?>
59
  </select>
60
  </div>
61
+ <div class="v-fix">
62
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
63
+ <select id="<?php echo $_code ?>_cc_ss_start_year" name="payment<?php echo $fieldCode; ?>[cc_ss_start_year]" class="year">
64
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
65
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
66
  <?php endforeach ?>
71
  <li>
72
  <div class="input-box">
73
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
74
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text validate-digits validate-length maximum-length-2" id="<?php echo $_code ?>_cc_ss_issue" name="payment<?php echo $fieldCode; ?>[cc_ss_issue]" style="width:50px;" value="" /></div>
75
  </div>
76
  </li>
77
  <li>
78
  <div class="input-box">
79
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
80
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="input-text required-entry validate-digits validate-length maximum-length-4" id="<?php echo $_code; ?>_cc_cid" name="payment<?php echo $fieldCode; ?>[cc_cid]" style="width:50px;" value=""/></div>
81
  &nbsp;
82
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
83
  </div>
app/design/adminhtml/default/default/template/cardsaveonlinepayments/info.phtml CHANGED
@@ -1,9 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
- <?php echo $this->__('You will be redirected to a secure payment page'); ?>
5
  <?php } else {?>
6
- <?php echo $this->__('No card information is available'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
+ <?php echo $this->__('CardSave Hosted Payment'); ?>
5
  <?php } else {?>
6
+ <?php echo $this->__('CardSave Transparent Redirect'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
app/design/frontend/base/default/template/cardsaveonlinepayments/form.phtml CHANGED
@@ -1,7 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
 
 
 
2
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
3
  <fieldset class="form-list">
4
- <?php $_code=$this->getMethodCode() ?>
5
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
6
  <li>
7
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
@@ -13,7 +15,6 @@
13
  </fieldset>
14
  <?php } else {?>
15
  <fieldset class="form-list">
16
- <?php $_code = $this->getMethodCode(); ?>
17
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
18
  <li>
19
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
@@ -21,20 +22,20 @@
21
  <li>
22
  <div class="input-box">
23
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
24
- <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
25
  </div>
26
  </li>
27
  <li>
28
  <div class="input-box">
29
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
30
- <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="required-entry input-text" value=""/>
31
  </div>
32
  </li>
33
  <li>
34
- <div class="input-box">
35
- <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiry Date') ?> <span class="required">*</span></label><br/>
36
  <div class="v-fix">
37
- <select id="<?php echo $_code; ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
38
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
39
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
40
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
@@ -42,9 +43,9 @@
42
  </select>
43
  </div>
44
 
45
- <div class="v-fix" style="padding-left:5px;">
46
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
47
- <select id="<?php echo $_code; ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
48
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
49
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
50
  <?php endforeach ?>
@@ -53,19 +54,19 @@
53
  </div>
54
  </li>
55
  <li>
56
- <div class="input-box">
57
- <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
58
  <div class="v-fix">
59
- <select id="<?php echo $_code; ?>_cc_ss_start_month" style="width:140px;" name="payment[cc_ss_start_month]" class="validate-cc-start">
60
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
61
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
62
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
63
  <?php endforeach ?>
64
  </select>
65
  </div>
66
- <div class="v-fix" style="padding-left:5px;">
67
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
68
- <select id="<?php echo $_code ?>_cc_ss_start_year" style="width:103px;" name="payment[cc_ss_start_year]">
69
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
70
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
71
  <?php endforeach ?>
@@ -76,13 +77,13 @@
76
  <li>
77
  <div class="input-box">
78
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
79
- <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text" id="<?php echo $_code ?>_cc_ss_issue" name="payment[cc_ss_issue]" style="width:3em;" value="" /></div>
80
  </div>
81
  </li>
82
  <li>
83
  <div class="input-box">
84
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
85
- <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value=""/></div>
86
  &nbsp;
87
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
88
  </div>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
+ <?php $_code = $this->getMethodCode() ?>
3
+ <?php $route = $this->getRequest()->getRequestedRouteName(); if($route == 'onestepcheckout'){ $fieldCode = '['.$_code.']'; } else { $fieldCode = ''; }?>
4
+
5
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
6
  <fieldset class="form-list">
 
7
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
8
  <li>
9
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
15
  </fieldset>
16
  <?php } else {?>
17
  <fieldset class="form-list">
 
18
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
19
  <li>
20
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
22
  <li>
23
  <div class="input-box">
24
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
25
+ <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="input-text required-entry validate-length maximum-length-100" id="<?php echo $_code; ?>_cc_owner" name="payment<?php echo $fieldCode; ?>[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
26
  </div>
27
  </li>
28
  <li>
29
  <div class="input-box">
30
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
31
+ <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment<?php echo $fieldCode; ?>[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="input-text required-entry validate-digits validate-length maximum-length-20" value=""/>
32
  </div>
33
  </li>
34
  <li>
35
+ <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiry Date') ?> <span class="required">*</span></label><br/>
36
+ <div class="input-box">
37
  <div class="v-fix">
38
+ <select id="<?php echo $_code; ?>_expiration" name="payment<?php echo $fieldCode; ?>[cc_exp_month]" class="month validate-cc-exp required-entry">
39
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
40
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
41
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
43
  </select>
44
  </div>
45
 
46
+ <div class="v-fix">
47
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
48
+ <select id="<?php echo $_code; ?>_expiration_yr" name="payment<?php echo $fieldCode; ?>[cc_exp_year]" class="year required-entry">
49
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
50
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
51
  <?php endforeach ?>
54
  </div>
55
  </li>
56
  <li>
57
+ <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
58
+ <div class="input-box">
59
  <div class="v-fix">
60
+ <select id="<?php echo $_code; ?>_cc_ss_start_month" name="payment<?php echo $fieldCode; ?>[cc_ss_start_month]" class="month">
61
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
62
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
63
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
64
  <?php endforeach ?>
65
  </select>
66
  </div>
67
+ <div class="v-fix">
68
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
69
+ <select id="<?php echo $_code ?>_cc_ss_start_year" name="payment<?php echo $fieldCode; ?>[cc_ss_start_year]" class="year">
70
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
71
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
72
  <?php endforeach ?>
77
  <li>
78
  <div class="input-box">
79
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
80
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text validate-digits validate-length maximum-length-2" id="<?php echo $_code ?>_cc_ss_issue" name="payment<?php echo $fieldCode; ?>[cc_ss_issue]" style="width:50px;" value="" /></div>
81
  </div>
82
  </li>
83
  <li>
84
  <div class="input-box">
85
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
86
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="input-text required-entry validate-digits validate-length maximum-length-4" id="<?php echo $_code; ?>_cc_cid" name="payment<?php echo $fieldCode; ?>[cc_cid]" style="width:50px;" value=""/></div>
87
  &nbsp;
88
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
89
  </div>
app/design/frontend/base/default/template/cardsaveonlinepayments/info.phtml CHANGED
@@ -1,9 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
- <?php echo $this->__('You will be redirected to a secure payment page'); ?>
5
  <?php } else {?>
6
- <?php echo $this->__('No card information is available'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
+ <?php echo $this->__('CardSave Hosted Payment'); ?>
5
  <?php } else {?>
6
+ <?php echo $this->__('CardSave Transparent Redirect'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
app/design/frontend/default/default/template/cardsaveonlinepayments/form.phtml CHANGED
@@ -1,7 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
 
 
 
2
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
3
  <fieldset class="form-list">
4
- <?php $_code=$this->getMethodCode() ?>
5
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
6
  <li>
7
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
@@ -13,7 +15,6 @@
13
  </fieldset>
14
  <?php } else {?>
15
  <fieldset class="form-list">
16
- <?php $_code = $this->getMethodCode(); ?>
17
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
18
  <li>
19
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
@@ -21,20 +22,20 @@
21
  <li>
22
  <div class="input-box">
23
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
24
- <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_owner" name="payment[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
25
  </div>
26
  </li>
27
  <li>
28
  <div class="input-box">
29
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
30
- <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="required-entry input-text" value=""/>
31
  </div>
32
  </li>
33
  <li>
34
- <div class="input-box">
35
- <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiry Date') ?> <span class="required">*</span></label><br/>
36
  <div class="v-fix">
37
- <select id="<?php echo $_code; ?>_expiration" style="width:140px;" name="payment[cc_exp_month]" class="required-entry">
38
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
39
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
40
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
@@ -42,9 +43,9 @@
42
  </select>
43
  </div>
44
 
45
- <div class="v-fix" style="padding-left:5px;">
46
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
47
- <select id="<?php echo $_code; ?>_expiration_yr" style="width:103px;" name="payment[cc_exp_year]" class="required-entry">
48
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
49
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
50
  <?php endforeach ?>
@@ -53,19 +54,19 @@
53
  </div>
54
  </li>
55
  <li>
56
- <div class="input-box">
57
- <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
58
  <div class="v-fix">
59
- <select id="<?php echo $_code; ?>_cc_ss_start_month" style="width:140px;" name="payment[cc_ss_start_month]" class="validate-cc-start">
60
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
61
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
62
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
63
  <?php endforeach ?>
64
  </select>
65
  </div>
66
- <div class="v-fix" style="padding-left:5px;">
67
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
68
- <select id="<?php echo $_code ?>_cc_ss_start_year" style="width:103px;" name="payment[cc_ss_start_year]">
69
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
70
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
71
  <?php endforeach ?>
@@ -76,13 +77,13 @@
76
  <li>
77
  <div class="input-box">
78
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
79
- <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text" id="<?php echo $_code ?>_cc_ss_issue" name="payment[cc_ss_issue]" style="width:3em;" value="" /></div>
80
  </div>
81
  </li>
82
  <li>
83
  <div class="input-box">
84
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
85
- <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="required-entry input-text" id="<?php echo $_code; ?>_cc_cid" name="payment[cc_cid]" style="width:3em;" value=""/></div>
86
  &nbsp;
87
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
88
  </div>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
+ <?php $_code=$this->getMethodCode(); ?>
3
+ <?php $route = $this->getRequest()->getRequestedRouteName(); if($route == 'onestepcheckout'){ $fieldCode = '['.$_code.']'; } else { $fieldCode = ''; }?>
4
+
5
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
6
  <fieldset class="form-list">
 
7
  <ul id="payment_form_<?php echo $_code ?>" style="display:none">
8
  <li>
9
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
15
  </fieldset>
16
  <?php } else {?>
17
  <fieldset class="form-list">
 
18
  <ul id="payment_form_<?php echo $_code; ?>" style="display:none">
19
  <li>
20
  <img alt="<?php echo $this->__('CardSave Online Payment Logo'); ?>" src="<?php echo $this->getSkinUrl('images/cardsave_online.jpg'); ?>">
22
  <li>
23
  <div class="input-box">
24
  <label for="<?php echo $_code; ?>_cc_owner"><?php echo $this->__('Name On Card') ?> <span class="required">*</span></label><br/>
25
+ <input type="text" title="<?php echo $this->__('Name On Card') ?>" class="input-text required-entry validate-length maximum-length-100" id="<?php echo $_code; ?>_cc_owner" name="payment<?php echo $fieldCode; ?>[cc_owner]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>"/>
26
  </div>
27
  </li>
28
  <li>
29
  <div class="input-box">
30
  <label for="<?php echo $_code; ?>_cc_number"><?php echo $this->__('Card Number') ?> <span class="required">*</span></label><br/>
31
+ <input type="text" id="<?php echo $_code; ?>_cc_number" name="payment<?php echo $fieldCode; ?>[cc_number]" title="<?php echo $this->__('Card Number') ?>" class="input-text required-entry validate-digits validate-length maximum-length-20" value=""/>
32
  </div>
33
  </li>
34
  <li>
35
+ <label for="<?php echo $_code; ?>_expiration"><?php echo $this->__('Expiry Date') ?> <span class="required">*</span></label><br/>
36
+ <div class="input-box">
37
  <div class="v-fix">
38
+ <select id="<?php echo $_code; ?>_expiration" name="payment<?php echo $fieldCode; ?>[cc_exp_month]" class="month validate-cc-exp required-entry">
39
  <?php $_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
40
  <?php foreach ($this->getCcMonths() as $k=>$v): ?>
41
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
43
  </select>
44
  </div>
45
 
46
+ <div class="v-fix">
47
  <?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
48
+ <select id="<?php echo $_code; ?>_expiration_yr" name="payment<?php echo $fieldCode; ?>[cc_exp_year]" class="year required-entry">
49
  <?php foreach ($this->getCcYears() as $k=>$v): ?>
50
  <option value="<?php echo $k?$k:'' ?>" <?php if($k==$_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
51
  <?php endforeach ?>
54
  </div>
55
  </li>
56
  <li>
57
+ <label for="<?php echo $_code; ?>_cc_ss_start_month"><?php echo $this->__('Start Date') ?></label><br />
58
+ <div class="input-box">
59
  <div class="v-fix">
60
+ <select id="<?php echo $_code; ?>_cc_ss_start_month" name="payment<?php echo $fieldCode; ?>[cc_ss_start_month]" class="month">
61
  <?php $_ccStartMonth = $this->getInfoData('cc_ss_start_month') ?>
62
  <?php foreach ($this->getCcStartMonths() as $k=>$v): ?>
63
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
64
  <?php endforeach ?>
65
  </select>
66
  </div>
67
+ <div class="v-fix">
68
  <?php $_ccStartYear = $this->getInfoData('cc_ss_start_year') ?>
69
+ <select id="<?php echo $_code ?>_cc_ss_start_year" name="payment<?php echo $fieldCode; ?>[cc_ss_start_year]" class="year">
70
  <?php foreach ($this->getCcStartYears() as $k=>$v): ?>
71
  <option value="<?php echo $k?$k:'' ?>"<?php if($k==$_ccStartYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
72
  <?php endforeach ?>
77
  <li>
78
  <div class="input-box">
79
  <label for="<?php echo $_code; ?>_cc_ss_issue"><?php echo $this->__('Issue Number') ?></label><br />
80
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('Issue Number') ?>" class="input-text validate-digits validate-length maximum-length-2" id="<?php echo $_code ?>_cc_ss_issue" name="payment<?php echo $fieldCode; ?>[cc_ss_issue]" style="width:50px;" value="" /></div>
81
  </div>
82
  </li>
83
  <li>
84
  <div class="input-box">
85
  <label for="<?php echo $_code; ?>_cc_cid"><?php echo $this->__('CV2') ?> <span class="required">*</span></label><br/>
86
+ <div class="v-fix"><input type="text" title="<?php echo $this->__('CV2') ?>" class="input-text required-entry validate-digits validate-length maximum-length-4" id="<?php echo $_code; ?>_cc_cid" name="payment<?php echo $fieldCode; ?>[cc_cid]" style="width:50px;" value=""/></div>
87
  &nbsp;
88
  <a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
89
  </div>
app/design/frontend/default/default/template/cardsaveonlinepayments/info.phtml CHANGED
@@ -1,9 +1,9 @@
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
- <?php echo $this->__('You will be redirected to a secure payment page'); ?>
5
  <?php } else {?>
6
- <?php echo $this->__('No card information is available'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
1
  <?php $direct = Mage::getModel('cardsaveonlinepayments/direct'); ?>
2
  <?php if ($direct->getConfigData('mode') != Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_DIRECT_API) {?>
3
  <?php if ($direct->getConfigData('mode') == Cardsave_Cardsaveonlinepayments_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM) {?>
4
+ <?php echo $this->__('CardSave Hosted Payment'); ?>
5
  <?php } else {?>
6
+ <?php echo $this->__('CardSave Transparent Redirect'); ?>
7
  <?php }?>
8
  <?php } else {?>
9
  <?php if($_info = $this->getInfo()): ?>
package.xml CHANGED
@@ -1,18 +1,21 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cardsave_Cardsaveonlinepayments</name>
4
- <version>1.9.3</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>CardSave payment extension compatible with Magento version 1.3.2.4, 1.3.3.0, 1.4.1.0, 1.4.1.1</summary>
10
- <description>Fully supports 3D secure transactions. Also supports all of the integration methods provided by Cardsave.</description>
11
- <notes>Fixed the missing email confirmation to customers for Hosted Payment form and Transparent Redirect methods</notes>
 
 
 
12
  <authors><author><name>cardsave.support</name><user>auto-converted</user><email>integrationsupport@cardsaveonlinepayments.com</email></author></authors>
13
- <date>2011-02-02</date>
14
- <time>15:26:27</time>
15
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="2b0b8a72c9f4a6d2ab9f0ea020c8f2ed"/><file name="info.phtml" hash="935e10cad0632d558b2db1913cb80a2a"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="2b0b8a72c9f4a6d2ab9f0ea020c8f2ed"/><file name="info.phtml" hash="935e10cad0632d558b2db1913cb80a2a"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="206c8703ef4d160dfc6c739c128ab47b"/><file name="info.phtml" hash="7256464904bbad66a821dea898d657a6"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="206c8703ef4d160dfc6c739c128ab47b"/><file name="info.phtml" hash="7256464904bbad66a821dea898d657a6"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Cardsave"><dir name="Cardsaveonlinepayments"><dir name="Block"><file name="Error.php" hash="660d3cbde48910ef271df9e05130a6d7"/><file name="Form.php" hash="ea5b3817c9607a94f4685d53d0b18569"/><file name="Info.php" hash="57a4bfec1a1c769de063be2b922f4a97"/><file name="Redirect.php" hash="b5a1f7af807dc9a41ec5b9db5c74e87e"/><file name="Threedsecure.php" hash="9d75776f34c5acaf6ea265f35f302c69"/></dir><dir name="controllers"><file name="PaymentController.php" hash="ea696459baa33fc027bea217e99ced08"/></dir><dir name="etc"><file name="config.xml" hash="14507a95509d6366272555a05ba110c9"/><file name="system.xml" hash="4d0eab1c1a11d3e2078802499ad49f1e"/></dir><dir name="Helper"><file name="Data.php" hash="e024ec0479d1e8e7efcf4751b05194d6"/></dir><dir name="Model"><dir name="Common"><dir name="ThePaymentGateway"><file name="PaymentSystem.php" hash="e4d4df170c21b7e3571b3ba1205ca979"/><file name="SOAP.php" hash="a0e5474dce51dc90ba4d37b5de3cdd84"/><file name="TPG_Common.php" hash="d86997c977cfd55b8ab577a514ab149c"/></dir><file name="GlobalErrors.php" hash="04d277d4a763efa508bf36d29c7dc8c4"/><file name="ISOCountries.php" hash="78dc558da68ca9a6ef44898a3980ecf2"/><file name="ISOCurrencies.php" hash="a32bc47b2d9896c293ecdcbf847144f9"/><file name="PaymentFormHelper.php" hash="41e22f61e8b71b8e8b6ca78b90da44e5"/></dir><dir name="Source"><file name="HashMethod.php" hash="997928579b69d21ae9eebec698c715c6"/><file name="OrderStatus.php" hash="4c44f8ba1652f20d934aa200ed4c8d00"/><file name="PaymentAction.php" hash="fa94be37c18bbb2f6301bdad1db3698d"/><file name="PaymentMode.php" hash="ea8af602bd09d54a123af64bc4b680d0"/><file name="ResultDeliveryMethod.php" hash="afb838319df715e604173d6aa143feab"/></dir><file name="Direct.php" hash="5b13a75e6f163241eda84f35326d5e18"/><file name="Request.php" hash="370f028086d13ae1df470e93a67dea66"/></dir></dir><dir name="Checkout"><dir name="Block"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="695d628564f6e1e0c85e3821699e6b45"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="9dbd58b6b32491d65e5c7d5850aa3420"/></dir><dir name="Model"><dir name="Type"><file name="Onepage.php" hash="1afc29e6ee372e2ec64556501998f263"/></dir></dir></dir><dir name="Sales"><dir name="etc"><file name="config.xml" hash="7b59887dda2117c9843b582a4721ade2"/></dir><dir name="Model"><dir name="Order"><file name="Invoice.php" hash="9be99f3fbe1c4fe98fb110d3daa8afe6"/><file name="Payment.php" hash="47ec8447f8560d7bbea56cba7e013575"/></dir><dir name="Service"><file name="Quote.php" hash="61670788275b93098bc8da9f27344e4b"/></dir><file name="Order.php" hash="9ffa9e06b0d5d8d2d810ab50017e81fa"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="cardsave_online.jpg" hash="abb239c81edb9ae8df8cf891e914e2aa"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="images"><file name="cardsave_online.jpg" hash="abb239c81edb9ae8df8cf891e914e2aa"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cardsave_All.xml" hash="e1d59fd8c4d4b5d87607f43fecf47e59"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cardsave_Cardsaveonlinepayments</name>
4
+ <version>1.9.4</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Cardsave payment extension for compatible with Magento v 1.3, 1.4, 1.5</summary>
10
+ <description>Fully supports 3D secure transactions. Also supports all of the integration methods provided by CardSave.</description>
11
+ <notes>Fixed the following bugs:
12
+ - payment form validation
13
+ - empty cart on failed payment
14
+ - wrong Payment Method wording in email confirmation</notes>
15
  <authors><author><name>cardsave.support</name><user>auto-converted</user><email>integrationsupport@cardsaveonlinepayments.com</email></author></authors>
16
+ <date>2011-05-31</date>
17
+ <time>10:48:29</time>
18
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="ad3f2b6304ce7e83e82195aa16fdb43a"/><file name="info.phtml" hash="9765a5eae50cb6fa21dcec22e7767e79"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="bf8cf94001d912f6d1e77b1d2b03cf6e"/><file name="info.phtml" hash="9765a5eae50cb6fa21dcec22e7767e79"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="34e9854beb8479eef68f452efa803ec1"/><file name="info.phtml" hash="c378bb59f085df95a4a6a5d866fc512d"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="cardsaveonlinepayments"><file name="form.phtml" hash="7f67d94e80b469997a5c1ca2f61a4e47"/><file name="info.phtml" hash="c378bb59f085df95a4a6a5d866fc512d"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Cardsave"><dir name="Cardsaveonlinepayments"><dir name="Block"><file name="Error.php" hash="660d3cbde48910ef271df9e05130a6d7"/><file name="Form.php" hash="ea5b3817c9607a94f4685d53d0b18569"/><file name="Info.php" hash="57a4bfec1a1c769de063be2b922f4a97"/><file name="Redirect.php" hash="b5a1f7af807dc9a41ec5b9db5c74e87e"/><file name="Threedsecure.php" hash="9d75776f34c5acaf6ea265f35f302c69"/></dir><dir name="controllers"><file name="PaymentController.php" hash="8bfece31f856e90f0cdadf3bca067ccf"/></dir><dir name="etc"><file name="config.xml" hash="d42560b62660323b2139db8201c3205f"/><file name="system.xml" hash="4d0eab1c1a11d3e2078802499ad49f1e"/></dir><dir name="Helper"><file name="Data.php" hash="e024ec0479d1e8e7efcf4751b05194d6"/></dir><dir name="Model"><dir name="Common"><dir name="ThePaymentGateway"><file name="PaymentSystem.php" hash="e4d4df170c21b7e3571b3ba1205ca979"/><file name="SOAP.php" hash="a0e5474dce51dc90ba4d37b5de3cdd84"/><file name="TPG_Common.php" hash="d86997c977cfd55b8ab577a514ab149c"/></dir><file name="GlobalErrors.php" hash="04d277d4a763efa508bf36d29c7dc8c4"/><file name="ISOCountries.php" hash="78dc558da68ca9a6ef44898a3980ecf2"/><file name="ISOCurrencies.php" hash="a32bc47b2d9896c293ecdcbf847144f9"/><file name="PaymentFormHelper.php" hash="41e22f61e8b71b8e8b6ca78b90da44e5"/></dir><dir name="Source"><file name="HashMethod.php" hash="997928579b69d21ae9eebec698c715c6"/><file name="OrderStatus.php" hash="4c44f8ba1652f20d934aa200ed4c8d00"/><file name="PaymentAction.php" hash="fa94be37c18bbb2f6301bdad1db3698d"/><file name="PaymentMode.php" hash="ea8af602bd09d54a123af64bc4b680d0"/><file name="ResultDeliveryMethod.php" hash="afb838319df715e604173d6aa143feab"/></dir><file name="Direct.php" hash="e35e88bd1c4dd94dc59adb6cb5061321"/><file name="Request.php" hash="370f028086d13ae1df470e93a67dea66"/></dir></dir><dir name="Checkout"><dir name="Block"><dir name="Onepage"><dir name="Payment"><file name="Methods.php" hash="695d628564f6e1e0c85e3821699e6b45"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="9dbd58b6b32491d65e5c7d5850aa3420"/></dir><dir name="Model"><dir name="Type"><file name="Onepage.php" hash="7d1b93be12eebd5e317d72655ba1d8e1"/></dir></dir></dir><dir name="Sales"><dir name="etc"><file name="config.xml" hash="9c884b19d80ee19e12bed268bb15e4ab"/></dir><dir name="Model"><dir name="Order"><file name="Invoice.php" hash="9be99f3fbe1c4fe98fb110d3daa8afe6"/><file name="Payment.php" hash="14f5fc7b55d07707e252f031f64cf18c"/></dir><dir name="Service"><file name="Quote.php" hash="a514922157b5690772d716c29f4a653e"/></dir><file name="Order.php" hash="9ffa9e06b0d5d8d2d810ab50017e81fa"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="cardsave_online.jpg" hash="abb239c81edb9ae8df8cf891e914e2aa"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="images"><file name="cardsave_online.jpg" hash="abb239c81edb9ae8df8cf891e914e2aa"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cardsave_All.xml" hash="e1d59fd8c4d4b5d87607f43fecf47e59"/></dir></target></contents>
19
  <compatible/>
20
  <dependencies/>
21
  </package>