Sparo_CharityProcessor - Version 1.0.1

Version Notes

Use of this module requires a merchant account with Sparo, in addition to an active API Key.

Find out more information:

https://sparo.com/pages/merchant-about

Download this release

Release Info

Developer Kyril Revels
Extension Sparo_CharityProcessor
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Sparo/CharityProcessor/Model/Resource/Script/Setup.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Sparo_CharityProcessor_Model_Resource_Script_Setup extends Mage_Core_Model_Resource_Setup {
4
+
5
+ public function addScriptBlock(){
6
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
7
+
8
+ $content = <<<HTML
9
+ <script type="text/javascript" id="SPARO-lib" data-merchant="{{config path="sparoconfig/sparoconfig_merchant/sparo_merchantid"}}" data-callback-url="{{config path="web/unsecure/base_url"}}/charityprocessor" src="https://scripts.sparo.com/sparo.min.js"></script>
10
+ HTML;
11
+
12
+ $scriptBlock = array(
13
+ 'title' => 'Sparo Charity Selection Tags',
14
+ 'identifier' => 'sparo_charity_selection_tags',
15
+ 'content' => $content,
16
+ 'is_active' => 1,
17
+ 'stores' => array(0),
18
+ );
19
+
20
+ Mage::getModel('cms/block')->setData($scriptBlock)->save();
21
+
22
+ }
23
+
24
+ public function addContainerBlock(){
25
+ Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
26
+
27
+ $containerBlock = array(
28
+ 'title' => 'Sparo Widget Container',
29
+ 'identifier' => 'sparo_widget_container',
30
+ 'content' => '<div id="sparo-mount"></div>',
31
+ 'is_active' => 1,
32
+ 'stores' => array(0),
33
+ );
34
+
35
+
36
+ Mage::getModel('cms/block')->setData($containerBlock)->save();
37
+ }
38
+ }
app/code/community/Sparo/CharityProcessor/controllers/IndexController.php CHANGED
@@ -3,18 +3,23 @@ class Sparo_CharityProcessor_IndexController extends Mage_Core_Controller_Front_
3
 
4
 
5
  public function indexAction(){
6
- $charity_id = $this->getRequest()->getParam('charity_id');
7
- $transaction_id = $this->getRequest()->getParam('tx_id');
8
 
9
  if(!empty($charity_id)){
10
  Mage::getSingleton('core/session')->setCharityId($charity_id);
11
  }
 
 
 
12
 
13
 
14
  if(!empty($transaction_id)){
15
  Mage::getSingleton('core/session')->setTransactionId($transaction_id);
16
  }
17
-
 
 
18
  }
19
  }
20
 
3
 
4
 
5
  public function indexAction(){
6
+ $charity_id = $this->getRequest()->getParam('charity');
7
+ $transaction_id = $this->getRequest()->getParam('txid');
8
 
9
  if(!empty($charity_id)){
10
  Mage::getSingleton('core/session')->setCharityId($charity_id);
11
  }
12
+ else {
13
+ Mage::getSingleton('core/session')->unsCharityId();
14
+ }
15
 
16
 
17
  if(!empty($transaction_id)){
18
  Mage::getSingleton('core/session')->setTransactionId($transaction_id);
19
  }
20
+ else {
21
+ Mage::getSingleton('core/session')->unsTransactionId();
22
+ }
23
  }
24
  }
25
 
app/code/community/Sparo/CharityProcessor/etc/config.xml CHANGED
@@ -10,10 +10,21 @@
10
  -->
11
  <Sparo_CharityProcessor>
12
  <!-- The version of our module, starting at 0.0.1 -->
13
- <version>0.0.1</version>
14
  </Sparo_CharityProcessor>
15
  </modules>
16
  <global>
 
 
 
 
 
 
 
 
 
 
 
17
  <models>
18
  <sparo_charityprocessor>
19
  <class>Sparo_CharityProcessor_Model</class>
10
  -->
11
  <Sparo_CharityProcessor>
12
  <!-- The version of our module, starting at 0.0.1 -->
13
+ <version>1.0.1</version>
14
  </Sparo_CharityProcessor>
