SCNet_iPayBy - Version 1.0.6

Version Notes

Repackage for 1.9.x

Download this release

Release Info

Developer SCNet
Extension SCNet_iPayBy
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.6

app/code/community/Scnet/Ipayby/Model/CreditCard.php CHANGED
@@ -20,7 +20,7 @@
20
  class Scnet_Ipayby_Model_CreditCard extends Mage_Payment_Model_Method_Cc {
21
 
22
  protected $_code = 'scnet_ipayby';
23
-
24
  protected $_isGateway = true;
25
  protected $_canOrder = false;
26
  protected $_canAuthorize = true;
@@ -45,14 +45,22 @@
45
 
46
  $_url = $this->_getServerUrl();
47
  $_xml = $this->_generatePaymentXml($this->_prepareParams($amount));
48
-
49
  try {
 
50
  $_res = $this->_connectServer($_url, $_xml);
 
51
  }catch(Exception $e) {
 
52
  throw Mage::Exception('Mage_Payment_Model_Info', $this->getConfigData('error_message'));
53
  }
54
 
55
  if(!$_res->isSuccessful()) {
 
 
 
 
 
56
  throw Mage::Exception('Mage_Payment_Model_Info', $this->getConfigData('error_message'));
57
  }
58
 
@@ -63,14 +71,15 @@
63
  throw Mage::Exception('Mage_Payment_Model_Info', $_error);
64
  }
65
 
66
- $payment->setStatus(self::STATUS_SUCCESS)
67
  ->setStatusDescription($_result->getData('responseText'))
68
  ->setTransactionId($_result->getData('orderNumber'))
69
  ->setIsTransactionClosed(0)
70
  ->setSuTransactionId($_result->getData('orderNumber'))
71
  ->setLastTransId($_result->getData('orderNumber'))
72
  ;
73
-
 
74
  return $this;
75
  }
76
 
@@ -146,6 +155,8 @@
146
  }
147
 
148
  protected function _connectServer($_url, $_xml) {
 
 
149
  $_headers = array(
150
  'Content-type: text/xml; charset=utf-8',
151
  'Content-length: ' . strlen($_xml),
@@ -153,12 +164,15 @@
153
  $_httpClient = new Varien_Http_Client($_url);
154
  $_httpClient->setHeaders($_headers);
155
  $_httpClient->setRawData($_xml);
 
156
 
157
  $this->_debug(array('requestedUrl'=>$_url, 'requestedXml'=>$_xml));
158
 
159
  try {
160
  $_response = $_httpClient->request(Varien_Http_Client::POST);
 
161
  }catch(Exception $e) {
 
162
  $this->_debug(array('Error' => $e->getMessage()));
163
  throw $e;
164
  }
20
  class Scnet_Ipayby_Model_CreditCard extends Mage_Payment_Model_Method_Cc {
21
 
22
  protected $_code = 'scnet_ipayby';
23
+
24
  protected $_isGateway = true;
25
  protected $_canOrder = false;
26
  protected $_canAuthorize = true;
45
 
46
  $_url = $this->_getServerUrl();
47
  $_xml = $this->_generatePaymentXml($this->_prepareParams($amount));
48
+
49
  try {
50
+
51
  $_res = $this->_connectServer($_url, $_xml);
52
+
53
  }catch(Exception $e) {
54
+
55
  throw Mage::Exception('Mage_Payment_Model_Info', $this->getConfigData('error_message'));
56
  }
57
 
58
  if(!$_res->isSuccessful()) {
59
+
60
+ //TODO
61
+ $current .= "\n6" . 'Error';
62
+ file_put_contents($file, $current);
63
+ //TODO
64
  throw Mage::Exception('Mage_Payment_Model_Info', $this->getConfigData('error_message'));
65
  }
66
 
71
  throw Mage::Exception('Mage_Payment_Model_Info', $_error);
72
  }
73
 
74
+ $payment->setStatus(self::STATUS_APPROVED)
75
  ->setStatusDescription($_result->getData('responseText'))
76
  ->setTransactionId($_result->getData('orderNumber'))
77
  ->setIsTransactionClosed(0)
78
  ->setSuTransactionId($_result->getData('orderNumber'))
79
  ->setLastTransId($_result->getData('orderNumber'))
80
  ;
81
+
82
+
83
  return $this;
84
  }
85
 
155
  }
