Version Notes
Ability to disable SSL Certificate authentication in API connection
Download this release
Release Info
Developer | Huseyin Ozturk |
Extension | NetPay_Netpayonlinepayments |
Version | 1.0.7 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.7
- app/code/local/NetPay/Netpayonlinepayments/Helper/Data.php +9 -0
- app/code/local/NetPay/Netpayonlinepayments/Model/Netpayapi.php +1 -0
- app/code/local/NetPay/Netpayonlinepayments/etc/config.xml +2 -2
- app/code/local/NetPay/Netpayonlinepayments/etc/system.xml +12 -3
- lib/NetPay/Connection.php +5 -2
- package.xml +5 -5
app/code/local/NetPay/Netpayonlinepayments/Helper/Data.php
CHANGED
@@ -119,6 +119,15 @@ class NetPay_Netpayonlinepayments_Helper_Data extends Mage_Core_Helper_Abstract
|
|
119 |
return Mage::getModel('netpayonlinepayments/netpayapi')->getConfigData('password');
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
/**
|
123 |
* @Purpose : Function to return Api Certificate Path set from configuration section
|
124 |
* @Outputs : Return Api Cert Path
|
119 |
return Mage::getModel('netpayonlinepayments/netpayapi')->getConfigData('password');
|
120 |
}
|
121 |
|
122 |
+
/**
|
123 |
+
* @Purpose : Function to return Api Certificate Path set from configuration section
|
124 |
+
* @Outputs : Return Api Cert Path
|
125 |
+
* @author : NetPay Development Team
|
126 |
+
*/
|
127 |
+
public function getApiCertEnabled() {
|
128 |
+
return Mage::getModel('netpayonlinepayments/netpayapi')->getConfigData('use_cert');
|
129 |
+
}
|
130 |
+
|
131 |
/**
|
132 |
* @Purpose : Function to return Api Certificate Path set from configuration section
|
133 |
* @Outputs : Return Api Cert Path
|
app/code/local/NetPay/Netpayonlinepayments/Model/Netpayapi.php
CHANGED
@@ -819,6 +819,7 @@ class NetPay_Netpayonlinepayments_Model_Netpayapi extends Mage_Payment_Model_Met
|
|
819 |
|
820 |
$helper = Mage::helper('netpayonlinepayments');
|
821 |
|
|
|
822 |
$this->_ssl_path['certificate'] = $helper->getApiCert();
|
823 |
$this->_ssl_path['key'] = $helper->getApiKey();
|
824 |
$this->_ssl_path['certificate_pass'] = $helper->getApiCertPass();
|
819 |
|
820 |
$helper = Mage::helper('netpayonlinepayments');
|
821 |
|
822 |
+
$this->_ssl_path['use_cert'] = $helper->getApiCertEnabled();
|
823 |
$this->_ssl_path['certificate'] = $helper->getApiCert();
|
824 |
$this->_ssl_path['key'] = $helper->getApiKey();
|
825 |
$this->_ssl_path['certificate_pass'] = $helper->getApiCertPass();
|
app/code/local/NetPay/Netpayonlinepayments/etc/config.xml
CHANGED
@@ -20,7 +20,7 @@
|
|
20 |
<config>
|
21 |
<modules>
|
22 |
<NetPay_Netpayonlinepayments>
|
23 |
-
<version>1.0.
|
24 |
</NetPay_Netpayonlinepayments>
|
25 |
</modules>
|
26 |
<global>
|
@@ -97,7 +97,7 @@
|
|
97 |
<default>
|
98 |
<payment>
|
99 |
<netpaysettings>
|
100 |
-
<version>1.0.
|
101 |
</netpaysettings>
|
102 |
<netpayonlinepayments>
|
103 |
<active>0</active>
|
20 |
<config>
|
21 |
<modules>
|
22 |
<NetPay_Netpayonlinepayments>
|
23 |
+
<version>1.0.7</version>
|
24 |
</NetPay_Netpayonlinepayments>
|
25 |
</modules>
|
26 |
<global>
|
97 |
<default>
|
98 |
<payment>
|
99 |
<netpaysettings>
|
100 |
+
<version>1.0.7</version>
|
101 |
</netpaysettings>
|
102 |
<netpayonlinepayments>
|
103 |
<active>0</active>
|
app/code/local/NetPay/Netpayonlinepayments/etc/system.xml
CHANGED
@@ -259,10 +259,19 @@
|
|
259 |
<show_in_website>1</show_in_website>
|
260 |
<show_in_store>0</show_in_store>
|
261 |
</password>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
<cert_path translate="label">
|
263 |
<label>Certificate Path</label>
|
264 |
<frontend_type>text</frontend_type>
|
265 |
-
<sort_order>
|
266 |
<show_in_default>1</show_in_default>
|
267 |
<show_in_website>1</show_in_website>
|
268 |
<show_in_store>0</show_in_store>
|
@@ -271,7 +280,7 @@
|
|
271 |
<key_path translate="label">
|
272 |
<label>Key Path</label>
|
273 |
<frontend_type>text</frontend_type>
|
274 |
-
<sort_order>
|
275 |
<show_in_default>1</show_in_default>
|
276 |
<show_in_website>1</show_in_website>
|
277 |
<show_in_store>0</show_in_store>
|
@@ -280,7 +289,7 @@
|
|
280 |
<certificate_pass translate="label">
|
281 |
<label>Certificate Password</label>
|
282 |
<frontend_type>text</frontend_type>
|
283 |
-
<sort_order>
|
284 |
<show_in_default>1</show_in_default>
|
285 |
<show_in_website>1</show_in_website>
|
286 |
<show_in_store>0</show_in_store>
|
259 |
<show_in_website>1</show_in_website>
|
260 |
<show_in_store>0</show_in_store>
|
261 |
</password>
|
262 |
+
<use_cert translate="label">
|
263 |
+
<label>Use SSL Certificate for authentication</label>
|
264 |
+
<frontend_type>select</frontend_type>
|
265 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
266 |
+
<sort_order>71</sort_order>
|
267 |
+
<show_in_default>1</show_in_default>
|
268 |
+
<show_in_website>1</show_in_website>
|
269 |
+
<show_in_store>0</show_in_store>
|
270 |
+
</use_cert>
|
271 |
<cert_path translate="label">
|
272 |
<label>Certificate Path</label>
|
273 |
<frontend_type>text</frontend_type>
|
274 |
+
<sort_order>72</sort_order>
|
275 |
<show_in_default>1</show_in_default>
|
276 |
<show_in_website>1</show_in_website>
|
277 |
<show_in_store>0</show_in_store>
|
280 |
<key_path translate="label">
|
281 |
<label>Key Path</label>
|
282 |
<frontend_type>text</frontend_type>
|
283 |
+
<sort_order>73</sort_order>
|
284 |
<show_in_default>1</show_in_default>
|
285 |
<show_in_website>1</show_in_website>
|
286 |
<show_in_store>0</show_in_store>
|
289 |
<certificate_pass translate="label">
|
290 |
<label>Certificate Password</label>
|
291 |
<frontend_type>text</frontend_type>
|
292 |
+
<sort_order>74</sort_order>
|
293 |
<show_in_default>1</show_in_default>
|
294 |
<show_in_website>1</show_in_website>
|
295 |
<show_in_store>0</show_in_store>
|
lib/NetPay/Connection.php
CHANGED
@@ -60,7 +60,7 @@ class NetPay_Connection {
|
|
60 |
* @param string $username Username for authorization with API
|
61 |
* @param string $password Password for authorization with API
|
62 |
*/
|
63 |
-
function __construct($base_url = '', $header = array())
|
64 |
{
|
65 |
if(!$this->curl_enabled())
|
66 |
{
|
@@ -73,6 +73,7 @@ class NetPay_Connection {
|
|
73 |
$this->set_password($header);
|
74 |
$this->set_accept($header);
|
75 |
$this->set_content_type($header);
|
|
|
76 |
|
77 |
|
78 |
}
|
@@ -332,6 +333,8 @@ class NetPay_Connection {
|
|
332 |
echo nl2br($str);
|
333 |
print_r($this->info);
|
334 |
}
|
|
|
|
|
335 |
}
|
336 |
|
337 |
/**
|
@@ -514,7 +517,7 @@ class NetPay_Connection {
|
|
514 |
}
|
515 |
|
516 |
public function curl_set_ssl() {
|
517 |
-
if(is_array($this->ssl) && isset($this->ssl['certificate'])){
|
518 |
$this->curl_add_option(CURLOPT_SSL_VERIFYPEER,FALSE);
|
519 |
$this->curl_add_option(CURLOPT_SSL_VERIFYHOST, 2);
|
520 |
$this->curl_add_option(CURLOPT_SSLCERT, $this->ssl['certificate']);
|
60 |
* @param string $username Username for authorization with API
|
61 |
* @param string $password Password for authorization with API
|
62 |
*/
|
63 |
+
function __construct($base_url = '', $header = array(), $ssl_path=array())
|
64 |
{
|
65 |
if(!$this->curl_enabled())
|
66 |
{
|
73 |
$this->set_password($header);
|
74 |
$this->set_accept($header);
|
75 |
$this->set_content_type($header);
|
76 |
+
$this->set_ssl_path($ssl_path);
|
77 |
|
78 |
|
79 |
}
|
333 |
echo nl2br($str);
|
334 |
print_r($this->info);
|
335 |
}
|
336 |
+
|
337 |
+
print_r($this->curl_connection);
|
338 |
}
|
339 |
|
340 |
/**
|
517 |
}
|
518 |
|
519 |
public function curl_set_ssl() {
|
520 |
+
if(is_array($this->ssl) && isset($this->ssl['certificate']) && (isset($this->ssl['use_cert']) && $this->ssl['use_cert'] === '1')){
|
521 |
$this->curl_add_option(CURLOPT_SSL_VERIFYPEER,FALSE);
|
522 |
$this->curl_add_option(CURLOPT_SSL_VERIFYHOST, 2);
|
523 |
$this->curl_add_option(CURLOPT_SSLCERT, $this->ssl['certificate']);
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>NetPay_Netpayonlinepayments</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -22,11 +22,11 @@ Features
|
|
22 |
• Supports tokenization, which enables store the payer’s card information on NetPay’s Secure Server
|
23 |
• Simple and easy configuration
|
24 |
</description>
|
25 |
-
<notes>
|
26 |
<authors><author><name>Huseyin Ozturk</name><user>netpay</user><email>huseyin.ozturk@netpay.co.uk</email></author></authors>
|
27 |
-
<date>2015-
|
28 |
-
<time>
|
29 |
-
<contents><target name="magelocal"><dir name="NetPay"><dir name="Netpayonlinepayments"><dir name="Block"><file name="Api.php" hash="6aaa4f88a658c71d3747048644a10a2c"/><file name="Form.php" hash="ae867dccec77bc8731c0c319c01402a4"/><file name="Redirect.php" hash="d96a5922a4f0aae616d39cec84d78974"/><file name="Secureredirect.php" hash="402a0a4f7dd462e178692863325ef309"/></dir><dir name="Helper"><file name="Data.php" hash="
|
30 |
<compatible/>
|
31 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
32 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>NetPay_Netpayonlinepayments</name>
|
4 |
+
<version>1.0.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
22 |
• Supports tokenization, which enables store the payer’s card information on NetPay’s Secure Server
|
23 |
• Simple and easy configuration
|
24 |
</description>
|
25 |
+
<notes>Ability to disable SSL Certificate authentication in API connection</notes>
|
26 |
<authors><author><name>Huseyin Ozturk</name><user>netpay</user><email>huseyin.ozturk@netpay.co.uk</email></author></authors>
|
27 |
+
<date>2015-12-21</date>
|
28 |
+
<time>13:38:18</time>
|
29 |
+
<contents><target name="magelocal"><dir name="NetPay"><dir name="Netpayonlinepayments"><dir name="Block"><file name="Api.php" hash="6aaa4f88a658c71d3747048644a10a2c"/><file name="Form.php" hash="ae867dccec77bc8731c0c319c01402a4"/><file name="Redirect.php" hash="d96a5922a4f0aae616d39cec84d78974"/><file name="Secureredirect.php" hash="402a0a4f7dd462e178692863325ef309"/></dir><dir name="Helper"><file name="Data.php" hash="197097ed76e6b7297ab1eaecd302e65a"/></dir><dir name="Model"><file name="Card.php" hash="c7cc0d160f316dde037c1b7f2ec14994"/><file name="Configkey.php" hash="e00f6572425364d24ce5c0d1e5fd2d23"/><file name="Direct.php" hash="dc51fbb45ce724e66d5cdeb2eaed2da0"/><dir name="Mysql4"><dir name="Card"><file name="Collection.php" hash="a2b0f9ff13a0bb52376d868b1d8520f0"/></dir><file name="Card.php" hash="c96dfece89ddf6da22aa1e507996e3c0"/><dir name="Response"><file name="Collection.php" hash="ff19db09c7bd5fdbef5241359b5b0cbf"/></dir><file name="Response.php" hash="90753bbe50f4d57ec038361db0ccdbf4"/><dir name="Temp"><file name="Collection.php" hash="03ca3ec1af68e06910190ccc34c30b10"/></dir><file name="Temp.php" hash="955e3a82839546574295d31ca87aa244"/></dir><file name="Netpayapi.php" hash="92cf4325ec582d80503f14e50052df36"/><file name="Response.php" hash="b6a1675696e1d1fc63992e437ae513c4"/><dir name="Source"><file name="Cctype.php" hash="fd4380fb02a6623cb0180de6dd806f4b"/><file name="OperationType.php" hash="23b55afe09fef51ea812cb97f7715496"/><file name="PaymentAction.php" hash="9c102faff0c1aa82a3eac11bbfdc0088"/><file name="PaymentMethod.php" hash="af97bcd4dd14292f84894e1456ccb24f"/><file name="PaymentMode.php" hash="9fb41527394c8e23ba79bafb36442693"/></dir><file name="Temp.php" hash="8875f13a75ecc75cb34c111c10da2961"/></dir><dir name="controllers"><file name="PaymentController.php" hash="7a15165c3653d0a8d9ef17a453d03578"/></dir><dir name="etc"><file name="config.xml" hash="f6edef9d00b68571a27770b3741cb364"/><file name="system.xml" hash="77db492622f434901d02a9d699f9b81e"/></dir><dir name="sql"><dir name="netpayonlinepayments_setup"><file name="install-1.0.0.php" hash="bee133624a0c09bf5138383f5381c348"/><file name="mysql4-install-1.0.0.php" hash="13257eaeb1e54a5a3a4fd5ad0dd4f98b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NetPay_Netpayonlinepayments.xml" hash="7c99deb0539260de7f8f6e6cd47f8171"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="netpayonlinepayments"><file name="api_form.phtml" hash="ee203403465036ecac848f2797b386ae"/><file name="form.phtml" hash="73335dfaff5bb334793c4da02d43f2e2"/><file name="redirect.phtml" hash="14e8ad032ac0f4d7d569ff1619174997"/></dir></dir><dir name="layout"><file name="netpayonlinepayments.xml" hash="d16a10dba3be3ee58d6e11be52de2bd6"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="images"><file name="netpay_payment.png" hash="8cb0d8dbec0fc02779e053f5d2ad4968"/></dir></dir></dir></dir></target><target name="magelib"><dir name="NetPay"><file name="Connection.php" hash="29d2f0f2ab8e23c80845dff4e7417c69"/></dir></target><target name="mage"><dir name="js"><dir name="NetPay"><file name="netpay-api.js" hash="aa36f04cbd78467700fdc712df9f5668"/></dir></dir></target></contents>
|
30 |
<compatible/>
|
31 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
32 |
</package>
|