15
  </modules>
16
  <global>
17
+ <resources>
18
+ <sparo_charityprocessor_setup>
19
+ <setup>
20
+ <module>Sparo_CharityProcessor</module>
21
+ <class>Sparo_CharityProcessor_Model_Resource_Script_Setup</class>
22
+ </setup>
23
+ <connection>
24
+ <use>core_setup</use>
25
+ </connection>
26
+ </sparo_charityprocessor_setup>
27
+ </resources>
28
  <models>
29
  <sparo_charityprocessor>
30
  <class>Sparo_CharityProcessor_Model</class>
app/code/community/Sparo/CharityProcessor/sql/sparo_charityprocessor_setup/install-1.0.1.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+ $installer->startSetup();
4
+
5
+ $installer->addScriptBlock();
6
+ $installer->addContainerBlock();
7
+
8
+ $installer->endSetup();
app/etc/modules/Sparo_CharityProcessor.xml CHANGED
@@ -12,3 +12,4 @@
12
  </Sparo_CharityProcessor>
13
  </modules>
14
  </config>
 
12
  </Sparo_CharityProcessor>
13
  </modules>
14
  </config>
15
+
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sparo_CharityProcessor</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MITL</license>
7
  <channel>community</channel>
@@ -14,9 +14,9 @@ Find out more information:&#xD;
14
  &#xD;
15
  https://sparo.com/pages/merchant-about</notes>
16
  <authors><author><name>Kyril Revels</name><user>krevels</user><email>kyril@developdc.com</email></author></authors>
17
- <date>2015-02-25</date>
18
- <time>22:11:25</time>
19
- <contents><target name="magecommunity"><dir name="Sparo"><dir name="CharityProcessor"><dir name="Model"><file name="Observer.php" hash="bdd542e661bcf033c5917f1e9642e37e"/></dir><dir name="controllers"><file name="IndexController.php" hash="a1e56b2ee8d8d54321fa46170cb9208d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d9d7d2e16fc75a3ed21fb37d799e2d4a"/><file name="config.xml" hash="2b89ad6dc2e45c8a5bc1e79e791b469f"/><file name="system.xml" hash="4632c60b3f154d8fbf4a0d34b7b1f347"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sparo_CharityProcessor.xml" hash="bb1747f5a072c75491ed3eeed5f7209e"/></dir></target></contents>
20
  <compatible/>
21
- <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.0</min><max>1.9</max></package><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package><extension><name>curl</name><min/><max/></extension></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Sparo_CharityProcessor</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MITL</license>
7
  <channel>community</channel>
14
  &#xD;
15
  https://sparo.com/pages/merchant-about</notes>
16
  <authors><author><name>Kyril Revels</name><user>krevels</user><email>kyril@developdc.com</email></author></authors>
17
+ <date>2015-04-07</date>
18
+ <time>18:11:44</time>
19
+ <contents><target name="magecommunity"><dir name="Sparo"><dir name="CharityProcessor"><dir name="Model"><file name="Observer.php" hash="bdd542e661bcf033c5917f1e9642e37e"/><dir name="Resource"><dir name="Script"><file name="Setup.php" hash="6fa8e98464aeaf4f385cf44eaa0af401"/></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="8ecb0daa40ada2842beaf83ecdf47a64"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d9d7d2e16fc75a3ed21fb37d799e2d4a"/><file name="config.xml" hash="f49431810fef7bcf5087afca0e6a18f3"/><file name="system.xml" hash="4632c60b3f154d8fbf4a0d34b7b1f347"/></dir><dir name="sql"><dir name="sparo_charityprocessor_setup"><file name="install-1.0.1.php" hash="5ecb0bfa51900ecbc56a2173cf048a97"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sparo_CharityProcessor.xml" hash="3b6207ba3e2657bad87b2a6ea2ae6343"/></dir></target></contents>
20
  <compatible/>
21
+ <dependencies><required><php><min>5.3.0</min><max>5.7.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0.0</min><max>1.9</max></package><extension><name>curl</name><min>5.3.0</min><max>5.7.0</max></extension></required></dependencies>
22
  </package>