Knox_Payments - Version 1.0.0

Version Notes

For knox to work, an admin must create a SOAP api role and user so the plugin can communicate back to your store.

Add a role for Knox:
System=> Web Services => SOAP- Roles
click Add New Role
Role Name: Knox
Resource Access: All (defaults to “custom” so this must be updated under role resources)
Save the role

Add a user for Knox
System=> Web Services => SOAP- Users
click Add New User
Under User Info:
User Name : Knox (case sensitive)
First Name, Last Name, Email can be made anything be the admin
API Key: enter your knox api key (found in your knox dashboard)
Under User Role:
you should see the role “Knox” that you just created, select the role “Knox” for the user “Knox you are creating.
Save the User

Download this release

Release Info

Developer Elizabeth Kukla
Extension Knox_Payments
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/local/Knox/.DS_Store ADDED
Binary file
app/code/local/Knox/KnoxGateway/.DS_Store ADDED
Binary file
app/code/local/Knox/KnoxGateway/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Knox_KnoxGateway_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/local/Knox/KnoxGateway/Model/.DS_Store ADDED
Binary file
app/code/local/Knox/KnoxGateway/Model/Observer.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Knox_KnoxGateway_Model_Observer
4
+ /**
5
+ *sends a new order confirmation email whenever an order is sucessfully placed.
6
+ *
7
+ */
8
+
9
+ {
10
+
11
+ public function sendOrderEmails(Varien_Event_Observer $observer){
12
+
13
+ $orderIds = $observer->getData('order_ids');
14
+
15
+ foreach($orderIds as $_orderId){
16
+
17
+ $order = Mage::getModel('sales/order')->load($_orderId);
18
+
19
+ try {
20
+
21
+ $order->sendNewOrderEmail();
22
+
23
+ Mage::log('email sent');
24
+
25
+ } catch (Exception $e) {
26
+
27
+ Mage::logException($e);
28
+
29
+ }
30
+
31
+ }
32
+
33
+ return $this;
34
+
35
+ }
36
+
37
+ }
38
+ ?>
app/code/local/Knox/KnoxGateway/Model/Standard.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Knox_KnoxGateway_Model_Standard extends Mage_Payment_Model_Method_Abstract {
4
+ /**
5
+ * @var $_code defines the name of our plugin when we register to magento
6
+ */
7
+ protected $_code = 'KnoxGateway';
8
+
9
+ /**
10
+ * @var $_isInitializeNeeded is set to true to declare we need
11
+ * to initialize while the order is in place
12
+ */
13
+ protected $_isInitializeNeeded = true;
14
+ /**
15
+ * @var $_canUseInternal is set to true to declare that people can pay
16
+ * with knox from the admin pages
17
+ */
18
+ protected $_canUseInternal = true;
19
+ /**
20
+ * @var $_canUseForMultishipping is set to false so that we don't try
21
+ * to send to multiple shipping addresses
22
+ */
23
+ protected $_canUseForMultishipping = false;
24
+ /**
25
+ * @var $_canUseCheckout is set to true due to the fact that we want to
26
+ * be used like any other normal payment gateway
27
+ */
28
+ protected $_canUseCheckout = true;
29
+
30
+ /**
31
+ *@var %_canOrder is true
32
+ *
33
+ */
34
+ protected $_canOrder=true;
35
+
36
+
37
+
38
+
39
+
40
+ /**
41
+ * @return getOrderPlacedRedirectUrl directs user to complete payment with Knox
42
+ */
43
+ public function getOrderPlaceRedirectUrl() {
44
+ $key = Mage::getStoreConfig('payment/KnoxGateway/api_key');
45
+ $grandTotal = Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal();//'11.50';
46
+ $reccur = "ot";
47
+ $info = "none";//Mage::getStoreConfig('payment/KnoxGateway/info_request');
48
+ $invoice = Mage::getStoreConfig('payment/KnoxGateway/invoice_detail');
49
+ //get store url and order id for passing through to api connection to update order status.
50
+ $orderId = Mage::getModel("sales/order")->getCollection()->getLastItem()->getIncrementId();
51
+ $storeURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
52
+ $callback = "https://knoxpayments.com/pay/success.php?orderId=".$orderId."&storeUrl=".$storeURL."&api=".$key."";//Mage::getStoreConfig('payment/KnoxGateway/callback_url');//"https://www.knoxpayments.com";//
53
+
54
+ return "https://knoxpayments.com/pay?api_key=".$key."&amount=".$grandTotal."&redirect_url=".$callback."&recurring=".$reccur."&information_request=".$info."&invoice_detail=".$invoice."";
55
+
56
+ }
57
+
58
+
59
+
60
+
61
+
62
+ }
63
+ ?>
app/code/local/Knox/KnoxGateway/etc/config.xml ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Knox_KnoxGateway>
5
+ <version>0.1.0</version>
6
+ </Knox_KnoxGateway>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <KnoxGateway>
11
+ <class>Knox_KnoxGateway_Model</class>
12
+ </KnoxGateway>
13
+ </models>
14
+ <events>
15
+ <checkout_onepage_controller_success_action>
16
+ <observers>
17
+ <sendOrderEmails>
18
+ <type>singleton</type>
19
+ <class>Knox_KnoxGateway_Model_Observer</class>
20
+ <method>sendOrderEmails</method>
21
+ </sendOrderEmails>
22
+ </observers>
23
+ </checkout_onepage_controller_success_action>
24
+ </events>
25
+ <helpers>
26
+ <KnoxGateway>
27
+ <class>Knox_KnoxGateway_Helper</class>
28
+ </KnoxGateway>
29
+ </helpers>
30
+ <blocks>
31
+ <KnoxGateway>
32
+ <class>Knox_KnoxGateway_Block</class>
33
+ </KnoxGateway>
34
+ </blocks>
35
+ </global>
36
+ <default>
37
+ <payment>
38
+ <KnoxGateway>
39
+ <model>KnoxGateway/standard</model>
40
+ <active>1</active>
41
+ <order_status>pending</order_status>
42
+ <title>Knox Gateway</title>
43
+ <payment_action>sale</payment_action>
44
+ <sort_order>1</sort_order>
45
+ <invoice_detail>custom_detail_no_spaces_permitted</invoice_detail>
46
+ <title>Pay with My Bank</title>
47
+ </KnoxGateway>
48
+ </payment>
49
+ </default>
50
+ <frontend>
51
+ <routers>
52
+ <KnoxGateway>
53
+ <use>standard</use>
54
+ <args>
55
+ <module>Knox_KnoxGateway</module>
56
+ <frontName>KnoxGateway</frontName>
57
+ </args>
58
+ </KnoxGateway>
59
+ </routers>
60
+ </frontend>
61
+ </config>
app/code/local/Knox/KnoxGateway/etc/system.xml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <sections>
4
+ <payment>
5
+ <groups>
6
+ <KnoxGateway translate="label comment" module="paygate">
7
+ <label>Knox Gateway</label>
8
+ <frontend_type>text</frontend_type>
9
+ <sort_order>0</sort_order>
10
+ <show_in_default>1</show_in_default>
11
+ <show_in_website>1</show_in_website>
12
+ <show_in_store>1</show_in_store>
13
+ <fields>
14
+ <active translate="label">
15
+ <label>Enabled</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>20</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <invoice_detail translate="label">
32
+ <label>Invoice Detail</label>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>10</sort_order>
35
+ <show_in_website>1</show_in_website>
36
+ <show_in_store>1</show_in_store>
37
+ <show_in_default>1</show_in_default>
38
+ </invoice_detail>
39
+ <api_key translate="label">
40
+ <label>Knox Api Key</label>
41
+ <frontend_type>text</frontend_type>
42
+ <sort_order>10</sort_order>
43
+ <show_in_default>1</show_in_default>
44
+ <show_in_website>1</show_in_website>
45
+ <show_in_store>1</show_in_store>
46
+ </api_key>
47
+ </fields>
48
+ </KnoxGateway>
49
+ </groups>
50
+ </payment>
51
+ </sections>
52
+ </config>
app/etc/modules/Knox_Knoxgateway.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <modules>
4
+ <Knox_KnoxGateway>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ <depends>
8
+ <Mage_Payment />
9
+ </depends>
10
+ </Knox_KnoxGateway>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Knox_Payments</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Accept payments with Knox Payments</summary>
10
+ <description>Knox enables your customers to make seamless ACH payments with just their online banking credentials, providing a better customer experience and sparing merchants from incredibly high card processing fees. &#xD;
11
+ &#xD;
12
+ &#xD;
13
+ IMPORTANT SETUP&#xD;
14
+ For knox to work, an admin must create a SOAP api role and user so the plugin can communicate back to your store.&#xD;
15
+ &#xD;
16
+ Add a role for Knox:&#xD;
17
+ System=&gt; Web Services =&gt; SOAP- Roles&#xD;
18
+ click Add New Role&#xD;
19
+ Role Name: Knox&#xD;
20
+ Resource Access: All (defaults to &#x201C;custom&#x201D; so this must be updated under role resources)&#xD;
21
+ Save the role&#xD;
22
+ &#xD;
23
+ Add a user for Knox&#xD;
24
+ System=&gt; Web Services =&gt; SOAP- Users&#xD;
25
+ click Add New User&#xD;
26
+ Under User Info:&#xD;
27
+ User Name : Knox (case sensitive)&#xD;
28
+ First Name, Last Name, Email can be made anything be the admin&#xD;
29
+ API Key: enter your knox api key (found in your knox dashboard)&#xD;
30
+ Under User Role:&#xD;
31
+ you should see the role &#x201C;Knox&#x201D; that you just created, select the role &#x201C;Knox&#x201D; for the user &#x201C;Knox you are creating.&#xD;
32
+ Save the User&#xD;
33
+ &#xD;
34
+ &#xD;
35
+ Magento 1.5 or later</description>
36
+ <notes>For knox to work, an admin must create a SOAP api role and user so the plugin can communicate back to your store.&#xD;
37
+ &#xD;
38
+ Add a role for Knox:&#xD;
39
+ System=&gt; Web Services =&gt; SOAP- Roles&#xD;
40
+ click Add New Role&#xD;
41
+ Role Name: Knox&#xD;
42
+ Resource Access: All (defaults to &#x201C;custom&#x201D; so this must be updated under role resources)&#xD;
43
+ Save the role&#xD;
44
+ &#xD;
45
+ Add a user for Knox&#xD;
46
+ System=&gt; Web Services =&gt; SOAP- Users&#xD;
47
+ click Add New User&#xD;
48
+ Under User Info:&#xD;
49
+ User Name : Knox (case sensitive)&#xD;
50
+ First Name, Last Name, Email can be made anything be the admin&#xD;
51
+ API Key: enter your knox api key (found in your knox dashboard)&#xD;
52
+ Under User Role:&#xD;
53
+ you should see the role &#x201C;Knox&#x201D; that you just created, select the role &#x201C;Knox&#x201D; for the user &#x201C;Knox you are creating.&#xD;
54
+ Save the User&#xD;
55
+ </notes>
56
+ <authors><author><name>Knox Payments</name><user>knoxpayments</user><email>tommy@knoxpayments.com</email></author><author><name>Elizabeth Kukla</name><user>KnoxPayments</user><email>elizabeth@knoxpayments.com</email></author></authors>
57
+ <date>2014-08-06</date>
58
+ <time>22:06:18</time>
59
+ <contents><target name="magelocal"><dir name="Knox"><dir name="KnoxGateway"><dir name="Helper"><file name="Data.php" hash="5bd4ca4320d14e43f9c1cb2c75c81c1c"/></dir><dir name="Model"><file name="Observer.php" hash="1c39f6b9783f6c039895376fc36e35ff"/><file name="Standard.php" hash="9ce57b760f8e610d18a328610a21bb5e"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="config.xml" hash="f4cf4dab44220740b29355813c3a0d1d"/><file name="system.xml" hash="92dc8887092782dc1c78d647732d0b87"/></dir><file name=".DS_Store" hash="6a4832a0d6d4f18d18a0fb9c4db7cc40"/></dir><file name=".DS_Store" hash="b0a445b5f4a500ade9471247a67d4b92"/></dir></target><target name="mageetc"><dir name="modules"><file name="Knox_Knoxgateway.xml" hash="9c683e5c9faa8fbbe095e93993a70926"/></dir></target></contents>
60
+ <compatible/>
61
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
62
+ </package>