156
 
157
  protected function _connectServer($_url, $_xml) {
158
+
159
+
160
  $_headers = array(
161
  'Content-type: text/xml; charset=utf-8',
162
  'Content-length: ' . strlen($_xml),
164
  $_httpClient = new Varien_Http_Client($_url);
165
  $_httpClient->setHeaders($_headers);
166
  $_httpClient->setRawData($_xml);
167
+
168
 
169
  $this->_debug(array('requestedUrl'=>$_url, 'requestedXml'=>$_xml));
170
 
171
  try {
172
  $_response = $_httpClient->request(Varien_Http_Client::POST);
173
+
174
  }catch(Exception $e) {
175
+
176
  $this->_debug(array('Error' => $e->getMessage()));
177
  throw $e;
178
  }
app/code/community/Scnet/Ipayby/etc/config.xml CHANGED
@@ -1,52 +1,52 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <config>
3
- <global>
4
- <models>
5
- <Scnet_Ipayby>
6
- <class>Scnet_Ipayby_Model</class>
7
- </Scnet_Ipayby>
8
- </models>
9
- <blocks>
10
- <Scnet_Ipayby>
11
- <class>Scnet_Ipayby_Block</class>
12
- </Scnet_Ipayby>
13
- </blocks>
14
- <helpers>
15
- <Scnet_Ipayby>
16
- <class>Scnet_Ipayby_Helper</class>
17
- </Scnet_Ipayby>
18
- </helpers>
19
- <events>
20
- <payment_info_block_prepare_specific_information>
21
- <observers>
22
- <Scnet_Ipayby>
23
- <class>Scnet_Ipayby/observer</class>
24
- <method>paymentSpecificInformation</method>
25
- </Scnet_Ipayby>
26
- </observers>
27
- </payment_info_block_prepare_specific_information>
28
- </events>
29
- </global>
30
- <default>
31
- <payment>
32
- <scnet_ipayby>
33
- <group>offline</group>
34
- <model>Scnet_Ipayby/CreditCard</model>
35
- <payment_action>authorize_capture</payment_action>
36
- <active>0</active>
37
- <title>SCNet iPayBy</title>
38
- <order_status>pending</order_status>
39
- <live_mode>0</live_mode>
40
- <allowspecific>0</allowspecific>
41
- <merchant_notification>0</merchant_notification>
42
- <customer_notification>0</customer_notification>
43
- <live_server_url>https://www.scnet.com.au/ipayby/ipaybyws?WSDL</live_server_url>
44
- <test_server_url>https://www.scnet.com.au/ipayby/ipaybyws?WSDL</test_server_url>
45
- <merchant_id>SCNet_Cert6</merchant_id>
46
- <password>testSCNet</password>
47
- <cctypes>AE,VI,MC,DI</cctypes>
48
- <error_message>This payment method is currently unavailable. If you would like to pay using this payment method, please contact us.</error_message>
49
- </scnet_ipayby>
50
- </payment>
51
- </default>
52
- </config>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <config>
3
+ <global>
4
+ <models>
5
+ <Scnet_Ipayby>
6
+ <class>Scnet_Ipayby_Model</class>
7
+ </Scnet_Ipayby>
8
+ </models>
9
+ <blocks>
10
+ <Scnet_Ipayby>
11
+ <class>Scnet_Ipayby_Block</class>
12
+ </Scnet_Ipayby>
13
+ </blocks>
14
+ <helpers>
15
+ <Scnet_Ipayby>
16
+ <class>Scnet_Ipayby_Helper</class>
17
+ </Scnet_Ipayby>
18
+ </helpers>
19
+ <events>
20
+ <payment_info_block_prepare_specific_information>
21
+ <observers>
22
+ <Scnet_Ipayby>
23
+ <class>Scnet_Ipayby/observer</class>
24
+ <method>paymentSpecificInformation</method>
25
+ </Scnet_Ipayby>
26
+ </observers>
27
+ </payment_info_block_prepare_specific_information>
28
+ </events>
29
+ </global>
30
+ <default>
31
+ <payment>
32
+ <scnet_ipayby>
33
+ <group>offline</group>
34
+ <model>Scnet_Ipayby/CreditCard</model>
35
+ <payment_action>authorize_capture</payment_action>
36
+ <active>0</active>
37
+ <title>SCNet iPayBy</title>
38
+ <order_status>pending</order_status>
39
+ <live_mode>0</live_mode>
40
+ <allowspecific>0</allowspecific>
41
+ <merchant_notification>0</merchant_notification>
42
+ <customer_notification>0</customer_notification>
43
+ <live_server_url>https://www.scnet.com.au/ipayby/ipaybyws</live_server_url>
44
+ <test_server_url>https://www.scnet.com.au/ipayby/ipaybyws</test_server_url>
45
+ <merchant_id>SCNet_Cert6</merchant_id>
46
+ <password>testSCNet</password>
47
+ <cctypes>AE,VI,MC,DI</cctypes>
48
+ <error_message>This payment method is currently unavailable. If you would like to pay using this payment method, please contact us.</error_message>
49
+ </scnet_ipayby>
50
+ </payment>
51
+ </default>
52
+ </config>
app/etc/modules/Scnet_Ipayby.xml DELETED
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
2
- <config>
3
- <modules>
4
- <Scnet_Ipayby>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- <version>0.1.0</version>
8
- <depends><Mage_Payment /></depends>
9
- </Scnet_Ipayby>
10
- </modules>
11
- </config>
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>SCNet_iPayBy</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>SCNet iPayBy Payment Gateway</summary>
10
  <description>SCNet iPayBy Payment Gateway</description>
11
- <notes>Repackage for 1.8.x</notes>
12
  <authors><author><name>SCNet</name><user>SCNet</user><email>support@scnet.com.au</email></author></authors>
13
- <date>2013-11-30</date>
14
- <time>06:01:39</time>
15
- <contents><target name="magecommunity"><dir name="Scnet"><dir name="Ipayby"><dir name="Helper"><file name="Data.php" hash="d6397ee1ae45bbe37864a72fa1023f5c"/></dir><dir name="Model"><file name="CreditCard.php" hash="a60c18b2bdd9620d98ccc1f777d1fccc"/><file name="Observer.php" hash="c1f8b0be0f415bb103d775bd7f6bb8d8"/><file name="ResponseParser.php" hash="dc95564aeba3ccb9f9fbd68ee9073c90"/></dir><dir name="etc"><file name="config.xml" hash="a829c791e6305116f81cbe0fab9f566b"/><file name="system.xml" hash="2f1dccd58d21d83aa7ec789b02e1c661"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Scnet_Ipayby.xml" hash="bf1018cd9dc74b53586f595e64149dc0"/></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>SCNet_iPayBy</name>
4
+ <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>SCNet iPayBy Payment Gateway</summary>
10
  <description>SCNet iPayBy Payment Gateway</description>
11
+ <notes>Repackage for 1.9.x</notes>
12
  <authors><author><name>SCNet</name><user>SCNet</user><email>support@scnet.com.au</email></author></authors>
13
+ <date>2015-04-02</date>
14
+ <time>01:17:05</time>
15
+ <contents><target name="magecommunity"><dir name="Scnet"><dir name="Ipayby"><dir name="Helper"><file name="Data.php" hash="d6397ee1ae45bbe37864a72fa1023f5c"/></dir><dir name="Model"><file name="CreditCard.php" hash="baf9e202f07b5a32fee2be0cae1cfdab"/><file name="Observer.php" hash="c1f8b0be0f415bb103d775bd7f6bb8d8"/><file name="ResponseParser.php" hash="dc95564aeba3ccb9f9fbd68ee9073c90"/></dir><dir name="etc"><file name="config.xml" hash="13be3cb2171ac29b4a309e79473f8b3d"/><file name="system.xml" hash="2f1dccd58d21d83aa7ec789b02e1c661"/></dir></dir></dir></target><target name="magelocal"><dir name="modules"><file name="Scnet_Ipayby.xml" hash=""/></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>