Version Notes
La version 2.6.5.5 est stable.
Download this release
Release Info
Developer | Johnny |
Extension | CardconnectCcgateway |
Version | 1.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.4
- app/code/community/Cardconnect/Ccgateway/Block/Addcard.php +0 -10
- app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Items.php +48 -2
- app/code/community/Cardconnect/Ccgateway/Block/Cardmanagement.php +3 -13
- app/code/community/Cardconnect/Ccgateway/Block/Form.php +9 -8
- app/code/community/Cardconnect/Ccgateway/Block/Info.php +3 -3
- app/code/community/Cardconnect/Ccgateway/Model/Standard.php +104 -83
- app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/items.phtml +3 -5
- app/code/community/Cardconnect/Ccgateway/controllers/CardmanagementController.php +2 -1
- app/code/community/Cardconnect/Ccgateway/controllers/PaymentController.php +6 -6
- app/code/community/Cardconnect/Ccgateway/etc/config.xml +36 -25
- app/design/frontend/base/default/template/ccgateway/cardmanagement/editcard.phtml +44 -50
- app/design/frontend/base/default/template/ccgateway/cardmanagement/new.phtml +2 -12
- app/design/frontend/base/default/template/ccgateway/form.phtml +46 -15
- app/etc/modules/Cardconnect_Ccgateway.xml +2 -1
- js/cardconnect/ccgateway.js +57 -41
- package.xml +5 -5
app/code/community/Cardconnect/Ccgateway/Block/Addcard.php
CHANGED
@@ -37,16 +37,6 @@ class Cardconnect_Ccgateway_Block_Form extends Mage_Core_Block_Template{
|
|
37 |
$this->setTemplate('ccgateway/cardmanagement/new.phtml');
|
38 |
}
|
39 |
|
40 |
-
/**
|
41 |
-
* Retrieve Transaction Type
|
42 |
-
*
|
43 |
-
* @return string
|
44 |
-
*/
|
45 |
-
public function getCheckoutType(){
|
46 |
-
$type = Mage::getStoreConfig('payment/ccgateway/checkout_type');
|
47 |
-
|
48 |
-
return $type;
|
49 |
-
}
|
50 |
|
51 |
|
52 |
/**
|
37 |
$this->setTemplate('ccgateway/cardmanagement/new.phtml');
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
|
42 |
/**
|
app/code/community/Cardconnect/Ccgateway/Block/Adminhtml/Sales/Order/Invoice/Create/Items.php
CHANGED
@@ -54,7 +54,7 @@ class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_Create_Items ext
|
|
54 |
}
|
55 |
|
56 |
// Check the Capture status for a current order
|
57 |
-
public function
|
58 |
$order = $this->getOrder();
|
59 |
$orderId = $order->increment_id;
|
60 |
|
@@ -66,7 +66,7 @@ class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_Create_Items ext
|
|
66 |
foreach ($collection as $data) {
|
67 |
$cc_action[] = $data->getData('CC_ACTION');
|
68 |
}
|
69 |
-
if (in_array("Capture", $cc_action)) {
|
70 |
$c_status = false;
|
71 |
}else{
|
72 |
$c_status = true;
|
@@ -75,6 +75,52 @@ class Cardconnect_Ccgateway_Block_Adminhtml_Sales_Order_Invoice_Create_Items ext
|
|
75 |
return $c_status;
|
76 |
}
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
|
54 |
}
|
55 |
|
56 |
// Check the Capture status for a current order
|
57 |
+
public function isCaptureAllowed(){
|
58 |
$order = $this->getOrder();
|
59 |
$orderId = $order->increment_id;
|
60 |
|
66 |
foreach ($collection as $data) {
|
67 |
$cc_action[] = $data->getData('CC_ACTION');
|
68 |
}
|
69 |
+
if (in_array("authorize_capture", $cc_action) || in_array("Capture", $cc_action)) {
|
70 |
$c_status = false;
|
71 |
}else{
|
72 |
$c_status = true;
|
75 |
return $c_status;
|
76 |
}
|
77 |
|
78 |
+
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Check capture availability
|
82 |
+
*
|
83 |
+
* @return bool
|
84 |
+
*/
|
85 |
+
/* public function canCapture() {
|
86 |
+
$order = $this->getOrder();
|
87 |
+
if ($this->getConfigData('checkout_trans' , $order->getStoreId()) == "authorize_capture") {
|
88 |
+
$_canCapture = false;
|
89 |
+
} else {
|
90 |
+
$_canCapture = true;
|
91 |
+
}
|
92 |
+
|
93 |
+
return $_canCapture;
|
94 |
+
}
|
95 |
+
*/
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Retrieve information from payment configuration
|
99 |
+
*
|
100 |
+
* @param string $field
|
101 |
+
* @param int|string|null|Mage_Core_Model_Store $storeId
|
102 |
+
*
|
103 |
+
* @return mixed
|
104 |
+
*/
|
105 |
+
/* public function getConfigData($field, $storeId = null)
|
106 |
+
{
|
107 |
+
if (null === $storeId) {
|
108 |
+
if (Mage::app()->getStore()->getCode() == Mage_Core_Model_Store::ADMIN_CODE) {
|
109 |
+
$storeId = Mage::getSingleton('adminhtml/session_quote')->getStoreId();
|
110 |
+
} else {
|
111 |
+
$storeId = $this->getStore();
|
112 |
+
}
|
113 |
+
}
|
114 |
+
$path = 'payment/ccgateway/'.$field;
|
115 |
+
|
116 |
+
$myLogMessage = "CC Config Data Service : ". __FILE__ . " @ " . __LINE__ ." Path: ".$path." Store Id: ".$storeId;
|
117 |
+
Mage::log($myLogMessage, Zend_Log::INFO , "cc.log" );
|
118 |
+
|
119 |
+
return Mage::getStoreConfig($path, $storeId);
|
120 |
+
}
|
121 |
+
|
122 |
+
*/
|
123 |
+
|
124 |
}
|
125 |
|
126 |
|
app/code/community/Cardconnect/Ccgateway/Block/Cardmanagement.php
CHANGED
@@ -70,7 +70,7 @@ class Cardconnect_Ccgateway_Block_Cardmanagement extends Mage_Core_Block_Templat
|
|
70 |
* @return string
|
71 |
*/
|
72 |
public function isTransactionModeTest() {
|
73 |
-
|
74 |
switch ($isTestMode) {
|
75 |
case 0:
|
76 |
$isTestMode = 'no';
|
@@ -113,11 +113,11 @@ class Cardconnect_Ccgateway_Block_Cardmanagement extends Mage_Core_Block_Templat
|
|
113 |
* @return array
|
114 |
*/
|
115 |
public function getCcTypes() {
|
116 |
-
|
117 |
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
118 |
$types = $cc_types->toOptionArray();
|
119 |
|
120 |
-
$availableTypes = Mage::
|
121 |
|
122 |
if ($availableTypes) {
|
123 |
$availableTypes = explode(',', $availableTypes);
|
@@ -196,14 +196,4 @@ class Cardconnect_Ccgateway_Block_Cardmanagement extends Mage_Core_Block_Templat
|
|
196 |
return $addressdata;
|
197 |
}
|
198 |
|
199 |
-
|
200 |
-
function getSystemPath($path) {
|
201 |
-
$newPath = '';
|
202 |
-
$parts = explode('/', $path);
|
203 |
-
if (count($parts) != 3) { //you must have at least 3 parts in the node name
|
204 |
-
return '';
|
205 |
-
}
|
206 |
-
return 'sections/'.$parts[0].'/groups/'.$parts[1].'/fields/'.$parts[2];
|
207 |
-
|
208 |
-
}
|
209 |
}
|
70 |
* @return string
|
71 |
*/
|
72 |
public function isTransactionModeTest() {
|
73 |
+
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
74 |
switch ($isTestMode) {
|
75 |
case 0:
|
76 |
$isTestMode = 'no';
|
113 |
* @return array
|
114 |
*/
|
115 |
public function getCcTypes() {
|
116 |
+
|
117 |
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
118 |
$types = $cc_types->toOptionArray();
|
119 |
|
120 |
+
$availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');
|
121 |
|
122 |
if ($availableTypes) {
|
123 |
$availableTypes = explode(',', $availableTypes);
|
196 |
return $addressdata;
|
197 |
}
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
}
|
app/code/community/Cardconnect/Ccgateway/Block/Form.php
CHANGED
@@ -35,7 +35,7 @@ class Cardconnect_Ccgateway_Block_Form extends Mage_Payment_Block_Form
|
|
35 |
|
36 |
protected function _construct()
|
37 |
{
|
38 |
-
if(Mage::
|
39 |
parent::_construct();
|
40 |
$this->setTemplate('ccgateway/form.phtml');
|
41 |
}
|
@@ -46,11 +46,11 @@ class Cardconnect_Ccgateway_Block_Form extends Mage_Payment_Block_Form
|
|
46 |
*
|
47 |
* @return string
|
48 |
*/
|
49 |
-
public function getCheckoutType()
|
50 |
-
|
51 |
-
$
|
52 |
|
53 |
-
return $
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -60,7 +60,7 @@ class Cardconnect_Ccgateway_Block_Form extends Mage_Payment_Block_Form
|
|
60 |
*/
|
61 |
public function isTransactionModeTest()
|
62 |
{
|
63 |
-
$isTestMode = Mage::
|
64 |
switch ($isTestMode) {
|
65 |
case 0:
|
66 |
$isTestMode = 'no';
|
@@ -92,11 +92,10 @@ class Cardconnect_Ccgateway_Block_Form extends Mage_Payment_Block_Form
|
|
92 |
*/
|
93 |
public function getCcTypes()
|
94 |
{
|
95 |
-
|
96 |
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
97 |
$types = $cc_types->toOptionArray();
|
98 |
|
99 |
-
$availableTypes = Mage::
|
100 |
|
101 |
if ($availableTypes) {
|
102 |
$availableTypes = explode(',', $availableTypes);
|
@@ -201,6 +200,8 @@ class Cardconnect_Ccgateway_Block_Form extends Mage_Payment_Block_Form
|
|
201 |
$response = json_decode($resp, true);
|
202 |
if(isset($response[0]['resptext'])){
|
203 |
$response = "CardConnect_Error";
|
|
|
|
|
204 |
}
|
205 |
}
|
206 |
} else {
|
35 |
|
36 |
protected function _construct()
|
37 |
{
|
38 |
+
if(Mage::getModel('ccgateway/standard')->getConfigData('active')==1){
|
39 |
parent::_construct();
|
40 |
$this->setTemplate('ccgateway/form.phtml');
|
41 |
}
|
46 |
*
|
47 |
* @return string
|
48 |
*/
|
49 |
+
public function getCheckoutType(){
|
50 |
+
|
51 |
+
$checkoutType = Mage::getModel('ccgateway/standard')->getConfigData('checkout_type');
|
52 |
|
53 |
+
return $checkoutType;
|
54 |
}
|
55 |
|
56 |
/**
|
60 |
*/
|
61 |
public function isTransactionModeTest()
|
62 |
{
|
63 |
+
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
64 |
switch ($isTestMode) {
|
65 |
case 0:
|
66 |
$isTestMode = 'no';
|
92 |
*/
|
93 |
public function getCcTypes()
|
94 |
{
|
|
|
95 |
$cc_types = new Cardconnect_Ccgateway_Adminhtml_Model_System_Config_Source_Cardtype();
|
96 |
$types = $cc_types->toOptionArray();
|
97 |
|
98 |
+
$availableTypes = Mage::getModel('ccgateway/standard')->getConfigData('card_type');
|
99 |
|
100 |
if ($availableTypes) {
|
101 |
$availableTypes = explode(',', $availableTypes);
|
200 |
$response = json_decode($resp, true);
|
201 |
if(isset($response[0]['resptext'])){
|
202 |
$response = "CardConnect_Error";
|
203 |
+
}else{
|
204 |
+
$response = json_decode($resp, true);
|
205 |
}
|
206 |
}
|
207 |
} else {
|
app/code/community/Cardconnect/Ccgateway/Block/Info.php
CHANGED
@@ -85,9 +85,9 @@ class Cardconnect_Ccgateway_Block_Info extends Mage_Payment_Block_Info {
|
|
85 |
* @return string
|
86 |
*/
|
87 |
public function getCheckoutType(){
|
88 |
-
$
|
89 |
-
|
90 |
-
return $
|
91 |
}
|
92 |
|
93 |
|
85 |
* @return string
|
86 |
*/
|
87 |
public function getCheckoutType(){
|
88 |
+
$checkoutType = Mage::getModel('ccgateway/standard')->getConfigData('checkout_type');
|
89 |
+
|
90 |
+
return $checkoutType;
|
91 |
}
|
92 |
|
93 |
|
app/code/community/Cardconnect/Ccgateway/Model/Standard.php
CHANGED
@@ -63,7 +63,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
63 |
*/
|
64 |
public function getUrl() {
|
65 |
|
66 |
-
$isTestMode = Mage::
|
67 |
switch ($isTestMode) {
|
68 |
case 0:
|
69 |
$_url = 'https://securepayments.cardconnect.com/hpp/payment/';
|
@@ -83,7 +83,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
83 |
*/
|
84 |
public function getWebServicesUrl() {
|
85 |
|
86 |
-
$isTestMode = Mage::
|
87 |
switch ($isTestMode) {
|
88 |
case 0:
|
89 |
$_webServicesUrl = 'https://fts.prinpay.com:8443/cardconnect/rest/';
|
@@ -102,7 +102,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
102 |
*/
|
103 |
public function getCardSecureApiUrl() {
|
104 |
|
105 |
-
$isTestMode = Mage::
|
106 |
switch ($isTestMode) {
|
107 |
case 0:
|
108 |
$_cardSecureApiUrl = "https://fts.prinpay.com:8443/cardsecure/cs";
|
@@ -133,8 +133,9 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
133 |
* @return bool
|
134 |
*/
|
135 |
public function canCapture() {
|
136 |
-
|
137 |
-
|
|
|
138 |
$_canCapture = false;
|
139 |
} else {
|
140 |
$_canCapture = true;
|
@@ -163,7 +164,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
163 |
* Get Payment transaction type
|
164 |
*/
|
165 |
public function getPaymentTransactionType() {
|
166 |
-
$checkout_trans =
|
167 |
|
168 |
return $checkout_trans;
|
169 |
}
|
@@ -197,9 +198,9 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
197 |
* @return array
|
198 |
*/
|
199 |
public function getFormFields() {
|
200 |
-
// get transaction amount and currency
|
201 |
|
202 |
-
|
|
|
203 |
$price = number_format($this->getOrder()->getGrandTotal(), 2, '.', '');
|
204 |
} else {
|
205 |
$price = number_format($this->getOrder()->getBaseGrandTotal(), 2, '.', '');
|
@@ -208,26 +209,26 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
208 |
$billing = $this->getOrder()->getBillingAddress();
|
209 |
|
210 |
$ccArray = array(
|
211 |
-
'ccId' =>
|
212 |
-
'ccSite' =>
|
213 |
-
'ccDisplayAddress' =>
|
214 |
-
'ccCapture' =>
|
215 |
-
'ccTokenize' =>
|
216 |
-
'ccDisplayCvv' =>
|
217 |
-
'ccAmount' => $price,
|
218 |
'ccName' => Mage::helper('core')->removeAccents($billing->getFirstname()
|
219 |
-
. ' ' . $billing->getLastname()),
|
220 |
-
'ccAddress' => Mage::helper('core')->removeAccents($billing->getStreet(1)),
|
221 |
-
'ccCity' => Mage::helper('core')->removeAccents($billing->getCity()),
|
222 |
-
'ccState' => $billing->getRegionCode(),
|
223 |
-
'ccCountry' => $billing->getCountry(),
|
224 |
-
'ccZip' => $billing->getPostcode(),
|
225 |
-
'ccCardTypes' =>
|
226 |
-
'ccOrderId' => Mage::getSingleton('checkout/session')->getLastRealOrderId(),
|
227 |
-
'ccCssUrl' =>
|
228 |
-
'ccPostbackUrl' => Mage::getUrl('ccgateway/payment/response'),
|
229 |
-
'ccAsync' =>
|
230 |
-
'ccCancel' =>
|
231 |
);
|
232 |
|
233 |
return $ccArray;
|
@@ -293,9 +294,9 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
293 |
public function authService($order, $authAmount = "", $status = "") {
|
294 |
|
295 |
$orderId = $order->getIncrementId();
|
296 |
-
$
|
297 |
-
$
|
298 |
-
$cc_password =
|
299 |
|
300 |
if (empty($status)) {
|
301 |
$ccOwner = Mage::getSingleton('core/session')->getCcOwner();
|
@@ -371,7 +372,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
371 |
'tokenize' => 'Y');
|
372 |
}
|
373 |
|
374 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
375 |
|
376 |
$resp = $cc->authService($param);
|
377 |
|
@@ -415,23 +416,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
415 |
return $response;
|
416 |
}
|
417 |
|
418 |
-
/** For card purge * */
|
419 |
-
public function cardPurgeService($tokenNum) {
|
420 |
-
|
421 |
-
$passWord = Mage::getStoreConfig('payment/ccgateway/password');
|
422 |
-
$cc_password = Mage::getModel('core/encryption')->decrypt($passWord);
|
423 |
-
|
424 |
-
$cc = new CardConnectWebService($this->getCardSecureApiUrl(), Mage::getStoreConfig('payment/ccgateway/username'), $cc_password, Mage::getStoreConfig('payment/ccgateway/merchant'), $this->getKeysLocation());
|
425 |
-
|
426 |
-
|
427 |
-
$resp = $cc->cardPurgeService("CP", "xml", $tokenNum);
|
428 |
|
429 |
-
$response = simplexml_load_string($resp) or die("Error: Cannot create object");
|
430 |
-
Mage:: log($response->data);
|
431 |
-
|
432 |
-
|
433 |
-
return $response->data;
|
434 |
-
}
|
435 |
|
436 |
/** For capture * */
|
437 |
public function capture(Varien_Object $payment, $amount) {
|
@@ -460,12 +445,11 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
460 |
$retref = $this->getRetrefReferenceNumber($orderId);
|
461 |
$authCode = $this->getAuthCode($orderId);
|
462 |
$checkout_trans = $this->getPaymentTransactionType();
|
463 |
-
$
|
|
|
|
|
464 |
|
465 |
-
$
|
466 |
-
$cc_password = Mage::getModel('core/encryption')->decrypt($passWord);
|
467 |
-
|
468 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(), Mage::getStoreConfig('payment/ccgateway/username'), $cc_password, Mage::getStoreConfig('payment/ccgateway/merchant'), $this->getKeysLocation());
|
469 |
|
470 |
|
471 |
if ($fullAuthorizedAmount == $amount) {
|
@@ -541,11 +525,11 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
541 |
$amount = number_format($amount, 2);
|
542 |
}
|
543 |
$amount = str_replace(",", "", $amount);
|
544 |
-
$
|
545 |
-
$
|
|
|
546 |
|
547 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
548 |
-
Mage::log("Void req ".$retref." amount ".$amount, Zend_Log::ERR , "cc.log" );
|
549 |
$resp = $cc->voidService($retref, $amount);
|
550 |
|
551 |
if ($resp != "") {
|
@@ -605,10 +589,11 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
605 |
$order = $payment->getOrder();
|
606 |
$orderId = $order->increment_id;
|
607 |
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
608 |
-
$
|
609 |
-
$
|
|
|
610 |
|
611 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
612 |
|
613 |
$resp = $cc->inquireService($retref);
|
614 |
$response = json_decode($resp, true);
|
@@ -635,7 +620,10 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
635 |
$order = $payment->getOrder();
|
636 |
$orderId = $order->increment_id;
|
637 |
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
638 |
-
$
|
|
|
|
|
|
|
639 |
if ($amount <= 0) {
|
640 |
Mage::throwException(Mage::helper('ccgateway')->__('Invalid amount for refund.'));
|
641 |
}
|
@@ -645,10 +633,8 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
645 |
}
|
646 |
|
647 |
$amount = str_replace(",", "", $amount);
|
648 |
-
$passWord = Mage::getStoreConfig('payment/ccgateway/password');
|
649 |
-
$cc_password = Mage::getModel('core/encryption')->decrypt($passWord);
|
650 |
|
651 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
652 |
|
653 |
$resp = $cc->refundService($retref, $amount);
|
654 |
|
@@ -687,8 +673,10 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
687 |
$order = Mage::getModel('sales/order');
|
688 |
$order->loadByIncrementId($orderId);
|
689 |
$responseData = $this->getResponseDataByOrderId($orderId);
|
690 |
-
$
|
691 |
-
$
|
|
|
|
|
692 |
|
693 |
$response = "";
|
694 |
$errorMsg = 0;
|
@@ -704,7 +692,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
704 |
$setlstat = $data->getData('CC_SETLSTAT');
|
705 |
|
706 |
|
707 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
708 |
|
709 |
$resp = $cc->inquireService($retref);
|
710 |
$response = json_decode($resp, true);
|
@@ -725,7 +713,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
725 |
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, 'cardconnect_void', $response['setlstat'])->save();
|
726 |
}
|
727 |
} else if ($response['setlstat'] == 'Rejected') {
|
728 |
-
|
729 |
}
|
730 |
|
731 |
$stat = strpos($setlstat, $response['setlstat']);
|
@@ -774,8 +762,9 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
774 |
// Create Profile webservices
|
775 |
function createProfileService($paymentInformation) {
|
776 |
|
777 |
-
$
|
778 |
-
$
|
|
|
779 |
|
780 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
781 |
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
@@ -804,7 +793,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
804 |
'postal' => $paymentInformation['cc_postcode']
|
805 |
);
|
806 |
|
807 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
808 |
|
809 |
$resp = $cc->createProfileService($profrequest);
|
810 |
|
@@ -835,10 +824,11 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
835 |
// Function for Get Profile webservices
|
836 |
function getProfileWebService($profileId, $cc_id) {
|
837 |
|
838 |
-
$
|
839 |
-
$
|
|
|
840 |
|
841 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
842 |
$resp = $cc->getProfileService($profileId);
|
843 |
if (!empty($resp) && $cc_id != "") {
|
844 |
$resource = Mage::getSingleton('core/resource');
|
@@ -863,10 +853,11 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
863 |
// Function for Get Profile webservices Checkout
|
864 |
function getProfileWebServiceCheckout($profileId) {
|
865 |
|
866 |
-
$
|
867 |
-
$
|
|
|
868 |
|
869 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
870 |
$resp = $cc->getProfileService($profileId);
|
871 |
if (empty($resp)) {
|
872 |
$myLogMessage = "CC Get Profile Service : ". __FILE__ . " @ " . __LINE__ ." ".$cc->getLastErrorMessage();
|
@@ -881,8 +872,10 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
881 |
|
882 |
function deleteWalletDataService($profileRowId) {
|
883 |
|
884 |
-
$
|
885 |
-
$
|
|
|
|
|
886 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
887 |
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
888 |
$ccUserId = $customerData->getId();
|
@@ -900,7 +893,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
900 |
|
901 |
|
902 |
if (!empty($tokenNum)) {
|
903 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
904 |
$resp = $cc->deleteProfileService($ccProfileId);
|
905 |
|
906 |
if (!empty($resp)) {
|
@@ -935,8 +928,10 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
935 |
|
936 |
// Update Profile webservices
|
937 |
function updateProfileService($paymentInformation) {
|
938 |
-
$
|
939 |
-
$
|
|
|
|
|
940 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
941 |
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
942 |
$ccUserId = $customerData->getId();
|
@@ -967,7 +962,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
967 |
);
|
968 |
|
969 |
|
970 |
-
$cc = new CardConnectWebService($this->getWebServicesUrl(),
|
971 |
|
972 |
$resp = $cc->createProfileService($profrequest);
|
973 |
if ($resp != "") {
|
@@ -981,7 +976,7 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
981 |
$connectionWrite->commit();
|
982 |
$response = "Profile Updated";
|
983 |
} else {
|
984 |
-
$errorMessage = "There is some problem in
|
985 |
Mage::log($errorMessage, Zend_Log::ERR);
|
986 |
}
|
987 |
} else {
|
@@ -1117,4 +1112,30 @@ class Cardconnect_Ccgateway_Model_Standard extends Mage_Payment_Model_Method_Abs
|
|
1117 |
return $retrefRefrenceNumber;
|
1118 |
}
|
1119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1120 |
}
|
63 |
*/
|
64 |
public function getUrl() {
|
65 |
|
66 |
+
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
67 |
switch ($isTestMode) {
|
68 |
case 0:
|
69 |
$_url = 'https://securepayments.cardconnect.com/hpp/payment/';
|
83 |
*/
|
84 |
public function getWebServicesUrl() {
|
85 |
|
86 |
+
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
87 |
switch ($isTestMode) {
|
88 |
case 0:
|
89 |
$_webServicesUrl = 'https://fts.prinpay.com:8443/cardconnect/rest/';
|
102 |
*/
|
103 |
public function getCardSecureApiUrl() {
|
104 |
|
105 |
+
$isTestMode = Mage::getModel('ccgateway/standard')->getConfigData('test_mode');
|
106 |
switch ($isTestMode) {
|
107 |
case 0:
|
108 |
$_cardSecureApiUrl = "https://fts.prinpay.com:8443/cardsecure/cs";
|
133 |
* @return bool
|
134 |
*/
|
135 |
public function canCapture() {
|
136 |
+
$order = $this->getOrder();
|
137 |
+
$tranType = $this->getConfigData('checkout_trans', $order->getStoreId());
|
138 |
+
if ($tranType == "authorize_capture") {
|
139 |
$_canCapture = false;
|
140 |
} else {
|
141 |
$_canCapture = true;
|
164 |
* Get Payment transaction type
|
165 |
*/
|
166 |
public function getPaymentTransactionType() {
|
167 |
+
$checkout_trans = $this->getConfigData('checkout_trans');
|
168 |
|
169 |
return $checkout_trans;
|
170 |
}
|
198 |
* @return array
|
199 |
*/
|
200 |
public function getFormFields() {
|
|
|
201 |
|
202 |
+
// get transaction amount and currency
|
203 |
+
if ($this->getConfigData('currency')) {
|
204 |
$price = number_format($this->getOrder()->getGrandTotal(), 2, '.', '');
|
205 |
} else {
|
206 |
$price = number_format($this->getOrder()->getBaseGrandTotal(), 2, '.', '');
|
209 |
$billing = $this->getOrder()->getBillingAddress();
|
210 |
|
211 |
$ccArray = array(
|
212 |
+
'ccId' => $this->getConfigData('card_id'), /* CardConnect Id */
|
213 |
+
'ccSite' => $this->getConfigData('site_name'), /* Site Name */
|
214 |
+
'ccDisplayAddress' => $this->getConfigData('address'), /* Display Address */
|
215 |
+
'ccCapture' => $this->getConfigData('checkout_trans'), /* Checkout Transaction Type */
|
216 |
+
'ccTokenize' => $this->getConfigData('tokenize'), /* Tokenize */
|
217 |
+
'ccDisplayCvv' => $this->getConfigData('display'), /* Display CVV */
|
218 |
+
'ccAmount' => $price, /* Transaction Amount */
|
219 |
'ccName' => Mage::helper('core')->removeAccents($billing->getFirstname()
|
220 |
+
. ' ' . $billing->getLastname()), /* Account Name */
|
221 |
+
'ccAddress' => Mage::helper('core')->removeAccents($billing->getStreet(1)), /* Account street address */
|
222 |
+
'ccCity' => Mage::helper('core')->removeAccents($billing->getCity()), /* Account city */
|
223 |
+
'ccState' => $billing->getRegionCode(), /* US State, Mexican State, Canadian Province, etc. */
|
224 |
+
'ccCountry' => $billing->getCountry(), /* Account country */
|
225 |
+
'ccZip' => $billing->getPostcode(), /* Account postal code */
|
226 |
+
'ccCardTypes' => $this->getConfigData('card_type'),
|
227 |
+
'ccOrderId' => Mage::getSingleton('checkout/session')->getLastRealOrderId(), /* Order Id */
|
228 |
+
'ccCssUrl' => $this->getConfigData('css'), /* CSS URL */
|
229 |
+
'ccPostbackUrl' => Mage::getUrl('ccgateway/payment/response'), /* Postback URL */
|
230 |
+
'ccAsync' => $this->getConfigData('validation'), /* Immediate Validation */
|
231 |
+
'ccCancel' => $this->getConfigData('cancel'), /* Cancel Button enable flag */
|
232 |
);
|
233 |
|
234 |
return $ccArray;
|
294 |
public function authService($order, $authAmount = "", $status = "") {
|
295 |
|
296 |
$orderId = $order->getIncrementId();
|
297 |
+
$username = $this->getConfigData('username' , $order->getStoreId());
|
298 |
+
$merchid = $this->getConfigData('merchant' , $order->getStoreId());
|
299 |
+
$cc_password = $this->getConfigData('password', $order->getStoreId());
|
300 |
|
301 |
if (empty($status)) {
|
302 |
$ccOwner = Mage::getSingleton('core/session')->getCcOwner();
|
372 |
'tokenize' => 'Y');
|
373 |
}
|
374 |
|
375 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
376 |
|
377 |
$resp = $cc->authService($param);
|
378 |
|
416 |
return $response;
|
417 |
}
|
418 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
|
421 |
/** For capture * */
|
422 |
public function capture(Varien_Object $payment, $amount) {
|
445 |
$retref = $this->getRetrefReferenceNumber($orderId);
|
446 |
$authCode = $this->getAuthCode($orderId);
|
447 |
$checkout_trans = $this->getPaymentTransactionType();
|
448 |
+
$username = $this->getConfigData('username' , $payment->getOrder()->getStoreId());
|
449 |
+
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
450 |
+
$cc_password = $this->getConfigData('password', $payment->getOrder()->getStoreId());
|
451 |
|
452 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
|
|
|
|
|
|
453 |
|
454 |
|
455 |
if ($fullAuthorizedAmount == $amount) {
|
525 |
$amount = number_format($amount, 2);
|
526 |
}
|
527 |
$amount = str_replace(",", "", $amount);
|
528 |
+
$username = $this->getConfigData('username' , $order->getStoreId());
|
529 |
+
$merchid = $this->getConfigData('merchant' , $order->getStoreId());
|
530 |
+
$cc_password = $this->getConfigData('password', $order->getStoreId());
|
531 |
|
532 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
|
|
533 |
$resp = $cc->voidService($retref, $amount);
|
534 |
|
535 |
if ($resp != "") {
|
589 |
$order = $payment->getOrder();
|
590 |
$orderId = $order->increment_id;
|
591 |
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
592 |
+
$username = $this->getConfigData('username' , $payment->getOrder()->getStoreId());
|
593 |
+
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
594 |
+
$cc_password = $this->getConfigData('password', $payment->getOrder()->getStoreId());
|
595 |
|
596 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
597 |
|
598 |
$resp = $cc->inquireService($retref);
|
599 |
$response = json_decode($resp, true);
|
620 |
$order = $payment->getOrder();
|
621 |
$orderId = $order->increment_id;
|
622 |
$retref = $this->getRetrefReferenceNumber($orderId, "Refund");
|
623 |
+
$username = $this->getConfigData('username' , $payment->getOrder()->getStoreId());
|
624 |
+
$merchid = $this->getConfigData('merchant' , $payment->getOrder()->getStoreId());
|
625 |
+
$cc_password = $this->getConfigData('password', $payment->getOrder()->getStoreId());
|
626 |
+
|
627 |
if ($amount <= 0) {
|
628 |
Mage::throwException(Mage::helper('ccgateway')->__('Invalid amount for refund.'));
|
629 |
}
|
633 |
}
|
634 |
|
635 |
$amount = str_replace(",", "", $amount);
|
|
|
|
|
636 |
|
637 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
638 |
|
639 |
$resp = $cc->refundService($retref, $amount);
|
640 |
|
673 |
$order = Mage::getModel('sales/order');
|
674 |
$order->loadByIncrementId($orderId);
|
675 |
$responseData = $this->getResponseDataByOrderId($orderId);
|
676 |
+
$username = $this->getConfigData('username' , $order->getStoreId());
|
677 |
+
$merchid = $this->getConfigData('merchant' , $order->getStoreId());
|
678 |
+
$cc_password = $this->getConfigData('password', $order->getStoreId());
|
679 |
+
|
680 |
|
681 |
$response = "";
|
682 |
$errorMsg = 0;
|
692 |
$setlstat = $data->getData('CC_SETLSTAT');
|
693 |
|
694 |
|
695 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
696 |
|
697 |
$resp = $cc->inquireService($retref);
|
698 |
$response = json_decode($resp, true);
|
713 |
$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, 'cardconnect_void', $response['setlstat'])->save();
|
714 |
}
|
715 |
} else if ($response['setlstat'] == 'Rejected') {
|
716 |
+
// Do not update order status for refund
|
717 |
}
|
718 |
|
719 |
$stat = strpos($setlstat, $response['setlstat']);
|
762 |
// Create Profile webservices
|
763 |
function createProfileService($paymentInformation) {
|
764 |
|
765 |
+
$username = $this->getConfigData('username');
|
766 |
+
$merchid = $this->getConfigData('merchant');
|
767 |
+
$cc_password = $this->getConfigData('password');
|
768 |
|
769 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
770 |
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
793 |
'postal' => $paymentInformation['cc_postcode']
|
794 |
);
|
795 |
|
796 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
797 |
|
798 |
$resp = $cc->createProfileService($profrequest);
|
799 |
|
824 |
// Function for Get Profile webservices
|
825 |
function getProfileWebService($profileId, $cc_id) {
|
826 |
|
827 |
+
$username = $this->getConfigData('username');
|
828 |
+
$merchid = $this->getConfigData('merchant');
|
829 |
+
$cc_password = $this->getConfigData('password');
|
830 |
|
831 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
832 |
$resp = $cc->getProfileService($profileId);
|
833 |
if (!empty($resp) && $cc_id != "") {
|
834 |
$resource = Mage::getSingleton('core/resource');
|
853 |
// Function for Get Profile webservices Checkout
|
854 |
function getProfileWebServiceCheckout($profileId) {
|
855 |
|
856 |
+
$username = $this->getConfigData('username');
|
857 |
+
$merchid = $this->getConfigData('merchant');
|
858 |
+
$cc_password = $this->getConfigData('password');
|
859 |
|
860 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
861 |
$resp = $cc->getProfileService($profileId);
|
862 |
if (empty($resp)) {
|
863 |
$myLogMessage = "CC Get Profile Service : ". __FILE__ . " @ " . __LINE__ ." ".$cc->getLastErrorMessage();
|
872 |
|
873 |
function deleteWalletDataService($profileRowId) {
|
874 |
|
875 |
+
$username = $this->getConfigData('username');
|
876 |
+
$merchid = $this->getConfigData('merchant');
|
877 |
+
$cc_password = $this->getConfigData('password');
|
878 |
+
|
879 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
880 |
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
881 |
$ccUserId = $customerData->getId();
|
893 |
|
894 |
|
895 |
if (!empty($tokenNum)) {
|
896 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
897 |
$resp = $cc->deleteProfileService($ccProfileId);
|
898 |
|
899 |
if (!empty($resp)) {
|
928 |
|
929 |
// Update Profile webservices
|
930 |
function updateProfileService($paymentInformation) {
|
931 |
+
$username = $this->getConfigData('username');
|
932 |
+
$merchid = $this->getConfigData('merchant');
|
933 |
+
$cc_password = $this->getConfigData('password');
|
934 |
+
|
935 |
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
936 |
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
937 |
$ccUserId = $customerData->getId();
|
962 |
);
|
963 |
|
964 |
|
965 |
+
$cc = new CardConnectWebService($this->getWebServicesUrl(), $username, $cc_password, $merchid, $this->getKeysLocation());
|
966 |
|
967 |
$resp = $cc->createProfileService($profrequest);
|
968 |
if ($resp != "") {
|
976 |
$connectionWrite->commit();
|
977 |
$response = "Profile Updated";
|
978 |
} else {
|
979 |
+
$errorMessage = "There is some problem in update profile. Due to " . $response['resptext'];
|
980 |
Mage::log($errorMessage, Zend_Log::ERR);
|
981 |
}
|
982 |
} else {
|
1112 |
return $retrefRefrenceNumber;
|
1113 |
}
|
1114 |
|
1115 |
+
/**
|
1116 |
+
* Retrieve information from payment configuration
|
1117 |
+
*
|
1118 |
+
* @param string $field
|
1119 |
+
* @param int|string|null|Mage_Core_Model_Store $storeId
|
1120 |
+
*
|
1121 |
+
* @return mixed
|
1122 |
+
*/
|
1123 |
+
public function getConfigData($field, $storeId = null)
|
1124 |
+
{
|
1125 |
+
|
1126 |
+
$path = 'payment/'.$this->getCode().'/'.$field;
|
1127 |
+
|
1128 |
+
if(empty($storeId)){
|
1129 |
+
if(Mage::app()->getStore()->getCode() == Mage_Core_Model_Store::ADMIN_CODE) {
|
1130 |
+
$storeId = Mage::getSingleton('adminhtml/session_quote')->getStoreId();
|
1131 |
+
return Mage::getStoreConfig($path, $storeId);
|
1132 |
+
}else {
|
1133 |
+
return Mage:: getStoreConfig($path);
|
1134 |
+
}
|
1135 |
+
}else{
|
1136 |
+
return Mage::getStoreConfig($path, $storeId);
|
1137 |
+
}
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
|
1141 |
}
|
app/code/community/Cardconnect/Ccgateway/blocks/invoice/create/items.phtml
CHANGED
@@ -91,9 +91,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
91 |
</fieldset>
|
92 |
</div>
|
93 |
|
94 |
-
|
95 |
-
// if($this->getCaptureStatus()==true){
|
96 |
-
?>
|
97 |
<div class="box-right entry-edit" id="invoice_totals">
|
98 |
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
|
99 |
<div class="order-totals">
|
@@ -102,7 +100,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
102 |
<div class="divider"></div>
|
103 |
<?php if ($this->isCaptureAllowed()): ?>
|
104 |
<?php if ($this->canCapture()):?>
|
105 |
-
<p>
|
106 |
<!--
|
107 |
<label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Capture Amount') ?></label>
|
108 |
<input type="checkbox" name="invoice[do_capture]" id="invoice_do_capture" value="1" checked/>
|
@@ -135,7 +133,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
135 |
</div>
|
136 |
</div>
|
137 |
</div>
|
138 |
-
|
139 |
<div class="clear"></div>
|
140 |
|
141 |
<table class="order-info-foot" cellpadding="10" cellspacing="0" width="100%">
|
91 |
</fieldset>
|
92 |
</div>
|
93 |
|
94 |
+
|
|
|
|
|
95 |
<div class="box-right entry-edit" id="invoice_totals">
|
96 |
<div class="entry-edit-head"><h4><?php echo $this->__('Invoice Totals') ?></h4></div>
|
97 |
<div class="order-totals">
|
100 |
<div class="divider"></div>
|
101 |
<?php if ($this->isCaptureAllowed()): ?>
|
102 |
<?php if ($this->canCapture()):?>
|
103 |
+
<p>
|
104 |
<!--
|
105 |
<label for="invoice_do_capture" class="normal"><?php echo Mage::helper('sales')->__('Capture Amount') ?></label>
|
106 |
<input type="checkbox" name="invoice[do_capture]" id="invoice_do_capture" value="1" checked/>
|
133 |
</div>
|
134 |
</div>
|
135 |
</div>
|
136 |
+
|
137 |
<div class="clear"></div>
|
138 |
|
139 |
<table class="order-info-foot" cellpadding="10" cellspacing="0" width="100%">
|
app/code/community/Cardconnect/Ccgateway/controllers/CardmanagementController.php
CHANGED
@@ -29,7 +29,8 @@
|
|
29 |
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
*/
|
32 |
-
|
|
|
33 |
|
34 |
class Cardconnect_Ccgateway_CardmanagementController extends Mage_Customer_AccountController {
|
35 |
|
29 |
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
30 |
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
31 |
*/
|
32 |
+
|
33 |
+
require_once Mage::getModuleDir('controllers', 'Mage_Customer').DS.'AccountController.php';
|
34 |
|
35 |
class Cardconnect_Ccgateway_CardmanagementController extends Mage_Customer_AccountController {
|
36 |
|
app/code/community/Cardconnect/Ccgateway/controllers/PaymentController.php
CHANGED
@@ -66,7 +66,7 @@ class Cardconnect_Ccgateway_PaymentController extends Mage_Core_Controller_Front
|
|
66 |
$session->setccgatewayQuoteId($session->getQuoteId());
|
67 |
}
|
68 |
|
69 |
-
$checkoutType = Mage::
|
70 |
|
71 |
if ($checkoutType == "tokenized_post") {
|
72 |
$response = Mage::getModel('ccgateway/standard')->authService($order);
|
@@ -95,11 +95,12 @@ class Cardconnect_Ccgateway_PaymentController extends Mage_Core_Controller_Front
|
|
95 |
|
96 |
public function responseAction($response = "") {
|
97 |
|
98 |
-
$cc_action = Mage::getStoreConfig('payment/ccgateway/checkout_trans');
|
99 |
-
$merchid = Mage::getStoreConfig('payment/ccgateway/merchant');
|
100 |
$session = $this->_getCheckout();
|
101 |
$order = Mage::getModel('sales/order');
|
102 |
$order->loadByIncrementId($session->getLastRealOrderId());
|
|
|
|
|
|
|
103 |
$ccToken = "";
|
104 |
|
105 |
if ($this->getRequest()->isPost()) {
|
@@ -159,9 +160,8 @@ class Cardconnect_Ccgateway_PaymentController extends Mage_Core_Controller_Front
|
|
159 |
if ($errorCode == 00) {
|
160 |
$statCVV = true; // false = Failure, true = Success
|
161 |
$statAVS = true; // false = Failure, true = Success
|
162 |
-
$voidOnAvs = Mage::
|
163 |
-
$voidOnCvv = Mage::
|
164 |
-
|
165 |
// Check config setting if void on cvv is yes
|
166 |
if ($voidOnCvv == 1) {
|
167 |
if ($cvvResp == "N") {
|
66 |
$session->setccgatewayQuoteId($session->getQuoteId());
|
67 |
}
|
68 |
|
69 |
+
$checkoutType = Mage::getModel('ccgateway/standard')->getConfigData('checkout_type' , $order->getStoreId());
|
70 |
|
71 |
if ($checkoutType == "tokenized_post") {
|
72 |
$response = Mage::getModel('ccgateway/standard')->authService($order);
|
95 |
|
96 |
public function responseAction($response = "") {
|
97 |
|
|
|
|
|
98 |
$session = $this->_getCheckout();
|
99 |
$order = Mage::getModel('sales/order');
|
100 |
$order->loadByIncrementId($session->getLastRealOrderId());
|
101 |
+
$cc_action = Mage::getModel('ccgateway/standard')->getConfigData('checkout_trans' , $order->getStoreId());
|
102 |
+
$merchid = Mage::getModel('ccgateway/standard')->getConfigData('merchant' , $order->getStoreId());
|
103 |
+
|
104 |
$ccToken = "";
|
105 |
|
106 |
if ($this->getRequest()->isPost()) {
|
160 |
if ($errorCode == 00) {
|
161 |
$statCVV = true; // false = Failure, true = Success
|
162 |
$statAVS = true; // false = Failure, true = Success
|
163 |
+
$voidOnAvs = Mage::getModel('ccgateway/standard')->getConfigData('void_avs' , $order->getStoreId());
|
164 |
+
$voidOnCvv = Mage::getModel('ccgateway/standard')->getConfigData('void_cvv' , $order->getStoreId());
|
|
|
165 |
// Check config setting if void on cvv is yes
|
166 |
if ($voidOnCvv == 1) {
|
167 |
if ($cvvResp == "N") {
|
app/code/community/Cardconnect/Ccgateway/etc/config.xml
CHANGED
@@ -35,7 +35,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
35 |
<config>
|
36 |
<modules>
|
37 |
<Cardconnect_Ccgateway>
|
38 |
-
<version>1.0.
|
39 |
</Cardconnect_Ccgateway>
|
40 |
</modules>
|
41 |
<global>
|
@@ -54,7 +54,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
54 |
<class>Cardconnect_Ccgateway_Block</class>
|
55 |
</ccgateway>
|
56 |
</blocks>
|
57 |
-
|
58 |
<blocks>
|
59 |
<adminhtml>
|
60 |
<rewrite>
|
@@ -71,8 +71,8 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
71 |
</rewrite>
|
72 |
</adminhtml>
|
73 |
</blocks>
|
74 |
-
|
75 |
-
|
76 |
<models>
|
77 |
<ccgateway_adminhtml>
|
78 |
<class>Cardconnect_Ccgateway_adminhtml_Model</class>
|
@@ -98,35 +98,35 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
98 |
</cardconnect_ccgateway_resource>
|
99 |
</models>
|
100 |
<resources>
|
101 |
-
<cardconnect_ccgateway_setup>
|
102 |
<setup>
|
103 |
-
<module>Cardconnect_Ccgateway</module>
|
104 |
<connection>
|
105 |
<use>core_setup</use>
|
106 |
-
</connection>
|
107 |
-
</setup>
|
108 |
-
</cardconnect_ccgateway_setup>
|
109 |
-
<cardconnect_ccgateway_write>
|
110 |
-
<connection>
|
111 |
-
<use>core_write</use>
|
112 |
</connection>
|
113 |
-
</cardconnect_ccgateway_write>
|
114 |
<cardconnect_ccgateway_read>
|
115 |
-
<connection>
|
116 |
-
<use>core_read</use>
|
117 |
-
</connection>
|
118 |
-
</cardconnect_ccgateway_read>
|
119 |
</resources>
|
120 |
-
<events>
|
121 |
<controller_action_postdispatch_checkout_onepage_savePayment>
|
122 |
<observers>
|
123 |
<ccgateway>
|
124 |
-
<type>model</type>
|
125 |
<class>ccgateway/observer</class>
|
126 |
<method>savePaymentAction</method>
|
127 |
</ccgateway>
|
128 |
</observers>
|
129 |
-
</controller_action_postdispatch_checkout_onepage_savePayment>
|
130 |
</events>
|
131 |
|
132 |
<sales>
|
@@ -237,7 +237,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
237 |
</states>
|
238 |
|
239 |
</order>
|
240 |
-
</sales>
|
241 |
|
242 |
</global>
|
243 |
<default>
|
@@ -281,8 +281,8 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
281 |
</modules>
|
282 |
</args>
|
283 |
</customer>
|
284 |
-
</routers>
|
285 |
-
</frontend>
|
286 |
<admin>
|
287 |
<routers>
|
288 |
<adminhtml>
|
@@ -294,7 +294,7 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
294 |
</adminhtml>
|
295 |
</routers>
|
296 |
</admin>
|
297 |
-
|
298 |
<adminhtml>
|
299 |
<layout>
|
300 |
<updates>
|
@@ -304,5 +304,16 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
304 |
</updates>
|
305 |
</layout>
|
306 |
</adminhtml>
|
307 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
</config>
|
35 |
<config>
|
36 |
<modules>
|
37 |
<Cardconnect_Ccgateway>
|
38 |
+
<version>1.0.4</version>
|
39 |
</Cardconnect_Ccgateway>
|
40 |
</modules>
|
41 |
<global>
|
54 |
<class>Cardconnect_Ccgateway_Block</class>
|
55 |
</ccgateway>
|
56 |
</blocks>
|
57 |
+
|
58 |
<blocks>
|
59 |
<adminhtml>
|
60 |
<rewrite>
|
71 |
</rewrite>
|
72 |
</adminhtml>
|
73 |
</blocks>
|
74 |
+
|
75 |
+
|
76 |
<models>
|
77 |
<ccgateway_adminhtml>
|
78 |
<class>Cardconnect_Ccgateway_adminhtml_Model</class>
|
98 |
</cardconnect_ccgateway_resource>
|
99 |
</models>
|
100 |
<resources>
|
101 |
+
<cardconnect_ccgateway_setup>
|
102 |
<setup>
|
103 |
+
<module>Cardconnect_Ccgateway</module>
|
104 |
<connection>
|
105 |
<use>core_setup</use>
|
106 |
+
</connection>
|
107 |
+
</setup>
|
108 |
+
</cardconnect_ccgateway_setup>
|
109 |
+
<cardconnect_ccgateway_write>
|
110 |
+
<connection>
|
111 |
+
<use>core_write</use>
|
112 |
</connection>
|
113 |
+
</cardconnect_ccgateway_write>
|
114 |
<cardconnect_ccgateway_read>
|
115 |
+
<connection>
|
116 |
+
<use>core_read</use>
|
117 |
+
</connection>
|
118 |
+
</cardconnect_ccgateway_read>
|
119 |
</resources>
|
120 |
+
<events>
|
121 |
<controller_action_postdispatch_checkout_onepage_savePayment>
|
122 |
<observers>
|
123 |
<ccgateway>
|
124 |
+
<type>model</type>
|
125 |
<class>ccgateway/observer</class>
|
126 |
<method>savePaymentAction</method>
|
127 |
</ccgateway>
|
128 |
</observers>
|
129 |
+
</controller_action_postdispatch_checkout_onepage_savePayment>
|
130 |
</events>
|
131 |
|
132 |
<sales>
|
237 |
</states>
|
238 |
|
239 |
</order>
|
240 |
+
</sales>
|
241 |
|
242 |
</global>
|
243 |
<default>
|
281 |
</modules>
|
282 |
</args>
|
283 |
</customer>
|
284 |
+
</routers>
|
285 |
+
</frontend>
|
286 |
<admin>
|
287 |
<routers>
|
288 |
<adminhtml>
|
294 |
</adminhtml>
|
295 |
</routers>
|
296 |
</admin>
|
297 |
+
|
298 |
<adminhtml>
|
299 |
<layout>
|
300 |
<updates>
|
304 |
</updates>
|
305 |
</layout>
|
306 |
</adminhtml>
|
307 |
+
|
308 |
+
<default>
|
309 |
+
<payment>
|
310 |
+
<ccgateway>
|
311 |
+
<active>0</active>
|
312 |
+
<test>1</test>
|
313 |
+
<title>CardConnect</title>
|
314 |
+
<password backend_model="adminhtml/system_config_backend_encrypted"/>
|
315 |
+
</ccgateway>
|
316 |
+
</payment>
|
317 |
+
</default>
|
318 |
+
|
319 |
</config>
|
app/design/frontend/base/default/template/ccgateway/cardmanagement/editcard.phtml
CHANGED
@@ -45,62 +45,56 @@
|
|
45 |
parameters: {profile: profile, cc_id: cid},
|
46 |
requestHeaders: {Accept: 'application/json'},
|
47 |
onComplete: function (transport) {
|
48 |
-
|
49 |
-
//alert(response.toSource());
|
50 |
|
51 |
if(response[0].resptext == "CardConnect_Error"){
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
84 |
});
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
});
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
function removeCardNumber(){
|
94 |
-
document.getElementById("ccgateway_cc_number").value = "";
|
95 |
-
document.getElementById("ccgateway_cc_number_org").value = "";
|
96 |
-
document.getElementById("ccgateway_cc_number_org").focus();
|
97 |
-
}
|
98 |
</script>
|
99 |
<style>
|
100 |
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px;}
|
101 |
.loader{position:absolute; top:80%; left:50%;}
|
102 |
</style>
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
<div class="page-title title-buttons">
|
105 |
<h1 onclick="getAlert();"><?php echo $this->__('Edit Card Form') ?></h1>
|
106 |
<button type="button" title="<?php echo $this->__('Go Back') ?>" class="button" onclick="window.location = '<?php echo $this->getUrl('customer/cardmanagement/') ?>';"><span><span><?php echo $this->__('Go Back') ?></span></span></button>
|
@@ -135,7 +129,7 @@
|
|
135 |
<li>
|
136 |
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
137 |
<div class="input-box">
|
138 |
-
<select id="<?php echo $_code ?>ccgateway_cc_type" name='editcard[cc_type]' onchange="javascript:return
|
139 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
140 |
<?php $_ccType = $this->getInfoData('cc_type'); ?>
|
141 |
<?php foreach ($this->getCcTypes() as $ccType): ?>
|
@@ -150,12 +144,12 @@
|
|
150 |
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
151 |
<div class="input-box">
|
152 |
|
153 |
-
<input type="text"
|
154 |
blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="editcard[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="" required />
|
155 |
<input type="hidden" id="ccgateway_cc_number" name="editcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
|
156 |
<input type="hidden" id="ccgateway_cc_profile" name="editcard[profile]" title="<?php echo $this->__('Customer Profile') ?>" class="input-text" value="" required />
|
157 |
<input type="hidden" id="ccgateway_cc_wallet_id" name="editcard[wallet_id]" title="<?php echo $this->__('Card wallet id') ?>" class="input-text" value="" required />
|
158 |
-
|
159 |
</div>
|
160 |
|
161 |
</li>
|
@@ -271,4 +265,4 @@
|
|
271 |
|
272 |
</ul>
|
273 |
</form>
|
274 |
-
</fieldset>
|
45 |
parameters: {profile: profile, cc_id: cid},
|
46 |
requestHeaders: {Accept: 'application/json'},
|
47 |
onComplete: function (transport) {
|
48 |
+
response = transport.responseText.evalJSON();
|
|
|
49 |
|
50 |
if(response[0].resptext == "CardConnect_Error"){
|
51 |
+
|
52 |
+
document.getElementById("customCheck").style.display = "block";
|
53 |
+
//alert("We are unable to perform the requested action, please contact customer service.");
|
54 |
+
}else{
|
55 |
+
document.getElementById("customCheck").style.display = "none";
|
56 |
+
var preResp = "************";
|
57 |
+
var maskToken = response[0].token.substr(12);
|
58 |
+
var month = response[0].expiry.substr(0, 2);
|
59 |
+
month = month.replace(/^0+/, '');
|
60 |
+
// month = getMonthName(month);
|
61 |
+
// alert(month);
|
62 |
+
var year = response[0].expiry.substr(2, 4);
|
63 |
+
|
64 |
+
document.getElementById("_cc_alias").value = response[1];
|
65 |
+
document.getElementById("ccgateway_cc_number_org").value = preResp + maskToken;
|
66 |
+
document.getElementById("ccgateway_cc_number").value = response[0].token;
|
67 |
+
document.getElementById("ccgateway_cc_profile").value = profile;
|
68 |
+
document.getElementById("ccgateway_cc_wallet_id").value = cid;
|
69 |
+
document.getElementById("ccgateway_cc_type").value = response[0].accttype;
|
70 |
+
document.getElementById("_cc_owner").value = response[0].name;
|
71 |
+
document.getElementById("ccgateway_expiration").value = month;
|
72 |
+
document.getElementById("ccgateway_expiration_yr").value = "20" + year;
|
73 |
+
document.getElementById("_cc_street").value = response[0].address;
|
74 |
+
document.getElementById("_cc_city").value = response[0].city;
|
75 |
+
document.getElementById("_cc_region").value = response[0].region;
|
76 |
+
document.getElementById("_cc_country").value = response[0].country;
|
77 |
+
document.getElementById("_cc_postcode").value = response[0].postal;
|
78 |
+
document.getElementById("_cc_telephone").value = response[0].phone;
|
79 |
+
}
|
80 |
+
|
81 |
+
|
82 |
+
stopLoading();
|
83 |
+
}
|
84 |
});
|
|
|
|
|
|
|
|
|
85 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
</script>
|
87 |
<style>
|
88 |
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px;}
|
89 |
.loader{position:absolute; top:80%; left:50%;}
|
90 |
</style>
|
91 |
|
92 |
+
<div id="customCheck" style="display: none;">
|
93 |
+
<ul class="message">
|
94 |
+
<li class="validation-advice"><ul><li><span>We are unable to perform the requested action, please contact customer service.</span></li></ul></li>
|
95 |
+
</ul>
|
96 |
+
</div>
|
97 |
+
|
98 |
<div class="page-title title-buttons">
|
99 |
<h1 onclick="getAlert();"><?php echo $this->__('Edit Card Form') ?></h1>
|
100 |
<button type="button" title="<?php echo $this->__('Go Back') ?>" class="button" onclick="window.location = '<?php echo $this->getUrl('customer/cardmanagement/') ?>';"><span><span><?php echo $this->__('Go Back') ?></span></span></button>
|
129 |
<li>
|
130 |
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
131 |
<div class="input-box">
|
132 |
+
<select id="<?php echo $_code ?>ccgateway_cc_type" name='editcard[cc_type]' onchange="javascript:return resetcardinfo();" title="<?php echo $this->__('Credit Card Type') ?>" required >
|
133 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
134 |
<?php $_ccType = $this->getInfoData('cc_type'); ?>
|
135 |
<?php foreach ($this->getCcTypes() as $ccType): ?>
|
144 |
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
145 |
<div class="input-box">
|
146 |
|
147 |
+
<input type="text" onchange="valid_credit_card(value, '<?php echo $isTestMode; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
|
148 |
blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="editcard[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="" required />
|
149 |
<input type="hidden" id="ccgateway_cc_number" name="editcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
|
150 |
<input type="hidden" id="ccgateway_cc_profile" name="editcard[profile]" title="<?php echo $this->__('Customer Profile') ?>" class="input-text" value="" required />
|
151 |
<input type="hidden" id="ccgateway_cc_wallet_id" name="editcard[wallet_id]" title="<?php echo $this->__('Card wallet id') ?>" class="input-text" value="" required />
|
152 |
+
<div class="validation-advice" id="testError" style="display: none;"></div>
|
153 |
</div>
|
154 |
|
155 |
</li>
|
265 |
|
266 |
</ul>
|
267 |
</form>
|
268 |
+
</fieldset>
|
app/design/frontend/base/default/template/ccgateway/cardmanagement/new.phtml
CHANGED
@@ -88,7 +88,7 @@ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
|
88 |
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
89 |
<div class="input-box">
|
90 |
|
91 |
-
<select id="ccgateway_cc_type" name="addcard[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" required>
|
92 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
93 |
<?php foreach ($this->getCcTypes() as $ccType): ?>
|
94 |
<option value="<?php echo $ccType['value']; ?>" ><?php echo $ccType['label'] ?></option>
|
@@ -103,7 +103,7 @@ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
|
103 |
<input type="text" onblur="valid_credit_card(value, '<?php echo $isTestMode; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
|
104 |
blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="addcard[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="" required />
|
105 |
<input type="hidden" id="ccgateway_cc_number" name="addcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
|
106 |
-
|
107 |
</div>
|
108 |
|
109 |
</li>
|
@@ -114,14 +114,12 @@ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
|
114 |
<div class="input-box">
|
115 |
<div class="v-fix">
|
116 |
<select id="<?php echo $_code ?>_expiration" name="addcard[cc_exp_month]" class="month validate-cc-exp required-entry" style="width: 150px;" required>
|
117 |
-
<?php #$_ccExpMonth = $this->getInfoData('cc_exp_month') ?>
|
118 |
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
119 |
<option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
|
120 |
<?php endforeach ?>
|
121 |
</select>
|
122 |
</div>
|
123 |
<div class="v-fix">
|
124 |
-
<?php #$_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
125 |
<select id="<?php echo $_code ?>_expiration_yr" name="addcard[cc_exp_year]" class="year required-entry" style="width: 150px;" required>
|
126 |
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
127 |
<option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
|
@@ -225,14 +223,6 @@ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
|
225 |
blockNonNumbers(this, event, false, false)" maxlength="10" id="<?php echo $_code ?>_cc_telephone" name="addcard[cc_telephone]" value="" required />
|
226 |
</div>
|
227 |
</li>
|
228 |
-
<!-- <li>
|
229 |
-
<span style="margin-bottom: 10px;">
|
230 |
-
<input type="checkbox" title="<?php // echo $this->__('Make this Card as default') ?>" id="ccgateway_cc_wallet" name="addcard[cc_defaultwallet]" value="" />
|
231 |
-
</span>
|
232 |
-
<label for="<?php // echo $_code ?>_cc_wallet"><?php // echo $this->__('Make this Card as default') ?></label>
|
233 |
-
</li>
|
234 |
-
-->
|
235 |
-
|
236 |
|
237 |
<button id="addcardbutton" class="button" style="margin-top: 10px;" type="submit" title="<?php echo $this->__('Add') ?>" class="button" onclick="<?php echo $this->getUrl('ccgateway/cardmanagement/savecard'); ?>"><span><span><?php echo $this->__('Add') ?></span></span></button>
|
238 |
|
88 |
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
89 |
<div class="input-box">
|
90 |
|
91 |
+
<select id="ccgateway_cc_type" name="addcard[cc_type]" onchange="resetcardinfo();" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" required>
|
92 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
93 |
<?php foreach ($this->getCcTypes() as $ccType): ?>
|
94 |
<option value="<?php echo $ccType['value']; ?>" ><?php echo $ccType['label'] ?></option>
|
103 |
<input type="text" onblur="valid_credit_card(value, '<?php echo $isTestMode; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org');
|
104 |
blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="addcard[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="" required />
|
105 |
<input type="hidden" id="ccgateway_cc_number" name="addcard[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text" value="" required />
|
106 |
+
<div class="validation-advice" id="testError" style="display: none;"></div>
|
107 |
</div>
|
108 |
|
109 |
</li>
|
114 |
<div class="input-box">
|
115 |
<div class="v-fix">
|
116 |
<select id="<?php echo $_code ?>_expiration" name="addcard[cc_exp_month]" class="month validate-cc-exp required-entry" style="width: 150px;" required>
|
|
|
117 |
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
118 |
<option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
|
119 |
<?php endforeach ?>
|
120 |
</select>
|
121 |
</div>
|
122 |
<div class="v-fix">
|
|
|
123 |
<select id="<?php echo $_code ?>_expiration_yr" name="addcard[cc_exp_year]" class="year required-entry" style="width: 150px;" required>
|
124 |
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
125 |
<option value="<?php echo $k ? $k : '' ?>" ><?php echo $v ?></option>
|
223 |
blockNonNumbers(this, event, false, false)" maxlength="10" id="<?php echo $_code ?>_cc_telephone" name="addcard[cc_telephone]" value="" required />
|
224 |
</div>
|
225 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
|
227 |
<button id="addcardbutton" class="button" style="margin-top: 10px;" type="submit" title="<?php echo $this->__('Add') ?>" class="button" onclick="<?php echo $this->getUrl('ccgateway/cardmanagement/savecard'); ?>"><span><span><?php echo $this->__('Add') ?></span></span></button>
|
228 |
|
app/design/frontend/base/default/template/ccgateway/form.phtml
CHANGED
@@ -28,11 +28,23 @@
|
|
28 |
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
*/
|
31 |
-
if(Mage::
|
32 |
?>
|
33 |
<style>
|
34 |
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
35 |
.loader{position:absolute; top:80%; left:50%;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
</style>
|
37 |
<fieldset class="form-list">
|
38 |
<?php
|
@@ -49,7 +61,9 @@ if(Mage::getStoreConfig('payment/ccgateway/active')==1){
|
|
49 |
$billingPostCode = $billingAddress->getPostcode();
|
50 |
$billingTelephone = $billingAddress->getTelephone();
|
51 |
?>
|
52 |
-
|
|
|
|
|
53 |
<?php if ($this->getCheckoutType() == "payment_page") { ?>
|
54 |
<li>
|
55 |
<?php echo Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') ?>
|
@@ -62,8 +76,14 @@ if(Mage::getStoreConfig('payment/ccgateway/active')==1){
|
|
62 |
$response = $this->getDefaultCCProfileId();
|
63 |
|
64 |
if($response !="CardConnect_Error"){
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
66 |
?>
|
|
|
67 |
<li class="wide">
|
68 |
<label for="<?php echo $_code ?>_cc_profile_name" class="required"><em>*</em><?php echo $this->__('Choose Your Card For Payment') ?></label>
|
69 |
<div class="input-box">
|
@@ -71,7 +91,8 @@ if(Mage::getStoreConfig('payment/ccgateway/active')==1){
|
|
71 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
72 |
<?php foreach ($this->getCCProfileName() as $data): ?>
|
73 |
<option value="<?php echo $data->getData('CC_PROFILEID'); ?>"
|
74 |
-
<?php
|
|
|
75 |
selected="selected"
|
76 |
<?php } ?> >
|
77 |
<?php echo $data->getData('CC_CARD_NAME'); ?>
|
@@ -93,30 +114,40 @@ if(Mage::getStoreConfig('payment/ccgateway/active')==1){
|
|
93 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
94 |
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
95 |
<div class="input-box">
|
96 |
-
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]"
|
|
|
97 |
</div>
|
98 |
</li>
|
99 |
<li>
|
100 |
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
101 |
-
<div class="input-box">
|
102 |
|
103 |
-
<select readonly id="ccgateway_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select">
|
104 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
105 |
-
<?php
|
106 |
-
|
|
|
107 |
<?php endforeach ?>
|
108 |
</select>
|
109 |
</div>
|
110 |
</li>
|
111 |
</div>
|
112 |
|
113 |
-
<li <?php if($response =="CardConnect_Error"){?> style="display: none;" <?php } ?>>
|
114 |
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
115 |
<div class="input-box">
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
119 |
|
|
|
|
|
|
|
|
|
120 |
</div>
|
121 |
|
122 |
</li>
|
@@ -133,14 +164,14 @@ if(Mage::getStoreConfig('payment/ccgateway/active')==1){
|
|
133 |
<div class="input-box">
|
134 |
<div class="v-fix">
|
135 |
<select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
|
136 |
-
<?php $_ccExpMonth = substr(
|
137 |
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
138 |
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
139 |
<?php endforeach ?>
|
140 |
</select>
|
141 |
</div>
|
142 |
<div class="v-fix">
|
143 |
-
<?php $_ccExpYear = substr($response[0]['expiry'], 2, 4); ?>
|
144 |
<select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
|
145 |
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
146 |
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == "20" . $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
28 |
@copyright Copyright (c) 2014 CardConnect (http://www.cardconnect.com)
|
29 |
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
30 |
*/
|
31 |
+
if(Mage::getModel('ccgateway/standard')->getConfigData('active')==1){
|
32 |
?>
|
33 |
<style>
|
34 |
#fade{ width:100%; height:100%; background:rgba(0,0,0,0.1); position:fixed; top:0px; left:0px; display:none;}
|
35 |
.loader{position:absolute; top:80%; left:50%;}
|
36 |
+
|
37 |
+
.input-text {
|
38 |
+
-moz-appearance: none;
|
39 |
+
border-radius: 2px;
|
40 |
+
border: 1px solid #C0C0C0;
|
41 |
+
background: #FFF none repeat scroll 0% 0%;
|
42 |
+
font-size: 15px;
|
43 |
+
font-weight:300;
|
44 |
+
width: 365px;
|
45 |
+
font-family: "Helvetica Neue",Verdana,Arial,sans-serif;
|
46 |
+
}
|
47 |
+
|
48 |
</style>
|
49 |
<fieldset class="form-list">
|
50 |
<?php
|
61 |
$billingPostCode = $billingAddress->getPostcode();
|
62 |
$billingTelephone = $billingAddress->getTelephone();
|
63 |
?>
|
64 |
+
|
65 |
+
<ul id="payment_form_<?php echo $_code ?>" style="display:none">
|
66 |
+
|
67 |
<?php if ($this->getCheckoutType() == "payment_page") { ?>
|
68 |
<li>
|
69 |
<?php echo Mage::helper('ccgateway')->__('You will be redirected to CardConnect website when you place an order.') ?>
|
76 |
$response = $this->getDefaultCCProfileId();
|
77 |
|
78 |
if($response !="CardConnect_Error"){
|
79 |
+
if(isset($response[0]['token'])){
|
80 |
+
$maskedToken = substr_replace($response[0]['token'], str_repeat("*", 12), 0, 12);
|
81 |
+
|
82 |
+
}else{
|
83 |
+
$maskedToken = "";
|
84 |
+
}
|
85 |
?>
|
86 |
+
|
87 |
<li class="wide">
|
88 |
<label for="<?php echo $_code ?>_cc_profile_name" class="required"><em>*</em><?php echo $this->__('Choose Your Card For Payment') ?></label>
|
89 |
<div class="input-box">
|
91 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
92 |
<?php foreach ($this->getCCProfileName() as $data): ?>
|
93 |
<option value="<?php echo $data->getData('CC_PROFILEID'); ?>"
|
94 |
+
<?php $profileId = (isset($response[0]['profileid'])) ? $response[0]['profileid'] : null;
|
95 |
+
if ($data->getData('CC_PROFILEID') === $profileId) { ?>
|
96 |
selected="selected"
|
97 |
<?php } ?> >
|
98 |
<?php echo $data->getData('CC_CARD_NAME'); ?>
|
114 |
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
|
115 |
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
116 |
<div class="input-box">
|
117 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]"
|
118 |
+
value="<?php echo $name = (isset($response[0]['name'])) ? $response[0]['name'] : null; ?>" />
|
119 |
</div>
|
120 |
</li>
|
121 |
<li>
|
122 |
<label for="<?php echo $_code ?>_cc_type" class="required validate-cc-type "><em>*</em><?php echo $this->__('Credit Card Type') ?></label>
|
123 |
+
<div class="input-box" >
|
124 |
|
125 |
+
<select readonly id="ccgateway_cc_type" name="payment[cc_type]" title="<?php echo $this->__('Credit Card Type') ?>" class="required-entry validate-select" onchange="resetcardinfo();">
|
126 |
<option value=""><?php echo $this->__('--Please Select--') ?></option>
|
127 |
+
<?php $accttype = (isset($response[0]['accttype'])) ? $response[0]['accttype'] : null;
|
128 |
+
foreach ($this->getCcTypes() as $ccType): ?>
|
129 |
+
<option value="<?php echo $ccType['value']; ?>"<?php if ($ccType['value'] == $accttype ): ?> selected="selected"<?php endif ?> ><?php echo $ccType['label']; ?></option>
|
130 |
<?php endforeach ?>
|
131 |
</select>
|
132 |
</div>
|
133 |
</li>
|
134 |
</div>
|
135 |
|
136 |
+
<li <?php if($response == "CardConnect_Error"){?> style="display: none;" <?php } ?>>
|
137 |
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
138 |
<div class="input-box">
|
139 |
+
<?php if ($this->hasCCProfile() == true) { ?>
|
140 |
+
<label id="cc_number_label" for="<?php echo $_code ?>_cc_number" class="input-text required-entry"><?php echo $maskedToken; ?></label>
|
141 |
+
|
142 |
+
<input type="text" hidden onchange="valid_credit_card(value , '<?php echo $isTestMode; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org'); blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="payment[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="<?php echo $maskedToken; ?>" />
|
143 |
+
|
144 |
+
<?php } else { ?>
|
145 |
+
<input type="text" onchange="valid_credit_card(value , '<?php echo $isTestMode; ?>')" onkeypress="javascript:return validate(event, 'ccgateway_cc_number_org'); blockNonNumbers(this, event, false, false)" id="ccgateway_cc_number_org" name="payment[cc_number_org]" title="<?php echo $this->__('Credit Card Number') ?>" maxlength="16" class="input-text required-entry" value="<?php echo $maskedToken; ?>" />
|
146 |
|
147 |
+
<?php } ?>
|
148 |
+
<input type="text" hidden id="ccgateway_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text"
|
149 |
+
value="<?php echo $token = (isset($response[0]['token'])) ? $response[0]['token'] : null; ?>" />
|
150 |
+
<div class="validation-advice" id="testError" style="display: none;"></div>
|
151 |
</div>
|
152 |
|
153 |
</li>
|
164 |
<div class="input-box">
|
165 |
<div class="v-fix">
|
166 |
<select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="month validate-cc-exp required-entry">
|
167 |
+
<?php if (isset($response[0]['expiry'])){ $_ccExpMonth = substr($response[0]['expiry'], 0, 2); } else { $_ccExpMonth = ""; } ?>
|
168 |
<?php foreach ($this->getCcMonths() as $k => $v): ?>
|
169 |
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
170 |
<?php endforeach ?>
|
171 |
</select>
|
172 |
</div>
|
173 |
<div class="v-fix">
|
174 |
+
<?php if (isset($response[0]['expiry'])){ $_ccExpYear = substr($response[0]['expiry'], 2, 4); } else { $_ccExpYear = ""; } ?>
|
175 |
<select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="year required-entry">
|
176 |
<?php foreach ($this->getCcYears() as $k => $v): ?>
|
177 |
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == "20" . $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
|
app/etc/modules/Cardconnect_Ccgateway.xml
CHANGED
@@ -41,8 +41,9 @@
|
|
41 |
<Cardconnect_Ccgateway>
|
42 |
<active>true</active>
|
43 |
<codePool>community</codePool>
|
44 |
-
|
45 |
<Mage_Sales/>
|
|
|
46 |
</depends>
|
47 |
</Cardconnect_Ccgateway>
|
48 |
</modules>
|
41 |
<Cardconnect_Ccgateway>
|
42 |
<active>true</active>
|
43 |
<codePool>community</codePool>
|
44 |
+
<depends>
|
45 |
<Mage_Sales/>
|
46 |
+
<Mage_Customer/>
|
47 |
</depends>
|
48 |
</Cardconnect_Ccgateway>
|
49 |
</modules>
|
js/cardconnect/ccgateway.js
CHANGED
@@ -33,10 +33,10 @@ to license@magentocommerce.com so we can send you a copy immediately.
|
|
33 |
function tokenize(cardNum , isTestMode) {
|
34 |
|
35 |
document.getElementById("ccgateway_cc_number_org").disabled = true;
|
|
|
36 |
|
37 |
// construct url
|
38 |
if(isTestMode == "yes"){
|
39 |
-
// var url = "https://fts.cardconnect.com:6443/cardsecure/cs";
|
40 |
var url = "https://fts.prinpay.com:6443/cardsecure/cs";
|
41 |
}else{
|
42 |
var url = "https://fts.prinpay.com:8443/cardsecure/cs";
|
@@ -104,9 +104,6 @@ function processXMLHttpResponse() {
|
|
104 |
var preResp = "************";
|
105 |
var resp = response.substr(12);
|
106 |
document.getElementById("ccgateway_cc_number_org").value = preResp + resp;
|
107 |
-
document.getElementById("ccgateway_expiration").disabled = false;
|
108 |
-
document.getElementById("ccgateway_expiration_yr").disabled = false;
|
109 |
-
// document.getElementById("ccgateway_cc_cid").disabled = false;
|
110 |
} else {
|
111 |
document.getElementById("response").classList.add('validation-advice');
|
112 |
document.getElementById("response").innerHTML = response;
|
@@ -171,23 +168,24 @@ function parseXml(xmlStr) {
|
|
171 |
function valid_credit_card(value, isTestMode)
|
172 |
{
|
173 |
startLoading();
|
174 |
-
|
175 |
-
document.getElementById("ccgateway_expiration").disabled = true;
|
176 |
-
document.getElementById("ccgateway_expiration_yr").disabled = true;
|
177 |
-
// document.getElementById("ccgateway_cc_cid").disabled = true;
|
178 |
// The Luhn Algorithm. It's so pretty.
|
179 |
var nCheck = 0, nDigit = 0, bEven = false;
|
180 |
-
if (value == null) {
|
181 |
-
|
|
|
|
|
|
|
|
|
182 |
} else {
|
183 |
var cardNum = value;
|
184 |
value = value.replace(/\D/g, "");
|
|
|
185 |
}
|
186 |
|
187 |
for (var n = value.length - 1; n >= 0; n--)
|
188 |
{
|
189 |
var cDigit = value.charAt(n),
|
190 |
-
|
191 |
|
192 |
if (bEven)
|
193 |
{
|
@@ -202,11 +200,12 @@ function valid_credit_card(value, isTestMode)
|
|
202 |
var cardType = GetCardType(cardNum);
|
203 |
var e = document.getElementById("ccgateway_cc_type");
|
204 |
var selectedCardType = e.options[e.selectedIndex].value;
|
205 |
-
if (cardType == selectedCardType && selectedCardType != null ) {
|
206 |
tokenize(cardNum , isTestMode);
|
207 |
setTimeout(stopLoading, 1000);
|
208 |
} else {
|
209 |
-
|
|
|
210 |
document.getElementById("ccgateway_cc_number_org").value = "";
|
211 |
document.getElementById("ccgateway_cc_number_org").focus();
|
212 |
stopLoading();
|
@@ -214,8 +213,9 @@ function valid_credit_card(value, isTestMode)
|
|
214 |
return;
|
215 |
}
|
216 |
else {
|
217 |
-
|
218 |
-
document.getElementById("
|
|
|
219 |
document.getElementById("ccgateway_cc_number_org").focus();
|
220 |
stopLoading();
|
221 |
return false;
|
@@ -314,14 +314,16 @@ function showAliseField(){
|
|
314 |
}
|
315 |
|
316 |
|
317 |
-
|
318 |
function callGetProfileWebserviceController( requestUrl, profile ){
|
319 |
-
|
|
|
320 |
|
321 |
if((profile != "Checkout with new card")){
|
322 |
|
|
|
323 |
document.getElementById("ccgateway_cc_owner").readOnly = true;
|
324 |
-
|
|
|
325 |
document.getElementById("ccgateway_cc_number").readOnly = true;
|
326 |
document.getElementById("ccgateway_cc_type").readOnly = true;
|
327 |
document.getElementById("ccgateway_expiration").readOnly = true;
|
@@ -344,8 +346,12 @@ function callGetProfileWebserviceController( requestUrl, profile ){
|
|
344 |
month = month.replace(/^0+/, '');
|
345 |
var year = response[0].expiry.substr(2,4);
|
346 |
|
|
|
347 |
document.getElementById("ccgateway_cc_owner").value = response[0].name;
|
348 |
-
document.getElementById("ccgateway_cc_number_org").
|
|
|
|
|
|
|
349 |
document.getElementById("ccgateway_cc_number").value = response[0].token;
|
350 |
document.getElementById("ccgateway_cc_type").value = response[0].accttype;
|
351 |
document.getElementById("ccgateway_cc_owner").value = response[0].name;
|
@@ -355,37 +361,37 @@ function callGetProfileWebserviceController( requestUrl, profile ){
|
|
355 |
document.getElementById("save_card_4future").hide();
|
356 |
document.getElementById("payment_info").hide();
|
357 |
document.getElementById("payment_info1").hide();
|
358 |
-
|
359 |
}
|
360 |
});
|
361 |
}else{
|
362 |
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
|
|
|
|
371 |
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
|
383 |
}
|
384 |
-
|
385 |
}
|
386 |
|
387 |
|
388 |
-
|
389 |
function showDefaultAddress(billingStreet,billingCity,billingRegion,billingCountry,billingPostCode,billingTelephone){
|
390 |
|
391 |
if( document.getElementById("ccgateway_default_address").checked == true){
|
@@ -426,4 +432,14 @@ function stopLoading() {
|
|
426 |
Element.hide('fade');
|
427 |
loaded = true;
|
428 |
document.getElementById("fade").style.display = "none";
|
429 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
function tokenize(cardNum , isTestMode) {
|
34 |
|
35 |
document.getElementById("ccgateway_cc_number_org").disabled = true;
|
36 |
+
document.getElementById("response").innerHTML = "";
|
37 |
|
38 |
// construct url
|
39 |
if(isTestMode == "yes"){
|
|
|
40 |
var url = "https://fts.prinpay.com:6443/cardsecure/cs";
|
41 |
}else{
|
42 |
var url = "https://fts.prinpay.com:8443/cardsecure/cs";
|
104 |
var preResp = "************";
|
105 |
var resp = response.substr(12);
|
106 |
document.getElementById("ccgateway_cc_number_org").value = preResp + resp;
|
|
|
|
|
|
|
107 |
} else {
|
108 |
document.getElementById("response").classList.add('validation-advice');
|
109 |
document.getElementById("response").innerHTML = response;
|
168 |
function valid_credit_card(value, isTestMode)
|
169 |
{
|
170 |
startLoading();
|
|
|
|
|
|
|
|
|
171 |
// The Luhn Algorithm. It's so pretty.
|
172 |
var nCheck = 0, nDigit = 0, bEven = false;
|
173 |
+
if (value == null || value == "") {
|
174 |
+
// alert("Please Fill the require field");
|
175 |
+
document.getElementById("testError").style.display = "block";
|
176 |
+
document.getElementById("testError").innerHTML = "Please Fill the require field.";
|
177 |
+
stopLoading();
|
178 |
+
return false;
|
179 |
} else {
|
180 |
var cardNum = value;
|
181 |
value = value.replace(/\D/g, "");
|
182 |
+
document.getElementById("testError").style.display = "none";
|
183 |
}
|
184 |
|
185 |
for (var n = value.length - 1; n >= 0; n--)
|
186 |
{
|
187 |
var cDigit = value.charAt(n),
|
188 |
+
nDigit = parseInt(cDigit, 10);
|
189 |
|
190 |
if (bEven)
|
191 |
{
|
200 |
var cardType = GetCardType(cardNum);
|
201 |
var e = document.getElementById("ccgateway_cc_type");
|
202 |
var selectedCardType = e.options[e.selectedIndex].value;
|
203 |
+
if (cardType == selectedCardType && selectedCardType != null && cardNum != null && cardNum.length >=12 ) {
|
204 |
tokenize(cardNum , isTestMode);
|
205 |
setTimeout(stopLoading, 1000);
|
206 |
} else {
|
207 |
+
document.getElementById("testError").style.display = "block";
|
208 |
+
document.getElementById("testError").innerHTML = "Entered card information mismatched. Please try again.";
|
209 |
document.getElementById("ccgateway_cc_number_org").value = "";
|
210 |
document.getElementById("ccgateway_cc_number_org").focus();
|
211 |
stopLoading();
|
213 |
return;
|
214 |
}
|
215 |
else {
|
216 |
+
document.getElementById("testError").style.display = "block";
|
217 |
+
document.getElementById("testError").innerHTML = "Please Enter valid card data.";
|
218 |
+
//document.getElementById("ccgateway_cc_number_org").value = "";
|
219 |
document.getElementById("ccgateway_cc_number_org").focus();
|
220 |
stopLoading();
|
221 |
return false;
|
314 |
}
|
315 |
|
316 |
|
|
|
317 |
function callGetProfileWebserviceController( requestUrl, profile ){
|
318 |
+
|
319 |
+
|
320 |
|
321 |
if((profile != "Checkout with new card")){
|
322 |
|
323 |
+
startLoading();
|
324 |
document.getElementById("ccgateway_cc_owner").readOnly = true;
|
325 |
+
|
326 |
+
document.getElementById("ccgateway_cc_number_org").disabled= true;
|
327 |
document.getElementById("ccgateway_cc_number").readOnly = true;
|
328 |
document.getElementById("ccgateway_cc_type").readOnly = true;
|
329 |
document.getElementById("ccgateway_expiration").readOnly = true;
|
346 |
month = month.replace(/^0+/, '');
|
347 |
var year = response[0].expiry.substr(2,4);
|
348 |
|
349 |
+
|
350 |
document.getElementById("ccgateway_cc_owner").value = response[0].name;
|
351 |
+
document.getElementById("ccgateway_cc_number_org").hide();
|
352 |
+
document.getElementById("cc_number_label").show();
|
353 |
+
document.getElementById("cc_number_label").innerHTML= preResp+maskToken;
|
354 |
+
|
355 |
document.getElementById("ccgateway_cc_number").value = response[0].token;
|
356 |
document.getElementById("ccgateway_cc_type").value = response[0].accttype;
|
357 |
document.getElementById("ccgateway_cc_owner").value = response[0].name;
|
361 |
document.getElementById("save_card_4future").hide();
|
362 |
document.getElementById("payment_info").hide();
|
363 |
document.getElementById("payment_info1").hide();
|
364 |
+
stopLoading();
|
365 |
}
|
366 |
});
|
367 |
}else{
|
368 |
|
369 |
+
document.getElementById("ccgateway_cc_number_org").style.display='block';
|
370 |
+
document.getElementById("cc_number_label").hide();
|
371 |
+
document.getElementById("ccgateway_cc_owner").readOnly = false;
|
372 |
+
document.getElementById("ccgateway_cc_number_org").disabled= false;
|
373 |
+
document.getElementById("ccgateway_cc_number").readOnly = false;
|
374 |
+
document.getElementById("ccgateway_cc_type").readOnly = false;
|
375 |
+
document.getElementById("ccgateway_expiration").readOnly = false;
|
376 |
+
document.getElementById("ccgateway_expiration_yr").readOnly = false;
|
377 |
+
document.getElementById("ccgateway_cc_cid").readOnly = false;
|
378 |
+
document.getElementById("ccgateway_cc_wallet").disabled = false;
|
379 |
|
380 |
+
document.getElementById("ccgateway_cc_owner").value = "";
|
381 |
+
document.getElementById("ccgateway_cc_number_org").value = "";
|
382 |
+
document.getElementById("ccgateway_cc_number").value = "";
|
383 |
+
document.getElementById("ccgateway_cc_type").value = "";
|
384 |
+
document.getElementById("ccgateway_expiration").value = "";
|
385 |
+
document.getElementById("ccgateway_expiration_yr").value = "";
|
386 |
+
document.getElementById("ccgateway_cc_cid").value = "";
|
387 |
+
document.getElementById("save_card_4future").show();
|
388 |
+
document.getElementById("payment_info").show();
|
389 |
+
document.getElementById("payment_info1").show();
|
390 |
|
391 |
}
|
|
|
392 |
}
|
393 |
|
394 |
|
|
|
395 |
function showDefaultAddress(billingStreet,billingCity,billingRegion,billingCountry,billingPostCode,billingTelephone){
|
396 |
|
397 |
if( document.getElementById("ccgateway_default_address").checked == true){
|
432 |
Element.hide('fade');
|
433 |
loaded = true;
|
434 |
document.getElementById("fade").style.display = "none";
|
435 |
+
}
|
436 |
+
|
437 |
+
function resetcardinfo() {
|
438 |
+
document.getElementById("ccgateway_cc_number_org").value = "";
|
439 |
+
document.getElementById("ccgateway_cc_number_org").focus();
|
440 |
+
document.getElementById("ccgateway_cc_number").value = "";
|
441 |
+
document.getElementById("ccgateway_expiration").value = "";
|
442 |
+
document.getElementById("ccgateway_expiration_yr").value = "";
|
443 |
+
return false;
|
444 |
+
}
|
445 |
+
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>CardconnectCcgateway</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Avis Verifies vous permet de recolter l&amp;apos;avis des clients sur votre site ecommerce.</summary>
|
10 |
<description>Avis Verifies vous permet de recolter l&amp;amp;apos;avis de vos clients suite &#xE0; leur achat sur votre boutique ecommerce. Essayez gratuitement notre solution sur www.avis-verifies.com et commencez maintenant &#xE0; r&#xE9;colter les avis de vos clients.</description>
|
11 |
-
<notes>La version 2.6.5.5 est stable
|
12 |
<authors><author><name>Johnny</name><user>Mikhael</user><email>johnny@verified-reviews.com</email></author><author><name>Rémi</name><user>Gravelle</user><email>remi@avis-verifies.com</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Cardconnect"><dir name="Ccgateway"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Cardtype.php" hash="4c6fd9bc202c33e88f515349e1cd6905"/><file name="Checkouttype.php" hash="4185650bfb5e2a872f1db890d5971fd0"/><file name="Transaction.php" hash="dc2fd1f6b45f1e2a53495017d443b1d2"/></dir></dir></dir></dir></dir><dir name="Block"><file name="Addcard.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>CardconnectCcgateway</name>
|
4 |
+
<version>1.0.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Avis Verifies vous permet de recolter l&amp;apos;avis des clients sur votre site ecommerce.</summary>
|
10 |
<description>Avis Verifies vous permet de recolter l&amp;amp;apos;avis de vos clients suite &#xE0; leur achat sur votre boutique ecommerce. Essayez gratuitement notre solution sur www.avis-verifies.com et commencez maintenant &#xE0; r&#xE9;colter les avis de vos clients.</description>
|
11 |
+
<notes>La version 2.6.5.5 est stable.</notes>
|
12 |
<authors><author><name>Johnny</name><user>Mikhael</user><email>johnny@verified-reviews.com</email></author><author><name>Rémi</name><user>Gravelle</user><email>remi@avis-verifies.com</email></author></authors>
|
13 |
+
<date>2015-06-19</date>
|
14 |
+
<time>09:33:44</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Cardconnect"><dir name="Ccgateway"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Cardtype.php" hash="4c6fd9bc202c33e88f515349e1cd6905"/><file name="Checkouttype.php" hash="4185650bfb5e2a872f1db890d5971fd0"/><file name="Transaction.php" hash="dc2fd1f6b45f1e2a53495017d443b1d2"/></dir></dir></dir></dir></dir><dir name="Block"><file name="Addcard.php" hash="a36241555adfc297c65baa365c627696"/><dir name="Adminhtml"><dir name="Customer"><file name="Data.php" hash="9b83c37bf900d12e6c46a1759617f60e"/><dir name="Edit"><dir name="Tab"><file name="Account.php" hash="c1b27f91036c483ae39685602f9f2633"/></dir></dir></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><dir name="Create"><file name="Form.php" hash="b1988d1db38e0f2b3d88ef6e829f9f6e"/><file name="Items.php" hash="15bf4862d806f944138e306960417050"/></dir><dir name="View"><file name="Form.php" hash="f0f8634c1f0033330eab4da031e3770c"/></dir></dir><dir name="Invoice"><dir name="Create"><file name="Form.php" hash="ad294ba34400cfe291187306e554af46"/><file name="Items.php" hash="d3b7b5ec66eb4a4ec8f8d5b0a934935b"/></dir><dir name="View"><file name="Form.php" hash="68a9a8435e67fe3e9d8f2f80e2c8d892"/></dir></dir><dir name="Shipment"><dir name="Create"><file name="Form.php" hash="f327b0f3fc5ef3dcb506dbeffd00ec8f"/></dir><dir name="View"><file name="Form.php" hash="6e56e053843082a99896cf93b2de93f3"/></dir></dir><dir name="View"><dir name="Tab"><file name="Info.php" hash="5e30f132a5180278bb13a3c20a92081a"/></dir></dir></dir></dir></dir><file name="Cardmanagement.php" hash="28867ca0604f6cd74060c4aa5de98553"/><file name="Form.php" hash="5c92b69b370998bb3b873ffb4484ec09"/><file name="Info.php" hash="3c47b946295f2cf51acd9e7e841a7f77"/><dir name="Onepage"><file name="Billing.php" hash="2bf341d653420e82e44bd15711c01abe"/></dir><file name="Redirect.php" hash="90c95f26953ee79d3d8f03f5cb664a41"/></dir><dir name="Helper"><file name="Data.php" hash="7ce727f86e64fd142b01610cf67b5884"/></dir><dir name="Model"><dir name="Cardconnect"><file name="Resp.php" hash="d96c58ed0636097348f7020d529708bb"/><file name="Wallet.php" hash="d271c1cea34fce819e2eed1b2f06b3a8"/></dir><file name="Observer.php" hash="6c7908fc4927d73bb7177944bdfdf5e3"/><dir name="Resource"><dir name="Cardconnect"><dir name="Resp"><file name="Collection.php" hash="454a1ad0ebe24f3af523001fd285e8f3"/></dir><file name="Resp.php" hash="fd67df66591d46cfb8399029bf02015c"/><dir name="Wallet"><file name="Collection.php" hash="2b7040940b22f2934df94c5779c44c81"/></dir><file name="Wallet.php" hash="b7254cf020d5ac4bfdce636692be896a"/></dir></dir><file name="Standard.php" hash="06d863503b15ad309d1b6479d65c8d1b"/><file name="cardconnect_webservice.php" hash="693b2bf76ec0ff58ec4f7980b12ee074"/></dir><dir name="blocks"><file name="billing.phtml" hash="ad81f6b3f396ddfb9c2c2e43f3b2d3eb"/><dir name="creditmemo"><dir name="create"><file name="form.phtml" hash="f88e763be7a99551c9f54354672d4551"/></dir><dir name="view"><file name="form.phtml" hash="d4d1a1402ae9bb9c0811786aa9795e38"/></dir></dir><file name="info.phtml" hash="bf0898675acdf232a9b54ddf89c7e248"/><dir name="invoice"><dir name="create"><file name="form.phtml" hash="9203de0089224e123aa8ad7bbb0f0f23"/><file name="items.phtml" hash="393419bf1ff4555f39e37deee2c7794f"/></dir><dir name="view"><file name="form.phtml" hash="1cb3c24f93138f5871b571260f48d1bc"/></dir></dir><dir name="shipment"><dir name="create"><file name="form.phtml" hash="f227f013e1410a82c1ffbad757e0e8de"/></dir><dir name="view"><file name="form.phtml" hash="be5ea3d6fa7277cb77785e92a9275b44"/></dir></dir></dir><dir name="cc_keys"><file name="cacert.pem" hash="060fd410fecfc10d9c229b941868090c"/><file name=".htaccess" hash="d6a6f4184696bd7c56ae76973ec3489a"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="CreateController.php" hash="13010ed7291bfcb96c57137364d9476f"/></dir><file name="OrderController.php" hash="39546076c91c5069420a614f12f7e79f"/></dir></dir><file name="CardmanagementController.php" hash="e18bb5127241bc30200dfa201361a190"/><file name="PaymentController.php" hash="2d5c6a7fca2f6f4d7b1590bb6bffc55b"/></dir><dir name="etc"><file name="config.xml" hash="e130d3370223b17a3e93273c7ef549ff"/><file name="system.xml" hash="b931b80be0fac76b5adeb481e8bd6e3d"/></dir><dir name="sql"><dir name="cardconnect_ccgateway_setup"><file name="install-1.0.0.php" hash="53714977ae574b3ede0b3701c271a42f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Cardconnect_Ccgateway.xml" hash="eac8d5ee15ec6943fefc4dbbdef74671"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ccgateway.xml" hash="354ffbd902833eaa7c7af1a847cb230f"/></dir><dir name="template"><dir name="ccgateway"><file name="form.phtml" hash="83e8b94111d74d9fa3e4d95b1c26f579"/><file name="info.phtml" hash="296b8e5284fa15e1ed0d771bb5a6b644"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="ccgateway.xml" hash="4752e242b9f6bd6d8e8dfa69f2e8b8c5"/></dir><dir name="template"><dir name="ccgateway"><file name="blank.phtml" hash="b11f3718962eb7574970bd346f2105aa"/><dir name="cardmanagement"><file name="editcard.phtml" hash="2aa4b7b3972908e268189a603957c3f2"/><file name="index.phtml" hash="32f863e7bd2c3c05ac6aefab63283154"/><file name="new.phtml" hash="ce08646f609cce75445a03bf9821c227"/></dir><file name="form.phtml" hash="1ade6fdd45536141701d98fc547ce9cd"/><file name="info.phtml" hash="c107ff370b915cd6cc0bf49c1a36363b"/><file name="redirect.phtml" hash="4b3964b41e6e55bf54039f758e74560e"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="cardconnect"><file name="ccgateway.js" hash="80d9f365638eaf4190adae1ce082f01b"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="cardconnect"><file name="cardconnect.gif" hash="b0ccf9c7446efd2bb6b65eadd98a3fde"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="cardconnect.css" hash="eb4c6d523d8e0b694c9231648a389a7e"/></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|