Version Notes
- more admin config
- support for more themes
- general UX enhancement
- https enabled
Download this release
Release Info
Developer | Minkasu Inc |
Extension | minkasu_smartphone_checkout |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.2.0
- app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/Cctype.php +17 -0
- app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/MinkasuGroup.php +11 -6
- app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/MinkasuMode.php +41 -33
- app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/Paymentaction.php +16 -0
- app/code/community/Minkasu/Wallet/Helper/Api.php +68 -11
- app/code/community/Minkasu/Wallet/Helper/Api.php.bak +161 -0
- app/code/community/Minkasu/Wallet/Helper/Api/Merchant.php +26 -0
- app/code/community/Minkasu/Wallet/Helper/Data.php +13 -0
- app/code/community/Minkasu/Wallet/Model/Api/Adapter/Abstract.php +2 -2
- app/code/community/Minkasu/Wallet/Model/Api/Adapter/Curl.php +18 -2
- app/code/community/Minkasu/Wallet/Model/Api/Type/Merchant.php +86 -4
- app/code/community/Minkasu/Wallet/Model/Api/Type/Transaction.php +2 -1
- app/code/community/Minkasu/Wallet/Model/Payment.php +44 -6
- app/code/community/Minkasu/Wallet/Model/Payment.php.bak +115 -0
- app/code/community/Minkasu/Wallet/Model/Source/Cctype.php +38 -0
- app/code/community/Minkasu/Wallet/Model/Source/Paymentaction.php +19 -0
- app/code/community/Minkasu/Wallet/Model/System/Config/Backend/AddressPoBoxEnabled.php +61 -0
- app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Cctype.php +65 -0
- app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Double.php +42 -0
- app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Mode.php +13 -0
- app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Paymentaction.php +57 -0
- app/code/community/Minkasu/Wallet/controllers/Adminhtml/Minkasu/Wallet/MerchantController.php +38 -1
- app/code/community/Minkasu/Wallet/controllers/PaymentController.php +34 -0
- app/code/community/Minkasu/Wallet/etc/config.xml +22 -0
- app/code/community/Minkasu/Wallet/etc/system.xml +37 -13
- app/design/adminhtml/default/default/template/minkasu/wallet/merchant/popup.phtml +35 -3
- app/design/frontend/base/default/template/minkasu/wallet/pay.phtml +90 -29
- app/design/frontend/ultimo/default/template/minkasu/wallet/estimate_box.phtml +89 -0
- package.xml +8 -7
app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/Cctype.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Block_Adminhtml_System_Config_Frontend_Cctype extends Mage_Adminhtml_Block_System_Config_Form_Field
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* {@inheritdoc}
|
7 |
+
*/
|
8 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
9 |
+
{
|
10 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
11 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
12 |
+
if (!$apiHelper->getApiAccountId() || !$apiHelper->getApiToken()) {
|
13 |
+
return '';
|
14 |
+
}
|
15 |
+
return parent::render($element);
|
16 |
+
}
|
17 |
+
}
|
app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/MinkasuGroup.php
CHANGED
@@ -8,14 +8,19 @@ class Minkasu_Wallet_Block_Adminhtml_System_Config_Frontend_MinkasuGroup
|
|
8 |
*/
|
9 |
protected function _getHeaderCommentHtml($element)
|
10 |
{
|
|
|
|
|
11 |
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
12 |
$apiHelper = Mage::helper('minkasu_wallet/api');
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
$
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
19 |
return parent::_getHeaderCommentHtml($element);
|
20 |
}
|
21 |
}
|
8 |
*/
|
9 |
protected function _getHeaderCommentHtml($element)
|
10 |
{
|
11 |
+
/** @var $helper Minkasu_Wallet_Helper_Data */
|
12 |
+
$helper = Mage::helper('minkasu_wallet');
|
13 |
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
14 |
$apiHelper = Mage::helper('minkasu_wallet/api');
|
15 |
+
|
16 |
+
$doesMerchantExist = $apiHelper->getApiAccountId() && $apiHelper->getApiToken();
|
17 |
+
$element->comment = sprintf(
|
18 |
+
$element->comment,
|
19 |
+
$doesMerchantExist ? 'openEditMerchantPopup()' : 'openCreateMerchantPopup()',
|
20 |
+
$apiHelper->__($doesMerchantExist ? 'Edit your Minkasu account' : 'Create a Minkasu account'),
|
21 |
+
$helper->getHelpUrl(),
|
22 |
+
$apiHelper->__('Help')
|
23 |
+
);
|
24 |
return parent::_getHeaderCommentHtml($element);
|
25 |
}
|
26 |
}
|
app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/MinkasuMode.php
CHANGED
@@ -1,28 +1,8 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
3 |
{
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Get element ID of the dependent field to toggle
|
7 |
-
*
|
8 |
-
* @param object $element
|
9 |
-
* @return String
|
10 |
-
*/
|
11 |
-
protected function _getToggleElementId($element)
|
12 |
-
{
|
13 |
-
return "payment_minkasu_wallet_gateway_url";
|
14 |
-
//return substr($element->getId(), 0, strrpos($element->getId(), 'gateway_url')) . 'active';
|
15 |
-
}
|
16 |
-
/**
|
17 |
-
* Get element ID of the dependent field's parent row
|
18 |
-
*
|
19 |
-
* @param object $element
|
20 |
-
* @return String
|
21 |
-
*/
|
22 |
-
protected function _getToggleRowElementId($element)
|
23 |
-
{
|
24 |
-
return 'row_'.$this->_getToggleElementId($element);
|
25 |
-
}
|
26 |
/**
|
27 |
* Override method to output our custom HTML with JavaScript
|
28 |
*
|
@@ -35,22 +15,50 @@ class Minkasu_Wallet_Block_Adminhtml_System_Config_Frontend_MinkasuMode extends
|
|
35 |
$html = parent::_getElementHtml($element);
|
36 |
// Set up additional JavaScript for our toggle action. Note we are using the two helper methods above
|
37 |
// to get the correct field ID's. They are hard-coded and depend on your option names in system.xml
|
38 |
-
//alert('{$element->getHtmlId()}'+ '='+ enabled);
|
39 |
$javaScript = "
|
40 |
<script type=\"text/javascript\">
|
|
|
|
|
|
|
41 |
Event.observe(window, 'load', function() {});
|
42 |
-
Event.observe('{$element->getHtmlId()}', 'change', function(){
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
</script>";
|
52 |
|
53 |
$html .= $javaScript;
|
54 |
return $html;
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
1 |
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Block_Adminhtml_System_Config_Frontend_MinkasuMode
|
4 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Field
|
5 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
/**
|
7 |
* Override method to output our custom HTML with JavaScript
|
8 |
*
|
15 |
$html = parent::_getElementHtml($element);
|
16 |
// Set up additional JavaScript for our toggle action. Note we are using the two helper methods above
|
17 |
// to get the correct field ID's. They are hard-coded and depend on your option names in system.xml
|
|
|
18 |
$javaScript = "
|
19 |
<script type=\"text/javascript\">
|
20 |
+
var accountApiIds = {$this->_getApiAccountIds()},
|
21 |
+
accountTokens = {$this->_getApiTokens()};
|
22 |
+
|
23 |
Event.observe(window, 'load', function() {});
|
24 |
+
Event.observe('{$element->getHtmlId()}', 'change', function() {
|
25 |
+
var enabled = $('{$element->getHtmlId()}').value,
|
26 |
+
gatewayUrl = $('payment_minkasu_wallet_gateway_url');
|
27 |
+
|
28 |
+
if(enabled == 0) {
|
29 |
+
gatewayUrl.value = 'https://transactions.minkasu.com';
|
30 |
+
} else {
|
31 |
+
gatewayUrl.value = 'https://sb.minkasu.com';
|
32 |
+
}
|
33 |
+
$('payment_minkasu_wallet_account_id').value = (accountApiIds[enabled] == undefined ? '' : accountApiIds[enabled]);
|
34 |
+
$('payment_minkasu_wallet_token').value = (accountTokens[enabled] == undefined ? '' : accountTokens[enabled]);
|
35 |
+
gatewayUrl.focus();
|
36 |
+
});
|
37 |
</script>";
|
38 |
|
39 |
$html .= $javaScript;
|
40 |
return $html;
|
41 |
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @return string
|
45 |
+
*/
|
46 |
+
protected function _getApiAccountIds()
|
47 |
+
{
|
48 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
49 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
50 |
+
$apiAccountIds = $apiHelper->getApiAccountIds();
|
51 |
+
return $apiAccountIds ? $apiAccountIds : '{}';
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @return string
|
56 |
+
*/
|
57 |
+
protected function _getApiTokens()
|
58 |
+
{
|
59 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
60 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
61 |
+
$apiTokens = $apiHelper->getApiTokens();
|
62 |
+
return $apiTokens ? $apiTokens : '{}';
|
63 |
+
}
|
64 |
}
|
app/code/community/Minkasu/Wallet/Block/Adminhtml/System/Config/Frontend/Paymentaction.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Block_Adminhtml_System_Config_Frontend_Paymentaction
|
4 |
+
extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
5 |
+
{
|
6 |
+
|
7 |
+
public function render(Varien_Data_Form_Element_Abstract $element)
|
8 |
+
{
|
9 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
10 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
11 |
+
if (!$apiHelper->getApiAccountId() || !$apiHelper->getApiToken()) {
|
12 |
+
return '';
|
13 |
+
}
|
14 |
+
return parent::render($element);
|
15 |
+
}
|
16 |
+
}
|
app/code/community/Minkasu/Wallet/Helper/Api.php
CHANGED
@@ -10,6 +10,8 @@ class Minkasu_Wallet_Helper_Api extends Mage_Core_Helper_Data
|
|
10 |
const XML_PATH_API_ACTIVE = 'payment/minkasu_wallet/active';
|
11 |
const XML_PATH_API_MODE = 'payment/minkasu_wallet/mode';
|
12 |
const XML_PATH_API_ESTIMATE_ENABLED = 'payment/minkasu_wallet/estimate_enabled';
|
|
|
|
|
13 |
|
14 |
/**
|
15 |
* Minkasu API log filename
|
@@ -29,17 +31,55 @@ class Minkasu_Wallet_Helper_Api extends Mage_Core_Helper_Data
|
|
29 |
*/
|
30 |
public function getApiAccountId()
|
31 |
{
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
/**
|
36 |
* @return string
|
37 |
*/
|
38 |
public function getApiToken()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
{
|
40 |
return Mage::getStoreConfig(self::XML_PATH_API_TOKEN);
|
41 |
}
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
/**
|
44 |
* @param string $accountId
|
45 |
*
|
@@ -47,7 +87,7 @@ class Minkasu_Wallet_Helper_Api extends Mage_Core_Helper_Data
|
|
47 |
*/
|
48 |
public function saveApiAccountId($accountId)
|
49 |
{
|
50 |
-
$this->_saveConfig(self::XML_PATH_API_ACCOUNT_ID, $accountId);
|
51 |
return $this;
|
52 |
}
|
53 |
|
@@ -66,6 +106,31 @@ class Minkasu_Wallet_Helper_Api extends Mage_Core_Helper_Data
|
|
66 |
$config->saveConfig($key, $coreHelper->encrypt($value));
|
67 |
return $this;
|
68 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
/**
|
71 |
* @param string $token
|
@@ -74,7 +139,7 @@ class Minkasu_Wallet_Helper_Api extends Mage_Core_Helper_Data
|
|
74 |
*/
|
75 |
public function saveApiToken($token)
|
76 |
{
|
77 |
-
$this->_saveConfig(self::XML_PATH_API_TOKEN, $token);
|
78 |
return $this;
|
79 |
}
|
80 |
|
@@ -94,14 +159,6 @@ class Minkasu_Wallet_Helper_Api extends Mage_Core_Helper_Data
|
|
94 |
return Mage::getStoreConfigFlag(self::XML_PATH_API_ACTIVE);
|
95 |
}
|
96 |
|
97 |
-
/**
|
98 |
-
* @return int
|
99 |
-
*/
|
100 |
-
public function getApiMode()
|
101 |
-
{
|
102 |
-
return (int) Mage::getStoreConfigFlag(self::XML_PATH_API_MODE);
|
103 |
-
}
|
104 |
-
|
105 |
/**
|
106 |
* @return bool
|
107 |
*/
|
10 |
const XML_PATH_API_ACTIVE = 'payment/minkasu_wallet/active';
|
11 |
const XML_PATH_API_MODE = 'payment/minkasu_wallet/mode';
|
12 |
const XML_PATH_API_ESTIMATE_ENABLED = 'payment/minkasu_wallet/estimate_enabled';
|
13 |
+
const XML_PATH_API_CC_TYPES = 'payment/minkasu_wallet/cctypes';
|
14 |
+
const XML_PATH_API_PAYMENTACTION = 'payment/minkasu_wallet/payment_action';
|
15 |
|
16 |
/**
|
17 |
* Minkasu API log filename
|
31 |
*/
|
32 |
public function getApiAccountId()
|
33 |
{
|
34 |
+
$configValue = Mage::getStoreConfig(self::XML_PATH_API_ACCOUNT_ID);
|
35 |
+
$configValue = json_decode($configValue, true);
|
36 |
+
|
37 |
+
return isset($configValue[$this->getApiMode()]) ? (int) $configValue[$this->getApiMode()] : '';
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @return int
|
42 |
+
*/
|
43 |
+
public function getApiMode()
|
44 |
+
{
|
45 |
+
return (int) Mage::getStoreConfigFlag(self::XML_PATH_API_MODE);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
public function getApiAccountIds()
|
52 |
+
{
|
53 |
+
return Mage::getStoreConfig(self::XML_PATH_API_ACCOUNT_ID);
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
* @return string
|
58 |
*/
|
59 |
public function getApiToken()
|
60 |
+
{
|
61 |
+
$configValue = Mage::getStoreConfig(self::XML_PATH_API_TOKEN);
|
62 |
+
$configValue = json_decode($configValue, true);
|
63 |
+
|
64 |
+
return isset($configValue[$this->getApiMode()]) ? $configValue[$this->getApiMode()] : '';
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @return string
|
69 |
+
*/
|
70 |
+
public function getApiTokens()
|
71 |
{
|
72 |
return Mage::getStoreConfig(self::XML_PATH_API_TOKEN);
|
73 |
}
|
74 |
|
75 |
+
/**
|
76 |
+
* @return string
|
77 |
+
*/
|
78 |
+
public function getPaymentaction()
|
79 |
+
{
|
80 |
+
return Mage::getStoreConfig(self::XML_PATH_API_PAYMENTACTION);
|
81 |
+
}
|
82 |
+
|
83 |
/**
|
84 |
* @param string $accountId
|
85 |
*
|
87 |
*/
|
88 |
public function saveApiAccountId($accountId)
|
89 |
{
|
90 |
+
$this->_saveConfig(self::XML_PATH_API_ACCOUNT_ID, json_encode(array($this->getApiMode() => $accountId)));
|
91 |
return $this;
|
92 |
}
|
93 |
|
106 |
$config->saveConfig($key, $coreHelper->encrypt($value));
|
107 |
return $this;
|
108 |
}
|
109 |
+
/**
|
110 |
+
* @param string $paymentAction
|
111 |
+
*
|
112 |
+
* @return $this
|
113 |
+
*/
|
114 |
+
public function savePaymentaction($paymentAction)
|
115 |
+
{
|
116 |
+
/** @var $config Mage_Core_Model_Config */
|
117 |
+
$config = Mage::getModel('core/config');
|
118 |
+
$config->saveConfig(self::XML_PATH_API_PAYMENTACTION, $paymentAction);
|
119 |
+
return $this;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* @param string $ccTypes
|
124 |
+
*
|
125 |
+
* @return $this
|
126 |
+
*/
|
127 |
+
public function saveCcTypes($ccTypes)
|
128 |
+
{
|
129 |
+
/** @var $config Mage_Core_Model_Config */
|
130 |
+
$config = Mage::getModel('core/config');
|
131 |
+
$config->saveConfig(self::XML_PATH_API_CC_TYPES, $ccTypes);
|
132 |
+
return $this;
|
133 |
+
}
|
134 |
|
135 |
/**
|
136 |
* @param string $token
|
139 |
*/
|
140 |
public function saveApiToken($token)
|
141 |
{
|
142 |
+
$this->_saveConfig(self::XML_PATH_API_TOKEN, json_encode(array($this->getApiMode() => $token)));
|
143 |
return $this;
|
144 |
}
|
145 |
|
159 |
return Mage::getStoreConfigFlag(self::XML_PATH_API_ACTIVE);
|
160 |
}
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
/**
|
163 |
* @return bool
|
164 |
*/
|
app/code/community/Minkasu/Wallet/Helper/Api.php.bak
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Minkasu_Wallet_Helper_Api extends Mage_Core_Helper_Data
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Xml paths
|
6 |
+
*/
|
7 |
+
const XML_PATH_API_GATEWAY_URL = 'payment/minkasu_wallet/gateway_url';
|
8 |
+
const XML_PATH_API_ACCOUNT_ID = 'payment/minkasu_wallet/account_id';
|
9 |
+
const XML_PATH_API_TOKEN = 'payment/minkasu_wallet/token';
|
10 |
+
const XML_PATH_API_ACTIVE = 'payment/minkasu_wallet/active';
|
11 |
+
const XML_PATH_API_MODE = 'payment/minkasu_wallet/mode';
|
12 |
+
const XML_PATH_API_ESTIMATE_ENABLED = 'payment/minkasu_wallet/estimate_enabled';
|
13 |
+
const XML_PATH_API_CC_TYPES = 'payment/minkasu_wallet/cctypes';
|
14 |
+
const XML_PATH_API_PAYMENTACTION = 'payment/minkasu_wallet/paymentaction';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Minkasu API log filename
|
18 |
+
*/
|
19 |
+
const LOG_FILENAME = 'minkasu_api.log';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
public function getApiGatewayUrl()
|
25 |
+
{
|
26 |
+
return rtrim(Mage::getStoreConfig(self::XML_PATH_API_GATEWAY_URL), '/');
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @return int
|
31 |
+
*/
|
32 |
+
public function getApiAccountId()
|
33 |
+
{
|
34 |
+
$configValue = Mage::getStoreConfig(self::XML_PATH_API_ACCOUNT_ID);
|
35 |
+
$configValue = json_decode($configValue, true);
|
36 |
+
|
37 |
+
return isset($configValue[$this->getApiMode()]) ? (int) $configValue[$this->getApiMode()] : '';
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @return int
|
42 |
+
*/
|
43 |
+
public function getApiMode()
|
44 |
+
{
|
45 |
+
return (int) Mage::getStoreConfigFlag(self::XML_PATH_API_MODE);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* @return string
|
50 |
+
*/
|
51 |
+
public function getApiAccountIds()
|
52 |
+
{
|
53 |
+
return Mage::getStoreConfig(self::XML_PATH_API_ACCOUNT_ID);
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* @return string
|
58 |
+
*/
|
59 |
+
public function getApiToken()
|
60 |
+
{
|
61 |
+
$configValue = Mage::getStoreConfig(self::XML_PATH_API_TOKEN);
|
62 |
+
$configValue = json_decode($configValue, true);
|
63 |
+
|
64 |
+
return isset($configValue[$this->getApiMode()]) ? $configValue[$this->getApiMode()] : '';
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @return string
|
69 |
+
*/
|
70 |
+
public function getApiTokens()
|
71 |
+
{
|
72 |
+
return Mage::getStoreConfig(self::XML_PATH_API_TOKEN);
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* @param string $accountId
|
77 |
+
*
|
78 |
+
* @return $this
|
79 |
+
*/
|
80 |
+
public function saveApiAccountId($accountId)
|
81 |
+
{
|
82 |
+
$this->_saveConfig(self::XML_PATH_API_ACCOUNT_ID, json_encode(array($this->getApiMode() => $accountId)));
|
83 |
+
return $this;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* @param string $key
|
88 |
+
* @param string $value
|
89 |
+
*
|
90 |
+
* @return $this
|
91 |
+
*/
|
92 |
+
protected function _saveConfig($key, $value)
|
93 |
+
{
|
94 |
+
/** @var $config Mage_Core_Model_Config */
|
95 |
+
$config = Mage::getModel('core/config');
|
96 |
+
/** @var $coreHelper Mage_Core_Helper_Data */
|
97 |
+
$coreHelper = Mage::helper('core');
|
98 |
+
$config->saveConfig($key, $coreHelper->encrypt($value));
|
99 |
+
return $this;
|
100 |
+
}
|
101 |
+
/**
|
102 |
+
* @param string $paymentAction
|
103 |
+
*
|
104 |
+
* @return $this
|
105 |
+
*/
|
106 |
+
public function savePaymentaction($paymentAction)
|
107 |
+
{
|
108 |
+
/** @var $config Mage_Core_Model_Config */
|
109 |
+
$config = Mage::getModel('core/config');
|
110 |
+
$config->saveConfig(self::XML_PATH_API_PAYMENTACTION, $paymentAction);
|
111 |
+
return $this;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* @param string $ccTypes
|
116 |
+
*
|
117 |
+
* @return $this
|
118 |
+
*/
|
119 |
+
public function saveCcTypes($ccTypes)
|
120 |
+
{
|
121 |
+
/** @var $config Mage_Core_Model_Config */
|
122 |
+
$config = Mage::getModel('core/config');
|
123 |
+
$config->saveConfig(self::XML_PATH_API_CC_TYPES, $ccTypes);
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* @param string $token
|
129 |
+
*
|
130 |
+
* @return $this
|
131 |
+
*/
|
132 |
+
public function saveApiToken($token)
|
133 |
+
{
|
134 |
+
$this->_saveConfig(self::XML_PATH_API_TOKEN, json_encode(array($this->getApiMode() => $token)));
|
135 |
+
return $this;
|
136 |
+
}
|
137 |
+
|
138 |
+
/**
|
139 |
+
* @return string
|
140 |
+
*/
|
141 |
+
public function getApiLogFilename()
|
142 |
+
{
|
143 |
+
return self::LOG_FILENAME;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* @return bool
|
148 |
+
*/
|
149 |
+
public function isApiActive()
|
150 |
+
{
|
151 |
+
return Mage::getStoreConfigFlag(self::XML_PATH_API_ACTIVE);
|
152 |
+
}
|
153 |
+
|
154 |
+
/**
|
155 |
+
* @return bool
|
156 |
+
*/
|
157 |
+
public function isApiEstimateEnabled()
|
158 |
+
{
|
159 |
+
return Mage::getStoreConfigFlag(self::XML_PATH_API_ESTIMATE_ENABLED);
|
160 |
+
}
|
161 |
+
}
|
app/code/community/Minkasu/Wallet/Helper/Api/Merchant.php
CHANGED
@@ -7,6 +7,32 @@ class Minkasu_Wallet_Helper_Api_Merchant extends Mage_Core_Helper_Data
|
|
7 |
*/
|
8 |
protected $_isMerchantActive;
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
/**
|
11 |
* @return bool
|
12 |
*/
|
7 |
*/
|
8 |
protected $_isMerchantActive;
|
9 |
|
10 |
+
/**
|
11 |
+
* @var array
|
12 |
+
*/
|
13 |
+
protected $_magentoToMinkasuCcMap = array(
|
14 |
+
'VI' => 'visa',
|
15 |
+
'MC' => 'mastercard',
|
16 |
+
'AE' => 'amex',
|
17 |
+
'DN' => 'dinners',
|
18 |
+
'DI' => 'discover',
|
19 |
+
'JCB' => 'jcb',
|
20 |
+
'CUP' => 'china_union_pay',
|
21 |
+
);
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @param string $magentoCode
|
25 |
+
* @return string
|
26 |
+
* @throws Mage_Core_Exception
|
27 |
+
*/
|
28 |
+
public function getMinkasuCcCode($magentoCode)
|
29 |
+
{
|
30 |
+
if (!isset($this->_magentoToMinkasuCcMap[$magentoCode])) {
|
31 |
+
Mage::throwException($this->__("CC with code %s doesn't exist."));
|
32 |
+
}
|
33 |
+
return $this->_magentoToMinkasuCcMap[$magentoCode];
|
34 |
+
}
|
35 |
+
|
36 |
/**
|
37 |
* @return bool
|
38 |
*/
|
app/code/community/Minkasu/Wallet/Helper/Data.php
CHANGED
@@ -2,6 +2,11 @@
|
|
2 |
|
3 |
class Minkasu_Wallet_Helper_Data extends Mage_Payment_Helper_Data
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* @param mixed $amount
|
7 |
*
|
@@ -57,4 +62,12 @@ class Minkasu_Wallet_Helper_Data extends Mage_Payment_Helper_Data
|
|
57 |
$session->unsetData('minkasu_est_state');
|
58 |
return $this;
|
59 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
}
|
2 |
|
3 |
class Minkasu_Wallet_Helper_Data extends Mage_Payment_Helper_Data
|
4 |
{
|
5 |
+
/**
|
6 |
+
* URL to Magento help resource
|
7 |
+
*/
|
8 |
+
const URL_HELP = 'https://www.minkasu.com/magento/';
|
9 |
+
|
10 |
/**
|
11 |
* @param mixed $amount
|
12 |
*
|
62 |
$session->unsetData('minkasu_est_state');
|
63 |
return $this;
|
64 |
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @return string
|
68 |
+
*/
|
69 |
+
public function getHelpUrl()
|
70 |
+
{
|
71 |
+
return self::URL_HELP;
|
72 |
+
}
|
73 |
}
|
app/code/community/Minkasu/Wallet/Model/Api/Adapter/Abstract.php
CHANGED
@@ -87,7 +87,7 @@ abstract class Minkasu_Wallet_Model_Api_Adapter_Abstract
|
|
87 |
null,
|
88 |
$apiHelper->getApiLogFilename()
|
89 |
);
|
90 |
-
Mage::throwException($helper->__('Minkasu API
|
91 |
}
|
92 |
return $decodedResponse;
|
93 |
}
|
@@ -129,7 +129,7 @@ abstract class Minkasu_Wallet_Model_Api_Adapter_Abstract
|
|
129 |
null,
|
130 |
$apiHelper->getApiLogFilename()
|
131 |
);
|
132 |
-
Mage::throwException($helper->__('Minkasu API
|
133 |
}
|
134 |
return $decodedResponse;
|
135 |
}
|
87 |
null,
|
88 |
$apiHelper->getApiLogFilename()
|
89 |
);
|
90 |
+
Mage::throwException($helper->__('Minkasu API Error: %s.', $error));
|
91 |
}
|
92 |
return $decodedResponse;
|
93 |
}
|
129 |
null,
|
130 |
$apiHelper->getApiLogFilename()
|
131 |
);
|
132 |
+
Mage::throwException($helper->__('Minkasu API Error: %s.', $error));
|
133 |
}
|
134 |
return $decodedResponse;
|
135 |
}
|
app/code/community/Minkasu/Wallet/Model/Api/Adapter/Curl.php
CHANGED
@@ -20,20 +20,36 @@ class Minkasu_Wallet_Model_Api_Adapter_Curl extends Minkasu_Wallet_Model_Api_Ada
|
|
20 |
$client->setUri($url);
|
21 |
$client->setMethod($httpMethod);
|
22 |
|
|
|
|
|
23 |
if (isset($parameters['headers'])) {
|
24 |
$client->setConfig(array('strict' => false));
|
25 |
-
$
|
26 |
unset($parameters['headers']);
|
27 |
}
|
|
|
28 |
|
29 |
if (Varien_Http_Client::GET == $httpMethod) {
|
30 |
$client->setParameterGet($parameters);
|
31 |
} elseif (Varien_Http_Client::POST == $httpMethod) {
|
32 |
-
$client->
|
33 |
} else {
|
34 |
Mage::throwException("Invalid http request method '{$httpMethod}'.");
|
35 |
}
|
36 |
|
37 |
return $client->request();
|
38 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
20 |
$client->setUri($url);
|
21 |
$client->setMethod($httpMethod);
|
22 |
|
23 |
+
$headers = array();
|
24 |
+
$this->_setServerHeaders($headers);
|
25 |
if (isset($parameters['headers'])) {
|
26 |
$client->setConfig(array('strict' => false));
|
27 |
+
$headers = array_merge($headers, $parameters['headers']);
|
28 |
unset($parameters['headers']);
|
29 |
}
|
30 |
+
$client->setHeaders($headers);
|
31 |
|
32 |
if (Varien_Http_Client::GET == $httpMethod) {
|
33 |
$client->setParameterGet($parameters);
|
34 |
} elseif (Varien_Http_Client::POST == $httpMethod) {
|
35 |
+
$client->setRawData(json_encode($parameters), 'application/json');
|
36 |
} else {
|
37 |
Mage::throwException("Invalid http request method '{$httpMethod}'.");
|
38 |
}
|
39 |
|
40 |
return $client->request();
|
41 |
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @param array $headers
|
45 |
+
* @return $this
|
46 |
+
*/
|
47 |
+
protected function _setServerHeaders(array &$headers)
|
48 |
+
{
|
49 |
+
if (isset($_SERVER['HTTP_HOST']) && isset($_SERVER['REMOTE_ADDR'])) {
|
50 |
+
$headers['X-MK-REMOTE-HOST'] = $_SERVER['HTTP_HOST'];
|
51 |
+
$headers['X-MK-REMOTE-IP'] = $_SERVER['REMOTE_ADDR'];
|
52 |
+
}
|
53 |
+
return $this;
|
54 |
+
}
|
55 |
}
|
app/code/community/Minkasu/Wallet/Model/Api/Type/Merchant.php
CHANGED
@@ -45,7 +45,7 @@ class Minkasu_Wallet_Model_Api_Type_Merchant extends Minkasu_Wallet_Model_Api_Ty
|
|
45 |
*
|
46 |
* @return array
|
47 |
*/
|
48 |
-
public function createMerchant(array $merchantData, array $gatewayData)
|
49 |
{
|
50 |
$params = array_merge(
|
51 |
$merchantData,
|
@@ -62,6 +62,23 @@ class Minkasu_Wallet_Model_Api_Type_Merchant extends Minkasu_Wallet_Model_Api_Ty
|
|
62 |
|
63 |
return $this->post($params);
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
/**
|
67 |
* Create a Minkasu merchant gateway
|
@@ -78,8 +95,6 @@ class Minkasu_Wallet_Model_Api_Type_Merchant extends Minkasu_Wallet_Model_Api_Ty
|
|
78 |
'login_id' => $gatewayData['login_id'],
|
79 |
'key' => $gatewayData['key'],
|
80 |
'test_mode' => $gatewayData['test_mode'],
|
81 |
-
'merchant_acct_id' => $apiHelper->getApiAccountId(),
|
82 |
-
'minkasu_token' => $apiHelper->getApiToken(),
|
83 |
':id' => $apiHelper->getApiAccountId(),
|
84 |
':action' => 'gateway',
|
85 |
'headers' => array(
|
@@ -89,7 +104,7 @@ class Minkasu_Wallet_Model_Api_Type_Merchant extends Minkasu_Wallet_Model_Api_Ty
|
|
89 |
);
|
90 |
return $this->post($params);
|
91 |
}
|
92 |
-
|
93 |
/**
|
94 |
* @return array
|
95 |
*/
|
@@ -141,4 +156,71 @@ class Minkasu_Wallet_Model_Api_Type_Merchant extends Minkasu_Wallet_Model_Api_Ty
|
|
141 |
);
|
142 |
return $this->post($params);
|
143 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
45 |
*
|
46 |
* @return array
|
47 |
*/
|
48 |
+
public function createMerchant(array $merchantData, array $gatewayData )
|
49 |
{
|
50 |
$params = array_merge(
|
51 |
$merchantData,
|
62 |
|
63 |
return $this->post($params);
|
64 |
}
|
65 |
+
/**
|
66 |
+
* Update merchant card_acceptance list
|
67 |
+
*
|
68 |
+
* @param array $cardAcceptanceData
|
69 |
+
*
|
70 |
+
* @return success/error
|
71 |
+
*/
|
72 |
+
public function updateCardAcceptanctData(array $cardAcceptanceData)
|
73 |
+
{
|
74 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
75 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
76 |
+
$params = array(
|
77 |
+
'cards_accepted' => $cardAcceptanceData
|
78 |
+
);
|
79 |
+
return $this->post($params);
|
80 |
+
}
|
81 |
+
|
82 |
|
83 |
/**
|
84 |
* Create a Minkasu merchant gateway
|
95 |
'login_id' => $gatewayData['login_id'],
|
96 |
'key' => $gatewayData['key'],
|
97 |
'test_mode' => $gatewayData['test_mode'],
|
|
|
|
|
98 |
':id' => $apiHelper->getApiAccountId(),
|
99 |
':action' => 'gateway',
|
100 |
'headers' => array(
|
104 |
);
|
105 |
return $this->post($params);
|
106 |
}
|
107 |
+
|
108 |
/**
|
109 |
* @return array
|
110 |
*/
|
156 |
);
|
157 |
return $this->post($params);
|
158 |
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* @param array $data
|
162 |
+
*
|
163 |
+
* @return array
|
164 |
+
*/
|
165 |
+
public function updatePreference(array $data)
|
166 |
+
{
|
167 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
168 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
169 |
+
$params = array(
|
170 |
+
'merchant_acct_id' => $apiHelper->getApiAccountId(),
|
171 |
+
'minkasu_token' => $apiHelper->getApiToken(),
|
172 |
+
':id' => $apiHelper->getApiAccountId(),
|
173 |
+
':action' => 'preference',
|
174 |
+
);
|
175 |
+
$params = array_merge($params, $data);
|
176 |
+
return $this->post($params);
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* @return array
|
181 |
+
*/
|
182 |
+
public function enableAddressPoBox()
|
183 |
+
{
|
184 |
+
$params = array(
|
185 |
+
'addressPOBoxEnabled' => true
|
186 |
+
);
|
187 |
+
return $this->updatePreference($params);
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* @return array
|
192 |
+
*/
|
193 |
+
public function disableAddressPoBox()
|
194 |
+
{
|
195 |
+
$params = array(
|
196 |
+
'addressPOBoxEnabled' => false
|
197 |
+
);
|
198 |
+
return $this->updatePreference($params);
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* @param array $cc
|
203 |
+
* @return array
|
204 |
+
*/
|
205 |
+
public function updateCc(array $cc)
|
206 |
+
{
|
207 |
+
$params = array(
|
208 |
+
'cards_accepted' => $cc
|
209 |
+
);
|
210 |
+
return $this->updatePreference($params);
|
211 |
+
}
|
212 |
+
/**
|
213 |
+
* @param string $paymentAction
|
214 |
+
* @return array
|
215 |
+
*/
|
216 |
+
public function updatePaymentaction(string $paymentAction)
|
217 |
+
{
|
218 |
+
//'capture_immediate' => $paymentAction
|
219 |
+
$boolean_capture_immediate = ($paymentAction == 'authorize_capture' ? true : false);
|
220 |
+
$params = array(
|
221 |
+
'capture_immediate' => $boolean_capture_immediate
|
222 |
+
);
|
223 |
+
return $this->updatePreference($params);
|
224 |
+
}
|
225 |
+
|
226 |
}
|
app/code/community/Minkasu/Wallet/Model/Api/Type/Transaction.php
CHANGED
@@ -115,7 +115,7 @@ class Minkasu_Wallet_Model_Api_Type_Transaction extends Minkasu_Wallet_Model_Api
|
|
115 |
*
|
116 |
* @return array
|
117 |
*/
|
118 |
-
public function authorizeTransaction($transactionId, $paymentToken, $amount)
|
119 |
{
|
120 |
/** @var $walletHelper Minkasu_Wallet_Helper_Data */
|
121 |
$walletHelper = Mage::helper('minkasu_wallet');
|
@@ -125,6 +125,7 @@ class Minkasu_Wallet_Model_Api_Type_Transaction extends Minkasu_Wallet_Model_Api
|
|
125 |
$params = array(
|
126 |
'operation' => self::OPERATION_AUTHORIZE,
|
127 |
'authorize_amount' => $walletHelper->convertDollarsToCents($amount),
|
|
|
128 |
'merchant_acct_id' => $apiHelper->getApiAccountId(),
|
129 |
'minkasu_token' => $apiHelper->getApiToken(),
|
130 |
'payment_token' => $paymentToken,
|
115 |
*
|
116 |
* @return array
|
117 |
*/
|
118 |
+
public function authorizeTransaction($transactionId, $paymentToken, $amount, $orderId)
|
119 |
{
|
120 |
/** @var $walletHelper Minkasu_Wallet_Helper_Data */
|
121 |
$walletHelper = Mage::helper('minkasu_wallet');
|
125 |
$params = array(
|
126 |
'operation' => self::OPERATION_AUTHORIZE,
|
127 |
'authorize_amount' => $walletHelper->convertDollarsToCents($amount),
|
128 |
+
'merchant_bill_number' => $orderId,
|
129 |
'merchant_acct_id' => $apiHelper->getApiAccountId(),
|
130 |
'minkasu_token' => $apiHelper->getApiToken(),
|
131 |
'payment_token' => $paymentToken,
|
app/code/community/Minkasu/Wallet/Model/Payment.php
CHANGED
@@ -11,6 +11,7 @@ class Minkasu_Wallet_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
11 |
protected $_canAuthorize = true;
|
12 |
protected $_canCapture = true;
|
13 |
protected $_canRefund = true;
|
|
|
14 |
protected $_canVoid = true;
|
15 |
|
16 |
public function isAvailable($quote = null)
|
@@ -34,15 +35,29 @@ class Minkasu_Wallet_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
34 |
/** @var $checkoutSession Mage_Checkout_Model_Session */
|
35 |
$checkoutSession = Mage::getSingleton('checkout/session');
|
36 |
|
|
|
|
|
|
|
|
|
37 |
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
38 |
$client = Mage::getModel('minkasu_wallet/api_client');
|
39 |
$client->getType('transaction')->authorizeTransaction(
|
40 |
$checkoutSession->getData('minkasu_txn_id'),
|
41 |
$checkoutSession->getData('minkasu_payment_token'),
|
42 |
-
$amount
|
|
|
43 |
);
|
44 |
|
45 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
$payment->setIsTransactionClosed(0);
|
47 |
$payment->setTransactionAdditionalInfo('quote number', $checkoutSession->getData('minkasu_bill_number'));
|
48 |
|
@@ -58,10 +73,18 @@ class Minkasu_Wallet_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
58 |
*/
|
59 |
public function capture(Varien_Object $payment, $amount)
|
60 |
{
|
61 |
-
/** @var $
|
62 |
-
$
|
63 |
-
$
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
return $this;
|
67 |
}
|
@@ -82,6 +105,7 @@ class Minkasu_Wallet_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
82 |
|
83 |
/**
|
84 |
* {@inheritdoc}
|
|
|
85 |
*/
|
86 |
public function cancel(Varien_Object $payment)
|
87 |
{
|
@@ -89,6 +113,20 @@ class Minkasu_Wallet_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
|
89 |
$client = Mage::getModel('minkasu_wallet/api_client');
|
90 |
$client->getType('transaction')->cancelTransaction($payment->getData('parent_transaction_id'));
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
return $this;
|
93 |
}
|
94 |
}
|
11 |
protected $_canAuthorize = true;
|
12 |
protected $_canCapture = true;
|
13 |
protected $_canRefund = true;
|
14 |
+
protected $_canCancel = true;
|
15 |
protected $_canVoid = true;
|
16 |
|
17 |
public function isAvailable($quote = null)
|
35 |
/** @var $checkoutSession Mage_Checkout_Model_Session */
|
36 |
$checkoutSession = Mage::getSingleton('checkout/session');
|
37 |
|
38 |
+
$quote = $checkoutSession->getQuote();
|
39 |
+
$orderId = $quote->getReservedOrderId();
|
40 |
+
Mage::log("Minkasu reserved order Id for quote is " . $orderId);
|
41 |
+
|
42 |
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
43 |
$client = Mage::getModel('minkasu_wallet/api_client');
|
44 |
$client->getType('transaction')->authorizeTransaction(
|
45 |
$checkoutSession->getData('minkasu_txn_id'),
|
46 |
$checkoutSession->getData('minkasu_payment_token'),
|
47 |
+
$amount,
|
48 |
+
$orderId
|
49 |
);
|
50 |
|
51 |
+
$txnId = $checkoutSession->getData('minkasu_txn_id');
|
52 |
+
|
53 |
+
/** @var $_apiHelper Minkasu_Wallet_Helper_Api */
|
54 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
55 |
+
$paymentaction = $apiHelper->getPaymentaction();
|
56 |
+
if ($paymentaction == 'authorize_capture') {
|
57 |
+
$txnId = $txnId . '-capture';
|
58 |
+
}
|
59 |
+
|
60 |
+
$payment->setTransactionId($txnId);
|
61 |
$payment->setIsTransactionClosed(0);
|
62 |
$payment->setTransactionAdditionalInfo('quote number', $checkoutSession->getData('minkasu_bill_number'));
|
63 |
|
73 |
*/
|
74 |
public function capture(Varien_Object $payment, $amount)
|
75 |
{
|
76 |
+
/** @var $_apiHelper Minkasu_Wallet_Helper_Api */
|
77 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
78 |
+
$paymentaction = $apiHelper->getPaymentaction();
|
79 |
+
|
80 |
+
if ($paymentaction == 'authorize_capture') {
|
81 |
+
$this->authorize($payment, $amount);
|
82 |
+
} else {
|
83 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
84 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
85 |
+
$client->getType('transaction')->captureTransaction($payment->getData('parent_transaction_id'), $amount);
|
86 |
+
$payment->setIsTransactionClosed(0);
|
87 |
+
}
|
88 |
|
89 |
return $this;
|
90 |
}
|
105 |
|
106 |
/**
|
107 |
* {@inheritdoc}
|
108 |
+
* void the external gateway authorization and cancels the payment
|
109 |
*/
|
110 |
public function cancel(Varien_Object $payment)
|
111 |
{
|
113 |
$client = Mage::getModel('minkasu_wallet/api_client');
|
114 |
$client->getType('transaction')->cancelTransaction($payment->getData('parent_transaction_id'));
|
115 |
|
116 |
+
return $this;
|
117 |
+
}
|
118 |
+
/**
|
119 |
+
* {@inheritdoc}
|
120 |
+
* void the external gateway authorization and cancels the payment
|
121 |
+
* Ideally 'void' should void only external gateway 'auth' and keep the transaction active
|
122 |
+
* A re-auth is possible on a voided txn. Currently Re-Auth is not implemented.
|
123 |
+
*/
|
124 |
+
public function void(Varien_Object $payment)
|
125 |
+
{
|
126 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
127 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
128 |
+
$client->getType('transaction')->cancelTransaction($payment->getData('parent_transaction_id'));
|
129 |
+
|
130 |
return $this;
|
131 |
}
|
132 |
}
|
app/code/community/Minkasu/Wallet/Model/Payment.php.bak
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_Payment extends Mage_Payment_Model_Method_Abstract
|
4 |
+
{
|
5 |
+
protected $_code = 'minkasu_wallet';
|
6 |
+
|
7 |
+
protected $_canUseCheckout = false;
|
8 |
+
protected $_canUseInternal = false;
|
9 |
+
protected $_canUseForMultishipping = false;
|
10 |
+
|
11 |
+
protected $_canAuthorize = true;
|
12 |
+
protected $_canCapture = true;
|
13 |
+
protected $_canRefund = true;
|
14 |
+
protected $_canCancel = true;
|
15 |
+
protected $_canVoid = true;
|
16 |
+
|
17 |
+
public function isAvailable($quote = null)
|
18 |
+
{
|
19 |
+
return true;
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* {@inheritdoc}
|
24 |
+
*/
|
25 |
+
public function isApplicableToQuote($quote, $checks)
|
26 |
+
{
|
27 |
+
return true;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* {@inheritdoc}
|
32 |
+
*/
|
33 |
+
public function authorize(Varien_Object $payment, $amount)
|
34 |
+
{
|
35 |
+
/** @var $checkoutSession Mage_Checkout_Model_Session */
|
36 |
+
$checkoutSession = Mage::getSingleton('checkout/session');
|
37 |
+
|
38 |
+
$quote = $checkoutSession->getQuote();
|
39 |
+
$orderId = $quote->getReservedOrderId();
|
40 |
+
Mage::log("Minkasu reserved order Id for quote is " . $orderId);
|
41 |
+
|
42 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
43 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
44 |
+
$client->getType('transaction')->authorizeTransaction(
|
45 |
+
$checkoutSession->getData('minkasu_txn_id'),
|
46 |
+
$checkoutSession->getData('minkasu_payment_token'),
|
47 |
+
$amount,
|
48 |
+
$orderId
|
49 |
+
);
|
50 |
+
|
51 |
+
$payment->setTransactionId($checkoutSession->getData('minkasu_txn_id'));
|
52 |
+
$payment->setIsTransactionClosed(0);
|
53 |
+
$payment->setTransactionAdditionalInfo('quote number', $checkoutSession->getData('minkasu_bill_number'));
|
54 |
+
|
55 |
+
/** @var $helper Minkasu_Wallet_Helper_Data */
|
56 |
+
$helper = Mage::helper('minkasu_wallet');
|
57 |
+
$helper->cleanCheckoutSessionParams();
|
58 |
+
|
59 |
+
return $this;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* {@inheritdoc}
|
64 |
+
*/
|
65 |
+
public function capture(Varien_Object $payment, $amount)
|
66 |
+
{
|
67 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
68 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
69 |
+
$client->getType('transaction')->captureTransaction($payment->getData('parent_transaction_id'), $amount);
|
70 |
+
$payment->setIsTransactionClosed(0);
|
71 |
+
|
72 |
+
return $this;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* {@inheritdoc}
|
77 |
+
*/
|
78 |
+
public function refund(Varien_Object $payment, $amount)
|
79 |
+
{
|
80 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
81 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
82 |
+
$transactionId = str_replace('-capture', '', $payment->getData('parent_transaction_id'));
|
83 |
+
$client->getType('transaction')->refundTransaction($transactionId, $amount);
|
84 |
+
$payment->setIsTransactionClosed(0);
|
85 |
+
|
86 |
+
return $this;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* {@inheritdoc}
|
91 |
+
* void the external gateway authorization and cancels the payment
|
92 |
+
*/
|
93 |
+
public function cancel(Varien_Object $payment)
|
94 |
+
{
|
95 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
96 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
97 |
+
$client->getType('transaction')->cancelTransaction($payment->getData('parent_transaction_id'));
|
98 |
+
|
99 |
+
return $this;
|
100 |
+
}
|
101 |
+
/**
|
102 |
+
* {@inheritdoc}
|
103 |
+
* void the external gateway authorization and cancels the payment
|
104 |
+
* Ideally 'void' should void only external gateway 'auth' and keep the transaction active
|
105 |
+
* A re-auth is possible on a voided txn. Currently Re-Auth is not implemented.
|
106 |
+
*/
|
107 |
+
public function void(Varien_Object $payment)
|
108 |
+
{
|
109 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
110 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
111 |
+
$client->getType('transaction')->cancelTransaction($payment->getData('parent_transaction_id'));
|
112 |
+
|
113 |
+
return $this;
|
114 |
+
}
|
115 |
+
}
|
app/code/community/Minkasu/Wallet/Model/Source/Cctype.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_Source_Cctype extends Mage_Payment_Model_Source_Cctype
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* @var array
|
7 |
+
*/
|
8 |
+
protected $_ccTypes = array('VI', 'MC', 'AE', 'DN', 'DI', 'JCB', 'CUP');
|
9 |
+
|
10 |
+
/**
|
11 |
+
* {@inheritdoc}
|
12 |
+
*/
|
13 |
+
public function getAllowedTypes()
|
14 |
+
{
|
15 |
+
$authNetCcTypes = $this->_getAuthNetCcTypes();
|
16 |
+
$ccTypes = array();
|
17 |
+
|
18 |
+
foreach ($this->_ccTypes as $ccType) {
|
19 |
+
if (in_array($ccType, $authNetCcTypes)) {
|
20 |
+
$ccTypes[] = $ccType;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
return $ccTypes;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @return array
|
29 |
+
*/
|
30 |
+
protected function _getAuthNetCcTypes()
|
31 |
+
{
|
32 |
+
/** @var $paygate Mage_Paygate_Model_Authorizenet */
|
33 |
+
$paygate = Mage::getModel('paygate/authorizenet');
|
34 |
+
$authNetCcTypes = $paygate->getConfigData('cctypes');
|
35 |
+
$authNetCcTypes = explode(',', $authNetCcTypes);
|
36 |
+
return $authNetCcTypes;
|
37 |
+
}
|
38 |
+
}
|
app/code/community/Minkasu/Wallet/Model/Source/Paymentaction.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_Source_Paymentaction
|
4 |
+
{
|
5 |
+
|
6 |
+
public function toOptionArray()
|
7 |
+
{
|
8 |
+
return array(
|
9 |
+
array(
|
10 |
+
'value' => 'authorize',
|
11 |
+
'label' => 'Authorize Only'
|
12 |
+
),
|
13 |
+
array(
|
14 |
+
'value' => 'authorize_capture',
|
15 |
+
'label' => 'Authorize and Capture'
|
16 |
+
),
|
17 |
+
);
|
18 |
+
}
|
19 |
+
}
|
app/code/community/Minkasu/Wallet/Model/System/Config/Backend/AddressPoBoxEnabled.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_System_Config_Backend_AddressPoBoxEnabled extends Mage_Core_Model_Config_Data
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* {@inheritdoc}
|
7 |
+
*/
|
8 |
+
protected function _beforeSave()
|
9 |
+
{
|
10 |
+
parent::_beforeSave();
|
11 |
+
|
12 |
+
if (false === $this->isValueChanged()) {
|
13 |
+
return $this;
|
14 |
+
}
|
15 |
+
try {
|
16 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
17 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
18 |
+
if (!$apiHelper->getApiAccountId() || !$apiHelper->getApiToken()) {
|
19 |
+
Mage::throwException($this->_getHelper()->__('Your Minkasu credentials are empty.'));
|
20 |
+
}
|
21 |
+
|
22 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
23 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
24 |
+
if ('1' === $this->getValue()) {
|
25 |
+
$result = $client->getType('merchant')->enableAddressPoBox();
|
26 |
+
$message = 'You have succesfully enabled P.O.Box.';
|
27 |
+
} else {
|
28 |
+
$result = $client->getType('merchant')->disableAddressPoBox();
|
29 |
+
$message = 'You have succesfully disabled P.O.Box.';
|
30 |
+
}
|
31 |
+
if (isset($result['status']) && 'success' === $result['status']) {
|
32 |
+
$this->_getSession()->addSuccess(
|
33 |
+
$this->_getHelper()->__($message)
|
34 |
+
);
|
35 |
+
} else {
|
36 |
+
$this->_getSession()->addError(
|
37 |
+
$this->_getHelper()->__('An error occurred during changing P.O.Box status.')
|
38 |
+
);
|
39 |
+
}
|
40 |
+
} catch (Exception $e) {
|
41 |
+
$this->_getSession()->addException($e, $e->getMessage());
|
42 |
+
}
|
43 |
+
return $this;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @return Mage_Adminhtml_Model_Session
|
48 |
+
*/
|
49 |
+
protected function _getSession()
|
50 |
+
{
|
51 |
+
return Mage::getSingleton('adminhtml/session');
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* @return Minkasu_Wallet_Helper_Data
|
56 |
+
*/
|
57 |
+
protected function _getHelper()
|
58 |
+
{
|
59 |
+
return Mage::helper('minkasu_wallet');
|
60 |
+
}
|
61 |
+
}
|
app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Cctype.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_System_Config_Backend_Cctype extends Mage_Core_Model_Config_Data
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* {@inheritdoc}
|
7 |
+
*/
|
8 |
+
protected function _beforeSave()
|
9 |
+
{
|
10 |
+
parent::_beforeSave();
|
11 |
+
|
12 |
+
$oldValue = explode(',', $this->getOldValue());
|
13 |
+
if ($this->getValue() === $oldValue) {
|
14 |
+
return $this;
|
15 |
+
}
|
16 |
+
|
17 |
+
try {
|
18 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
19 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
20 |
+
if (!$apiHelper->getApiAccountId() || !$apiHelper->getApiToken()) {
|
21 |
+
Mage::throwException($this->_getHelper()->__('Your Minkasu credentials are empty.'));
|
22 |
+
}
|
23 |
+
|
24 |
+
/** @var $merchantHelper Minkasu_Wallet_Helper_Api_Merchant */
|
25 |
+
$merchantHelper = Mage::helper('minkasu_wallet/api_merchant');
|
26 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
27 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
28 |
+
|
29 |
+
$minkasuCcCodes = array();
|
30 |
+
foreach ($this->getValue() as $magentoCcCode) {
|
31 |
+
$minkasuCcCodes[] = $merchantHelper->getMinkasuCcCode($magentoCcCode);
|
32 |
+
}
|
33 |
+
$result = $client->getType('merchant')->updateCc($minkasuCcCodes);
|
34 |
+
|
35 |
+
if (isset($result['status']) && 'success' === $result['status']) {
|
36 |
+
$this->_getSession()->addSuccess(
|
37 |
+
$this->_getHelper()->__('You have succesfully updated Minkasu CC types.')
|
38 |
+
);
|
39 |
+
} else {
|
40 |
+
$this->_getSession()->addError(
|
41 |
+
$this->_getHelper()->__('An error occurred during changing Minkasu CC types.')
|
42 |
+
);
|
43 |
+
}
|
44 |
+
} catch (Exception $e) {
|
45 |
+
$this->_getSession()->addException($e, $e->getMessage());
|
46 |
+
}
|
47 |
+
return $this;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @return Mage_Adminhtml_Model_Session
|
52 |
+
*/
|
53 |
+
protected function _getSession()
|
54 |
+
{
|
55 |
+
return Mage::getSingleton('adminhtml/session');
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @return Minkasu_Wallet_Helper_Data
|
60 |
+
*/
|
61 |
+
protected function _getHelper()
|
62 |
+
{
|
63 |
+
return Mage::helper('minkasu_wallet');
|
64 |
+
}
|
65 |
+
}
|
app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Double.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_System_Config_Backend_Double extends Mage_Adminhtml_Model_System_Config_Backend_Encrypted
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* {@inheritdoc}
|
7 |
+
*/
|
8 |
+
protected function _beforeSave()
|
9 |
+
{
|
10 |
+
$currentMode = Mage::registry('current_minkasu_mode');
|
11 |
+
|
12 |
+
/** @var $coreHelper Mage_Core_Helper_Data */
|
13 |
+
$coreHelper = Mage::helper('core');
|
14 |
+
$oldValue = $this->getOldValue();
|
15 |
+
$oldValue = $coreHelper->decrypt($oldValue);
|
16 |
+
if ($oldValue) {
|
17 |
+
$value = json_decode($oldValue);
|
18 |
+
$value[$currentMode] = (string) $this->getValue();
|
19 |
+
} else {
|
20 |
+
$value = array($currentMode => (string) $this->getValue());
|
21 |
+
}
|
22 |
+
$this->setValue(json_encode($value));
|
23 |
+
parent::_beforeSave();
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* {@inheritdoc}
|
28 |
+
*/
|
29 |
+
protected function _afterLoad()
|
30 |
+
{
|
31 |
+
parent::_afterLoad();
|
32 |
+
if ($this->getValue()) {
|
33 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
34 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
35 |
+
$value = json_decode($this->getValue(), true);
|
36 |
+
$mode = $apiHelper->getApiMode();
|
37 |
+
if (isset($value[$mode])) {
|
38 |
+
$this->setValue($value[$mode]);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Mode.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_System_Config_Backend_Mode extends Mage_Core_Model_Config_Data
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* {@inheritdoc}
|
7 |
+
*/
|
8 |
+
protected function _beforeSave()
|
9 |
+
{
|
10 |
+
parent::_beforeSave();
|
11 |
+
Mage::register('current_minkasu_mode', $this->getValue() ? $this->getValue() : $this->getOldValue());
|
12 |
+
}
|
13 |
+
}
|
app/code/community/Minkasu/Wallet/Model/System/Config/Backend/Paymentaction.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Minkasu_Wallet_Model_System_Config_Backend_Paymentaction extends Mage_Core_Model_Config_Data
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* {@inheritdoc}
|
7 |
+
*/
|
8 |
+
protected function _beforeSave()
|
9 |
+
{
|
10 |
+
parent::_beforeSave();
|
11 |
+
|
12 |
+
if (false === $this->isValueChanged()) {
|
13 |
+
return $this;
|
14 |
+
}
|
15 |
+
try {
|
16 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
17 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
18 |
+
if (!$apiHelper->getApiAccountId() || !$apiHelper->getApiToken()) {
|
19 |
+
Mage::throwException($this->_getHelper()->__('Your Minkasu credentials are empty.'));
|
20 |
+
}
|
21 |
+
|
22 |
+
/** @var $merchantHelper Minkasu_Wallet_Helper_Api_Merchant */
|
23 |
+
$merchantHelper = Mage::helper('minkasu_wallet/api_merchant');
|
24 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
25 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
26 |
+
$result = $client->getType('merchant')->updatePaymentaction($this->getValue());
|
27 |
+
if (isset($result['status']) && 'success' === $result['status']) {
|
28 |
+
$this->_getSession()->addSuccess(
|
29 |
+
$this->_getHelper()->__('You have succesfully updated Payment Action.')
|
30 |
+
);
|
31 |
+
} else {
|
32 |
+
$this->_getSession()->addError(
|
33 |
+
$this->_getHelper()->__('An error occurred during saving Payment Action.')
|
34 |
+
);
|
35 |
+
}
|
36 |
+
} catch (Exception $e) {
|
37 |
+
$this->_getSession()->addException($e, $e->getMessage());
|
38 |
+
}
|
39 |
+
return $this;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* @return Mage_Adminhtml_Model_Session
|
44 |
+
*/
|
45 |
+
protected function _getSession()
|
46 |
+
{
|
47 |
+
return Mage::getSingleton('adminhtml/session');
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @return Minkasu_Wallet_Helper_Data
|
52 |
+
*/
|
53 |
+
protected function _getHelper()
|
54 |
+
{
|
55 |
+
return Mage::helper('minkasu_wallet');
|
56 |
+
}
|
57 |
+
}
|
app/code/community/Minkasu/Wallet/controllers/Adminhtml/Minkasu/Wallet/MerchantController.php
CHANGED
@@ -55,7 +55,7 @@ class Minkasu_Wallet_Adminhtml_Minkasu_Wallet_MerchantController extends Mage_Ad
|
|
55 |
'business_name' => $postData['name'],
|
56 |
'email' => $postData['email'],
|
57 |
'phone' => $postData['phone'],
|
58 |
-
|
59 |
);
|
60 |
$gatewayData = array(
|
61 |
'login_id' => $postData['authNet_api_login_id'],
|
@@ -66,10 +66,13 @@ class Minkasu_Wallet_Adminhtml_Minkasu_Wallet_MerchantController extends Mage_Ad
|
|
66 |
$client = Mage::getModel('minkasu_wallet/api_client');
|
67 |
$result = $client->getType('merchant')->createMerchant($userData, $gatewayData);
|
68 |
if (isset($result['merchant_id']) && isset($result['minkasu_token'])) {
|
|
|
69 |
$apiHelper = Mage::helper('minkasu_wallet/api');
|
70 |
$apiHelper->saveApiAccountId($result['merchant_id']);
|
71 |
$apiHelper->saveApiToken($result['minkasu_token']);
|
72 |
|
|
|
|
|
73 |
$this->_getSession()->addSuccess(
|
74 |
$this->__('You have successfully created your Minkasu account and added it your Magento configuration.')
|
75 |
);
|
@@ -86,6 +89,40 @@ class Minkasu_Wallet_Adminhtml_Minkasu_Wallet_MerchantController extends Mage_Ad
|
|
86 |
}
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
/**
|
90 |
* Update a Minkasu merchant
|
91 |
*/
|
55 |
'business_name' => $postData['name'],
|
56 |
'email' => $postData['email'],
|
57 |
'phone' => $postData['phone'],
|
58 |
+
'store_url' => Mage::getBaseUrl()
|
59 |
);
|
60 |
$gatewayData = array(
|
61 |
'login_id' => $postData['authNet_api_login_id'],
|
66 |
$client = Mage::getModel('minkasu_wallet/api_client');
|
67 |
$result = $client->getType('merchant')->createMerchant($userData, $gatewayData);
|
68 |
if (isset($result['merchant_id']) && isset($result['minkasu_token'])) {
|
69 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
70 |
$apiHelper = Mage::helper('minkasu_wallet/api');
|
71 |
$apiHelper->saveApiAccountId($result['merchant_id']);
|
72 |
$apiHelper->saveApiToken($result['minkasu_token']);
|
73 |
|
74 |
+
$this->_updateMinkasuCcTypes($result['merchant_id'], $result['minkasu_token']);
|
75 |
+
|
76 |
$this->_getSession()->addSuccess(
|
77 |
$this->__('You have successfully created your Minkasu account and added it your Magento configuration.')
|
78 |
);
|
89 |
}
|
90 |
}
|
91 |
|
92 |
+
/**
|
93 |
+
* @return $this
|
94 |
+
*/
|
95 |
+
protected function _updateMinkasuCcTypes($merchantId, $minkasuToken)
|
96 |
+
{
|
97 |
+
/** @var $client Minkasu_Wallet_Model_Api_Client */
|
98 |
+
$client = Mage::getModel('minkasu_wallet/api_client');
|
99 |
+
/** @var $merchantHelper Minkasu_Wallet_Helper_Api_Merchant */
|
100 |
+
$merchantHelper = Mage::helper('minkasu_wallet/api_merchant');
|
101 |
+
/** @var $paygate Mage_Paygate_Model_Authorizenet */
|
102 |
+
$paygate = Mage::getModel('paygate/authorizenet');
|
103 |
+
|
104 |
+
$authNetCcTypes = $paygate->getConfigData('cctypes');
|
105 |
+
if ($authNetCcTypes) {
|
106 |
+
$authNetCcTypesArray = explode(',', $authNetCcTypes);
|
107 |
+
$minkasuCcCodes = array();
|
108 |
+
foreach ($authNetCcTypesArray as $authNetCcType) {
|
109 |
+
$minkasuCcCodes[] = $merchantHelper->getMinkasuCcCode($authNetCcType);
|
110 |
+
}
|
111 |
+
$data = array(
|
112 |
+
'merchant_acct_id' => $merchantId,
|
113 |
+
'minkasu_token' => $minkasuToken,
|
114 |
+
':id' => $merchantId,
|
115 |
+
'cards_accepted' => $minkasuCcCodes,
|
116 |
+
);
|
117 |
+
$result = $client->getType('merchant')->updatePreference($data);
|
118 |
+
if (isset($result['status']) && 'success' === $result['status']) {
|
119 |
+
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
120 |
+
$apiHelper = Mage::helper('minkasu_wallet/api');
|
121 |
+
$apiHelper->saveCcTypes($authNetCcTypes);
|
122 |
+
}
|
123 |
+
}
|
124 |
+
return $this;
|
125 |
+
}
|
126 |
/**
|
127 |
* Update a Minkasu merchant
|
128 |
*/
|
app/code/community/Minkasu/Wallet/controllers/PaymentController.php
CHANGED
@@ -26,6 +26,40 @@ class Minkasu_Wallet_PaymentController extends Mage_Core_Controller_Front_Action
|
|
26 |
}
|
27 |
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
/**
|
30 |
* Make a payment
|
31 |
*/
|
26 |
}
|
27 |
|
28 |
|
29 |
+
public function applyCouponCodeAction()
|
30 |
+
{
|
31 |
+
$coupon = $this->getRequest()->getParam('coupon_code');
|
32 |
+
$remove = $this->getRequest()->getParam('remove');
|
33 |
+
|
34 |
+
if ($remove == 1) {
|
35 |
+
$coupon = '';
|
36 |
+
}
|
37 |
+
|
38 |
+
try {
|
39 |
+
Mage::getSingleton('checkout/cart')
|
40 |
+
->getQuote()
|
41 |
+
->setCouponCode($coupon)
|
42 |
+
->collectTotals()
|
43 |
+
->save();
|
44 |
+
$applied_coupon = Mage::getSingleton('checkout/cart')
|
45 |
+
->getQuote()
|
46 |
+
->getCouponCode();
|
47 |
+
if ($coupon == $applied_coupon) {
|
48 |
+
$status = "success";
|
49 |
+
} else {
|
50 |
+
$status = "failed";
|
51 |
+
}
|
52 |
+
}
|
53 |
+
catch (Exception $e) {
|
54 |
+
$status = "failed";
|
55 |
+
}
|
56 |
+
|
57 |
+
$result = ["status" => $status];
|
58 |
+
$this->getResponse()->setHeader('Content-type', 'application/json');
|
59 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
/**
|
64 |
* Make a payment
|
65 |
*/
|
app/code/community/Minkasu/Wallet/etc/config.xml
CHANGED
@@ -16,6 +16,27 @@
|
|
16 |
<class>Minkasu_Wallet_Helper</class>
|
17 |
</minkasu_wallet>
|
18 |
</helpers>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
<resources>
|
20 |
<minkasu_wallet_setup>
|
21 |
<setup>
|
@@ -104,6 +125,7 @@
|
|
104 |
<payment_action>authorize</payment_action>
|
105 |
<token backend_model="adminhtml/system_config_backend_encrypted"/>
|
106 |
<estimate_enabled>1</estimate_enabled>
|
|
|
107 |
</minkasu_wallet>
|
108 |
</payment>
|
109 |
</default>
|
16 |
<class>Minkasu_Wallet_Helper</class>
|
17 |
</minkasu_wallet>
|
18 |
</helpers>
|
19 |
+
<payment>
|
20 |
+
<cc>
|
21 |
+
<types>
|
22 |
+
<DN>
|
23 |
+
<code>DN</code>
|
24 |
+
<name>Dinners</name>
|
25 |
+
<order>60</order>
|
26 |
+
</DN>
|
27 |
+
<JSB>
|
28 |
+
<code>JCB</code>
|
29 |
+
<name>JCB</name>
|
30 |
+
<order>70</order>
|
31 |
+
</JSB>
|
32 |
+
<CUP>
|
33 |
+
<code>CUP</code>
|
34 |
+
<name>China Union Pay</name>
|
35 |
+
<order>80</order>
|
36 |
+
</CUP>
|
37 |
+
</types>
|
38 |
+
</cc>
|
39 |
+
</payment>
|
40 |
<resources>
|
41 |
<minkasu_wallet_setup>
|
42 |
<setup>
|
125 |
<payment_action>authorize</payment_action>
|
126 |
<token backend_model="adminhtml/system_config_backend_encrypted"/>
|
127 |
<estimate_enabled>1</estimate_enabled>
|
128 |
+
<address_po_box_enabled>0</address_po_box_enabled>
|
129 |
</minkasu_wallet>
|
130 |
</payment>
|
131 |
</default>
|
app/code/community/Minkasu/Wallet/etc/system.xml
CHANGED
@@ -5,17 +5,18 @@
|
|
5 |
<groups>
|
6 |
<minkasu_wallet translate="label comment" module="minkasu_wallet">
|
7 |
<label>Minkasu. Smartphone Checkout</label>
|
8 |
-
<comment><![CDATA[<a href="#" onclick="
|
9 |
<frontend_model>minkasu_wallet/adminhtml_system_config_frontend_minkasuGroup</frontend_model>
|
10 |
<sort_order>670</sort_order>
|
11 |
<show_in_default>1</show_in_default>
|
12 |
<show_in_website>1</show_in_website>
|
13 |
<show_in_store>1</show_in_store>
|
14 |
<fields>
|
15 |
-
|
16 |
<label>Test Mode</label>
|
17 |
<frontend_type>select</frontend_type>
|
18 |
<frontend_model>minkasu_wallet/adminhtml_system_config_frontend_minkasuMode</frontend_model>
|
|
|
19 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
20 |
<comment><![CDATA[Run against Minkasu LIVE/SandBox Environment.]]></comment>
|
21 |
<sort_order>10</sort_order>
|
@@ -23,15 +24,6 @@
|
|
23 |
<show_in_website>1</show_in_website>
|
24 |
<show_in_store>0</show_in_store>
|
25 |
</mode>
|
26 |
-
<!--mode>
|
27 |
-
<label>Mode</label>
|
28 |
-
<frontend_type>select</frontend_type>
|
29 |
-
<source_model>minkasu_wallet/source_api_mode</source_model>
|
30 |
-
<sort_order>10</sort_order>
|
31 |
-
<show_in_default>1</show_in_default>
|
32 |
-
<show_in_website>1</show_in_website>
|
33 |
-
<show_in_store>0</show_in_store>
|
34 |
-
</mode-->
|
35 |
<separator>
|
36 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
37 |
<sort_order>20</sort_order>
|
@@ -73,7 +65,7 @@
|
|
73 |
<label>Account Id</label>
|
74 |
<comment><![CDATA[This data is stored encrypted in the database.]]></comment>
|
75 |
<frontend_type>text</frontend_type>
|
76 |
-
<backend_model>
|
77 |
<sort_order>60</sort_order>
|
78 |
<show_in_default>1</show_in_default>
|
79 |
<show_in_website>1</show_in_website>
|
@@ -83,7 +75,7 @@
|
|
83 |
<label>Token</label>
|
84 |
<comment><![CDATA[This data is stored encrypted in the database.]]></comment>
|
85 |
<frontend_type>text</frontend_type>
|
86 |
-
<backend_model>
|
87 |
<sort_order>70</sort_order>
|
88 |
<show_in_default>1</show_in_default>
|
89 |
<show_in_website>1</show_in_website>
|
@@ -107,6 +99,38 @@
|
|
107 |
<show_in_website>1</show_in_website>
|
108 |
<show_in_store>0</show_in_store>
|
109 |
</estimate_enabled>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
</fields>
|
111 |
</minkasu_wallet>
|
112 |
</groups>
|
5 |
<groups>
|
6 |
<minkasu_wallet translate="label comment" module="minkasu_wallet">
|
7 |
<label>Minkasu. Smartphone Checkout</label>
|
8 |
+
<comment><![CDATA[<a id="create_edit_mechant" href="#" style="margin:0" onclick="%s; return false;">%s</a> / <a style="margin:0" href="%s" target="_blank">%s</a>]]></comment>
|
9 |
<frontend_model>minkasu_wallet/adminhtml_system_config_frontend_minkasuGroup</frontend_model>
|
10 |
<sort_order>670</sort_order>
|
11 |
<show_in_default>1</show_in_default>
|
12 |
<show_in_website>1</show_in_website>
|
13 |
<show_in_store>1</show_in_store>
|
14 |
<fields>
|
15 |
+
<mode>
|
16 |
<label>Test Mode</label>
|
17 |
<frontend_type>select</frontend_type>
|
18 |
<frontend_model>minkasu_wallet/adminhtml_system_config_frontend_minkasuMode</frontend_model>
|
19 |
+
<backend_model>minkasu_wallet/system_config_backend_mode</backend_model>
|
20 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
21 |
<comment><![CDATA[Run against Minkasu LIVE/SandBox Environment.]]></comment>
|
22 |
<sort_order>10</sort_order>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>0</show_in_store>
|
26 |
</mode>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
<separator>
|
28 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
29 |
<sort_order>20</sort_order>
|
65 |
<label>Account Id</label>
|
66 |
<comment><![CDATA[This data is stored encrypted in the database.]]></comment>
|
67 |
<frontend_type>text</frontend_type>
|
68 |
+
<backend_model>minkasu_wallet/system_config_backend_double</backend_model>
|
69 |
<sort_order>60</sort_order>
|
70 |
<show_in_default>1</show_in_default>
|
71 |
<show_in_website>1</show_in_website>
|
75 |
<label>Token</label>
|
76 |
<comment><![CDATA[This data is stored encrypted in the database.]]></comment>
|
77 |
<frontend_type>text</frontend_type>
|
78 |
+
<backend_model>minkasu_wallet/system_config_backend_double</backend_model>
|
79 |
<sort_order>70</sort_order>
|
80 |
<show_in_default>1</show_in_default>
|
81 |
<show_in_website>1</show_in_website>
|
99 |
<show_in_website>1</show_in_website>
|
100 |
<show_in_store>0</show_in_store>
|
101 |
</estimate_enabled>
|
102 |
+
<address_po_box_enabled translate="label">
|
103 |
+
<label><![CDATA[Enable Address with P.O.Box]]></label>
|
104 |
+
<frontend_type>select</frontend_type>
|
105 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
106 |
+
<backend_model>minkasu_wallet/system_config_backend_addressPoBoxEnabled</backend_model>
|
107 |
+
<sort_order>100</sort_order>
|
108 |
+
<show_in_default>1</show_in_default>
|
109 |
+
<show_in_website>1</show_in_website>
|
110 |
+
<show_in_store>0</show_in_store>
|
111 |
+
</address_po_box_enabled>
|
112 |
+
<payment_action translate="label">
|
113 |
+
<label><![CDATA[Payment Action]]></label>
|
114 |
+
<frontend_type>select</frontend_type>
|
115 |
+
<source_model>minkasu_wallet/source_paymentaction</source_model>
|
116 |
+
<!--frontend_model>minkasu_wallet/adminhtml_system_config_frontend_paymentaction</frontend_model-->
|
117 |
+
<backend_model>minkasu_wallet/system_config_backend_paymentaction</backend_model>
|
118 |
+
<sort_order>110</sort_order>
|
119 |
+
<show_in_default>1</show_in_default>
|
120 |
+
<show_in_website>1</show_in_website>
|
121 |
+
<show_in_store>0</show_in_store>
|
122 |
+
</payment_action>
|
123 |
+
<cctypes translate="label">
|
124 |
+
<label>Credit Card Types</label>
|
125 |
+
<frontend_type>multiselect</frontend_type>
|
126 |
+
<frontend_model>minkasu_wallet/adminhtml_system_config_frontend_cctype</frontend_model>
|
127 |
+
<backend_model>minkasu_wallet/system_config_backend_cctype</backend_model>
|
128 |
+
<source_model>minkasu_wallet/source_cctype</source_model>
|
129 |
+
<sort_order>120</sort_order>
|
130 |
+
<show_in_default>1</show_in_default>
|
131 |
+
<show_in_website>1</show_in_website>
|
132 |
+
<show_in_store>0</show_in_store>
|
133 |
+
</cctypes>
|
134 |
</fields>
|
135 |
</minkasu_wallet>
|
136 |
</groups>
|
app/design/adminhtml/default/default/template/minkasu/wallet/merchant/popup.phtml
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
3 |
$apiHelper = Mage::helper('minkasu_wallet/api');
|
4 |
-
$
|
5 |
?>
|
6 |
<script type="text/javascript">
|
7 |
function openCreateMerchantPopup() {
|
8 |
-
var url = '<?php echo $this->getUrl('adminhtml/minkasu_wallet_merchant/
|
9 |
var loadingMask = $('loading-mask');
|
10 |
|
11 |
if ($('browser_window') && typeof(Windows) != 'undefined') {
|
@@ -19,7 +19,39 @@
|
|
19 |
className:'magento',
|
20 |
windowClassName:'popup-window',
|
21 |
width:600,
|
22 |
-
height
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
zIndex:1000,
|
24 |
recenterAuto:true,
|
25 |
hideEffect:Element.hide,
|
1 |
<?php
|
2 |
/** @var $apiHelper Minkasu_Wallet_Helper_Api */
|
3 |
$apiHelper = Mage::helper('minkasu_wallet/api');
|
4 |
+
$doesMerchantExist = $apiHelper->getApiAccountId() && $apiHelper->getApiToken();
|
5 |
?>
|
6 |
<script type="text/javascript">
|
7 |
function openCreateMerchantPopup() {
|
8 |
+
var url = '<?php echo $this->getUrl('adminhtml/minkasu_wallet_merchant/create') ?>';
|
9 |
var loadingMask = $('loading-mask');
|
10 |
|
11 |
if ($('browser_window') && typeof(Windows) != 'undefined') {
|
19 |
className:'magento',
|
20 |
windowClassName:'popup-window',
|
21 |
width:600,
|
22 |
+
height:335,
|
23 |
+
zIndex:1000,
|
24 |
+
recenterAuto:true,
|
25 |
+
hideEffect:Element.hide,
|
26 |
+
showEffect:function() {
|
27 |
+
loadingMask.style.zIndex = Windows.maxZIndex + 2;
|
28 |
+
loadingMask.show();
|
29 |
+
},
|
30 |
+
id:'browser_window',
|
31 |
+
url:url,
|
32 |
+
onload:function() {
|
33 |
+
loadingMask.hide();
|
34 |
+
Element.show('browser_window');
|
35 |
+
}
|
36 |
+
});
|
37 |
+
}
|
38 |
+
|
39 |
+
function openEditMerchantPopup() {
|
40 |
+
var url = '<?php echo $this->getUrl('adminhtml/minkasu_wallet_merchant/edit') ?>';
|
41 |
+
var loadingMask = $('loading-mask');
|
42 |
+
|
43 |
+
if ($('browser_window') && typeof(Windows) != 'undefined') {
|
44 |
+
Windows.focus('browser_window');
|
45 |
+
return;
|
46 |
+
}
|
47 |
+
var dialogWindow = Dialog.info(null, {
|
48 |
+
closable:true,
|
49 |
+
resizable:false,
|
50 |
+
draggable:false,
|
51 |
+
className:'magento',
|
52 |
+
windowClassName:'popup-window',
|
53 |
+
width:600,
|
54 |
+
height:200,
|
55 |
zIndex:1000,
|
56 |
recenterAuto:true,
|
57 |
hideEffect:Element.hide,
|
app/design/frontend/base/default/template/minkasu/wallet/pay.phtml
CHANGED
@@ -194,7 +194,7 @@ var showShippingOptions = function() {
|
|
194 |
}
|
195 |
|
196 |
so_el.append("<select name=\"mk_shipping_option\" " +
|
197 |
-
|
198 |
"font-family: Open Sans; font-size: 13px; height: auto; margin: 0px; padding: 4px; width: 100%\">" + shipping_option_elems + "</select>");
|
199 |
so_el.find('[name="mk_shipping_option"]').change(function() {
|
200 |
var current_shipping_option = $(this).val();
|
@@ -237,16 +237,41 @@ var getShippingRates = function(cb_fn) {
|
|
237 |
|
238 |
};
|
239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
var updateCartPriceEstimateWithZip = function(zip) {
|
242 |
|
243 |
jQuery.cors = true;
|
244 |
var req_data = { };
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
_getStateAndCityFromZip(zip, function(error, address_info) {
|
247 |
|
248 |
if (error) {
|
249 |
-
errorMsg = "
|
250 |
window.alert(errorMsg);
|
251 |
return;
|
252 |
}
|
@@ -284,9 +309,11 @@ var updateCartPriceEstimateWithDiscount = function(discount_code) {
|
|
284 |
|
285 |
jQuery.cors = true;
|
286 |
var req_data = { };
|
|
|
287 |
|
288 |
if (!discount_code || discount_code.length == 0) {
|
289 |
req_data["remove"] = "1";
|
|
|
290 |
} else {
|
291 |
req_data["coupon_code"] = discount_code;
|
292 |
}
|
@@ -294,14 +321,25 @@ var updateCartPriceEstimateWithDiscount = function(discount_code) {
|
|
294 |
$("#mk_shipping_est_table").find("#inprogress_indicator").show();
|
295 |
|
296 |
$.ajax({
|
297 |
-
url: '<?php echo $this->getUrl("
|
298 |
type:'post',
|
299 |
data: $.param(req_data),
|
300 |
success: function(resp) {
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
},
|
303 |
error: function(jqXHR, textStatus, errorThrown) {
|
304 |
-
errorMsg = "Error
|
305 |
window.alert(errorMsg);
|
306 |
$("#mk_shipping_est_table").find("#inprogress_indicator").hide();
|
307 |
return;
|
@@ -344,40 +382,24 @@ var minkasu_session_ready_for_chkout = function() {
|
|
344 |
<?php else: ?>
|
345 |
if (hide_default_estimate_block && $(".shipping").is(":hidden")) {
|
346 |
$(".shipping").show("slow", function() {
|
347 |
-
alert("Please estimate shipping and taxes and retry.");
|
348 |
});
|
349 |
} else {
|
350 |
-
alert("Please estimate shipping and taxes and retry.");
|
351 |
}
|
352 |
return false;
|
353 |
<?php endif; ?>
|
354 |
|
355 |
};
|
356 |
|
357 |
-
|
|
|
358 |
|
359 |
var minkasu_get_txnid_fn = function(mk_data) {
|
360 |
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
$data = NULL;
|
365 |
-
$shippingAddress = $quote->getShippingAddress();
|
366 |
-
if ($shippingAddress != NULL) {
|
367 |
-
$expectedAddress = ($shippingAddress->exportCustomerAddress());
|
368 |
-
if ($expectedAddress != NULL) {
|
369 |
-
$data = $expectedAddress->getData();
|
370 |
-
}
|
371 |
-
}
|
372 |
-
if (($data != NULL) &&
|
373 |
-
($minkasu_exp_zip && ($minkasu_exp_zip == $data["postcode"])) &&
|
374 |
-
($minkasu_exp_state && ($minkasu_exp_state == $data["region"]))): ?>
|
375 |
-
console.log("Transaction id requested when already present.");
|
376 |
-
mk_data.error("Transaction id requested when already present.");
|
377 |
-
return;
|
378 |
-
<?php endif; ?>
|
379 |
-
<?php endif; ?>
|
380 |
-
console.log("Updating transaction...");
|
381 |
$.ajax({
|
382 |
url: '<?php echo $this->getUrl('minkasu_wallet/transaction/update') ?>',
|
383 |
type: 'post',
|
@@ -398,7 +420,11 @@ var minkasu_get_txnid_fn = function(mk_data) {
|
|
398 |
}
|
399 |
});
|
400 |
return;
|
401 |
-
|
|
|
|
|
|
|
|
|
402 |
console.log("Creating transaction...");
|
403 |
$.ajax({
|
404 |
url: '<?php echo $this->getUrl('minkasu_wallet/transaction/create') ?>',
|
@@ -410,6 +436,8 @@ var minkasu_get_txnid_fn = function(mk_data) {
|
|
410 |
mk_data.error(resp.error);
|
411 |
} else {
|
412 |
mk_data.success({"txn_id": resp.txn_id, "payment_code": resp.payment_code, "payment_code_ttl": resp.payment_code_ttl});
|
|
|
|
|
413 |
}
|
414 |
return;
|
415 |
},
|
@@ -419,6 +447,39 @@ var minkasu_get_txnid_fn = function(mk_data) {
|
|
419 |
return;
|
420 |
}
|
421 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
<?php endif; ?>
|
423 |
|
424 |
};
|
194 |
}
|
195 |
|
196 |
so_el.append("<select name=\"mk_shipping_option\" " +
|
197 |
+
"style=\"background-color: white; border-color: #999999; box-sizing: border-box; color: #333333; " +
|
198 |
"font-family: Open Sans; font-size: 13px; height: auto; margin: 0px; padding: 4px; width: 100%\">" + shipping_option_elems + "</select>");
|
199 |
so_el.find('[name="mk_shipping_option"]').change(function() {
|
200 |
var current_shipping_option = $(this).val();
|
237 |
|
238 |
};
|
239 |
|
240 |
+
function zip_code_is_valid(zip) {
|
241 |
+
|
242 |
+
var trim_zip = zip.trim();
|
243 |
+
|
244 |
+
if (trim_zip.length != 5) {
|
245 |
+
return false;
|
246 |
+
}
|
247 |
+
|
248 |
+
for (var i = 0; i < 5; i++) {
|
249 |
+
var next_char_code = trim_zip.charCodeAt(i);
|
250 |
+
if ((next_char_code < 48) || (next_char_code > 57)) {
|
251 |
+
return false;
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
return true;
|
256 |
+
|
257 |
+
}
|
258 |
+
|
259 |
|
260 |
var updateCartPriceEstimateWithZip = function(zip) {
|
261 |
|
262 |
jQuery.cors = true;
|
263 |
var req_data = { };
|
264 |
|
265 |
+
if (!(zip_code_is_valid(zip))) {
|
266 |
+
errorMsg = "Please enter a valid zip code.";
|
267 |
+
window.alert(errorMsg);
|
268 |
+
return;
|
269 |
+
}
|
270 |
+
|
271 |
_getStateAndCityFromZip(zip, function(error, address_info) {
|
272 |
|
273 |
if (error) {
|
274 |
+
errorMsg = "Please enter a valid zip code.";
|
275 |
window.alert(errorMsg);
|
276 |
return;
|
277 |
}
|
309 |
|
310 |
jQuery.cors = true;
|
311 |
var req_data = { };
|
312 |
+
var remove_code = false;
|
313 |
|
314 |
if (!discount_code || discount_code.length == 0) {
|
315 |
req_data["remove"] = "1";
|
316 |
+
remove_code = true;
|
317 |
} else {
|
318 |
req_data["coupon_code"] = discount_code;
|
319 |
}
|
321 |
$("#mk_shipping_est_table").find("#inprogress_indicator").show();
|
322 |
|
323 |
$.ajax({
|
324 |
+
url: '<?php echo $this->getUrl("minkasu_wallet/payment/applyCouponCode") ?>',
|
325 |
type:'post',
|
326 |
data: $.param(req_data),
|
327 |
success: function(resp) {
|
328 |
+
console.log("Resp recevied for coupon code - " + JSON.stringify(resp));
|
329 |
+
if (resp.status == "success") {
|
330 |
+
// alert("Coupon code applied.");
|
331 |
+
window.location.reload();
|
332 |
+
} else {
|
333 |
+
var alert_msg = "Please enter a valid coupon code.";
|
334 |
+
if (remove_code) {
|
335 |
+
alert_msg = "Unable to remove coupon. Unknown error";
|
336 |
+
}
|
337 |
+
window.alert(alert_msg);
|
338 |
+
$("#mk_shipping_est_table").find("#inprogress_indicator").hide();
|
339 |
+
}
|
340 |
},
|
341 |
error: function(jqXHR, textStatus, errorThrown) {
|
342 |
+
errorMsg = "Error applying discount code: " + textStatus + "; \n" + errorThrown + "\n" + JSON.stringify(jqXHR);
|
343 |
window.alert(errorMsg);
|
344 |
$("#mk_shipping_est_table").find("#inprogress_indicator").hide();
|
345 |
return;
|
382 |
<?php else: ?>
|
383 |
if (hide_default_estimate_block && $(".shipping").is(":hidden")) {
|
384 |
$(".shipping").show("slow", function() {
|
385 |
+
alert("Please enter your zip code to estimate your shipping and taxes and retry.");
|
386 |
});
|
387 |
} else {
|
388 |
+
alert("Please enter your zip code to estimate your shipping and taxes and retry.");
|
389 |
}
|
390 |
return false;
|
391 |
<?php endif; ?>
|
392 |
|
393 |
};
|
394 |
|
395 |
+
var txn_created = false;
|
396 |
+
var created_txn_id = null;
|
397 |
|
398 |
var minkasu_get_txnid_fn = function(mk_data) {
|
399 |
|
400 |
+
var update_txn_fn = function() {
|
401 |
+
|
402 |
+
console.log("Updating transaction...");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
$.ajax({
|
404 |
url: '<?php echo $this->getUrl('minkasu_wallet/transaction/update') ?>',
|
405 |
type: 'post',
|
420 |
}
|
421 |
});
|
422 |
return;
|
423 |
+
|
424 |
+
};
|
425 |
+
|
426 |
+
var create_txn_fn = function() {
|
427 |
+
|
428 |
console.log("Creating transaction...");
|
429 |
$.ajax({
|
430 |
url: '<?php echo $this->getUrl('minkasu_wallet/transaction/create') ?>',
|
436 |
mk_data.error(resp.error);
|
437 |
} else {
|
438 |
mk_data.success({"txn_id": resp.txn_id, "payment_code": resp.payment_code, "payment_code_ttl": resp.payment_code_ttl});
|
439 |
+
txn_created = true;
|
440 |
+
created_txn_id = resp.txn_id;
|
441 |
}
|
442 |
return;
|
443 |
},
|
447 |
return;
|
448 |
}
|
449 |
});
|
450 |
+
|
451 |
+
};
|
452 |
+
|
453 |
+
<?php if ($minkasu_txn_id && $minkasu_bill_number == $quote->getId()): ?>
|
454 |
+
<?php if ($minkasu_amount == $quote->getGrandTotal()): ?>
|
455 |
+
<?php
|
456 |
+
$data = NULL;
|
457 |
+
$shippingAddress = $quote->getShippingAddress();
|
458 |
+
if ($shippingAddress != NULL) {
|
459 |
+
$expectedAddress = ($shippingAddress->exportCustomerAddress());
|
460 |
+
if ($expectedAddress != NULL) {
|
461 |
+
$data = $expectedAddress->getData();
|
462 |
+
}
|
463 |
+
}
|
464 |
+
if (($data != NULL) &&
|
465 |
+
($minkasu_exp_zip && ($minkasu_exp_zip == $data["postcode"])) &&
|
466 |
+
($minkasu_exp_state && ($minkasu_exp_state == $data["region"]))): ?>
|
467 |
+
console.log("Transaction id requested when already present.");
|
468 |
+
mk_data.error("Transaction id requested when already present.");
|
469 |
+
return;
|
470 |
+
<?php endif; ?>
|
471 |
+
<?php endif; ?>
|
472 |
+
|
473 |
+
update_txn_fn();
|
474 |
+
|
475 |
+
<?php else: ?>
|
476 |
+
|
477 |
+
if (txn_created) {
|
478 |
+
update_txn_fn();
|
479 |
+
} else {
|
480 |
+
create_txn_fn();
|
481 |
+
}
|
482 |
+
|
483 |
<?php endif; ?>
|
484 |
|
485 |
};
|
app/design/frontend/ultimo/default/template/minkasu/wallet/estimate_box.phtml
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/** @var $_apiHelper Minkasu_Wallet_Helper_Api */
|
4 |
+
$_apiHelper = Mage::helper('minkasu_wallet/api');
|
5 |
+
$_apiEstimateEnabled = $_apiHelper->isApiEstimateEnabled();
|
6 |
+
|
7 |
+
$show_minkasu_estimate_box = $_apiEstimateEnabled;
|
8 |
+
|
9 |
+
?>
|
10 |
+
|
11 |
+
<?php if ($show_minkasu_estimate_box) : ?>
|
12 |
+
|
13 |
+
<div id="mk_shipping_est_div" style="/* display: block; */ /* overflow: auto */">
|
14 |
+
<table style="border: 0px; margin:0px;width: 100%;"><tbody><tr>
|
15 |
+
<td style="border: 0px; padding: 0px; padding-bottom: 20px; padding-top: 0px;">
|
16 |
+
|
17 |
+
<table id="mk_shipping_est_table" style="background-color: #E7F6F0; border: 1px solid #19D383; border-collapse: separate; border-spacing: 0px; border-radius: 3px; margin: 0px; padding-bottom: 10px; /* padding-left: 15px; */ /* padding-right: 15px; */ padding-top: 15px; max-width: 215px; width: 100%; float: right">
|
18 |
+
|
19 |
+
<tbody><tr>
|
20 |
+
<td style="border: 0px; padding-bottom: 5px; padding-left: 7px; padding-right: 5px; padding-top:0px; vertical-align: middle">
|
21 |
+
<input type="text" id="ship_zip" style="background-color: white; border-color: #999999; box-sizing: content-box; color: #999999; font-family: Open Sans; font-size: 13px; font-style: italic; height: 16px; margin: 0px; padding: 4px; width: 65px;" value="Zip code">
|
22 |
+
</td>
|
23 |
+
<td style="border: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 5px; padding-top:0px; vertical-align: middle">
|
24 |
+
<input type="button" id="mk_cart_est_btn" value="Estimate Shipping" style="background-color: #F2F2F2; border-color: #999999; border-radius: 2px; border-width: 1px; color: #333333; font-family: Open Sans; font-size: 12px; font-weight: 600; height: 28px; margin: 0px; padding: 4px; width: 115px;">
|
25 |
+
</td>
|
26 |
+
</tr>
|
27 |
+
|
28 |
+
<tr id="discount_code_row" style="display:none">
|
29 |
+
|
30 |
+
<td style="border: 0px; padding-bottom: 5px; padding-left: 7px; padding-right: 5px; padding-top:5px; vertical-align: middle">
|
31 |
+
<input type="text" id="discount_code" style="background-color: white; border-color: #999999; box-sizing: content-box; color: #999999; font-family: Open Sans; font-size: 13px; font-style: italic; height: 16px; margin: 0px; padding: 4px; width: 65px;" value="Coupon">
|
32 |
+
</td>
|
33 |
+
<td style="border: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 5px; padding-top:5px; vertical-align: middle">
|
34 |
+
<input type="button" id="mk_cart_apply_btn" value="Apply" style="background-color: #F2F2F2; border-color: #999999; border-radius: 2px; border-width: 1px; color: #333333; font-family: Open Sans; font-size: 12px; font-weight: 600; height: 28px; margin: 0px; padding: 4px; width: 115px;">
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
+
|
38 |
+
<tr id="inprogress_indicator" style="display:none">
|
39 |
+
<td colspan="2" style="border: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top:5px; text-align:center">
|
40 |
+
<img src="https://transactions.minkasu.com/images/spinning_wheel.gif" pagespeed_url_hash="632911007" onload="pagespeed.CriticalImages.checkImageForCriticality(this);" style="margin-left:auto; margin-right:auto">
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
|
44 |
+
<tr id="shipping_method_label_row" style="display:none" >
|
45 |
+
<td colspan="2" style="padding-left:5px; margin-left: 0px; padding-top: 5px ">
|
46 |
+
<p style="font-family: Open Sans; font-size: 12px; font-weight: 600; text-align:left;"> Shipping Method: </p>
|
47 |
+
</td>
|
48 |
+
</tr>
|
49 |
+
|
50 |
+
<tr id="shipping_options_row" style="display:none">
|
51 |
+
|
52 |
+
<td id="shipping_options_cell" colspan="2" style="border: 0px; padding-bottom: 5px; padding-left: 7px; padding-right: 8px; padding-top: 5px">
|
53 |
+
</td>
|
54 |
+
</tr>
|
55 |
+
|
56 |
+
<tr><td colspan="2" style="border: 0px; padding-bottom: 5px; padding-left: 0px; padding-right: 0px; padding-top:5px;"></td></tr>
|
57 |
+
|
58 |
+
<tr>
|
59 |
+
<td id="mk_checkout_td" colspan="2" style="border: 0px; border-top: 1px solid #DDDDDD; padding-bottom: 0px; padding-left: 0px; padding-right: 21px; padding-top:10px;/* text-align: center; */">
|
60 |
+
<div id="minkasu_payment_div"> </div>
|
61 |
+
<div class="buttons" style="height: 45px;">
|
62 |
+
<div class="right">
|
63 |
+
<input type="button" value="Checkout with Smart Phone (Minkasu)" id="button-mk-chkout" class="button" />
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
</td>
|
67 |
+
</tr>
|
68 |
+
|
69 |
+
</table>
|
70 |
+
|
71 |
+
</td></tr>
|
72 |
+
</table>
|
73 |
+
|
74 |
+
</div>
|
75 |
+
|
76 |
+
|
77 |
+
<?php else: ?>
|
78 |
+
|
79 |
+
<div class="row">
|
80 |
+
<div class="col-sm-12" style="text-align:right" id="minkasu_payment_div"></div>
|
81 |
+
</div>
|
82 |
+
|
83 |
+
<div class="buttons" style="height: 45px;">
|
84 |
+
<div class="right">
|
85 |
+
<input type="button" value="Checkout with Smart Phone (Minkasu)" id="button-mk-chkout" class="button" />
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
<?php endif; ?>
|
package.xml
CHANGED
@@ -1,20 +1,21 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>minkasu_smartphone_checkout</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Enjoy higher conversion and greater security by offering a smartphone checkout option for your customers </summary>
|
10 |
<description>Enjoy higher conversion and greater security by offering a smartphone checkout option for your customers </description>
|
11 |
-
<notes>-
|
12 |
-
-support for
|
13 |
-
|
|
|
14 |
<authors><author><name>Minkasu Inc</name><user>it-admin</user><email>it-admin@minkasu.com</email></author></authors>
|
15 |
-
<date>2015-
|
16 |
-
<time>
|
17 |
-
<contents><target name="magecommunity"><dir name="Minkasu"><dir name="Wallet"><dir name="Block"><dir name="Adminhtml"><dir name="Merchant"><dir name="Create"><file name="Form.php" hash="77e288884729c197292d3799b2094d7b"/><file name="Success.php" hash="d1ed1419a27fed884c9d8d83eef9546c"/></dir><file name="Create.php" hash="108bac82be521ce9a98ffdcd716c7b4c"/><dir name="Edit"><file name="Form.php" hash="6d98746a2004442e70d6fa1e0c243723"/></dir><file name="Edit.php" hash="2c0b329a6f6df4af99da5c6407c280c8"/></dir><dir name="System"><dir name="Config"><dir name="Frontend"><file name="MinkasuGroup.php" hash="
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php></required></dependencies>
|
20 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>minkasu_smartphone_checkout</name>
|
4 |
+
<version>1.2.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>MITL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Enjoy higher conversion and greater security by offering a smartphone checkout option for your customers </summary>
|
10 |
<description>Enjoy higher conversion and greater security by offering a smartphone checkout option for your customers </description>
|
11 |
+
<notes>- more admin config
|
12 |
+
- support for more themes
|
13 |
+
- general UX enhancement
|
14 |
+
- https enabled</notes>
|
15 |
<authors><author><name>Minkasu Inc</name><user>it-admin</user><email>it-admin@minkasu.com</email></author></authors>
|
16 |
+
<date>2015-08-17</date>
|
17 |
+
<time>21:35:39</time>
|
18 |
+
<contents><target name="magecommunity"><dir name="Minkasu"><dir name="Wallet"><dir name="Block"><dir name="Adminhtml"><dir name="Merchant"><dir name="Create"><file name="Form.php" hash="77e288884729c197292d3799b2094d7b"/><file name="Success.php" hash="d1ed1419a27fed884c9d8d83eef9546c"/></dir><file name="Create.php" hash="108bac82be521ce9a98ffdcd716c7b4c"/><dir name="Edit"><file name="Form.php" hash="6d98746a2004442e70d6fa1e0c243723"/></dir><file name="Edit.php" hash="2c0b329a6f6df4af99da5c6407c280c8"/></dir><dir name="System"><dir name="Config"><dir name="Frontend"><file name="Cctype.php" hash="e236b1263378f894b7becf3852b1027e"/><file name="MinkasuGroup.php" hash="2fb103ce6e246972636dbfc4dd77bc42"/><file name="MinkasuMode.php" hash="f877b4be92ee3f869b6e42f0e1916a1b"/><file name="Paymentaction.php" hash="91420a5a4f610bf48821d51d688bc079"/></dir></dir></dir></dir><file name="Pay.php" hash="6545b86f80ab7a1aa43ddaaecce48112"/></dir><dir name="Helper"><dir name="Api"><file name="Merchant.php" hash="8192234ddd243022df5298171349321c"/></dir><file name="Api.php" hash="0852f37381c1a58779926e27cab070b5"/><file name="Api.php.bak" hash="c5879aedfd087be2d60c0b8cf6c5c0eb"/><file name="Data.php" hash="004ff5e827b9a2981019f421c7be01a9"/></dir><dir name="Model"><dir name="Api"><dir name="Adapter"><file name="Abstract.php" hash="2c35170bc831f3884c9351716ca55030"/><file name="Curl.php" hash="0f64beb2ed75a3cadcb9b264b7c10eb9"/></dir><file name="Client.php" hash="8575b8b0d52635b0ec5942d2ace4dba6"/><dir name="Format"><file name="Abstract.php" hash="011af2c9cd958efffbba03e411cc1627"/><file name="Json.php" hash="f32759fe608158aede8c39d4816b8236"/></dir><dir name="Type"><file name="Abstract.php" hash="df9ed9fa6e616f233c7e01d7943ee709"/><file name="Merchant.php" hash="96e782e3756f5753c46a36f1aa6970f8"/><file name="Transaction.php" hash="3365045471a509166827e7a86eb9e4ab"/><file name="Transaction.php~" hash="23545e15da56da3800c12a4ad6ce5139"/></dir></dir><file name="Observer.php" hash="e6492743eb60b10fdaee95536149ee2d"/><file name="Observer.php~" hash="9c3277299b811406040d738af4ce5d59"/><file name="Payment.php" hash="61aeb4f7d7e5872401de43c87711d3f3"/><file name="Payment.php.bak" hash="b2010fb5443edc1543472d5df2b10a7c"/><dir name="Source"><dir name="Api"><file name="Mode.php" hash="0e479fee542ff543ad1e3a2206b74acf"/></dir><file name="Cctype.php" hash="833ab97e39326b25cf13c644866493fb"/><file name="Paymentaction.php" hash="04bb331b86110d118254d49bd96aa33d"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="AddressPoBoxEnabled.php" hash="9795465148b90b598fe811809ca591c0"/><file name="Cctype.php" hash="08fbfe643918fad60eb5fc1140616f85"/><file name="Double.php" hash="a9fc25c67caf2db75af89a85b188ad80"/><file name="MinkasuStatus.php" hash="3d1b41d010c4ec15311beebce2e88ae5"/><file name="Mode.php" hash="8f5e497d6dceff432ce5b6dc11400bb9"/><file name="Paymentaction.php" hash="fc061be2e85fd8303bcd1da95198a3e2"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Minkasu"><dir name="Wallet"><file name="MerchantController.php" hash="c892302a1883c417b56628ec43172a27"/></dir></dir></dir><file name="PaymentController.php" hash="30f77a1220d4bd1d60bd122e166c1654"/><file name="PaymentController.php.bk" hash="cac0b113f5ecf0effcc8d6f6c60faca6"/><file name="PaymentController.php.old" hash="981afd634443bc7998c76ec99c286e99"/><file name="PaymentController.php~" hash="229a669ed1748eacac248ee3bb85c157"/><file name="TransactionController.php" hash="361617e656a59979d886fe54cf2328a5"/><file name="TransactionController.php~" hash="7ba1f617632e7b7685e8d521c9134b01"/></dir><dir name="etc"><file name="config.xml" hash="0e57aadb4fb25f1e068300643a8b2edb"/><file name="system.xml" hash="de2d3991b9ee4fc0faeea99793020101"/></dir><dir name="sql"><dir name="minkasu_wallet_setup"><file name="install-0.0.0.1.php" hash="ccbed051e0d98bf2fa167ea7b13edb4f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Minkasu_Wallet.xml" hash="a8daca594f8108b5fd5f28b04842fa91"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="minkasu_wallet.xml" hash="95ca0132f2696fd91c0a67922030c8a2"/></dir><dir name="template"><dir name="minkasu"><dir name="wallet"><dir name="merchant"><dir name="create"><file name="success.phtml" hash="fec665badf6dc1032514ac0dd3b31996"/></dir><file name="popup.phtml" hash="5e4050fa03cee52c263d259383ae0308"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="minkasu_wallet.xml" hash="383412265ce51df29662f23f1e3accea"/></dir><dir name="template"><dir name="minkasu"><dir name="wallet"><file name="pay.phtml" hash="75e573f9105bb6aae851276381a99e45"/><file name="estimate_box.phtml" hash="5162820b71379e5f25e3333a17184e16"/></dir></dir></dir></dir></dir><dir name="gravdept"><dir name="acumen"><dir name="template"><dir name="minkasu"><dir name="wallet"><file name="estimate_box.phtml" hash="7c839278df79b217ad5f53a24ad8b32d"/></dir></dir></dir></dir></dir><dir name="ultimo"><dir name="default"><dir name="template"><dir name="minkasu"><dir name="wallet"><file name="estimate_box.phtml" hash="ae5dfa221ce237e9f8567e7805262af3"/></dir></dir></dir></dir></dir></dir></target></contents>
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php></required></dependencies>
|
21 |
</package>
|