HC_PayByFinance - Version 2.0.3.2

Version Notes

Change Log:
* HC-316 PBF Widget Displays For Non-Eligible Products
* HC-345 - Adding Google analytics override - sending grand total + financed amount to GA
* HC-349 SagePay status initiator
* HC-444 Financed amount added to invoice PDF
* HC-443 Adding new service types 25, 36 refactored
* HC-448 rounding issues fixed

Download this release

Release Info

Developer Sandor Czettner
Extension HC_PayByFinance
Version 2.0.3.2
Comparing to
See all releases


Code changes from version 2.0.3.1 to 2.0.3.2

Files changed (76) hide show
  1. app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Redirect.php +5 -5
  2. app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service.php +5 -5
  3. app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit.php +5 -5
  4. app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit/Form.php +5 -5
  5. app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit/Tab/Form.php +23 -5
  6. app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit/Tabs.php +5 -5
  7. app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Grid.php +5 -5
  8. app/code/local/HC/PayByFinance/Block/Adminhtml/Version.php +7 -7
  9. app/code/local/HC/PayByFinance/Block/Checkout/Redirect.php +4 -4
  10. app/code/local/HC/PayByFinance/Block/GoogleAnalytics/Ga.php +162 -0
  11. app/code/local/HC/PayByFinance/Block/Product/List/Finance.php +4 -4
  12. app/code/local/HC/PayByFinance/Block/Sales/Order/Totals.php +4 -4
  13. app/code/local/HC/PayByFinance/Block/Selector.php +26 -6
  14. app/code/local/HC/PayByFinance/Block/Status.php +5 -22
  15. app/code/local/HC/PayByFinance/Helper/Cart.php +4 -4
  16. app/code/local/HC/PayByFinance/Helper/Checkout.php +12 -10
  17. app/code/local/HC/PayByFinance/Helper/Data.php +30 -4
  18. app/code/local/HC/PayByFinance/Helper/Notification.php +4 -4
  19. app/code/local/HC/PayByFinance/Helper/Order.php +6 -6
  20. app/code/local/HC/PayByFinance/Model/Calculator.php +7 -7
  21. app/code/local/HC/PayByFinance/Model/Config/Source/Catalog/Product/Finance.php +4 -4
  22. app/code/local/HC/PayByFinance/Model/Config/Source/Catalog/Product/Type.php +4 -4
  23. app/code/local/HC/PayByFinance/Model/Config/Source/Cms/Block.php +4 -4
  24. app/code/local/HC/PayByFinance/Model/Config/Source/Connectionmode.php +4 -4
  25. app/code/local/HC/PayByFinance/Model/Config/Source/Notification/Status.php +4 -4
  26. app/code/local/HC/PayByFinance/Model/Config/Source/Type.php +42 -14
  27. app/code/local/HC/PayByFinance/Model/Log.php +4 -4
  28. app/code/local/HC/PayByFinance/Model/Mysql4/Log.php +4 -4
  29. app/code/local/HC/PayByFinance/Model/Mysql4/Log/Collection.php +4 -4
  30. app/code/local/HC/PayByFinance/Model/Mysql4/Service.php +4 -4
  31. app/code/local/HC/PayByFinance/Model/Mysql4/Service/Collection.php +4 -4
  32. app/code/local/HC/PayByFinance/Model/Observer.php +16 -11
  33. app/code/local/HC/PayByFinance/Model/Paypal/Api/Nvp.php +4 -4
  34. app/code/local/HC/PayByFinance/Model/Paypal/Hostedpro/Request.php +4 -4
  35. app/code/local/HC/PayByFinance/Model/PaypalUk/Api/Nvp.php +4 -4
  36. app/code/local/HC/PayByFinance/Model/Post.php +4 -4
  37. app/code/local/HC/PayByFinance/Model/Post/Abstract.php +4 -4
  38. app/code/local/HC/PayByFinance/Model/Post/Custom.php +4 -4
  39. app/code/local/HC/PayByFinance/Model/Post/Live.php +4 -4
  40. app/code/local/HC/PayByFinance/Model/Post/Simulation.php +4 -4
  41. app/code/local/HC/PayByFinance/Model/Post/Test.php +4 -4
  42. app/code/local/HC/PayByFinance/Model/Post/Unittest.php +4 -4
  43. app/code/local/HC/PayByFinance/Model/Resource/Setup.php +4 -4
  44. app/code/local/HC/PayByFinance/Model/Sagepayorderstatusobserver.php +99 -0
  45. app/code/local/HC/PayByFinance/Model/Sagepaypreauthobserver.php +118 -0
  46. app/code/local/HC/PayByFinance/Model/Sales/Order/Creditmemo/Financeamount.php +4 -4
  47. app/code/local/HC/PayByFinance/Model/Sales/Order/Invoice/Financeamount.php +4 -4
  48. app/code/local/HC/PayByFinance/Model/Sales/Pdf/Financeamount.php +51 -0
  49. app/code/local/HC/PayByFinance/Model/Sales/Quote/Financeamount.php +4 -4
  50. app/code/local/HC/PayByFinance/Model/Sales/Quote/Totalcost.php +4 -4
  51. app/code/local/HC/PayByFinance/Model/Service.php +4 -4
  52. app/code/local/HC/PayByFinance/Model/Session.php +4 -4
  53. app/code/local/HC/PayByFinance/Model/Sessionobserver.php +6 -4
  54. app/code/local/HC/PayByFinance/controllers/Adminhtml/Paybyfinance/RedirectController.php +4 -4
  55. app/code/local/HC/PayByFinance/controllers/Adminhtml/Paybyfinance/ServiceController.php +4 -4
  56. app/code/local/HC/PayByFinance/controllers/CheckoutController.php +15 -5
  57. app/code/local/HC/PayByFinance/controllers/NotificationController.php +4 -4
  58. app/code/local/HC/PayByFinance/controllers/SelectorController.php +4 -4
  59. app/code/local/HC/PayByFinance/controllers/SessionController.php +4 -4
  60. app/code/local/HC/PayByFinance/controllers/StatusController.php +4 -4
  61. app/code/local/HC/PayByFinance/etc/config.xml +58 -1
  62. app/code/local/HC/PayByFinance/etc/system.xml +37 -0
  63. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-install-2.0.3.php +2 -2
  64. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.0-1.0.1.php +2 -2
  65. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.1-1.0.2.php +2 -2
  66. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.3-1.0.4.php +2 -2
  67. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.4-1.0.5.php +2 -2
  68. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.5-1.0.6.php +2 -2
  69. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.6-1.0.7.php +2 -2
  70. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.7-2.0.0.php +2 -2
  71. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-2.0.0-2.0.1.php +2 -2
  72. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-2.0.1-2.0.2.php +2 -2
  73. app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-2.0.2-2.0.3.php +2 -2
  74. app/design/frontend/base/default/template/paybyfinance/form.phtml +2 -2
  75. app/design/frontend/base/default/template/paybyfinance/selector.phtml +6 -4
  76. package.xml +13 -10
app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Redirect.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Redirect
30
  extends Mage_Adminhtml_Block_Template
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Redirect
30
  extends Mage_Adminhtml_Block_Template
app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service
30
  extends Mage_Adminhtml_Block_Widget_Grid_Container
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service
30
  extends Mage_Adminhtml_Block_Widget_Grid_Container
app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit
30
  extends Mage_Adminhtml_Block_Widget_Form_Container
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit
30
  extends Mage_Adminhtml_Block_Widget_Form_Container
app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit/Form.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit_Form
30
  extends Mage_Adminhtml_Block_Widget_Form
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit_Form
30
  extends Mage_Adminhtml_Block_Widget_Form
app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit/Tab/Form.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit_Tab_Form
30
  extends Mage_Adminhtml_Block_Widget_Form
@@ -162,6 +162,8 @@ class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit_Tab_Form
162
  )
163
  );
164
 
 
 
165
  if (Mage::getSingleton('adminhtml/session')->getServiceData()) {
166
  $form->setValues(
167
  Mage::getSingleton('adminhtml/session')->getServiceData()
@@ -171,6 +173,22 @@ class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit_Tab_Form
171
  $form->setValues(Mage::registry('service_data')->getData());
172
  }
173
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  return parent::_prepareForm();
175
  }
176
  }
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Paybyfinance_Service_Edit_Tab_Form
30
  extends Mage_Adminhtml_Block_Widget_Form
162
  )
163
  );
164
 
165
+
166
+
167
  if (Mage::getSingleton('adminhtml/session')->getServiceData()) {
168
  $form->setValues(
169
  Mage::getSingleton('adminhtml/session')->getServiceData()
173
  $form->setValues(Mage::registry('service_data')->getData());
174
  }
175
 
176
+ /*
177
+ Show defer_term only for type 25, 34, 35
178
+ */
179
+ $this->setChild(
180
+ 'form_after', $this->getLayout()
181
+ ->createBlock('adminhtml/widget_form_element_dependence')
182
+ ->addFieldMap('type', 'type')
183
+ ->addFieldMap('defer_term', 'defer_term')
184
+ ->addFieldDependence(
185
+ 'defer_term', 'type',
186
+ array((string) HC_PayByFinance_Model_Config_Source_Type::TYPE25,
187
+ (string) HC_PayByFinance_Model_Config_Source_Type::TYPE34,
188
+ (string) HC_PayByFinance_Model_Config_Source_Type::TYPE35)
189
+ )
190
+ );
191
+
192
  return parent::_prepareForm();
193
  }
194
  }
app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Edit/Tabs.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFInance_Block_Adminhtml_Paybyfinance_Service_Edit_Tabs
30
  extends Mage_Adminhtml_Block_Widget_Tabs
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFInance_Block_Adminhtml_Paybyfinance_Service_Edit_Tabs
30
  extends Mage_Adminhtml_Block_Widget_Tabs
app/code/local/HC/PayByFinance/Block/Adminhtml/Paybyfinance/Service/Grid.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFInance_Block_Adminhtml_Paybyfinance_Service_Grid
30
  extends Mage_Adminhtml_Block_Widget_Grid
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFInance_Block_Adminhtml_Paybyfinance_Service_Grid
30
  extends Mage_Adminhtml_Block_Widget_Grid
app/code/local/HC/PayByFinance/Block/Adminhtml/Version.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
- * @copyright 2014 Healthy Websites
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,14 +22,14 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Version extends Mage_Adminhtml_Block_Template
30
  implements Varien_Data_Form_Element_Renderer_Interface
31
  {
32
- const PATCH_LEVEL = 1;
33
 
34
  protected $_template = "paybyfinance/version.phtml";
35
 
@@ -91,7 +91,7 @@ class HC_PayByFinance_Block_Adminhtml_Version extends Mage_Adminhtml_Block_Templ
91
 
92
  $res .= '<p>';
93
  $res .= 'Support reference: ' . $hash;
94
- $res .= '<br/><a href="mailto:support@healthywebsites.co.uk?subject=Support&body='
95
  . $id . '%20ref:%20' . $hash . '%0D%0ADO NOT REMOVE THE ABOVE LINE'
96
  . '">Email support</a>';
97
  $res .= '</p>';
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Cohesion Digital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Adminhtml_Version extends Mage_Adminhtml_Block_Template
30
  implements Varien_Data_Form_Element_Renderer_Interface
31
  {
32
+ const PATCH_LEVEL = 2;
33
 
34
  protected $_template = "paybyfinance/version.phtml";
35
 
91
 
92
  $res .= '<p>';
93
  $res .= 'Support reference: ' . $hash;
94
+ $res .= '<br/><a href="mailto:support@cohesiondigital.co.uk?subject=Support&body='
95
  . $id . '%20ref:%20' . $hash . '%0D%0ADO NOT REMOVE THE ABOVE LINE'
96
  . '">Email support</a>';
97
  $res .= '</p>';
app/code/local/HC/PayByFinance/Block/Checkout/Redirect.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Block_Checkout_Redirect extends Mage_Core_Block_Template
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Block_Checkout_Redirect extends Mage_Core_Block_Template
28
  {
app/code/local/HC/PayByFinance/Block/GoogleAnalytics/Ga.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hitachi Capital Pay By Finance
4
+ *
5
+ * Hitachi Capital Pay By Finance Extension
6
+ *
7
+ * PHP version >= 5.4.*
8
+ *
9
+ * @category HC
10
+ * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2016 Hitachi Capital
13
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
+ *
16
+ */
17
+
18
+
19
+ /**
20
+ * Send financed amount and grand total as value of order to Google Analytics
21
+ *
22
+ * @category HC
23
+ * @package PayByFinance
24
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
25
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
26
+ * @link http://www.cohesiondigital.co.uk/
27
+ */
28
+ class HC_PayByFinance_Block_GoogleAnalytics_Ga extends Mage_GoogleAnalytics_Block_Ga
29
+ {
30
+
31
+ /**
32
+ * Older Magento versions has this method only
33
+ *
34
+ * @return string|void
35
+ */
36
+ protected function _getOrdersTrackingCode()
37
+ {
38
+ $helper = $this->helper('googleanalytics');
39
+ if ($helper && method_exists($helper, 'isUseUniversalAnalytics')) {
40
+ if ($helper->isUseUniversalAnalytics()) {
41
+ return $this->_getOrdersTrackingCodeUniversal();
42
+ }
43
+ }
44
+
45
+ return $this->_getOrdersTrackingCodeAnalytics();
46
+ }
47
+
48
+ /**
49
+ * Generates code for Universal GA
50
+ *
51
+ * @return string
52
+ */
53
+ protected function _getOrdersTrackingCodeUniversal()
54
+ {
55
+ $orderIds = $this->getOrderIds();
56
+ if (empty($orderIds) || !is_array($orderIds)) {
57
+ return;
58
+ }
59
+ $collection = Mage::getResourceModel('sales/order_collection')
60
+ ->addFieldToFilter('entity_id', array('in' => $orderIds));
61
+ $result = array();
62
+ $result[] = "ga('require', 'ecommerce')";
63
+ foreach ($collection as $order) {
64
+ $baseGrandTotal = $order->getBaseGrandTotal();
65
+ //Adding financed amount in case of financed order
66
+ $financeAmount = $order->getFinanceAmount();
67
+ if ($financeAmount) {
68
+ $baseGrandTotal += $financeAmount;
69
+ }
70
+
71
+ $result[] = sprintf(
72
+ "ga('ecommerce:addTransaction', {
73
+ 'id': '%s',
74
+ 'affiliation': '%s',
75
+ 'revenue': '%s',
76
+ 'tax': '%s',
77
+ 'shipping': '%s'
78
+ });",
79
+ $order->getIncrementId(),
80
+ $this->jsQuoteEscape(Mage::app()->getStore()->getFrontendName()),
81
+ $baseGrandTotal,
82
+ $order->getBaseTaxAmount(),
83
+ $order->getBaseShippingAmount()
84
+ );
85
+ foreach ($order->getAllVisibleItems() as $item) {
86
+ $result[] = sprintf(
87
+ "ga('ecommerce:addItem', {
88
+ 'id': '%s',
89
+ 'sku': '%s',
90
+ 'name': '%s',
91
+ 'category': '%s',
92
+ 'price': '%s',
93
+ 'quantity': '%s'
94
+ });",
95
+ $order->getIncrementId(),
96
+ $this->jsQuoteEscape($item->getSku()),
97
+ $this->jsQuoteEscape($item->getName()),
98
+ null, // there is no "category" defined for the order item
99
+ $item->getBasePrice(),
100
+ $item->getQtyOrdered()
101
+ );
102
+ }
103
+ $result[] = "ga('ecommerce:send');";
104
+ }
105
+ return implode("\n", $result);
106
+ }
107
+
108
+ /**
109
+ * Generates code for Analytics version of GA
110
+ *
111
+ * @return string|void
112
+ */
113
+ protected function _getOrdersTrackingCodeAnalytics()
114
+ {
115
+ $orderIds = $this->getOrderIds();
116
+ if (empty($orderIds) || !is_array($orderIds)) {
117
+ return;
118
+ }
119
+ $collection = Mage::getResourceModel('sales/order_collection')
120
+ ->addFieldToFilter('entity_id', array('in' => $orderIds));
121
+ $result = array();
122
+ foreach ($collection as $order) {
123
+ if ($order->getIsVirtual()) {
124
+ $address = $order->getBillingAddress();
125
+ } else {
126
+ $address = $order->getShippingAddress();
127
+ }
128
+
129
+ $baseGrandTotal = $order->getBaseGrandTotal();
130
+ //Adding financed amount in case of financed order
131
+ $financeAmount = $order->getFinanceAmount();
132
+ if ($financeAmount) {
133
+ $baseGrandTotal += $financeAmount;
134
+ }
135
+
136
+ $result[] = sprintf(
137
+ "_gaq.push(['_addTrans', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s']);",
138
+ $order->getIncrementId(),
139
+ $this->jsQuoteEscape(Mage::app()->getStore()->getFrontendName()),
140
+ $baseGrandTotal,
141
+ $order->getBaseTaxAmount(),
142
+ $order->getBaseShippingAmount(),
143
+ $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($address->getCity())),
144
+ $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($address->getRegion())),
145
+ $this->jsQuoteEscape(Mage::helper('core')->escapeHtml($address->getCountry()))
146
+ );
147
+ foreach ($order->getAllVisibleItems() as $item) {
148
+ $result[] = sprintf(
149
+ "_gaq.push(['_addItem', '%s', '%s', '%s', '%s', '%s', '%s']);",
150
+ $order->getIncrementId(),
151
+ $this->jsQuoteEscape($item->getSku()), $this->jsQuoteEscape($item->getName()),
152
+ null, // there is no "category" defined for the order item
153
+ $item->getBasePrice(), $item->getQtyOrdered()
154
+ );
155
+ }
156
+ $result[] = "_gaq.push(['_trackTrans']);";
157
+ }
158
+ return implode("\n", $result);
159
+ }
160
+
161
+
162
+ }
app/code/local/HC/PayByFinance/Block/Product/List/Finance.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Product_List_Finance extends Mage_Core_Block_Template
30
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Product_List_Finance extends Mage_Core_Block_Template
30
  {
app/code/local/HC/PayByFinance/Block/Sales/Order/Totals.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFInance_Block_Sales_Order_Totals extends Mage_Core_Block_Template
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFInance_Block_Sales_Order_Totals extends Mage_Core_Block_Template
28
  {
app/code/local/HC/PayByFinance/Block/Selector.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Selector extends Mage_Core_Block_Template
30
  {
@@ -73,7 +73,7 @@ class HC_PayByFinance_Block_Selector extends Mage_Core_Block_Template
73
 
74
  $calculator = Mage::getSingleton('paybyfinance/calculator');
75
  $minInstallment = $calculator->getLowestMonthlyInstallment($this->_amount);
76
- if (!$minInstallment) {
77
  return false;
78
  }
79
  }
@@ -131,7 +131,8 @@ class HC_PayByFinance_Block_Selector extends Mage_Core_Block_Template
131
  if (!$helper->isActive()) {
132
  return '';
133
  }
134
- if (!$this->getProduct() && $this->getServices()->getSize() == 0) {
 
135
  $this->setTemplate('paybyfinance/selector-no.phtml');
136
  }
137
 
@@ -162,4 +163,23 @@ class HC_PayByFinance_Block_Selector extends Mage_Core_Block_Template
162
  return $name;
163
  }
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Selector extends Mage_Core_Block_Template
30
  {
73
 
74
  $calculator = Mage::getSingleton('paybyfinance/calculator');
75
  $minInstallment = $calculator->getLowestMonthlyInstallment($this->_amount);
76
+ if ($minInstallment === false) {
77
  return false;
78
  }
79
  }
131
  if (!$helper->isActive()) {
132
  return '';
133
  }
134
+
135
+ if ($this->shouldEmptySelectorDisplay()) {
136
  $this->setTemplate('paybyfinance/selector-no.phtml');
137
  }
138
 
163
  return $name;
164
  }
165
 
166
+ /**
167
+ * Should empty widget need to be displayed? Inverse function for isWidgetDisplayed()
168
+ *
169
+ * @return bool
170
+ */
171
+ private function shouldEmptySelectorDisplay()
172
+ {
173
+ // @codingStandardsIgnoreStart
174
+ // will test also product eligibility by calling
175
+ // Mage::helper('paybyfinance/cart')->getEligibleAmount() method
176
+ // @codingStandardsIgnoreLine
177
+ if ($this->getAmount() == false) {
178
+ return true;
179
+ }
180
+
181
+ // we are not on product page and no services will serve that cart
182
+ return (!$this->getProduct() && $this->getServices()->getSize() == 0);
183
+ }
184
+
185
  }
app/code/local/HC/PayByFinance/Block/Status.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Status extends Mage_Core_Block_Template
30
  {
@@ -74,7 +74,7 @@ class HC_PayByFinance_Block_Status extends Mage_Core_Block_Template
74
  }
75
 
76
  $block = Mage::getModel('cms/block')->load($id);
77
- $this->_order = $this->getOrder();
78
  $helper = Mage::helper('cms');
79
  $processor = $helper->getBlockTemplateProcessor();
80
  $processor->setVariables(
@@ -130,21 +130,4 @@ class HC_PayByFinance_Block_Status extends Mage_Core_Block_Template
130
 
131
  return Mage::getSingleton('customer/session')->isLoggedIn();
132
  }
133
-
134
- /**
135
- * Get order from request parameters
136
- *
137
- * @return Mage_Sales_Model_Order|null
138
- *
139
- * @throws Exception
140
- */
141
- private function getOrder()
142
- {
143
- $parameters = $this->getRequest()->getParams();
144
- if (isset($parameters['order_id'])) {
145
- return Mage::getModel('sales/order')->load($parameters['order_id']);
146
- }
147
-
148
- return null;
149
- }
150
  }
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Block_Status extends Mage_Core_Block_Template
30
  {
74
  }
75
 
76
  $block = Mage::getModel('cms/block')->load($id);
77
+ $this->_order = $helper->getOrder($this->getRequest()->getParams());
78
  $helper = Mage::helper('cms');
79
  $processor = $helper->getBlockTemplateProcessor();
80
  $processor->setVariables(
130
 
131
  return Mage::getSingleton('customer/session')->isLoggedIn();
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
app/code/local/HC/PayByFinance/Helper/Cart.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Cart extends Mage_Core_Helper_Data
30
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Cart extends Mage_Core_Helper_Data
30
  {
app/code/local/HC/PayByFinance/Helper/Checkout.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Checkout extends Mage_Core_Helper_Data
30
  {
@@ -71,9 +71,9 @@ class HC_PayByFinance_Helper_Checkout extends Mage_Core_Helper_Data
71
  $message = $this->getParamText('id', 'id', $parameters);
72
  $message .= $this->getParamText('id2', 'id2', $parameters);
73
  $message .= "\nFinance: " . $parameters['decision'];
74
- $message .= "\nApplication: " . $parameters['applicationNo'];
75
- $message .= "\nAuthorization: " . $parameters['authorisationcode'];
76
- $message .= "\nSURL: " . $parameters['sourceurl'];
77
  $message .= $this->getParamText('Errreason', 'Reason', $parameters);
78
  $message .= $this->getParamText('Errtext', 'Message', $parameters);
79
 
@@ -148,9 +148,11 @@ class HC_PayByFinance_Helper_Checkout extends Mage_Core_Helper_Data
148
  $message = 'id: ' . $parameters['id'];
149
  $message .= ' id2: ' . $parameters['id2'];
150
  $message .= "\n" . $parameters['decision'];
151
- $message .= "\nApplication: " . $parameters['applicationNo'];
152
- $message .= "\nAuthorization: " . $parameters['authorisationcode'];
153
- $message .= "\nSURL: " . $parameters['sourceurl'];
 
 
154
  $message .= "\nReason: " . $parameters['Errreason'];
155
  $message .= "\nMessage: " . $parameters['Errtext'];
156
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Checkout extends Mage_Core_Helper_Data
30
  {
71
  $message = $this->getParamText('id', 'id', $parameters);
72
  $message .= $this->getParamText('id2', 'id2', $parameters);
73
  $message .= "\nFinance: " . $parameters['decision'];
74
+ $message .= "\nApplication: " . isset($parameters['applicationNo'])?$parameters['applicationNo']:"N/A";
75
+ $message .= "\nAuthorization: " . isset($parameters['authorisationcode'])?$parameters['authorisationcode']:"N/A";
76
+ $message .= "\nSURL: " . isset($parameters['sourceurl'])?$parameters['sourceurl']:"N/A";
77
  $message .= $this->getParamText('Errreason', 'Reason', $parameters);
78
  $message .= $this->getParamText('Errtext', 'Message', $parameters);
79
 
148
  $message = 'id: ' . $parameters['id'];
149
  $message .= ' id2: ' . $parameters['id2'];
150
  $message .= "\n" . $parameters['decision'];
151
+ $message .= "\nApplication: " .
152
+ isset($parameters['applicationNo'])?$parameters['applicationNo']:"N/A";
153
+ $message .= "\nAuthorization: " .
154
+ isset($parameters['authorisationcode'])?$parameters['authorisationcode']:"N/A";
155
+ $message .= "\nSURL: " . isset($parameters['sourceurl'])?$parameters['sourceurl']:"N/A";
156
  $message .= "\nReason: " . $parameters['Errreason'];
157
  $message .= "\nMessage: " . $parameters['Errtext'];
158
 
app/code/local/HC/PayByFinance/Helper/Data.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
30
  {
@@ -61,6 +61,8 @@ class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
61
  const XML_PATH_EMAIL_TEMPLATE_GUEST = 'hc_paybyfinance/general/declined_email_guest';
62
  const XML_PATH_EMAIL_REFERRED = 'hc_paybyfinance/general/referred_email';
63
  const XML_PATH_EMAIL_REFERRED_GUEST = 'hc_paybyfinance/general/referred_email_guest';
 
 
64
  const ERROR_LOG_PATH_LOG = 'paybyfinance/paybyfinance-log.log';
65
  const ERROR_LOG_PATH_POST = 'paybyfinance/paybyfinance-post.log';
66
  const ERROR_LOG_PATH_NOTIFICATION = 'paybyfinance/paybyfinance-notification.log';
@@ -90,6 +92,8 @@ class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
90
  'service' => $session->getData('service'),
91
  'deposit' => $session->getData('deposit'),
92
  );
 
 
93
  foreach ($services as $service) {
94
  $types[$service->getType()] = $this->getTypeName((int) $service->getType());
95
  $json['terms'][] = array(
@@ -166,6 +170,8 @@ class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
166
  public function isProductEligible($item)
167
  {
168
  $options = Mage::getSingleton('paybyfinance/config_source_catalog_product_finance');
 
 
169
 
170
  if ($item instanceof Mage_Sales_Model_Quote_Item
171
  || $item instanceof Mage_Sales_Model_Order_Item
@@ -177,6 +183,10 @@ class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
177
  $price = Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), true);
178
  }
179
 
 
 
 
 
180
  if ($product->getPaybyfinanceEnable() == $options::VALUES_DISABLE) {
181
  return false;
182
  } elseif ($product->getPaybyfinanceEnable() == $options::VALUES_ENABLE) {
@@ -403,4 +413,20 @@ class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
403
 
404
  return (boolean) $enabled;
405
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
  }
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Data extends Mage_Core_Helper_Data
30
  {
61
  const XML_PATH_EMAIL_TEMPLATE_GUEST = 'hc_paybyfinance/general/declined_email_guest';
62
  const XML_PATH_EMAIL_REFERRED = 'hc_paybyfinance/general/referred_email';
63
  const XML_PATH_EMAIL_REFERRED_GUEST = 'hc_paybyfinance/general/referred_email_guest';
64
+ const XML_PATH_SAGEPAY_INITIATOR = 'hc_paybyfinance/general/sagepay_status_initiator';
65
+ const XML_PATH_SAGEPAY_PREAUTH = 'hc_paybyfinance/general/sagepay_preauth';
66
  const ERROR_LOG_PATH_LOG = 'paybyfinance/paybyfinance-log.log';
67
  const ERROR_LOG_PATH_POST = 'paybyfinance/paybyfinance-post.log';
68
  const ERROR_LOG_PATH_NOTIFICATION = 'paybyfinance/paybyfinance-notification.log';
92
  'service' => $session->getData('service'),
93
  'deposit' => $session->getData('deposit'),
94
  );
95
+ $types = array();
96
+
97
  foreach ($services as $service) {
98
  $types[$service->getType()] = $this->getTypeName((int) $service->getType());
99
  $json['terms'][] = array(
170
  public function isProductEligible($item)
171
  {
172
  $options = Mage::getSingleton('paybyfinance/config_source_catalog_product_finance');
173
+ $product = null;
174
+ $price = null;
175
 
176
  if ($item instanceof Mage_Sales_Model_Quote_Item
177
  || $item instanceof Mage_Sales_Model_Order_Item
183
  $price = Mage::helper('tax')->getPrice($product, $product->getFinalPrice(), true);
184
  }
185
 
186
+ if ($product === null || $price === null) {
187
+ return false;
188
+ }
189
+
190
  if ($product->getPaybyfinanceEnable() == $options::VALUES_DISABLE) {
191
  return false;
192
  } elseif ($product->getPaybyfinanceEnable() == $options::VALUES_ENABLE) {
413
 
414
  return (boolean) $enabled;
415
  }
416
+
417
+ /**
418
+ * Get order from request parameters
419
+ *
420
+ * @param array $parameters URL parameters
421
+ *
422
+ * @return Mage_Sales_Model_Order|null
423
+ */
424
+ public function getOrder($parameters)
425
+ {
426
+ if (isset($parameters['order_id'])) {
427
+ return Mage::getModel('sales/order')->load($parameters['order_id']);
428
+ }
429
+
430
+ return null;
431
+ }
432
  }
app/code/local/HC/PayByFinance/Helper/Notification.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Notification extends Mage_Core_Helper_Data
30
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Notification extends Mage_Core_Helper_Data
30
  {
app/code/local/HC/PayByFinance/Helper/Order.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Order extends Mage_Core_Helper_Data
30
  {
@@ -58,7 +58,7 @@ class HC_PayByFinance_Helper_Order extends Mage_Core_Helper_Data
58
  */
59
  public function queueFailedOrderEmail($order, $financeStatus, $forceMode = false)
60
  {
61
- $helper = mage::helper('paybyfinance');
62
  $storeId = $order->getStore()->getId();
63
 
64
  if (!Mage::helper('sales')->canSendNewOrderEmail($storeId)) {
@@ -177,7 +177,7 @@ class HC_PayByFinance_Helper_Order extends Mage_Core_Helper_Data
177
  public function sendFailedOrderEmail($order, $financeStatus)
178
  {
179
  $storeId = $order->getStore()->getId();
180
- $helper = mage::helper('paybyfinance');
181
 
182
  if (!Mage::helper('sales')->canSendNewOrderEmail($storeId)) {
183
  return $order;
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Helper_Order extends Mage_Core_Helper_Data
30
  {
58
  */
59
  public function queueFailedOrderEmail($order, $financeStatus, $forceMode = false)
60
  {
61
+ $helper = Mage::helper('paybyfinance'); // @codingStandardsIgnoreStart /** @var HC_PayByFinance_Helper_Data $helper */ // @codingStandardsIgnoreEnd
62
  $storeId = $order->getStore()->getId();
63
 
64
  if (!Mage::helper('sales')->canSendNewOrderEmail($storeId)) {
177
  public function sendFailedOrderEmail($order, $financeStatus)
178
  {
179
  $storeId = $order->getStore()->getId();
180
+ $helper = mage::helper('paybyfinance'); // @codingStandardsIgnoreStart /** @var HC_PayByFinance_Helper_Data $helper */ // @codingStandardsIgnoreEnd
181
 
182
  if (!Mage::helper('sales')->canSendNewOrderEmail($storeId)) {
183
  return $order;
app/code/local/HC/PayByFinance/Model/Calculator.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Calculator extends Varien_Object
30
  {
@@ -93,14 +93,14 @@ class HC_PayByFinance_Model_Calculator extends Varien_Object
93
  if ($service === null) {
94
  $service = $this->getService();
95
  }
96
- // No rounding issues, rounding always down.
97
- $monthlyPayment = floor(($amount * $service->getMultiplier()) * 100) / 100;
98
 
99
  return $monthlyPayment;
100
  }
101
 
102
  /**
103
- * Calculating monthly payments (Interst Free, type=32)
104
  *
105
  * @param float $amount Credit amount
106
  * @param HC_PayByFinance_Model_Service $service Service
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Calculator extends Varien_Object
30
  {
93
  if ($service === null) {
94
  $service = $this->getService();
95
  }
96
+ // rounding always up for interest bearing services.
97
+ $monthlyPayment = ceil(($amount * $service->getMultiplier()) * 100) / 100;
98
 
99
  return $monthlyPayment;
100
  }
101
 
102
  /**
103
+ * Calculating monthly payments (Interest Free, type=32)
104
  *
105
  * @param float $amount Credit amount
106
  * @param HC_PayByFinance_Model_Service $service Service
app/code/local/HC/PayByFinance/Model/Config/Source/Catalog/Product/Finance.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Catalog_Product_Finance
28
  extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Catalog_Product_Finance
28
  extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
app/code/local/HC/PayByFinance/Model/Config/Source/Catalog/Product/Type.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Catalog_Product_Type
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Catalog_Product_Type
28
  {
app/code/local/HC/PayByFinance/Model/Config/Source/Cms/Block.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Cms_Block
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Cms_Block
28
  {
app/code/local/HC/PayByFinance/Model/Config/Source/Connectionmode.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Connectionmode
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Connectionmode
28
  {
app/code/local/HC/PayByFinance/Model/Config/Source/Notification/Status.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2015 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Notification_Status
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2015 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Notification_Status
28
  {
app/code/local/HC/PayByFinance/Model/Config/Source/Type.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,12 +20,20 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Type
28
  {
 
 
 
 
 
 
 
 
29
  /**
30
  * toOptionArray
31
  *
@@ -34,14 +42,17 @@ class HC_PayByFinance_Model_Config_Source_Type
34
  public function toOptionArray()
35
  {
36
  $options = array(
37
- 31 => '31: Interest bearing credit',
38
- 32 => '32: Interest free credit',
39
- 33 => '33: Interest option',
40
- 34 => '34: Buy now pay later interest free credit',
41
- 35 => '35: Buy now pay later interest bearing',
 
 
42
  );
43
 
44
  return $options;
 
45
  }
46
 
47
  /**
@@ -52,13 +63,30 @@ class HC_PayByFinance_Model_Config_Source_Type
52
  public function toFrontendArray()
53
  {
54
  $options = array(
55
- 31 => 'Interest bearing',
56
- 32 => 'Interest free',
57
- 33 => 'Interest option',
58
- 34 => 'Buy now pay later interest free',
59
- 35 => 'Buy now pay later interest bearing',
 
 
60
  );
61
 
62
  return $options;
63
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Config_Source_Type
28
  {
29
+ const TYPE25 = 25; //Deferred Interest Bearing Credit
30
+ const TYPE31 = 31; //Interest bearing credit
31
+ const TYPE32 = 32; //Interest free credit
32
+ const TYPE33 = 33; //Interest option
33
+ const TYPE34 = 34; //Buy now pay later interest free credit
34
+ const TYPE35 = 35; //Buy now pay later interest bearing
35
+ const TYPE36 = 36; //Accelerated Payment
36
+
37
  /**
38
  * toOptionArray
39
  *
42
  public function toOptionArray()
43
  {
44
  $options = array(
45
+ self::TYPE25 => self::TYPE25 . ': Deferred Interest Bearing Credit',
46
+ self::TYPE31 => self::TYPE31 . ': Interest bearing credit',
47
+ self::TYPE32 => self::TYPE32 . ': Interest free credit',
48
+ self::TYPE33 => self::TYPE33 . ': Interest option',
49
+ self::TYPE34 => self::TYPE34 . ': Buy now pay later interest free credit',
50
+ self::TYPE35 => self::TYPE35 . ': Buy now pay later interest bearing',
51
+ self::TYPE36 => self::TYPE36 . ': Accelerated Payment',
52
  );
53
 
54
  return $options;
55
+
56
  }
57
 
58
  /**
63
  public function toFrontendArray()
64
  {
65
  $options = array(
66
+ self::TYPE25 => 'Deferred Interest Bearing',
67
+ self::TYPE31 => 'Interest bearing',
68
+ self::TYPE32 => 'Interest free',
69
+ self::TYPE33 => 'Interest option',
70
+ self::TYPE34 => 'Buy now pay later interest free',
71
+ self::TYPE35 => 'Buy now pay later interest bearing',
72
+ self::TYPE36 => 'Accelerated Payment',
73
  );
74
 
75
  return $options;
76
  }
77
+
78
+ /**
79
+ * Is provided service type deferred one? Those services requires
80
+ * more parameters when sending to HC
81
+ *
82
+ * @param int $serviceType service Type
83
+ *
84
+ * @return bool
85
+ */
86
+ public static function isDeferredType($serviceType)
87
+ {
88
+ return ($serviceType == self::TYPE25) || ($serviceType == self::TYPE34)
89
+ || ($serviceType == self::TYPE35);
90
+ }
91
+
92
  }
app/code/local/HC/PayByFinance/Model/Log.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Log extends Mage_Core_Model_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Log extends Mage_Core_Model_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Mysql4/Log.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Log
28
  extends Mage_Core_Model_Mysql4_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Log
28
  extends Mage_Core_Model_Mysql4_Abstract
app/code/local/HC/PayByFinance/Model/Mysql4/Log/Collection.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Log_Collection
28
  extends Mage_Core_Model_Mysql4_Collection_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Log_Collection
28
  extends Mage_Core_Model_Mysql4_Collection_Abstract
app/code/local/HC/PayByFinance/Model/Mysql4/Service.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Service
28
  extends Mage_Core_Model_Mysql4_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Service
28
  extends Mage_Core_Model_Mysql4_Abstract
app/code/local/HC/PayByFinance/Model/Mysql4/Service/Collection.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Service_Collection
28
  extends Mage_Core_Model_Mysql4_Collection_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Mysql4_Service_Collection
28
  extends Mage_Core_Model_Mysql4_Collection_Abstract
app/code/local/HC/PayByFinance/Model/Observer.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Observer
28
  {
@@ -345,14 +345,19 @@ class HC_PayByFinance_Model_Observer
345
  if (Mage::getSingleton('paybyfinance/session')->getData('analytics_sent')) {
346
  return;
347
  }
348
- $order = Mage::getModel('sales/order')->load(
349
- Mage::getSingleton('paybyfinance/session')->getData('order_id')
350
- );
351
- $lastOrderId = $order->getId();
352
- if (!is_numeric($lastOrderId)) {
353
- return;
 
 
 
 
354
  }
355
 
 
356
  $block = Mage::app()
357
  ->getFrontController()
358
  ->getAction()
@@ -360,7 +365,7 @@ class HC_PayByFinance_Model_Observer
360
  ->getBlock('google_analytics');
361
 
362
  if ($block) {
363
- $block->setOrderIds(array($lastOrderId));
364
  Mage::getSingleton('paybyfinance/session')->setData('analytics_sent', true);
365
  }
366
  }
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Observer
28
  {
345
  if (Mage::getSingleton('paybyfinance/session')->getData('analytics_sent')) {
346
  return;
347
  }
348
+ $helper = Mage::helper('paybyfinance');
349
+ $order = $helper->getOrder(Mage::app()->getRequest()->getParams());
350
+ if ($order === null) { // try to fetch order from session, old way, compatibility...
351
+ $order = Mage::getModel('sales/order')->load(
352
+ Mage::getSingleton('paybyfinance/session')->getData('order_id')
353
+ );
354
+ $lastOrderId = $order->getId();
355
+ if (!is_numeric($lastOrderId)) {
356
+ return;
357
+ }
358
  }
359
 
360
+
361
  $block = Mage::app()
362
  ->getFrontController()
363
  ->getAction()
365
  ->getBlock('google_analytics');
366
 
367
  if ($block) {
368
+ $block->setOrderIds(array($order->getId()));
369
  Mage::getSingleton('paybyfinance/session')->setData('analytics_sent', true);
370
  }
371
  }
app/code/local/HC/PayByFinance/Model/Paypal/Api/Nvp.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Paypal_Api_Nvp extends Mage_Paypal_Model_Api_Nvp
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Paypal_Api_Nvp extends Mage_Paypal_Model_Api_Nvp
28
  {
app/code/local/HC/PayByFinance/Model/Paypal/Hostedpro/Request.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Paypal_Hostedpro_Request extends Mage_Paypal_Model_Hostedpro_Request
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Paypal_Hostedpro_Request extends Mage_Paypal_Model_Hostedpro_Request
28
  {
app/code/local/HC/PayByFinance/Model/PaypalUk/Api/Nvp.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_PaypalUk_Api_Nvp extends HC_PayByFinance_Model_Paypal_Api_Nvp
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_PaypalUk_Api_Nvp extends HC_PayByFinance_Model_Paypal_Api_Nvp
28
  {
app/code/local/HC/PayByFinance/Model/Post.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post extends Mage_Core_Model_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post extends Mage_Core_Model_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Post/Abstract.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  abstract class HC_PayByFinance_Model_Post_Abstract extends Mage_Core_Model_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  abstract class HC_PayByFinance_Model_Post_Abstract extends Mage_Core_Model_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Post/Custom.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Custom extends HC_PayByFinance_Model_Post_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Custom extends HC_PayByFinance_Model_Post_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Post/Live.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Live extends HC_PayByFinance_Model_Post_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Live extends HC_PayByFinance_Model_Post_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Post/Simulation.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Simulation extends HC_PayByFinance_Model_Post_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Simulation extends HC_PayByFinance_Model_Post_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Post/Test.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Test extends HC_PayByFinance_Model_Post_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Test extends HC_PayByFinance_Model_Post_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Post/Unittest.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Unittest extends HC_PayByFinance_Model_Post_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Post_Unittest extends HC_PayByFinance_Model_Post_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Resource/Setup.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Resource_Setup
30
  extends Mage_Core_Model_Resource_Setup
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Resource_Setup
30
  extends Mage_Core_Model_Resource_Setup
app/code/local/HC/PayByFinance/Model/Sagepayorderstatusobserver.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Initializes new order status by configuration
4
+ *
5
+ * PHP version >= 5.4.*
6
+ *
7
+ * @category HC
8
+ * @package PayByFinance
9
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
10
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
11
+ * @link http://www.cohesiondigital.co.uk/
12
+ */
13
+
14
+ /**
15
+ * Initializes new order status by configuration
16
+ *
17
+ * @uses Mage_Core_Helper_Data
18
+ *
19
+ * @category HC
20
+ * @package PayByFinance
21
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
22
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
23
+ * @link http://www.cohesiondigital.co.uk/
24
+ */
25
+ class HC_PayByFinance_Model_Sagepayorderstatusobserver
26
+ {
27
+
28
+ /**
29
+ * Called when order is placed and sets configured status
30
+ *
31
+ * @param Varien_Event_Observer $observer observer
32
+ *
33
+ * @return void
34
+ */
35
+ public function salesOrderPaymentPlaceEnd(Varien_Event_Observer $observer)
36
+ {
37
+ if (!$this->isPBFActiveForThisOrder() || !$this->isModuleEnabled()) {
38
+ return;
39
+ }
40
+ $payment = $observer->getEvent()->getPayment();
41
+ if ($payment) {
42
+ $order = $payment->getOrder();
43
+ if ($order->getFinanceService()) {
44
+ $status = $this->getNewStatusValue();
45
+ $order->setStatus($status);
46
+ }
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Sets configured order status value to passed observer object
52
+ *
53
+ * @param Varien_Event_Observer $observer $observer
54
+ *
55
+ * @return void
56
+ */
57
+ public function sagepaysuiteGetConfigvalueOrderStatus(Varien_Event_Observer $observer)
58
+ {
59
+ if (!$this->isPBFActiveForThisOrder() || !$this->isModuleEnabled()) {
60
+ return;
61
+ }
62
+
63
+ $confObject = $observer->getConfobject();
64
+ $confObject->value=$this->getNewStatusValue();
65
+ }
66
+
67
+
68
+ /**
69
+ * Is current order financed? Ugly access to session ;-(
70
+ *
71
+ * @return mixed
72
+ */
73
+ private function isPBFActiveForThisOrder()
74
+ {
75
+ return (Mage::getSingleton('paybyfinance/session')->getData('enabled'));
76
+ }
77
+
78
+ /**
79
+ * Is SagePay order status initiator submodule enabled in config?
80
+ *
81
+ * @return bool
82
+ */
83
+ private function isModuleEnabled()
84
+ {
85
+ $helper = Mage::helper('paybyfinance');
86
+ return (((boolean) Mage::getStoreConfig($helper::XML_PATH_SAGEPAY_INITIATOR)) == true) ;
87
+ }
88
+
89
+ /**
90
+ * Returns configured value for status of newly created financed orders
91
+ *
92
+ * @return mixed
93
+ */
94
+ protected function getNewStatusValue()
95
+ {
96
+ return Mage::getStoreConfig('payment/sagepayserver/order_status_financed');
97
+ }
98
+
99
+ }
app/code/local/HC/PayByFinance/Model/Sagepaypreauthobserver.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hitachi Capital Pay By Finance
4
+ *
5
+ * Hitachi Capital Pay By Finance modifgications for Sagepaypreauth
6
+ *
7
+ * PHP version >= 5.4.*
8
+ *
9
+ * @category HC
10
+ * @package Sagepaypreauth
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2015 Hitachi Capital
13
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
+ *
16
+ */
17
+
18
+ /**
19
+ * Observer Model
20
+ *
21
+ * @category HC
22
+ * @package Sagepaypreauth
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
+ */
27
+ class HC_PayByFinance_Model_Sagepaypreauthobserver
28
+ {
29
+ /**
30
+ * Get payment action
31
+ *
32
+ * @param Object $observer Observer object
33
+ *
34
+ * @see Ebizmarts_SagePaySuite_Model_Api_Payment::getConfigData()
35
+ * @return void
36
+ */
37
+ public function getPaymentAction($observer)
38
+ {
39
+ if (!$this->isModuleEnabled()) {
40
+ return;
41
+ }
42
+
43
+ if (!Mage::getSingleton('paybyfinance/session')->getData('enabled')) {
44
+ return;
45
+ }
46
+
47
+ $confobject = $observer->getConfobject();
48
+ $confobject->value = Ebizmarts_SagePaySuite_Model_Api_Payment::REQUEST_TYPE_DEFERRED;
49
+ }
50
+
51
+ /**
52
+ * Shipment event to create invoice, capture online for financed orders
53
+ *
54
+ * @param Object $observer Observer object
55
+ *
56
+ * @return void
57
+ */
58
+ public function orderSaveAfter($observer)
59
+ {
60
+ if (!$this->isModuleEnabled()) {
61
+ return;
62
+ }
63
+
64
+ $order = $observer->getOrder();
65
+
66
+ if ($order->getFinanceStatus() == 'ACCEPT'
67
+ && $order->getState() == Mage_Sales_Model_Order::STATE_PROCESSING
68
+ && !$order->hasInvoices()
69
+ ) {
70
+ if (!$order->canInvoice()) {
71
+ Mage::log(
72
+ 'Can\'t create invoice automatically for '
73
+ . $order->getIncrementId(), null, 'invoice.log'
74
+ );
75
+ return;
76
+ }
77
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
78
+
79
+ if (!$invoice->getTotalQty()) {
80
+ Mage::log(
81
+ 'Can\'t create invoice without products '
82
+ . $order->getIncrementId(), null, 'invoice.log'
83
+ );
84
+ return;
85
+ }
86
+
87
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
88
+ $invoice->register();
89
+ $transactionSave = Mage::getModel('core/resource_transaction')
90
+ ->addObject($invoice)
91
+
92
+ ->addObject($invoice->getOrder());
93
+
94
+ $transactionSave->save();
95
+ Mage::log(
96
+ 'Invoiced automatically: ' . $order->getIncrementId()
97
+ . ' Invoice: ' . $invoice->getIncrementId(), null, 'invoice.log'
98
+ );
99
+ } else {
100
+ Mage::log(
101
+ 'Not a financed order or finance is not "ACCEPT": '
102
+ . $order->getIncrementId(), null, 'invoice.log'
103
+ );
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Is SagePay preauth submodule enabled in config?
109
+ *
110
+ * @return bool
111
+ */
112
+ private function isModuleEnabled()
113
+ {
114
+ $helper = Mage::helper('paybyfinance');
115
+ return (((boolean) Mage::getStoreConfig($helper::XML_PATH_SAGEPAY_PREAUTH)) == true) ;
116
+ }
117
+
118
+ }
app/code/local/HC/PayByFinance/Model/Sales/Order/Creditmemo/Financeamount.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Order_Creditmemo_FInanceamount
30
  extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Order_Creditmemo_FInanceamount
30
  extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
app/code/local/HC/PayByFinance/Model/Sales/Order/Invoice/Financeamount.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Order_Invoice_Financeamount
30
  extends Mage_Sales_Model_Order_Invoice_Total_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Order_Invoice_Financeamount
30
  extends Mage_Sales_Model_Order_Invoice_Total_Abstract
app/code/local/HC/PayByFinance/Model/Sales/Pdf/Financeamount.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Hitachi Capital Pay By Finance
4
+ *
5
+ * Hitachi Capital Pay By Finance Extension
6
+ *
7
+ * PHP version >= 5.4.*
8
+ *
9
+ * @category HC
10
+ * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
+ * @copyright 2014 Hitachi Capital
13
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
+ *
16
+ */
17
+
18
+ /**
19
+ * Totals value on invoice PDF
20
+ *
21
+ * @uses Mage_Sales_Model_Order_Pdf_Total_Default
22
+ *
23
+ * @category HC
24
+ * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
+ * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
+ */
29
+ class HC_PayByFinance_Model_Sales_Pdf_Financeamount extends Mage_Sales_Model_Order_Pdf_Total_Default
30
+ {
31
+
32
+ /**
33
+ * Get totals array to display
34
+ *
35
+ * @return array
36
+ */
37
+ public function getTotalsForDisplay()
38
+ {
39
+ // getAmount will automatically get the value of the total
40
+ // its value id defined source_field in config.xml
41
+ $amount = $this->getAmount();
42
+ $label = Mage::helper('paybyfinance')->__('Financed Amount').':';
43
+ $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
44
+ $total = array(
45
+ 'amount' => Mage::helper('core')->currency($amount, true, false),
46
+ 'label' => $label,
47
+ 'font_size' => $fontSize
48
+ );
49
+ return array($total);
50
+ }
51
+ }
app/code/local/HC/PayByFinance/Model/Sales/Quote/Financeamount.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Quote_Financeamount
30
  extends Mage_Sales_Model_Quote_Address_Total_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Quote_Financeamount
30
  extends Mage_Sales_Model_Quote_Address_Total_Abstract
app/code/local/HC/PayByFinance/Model/Sales/Quote/Totalcost.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Quote_Totalcost
30
  extends Mage_Sales_Model_Quote_Address_Total_Abstract
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sales_Quote_Totalcost
30
  extends Mage_Sales_Model_Quote_Address_Total_Abstract
app/code/local/HC/PayByFinance/Model/Service.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Service extends Mage_Core_Model_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Service extends Mage_Core_Model_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Session.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -20,9 +20,9 @@
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Session extends Mage_Core_Model_Session_Abstract
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
20
  *
21
  * @category HC
22
  * @package PayByFinance
23
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
+ * @link http://www.cohesiondigital.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Session extends Mage_Core_Model_Session_Abstract
28
  {
app/code/local/HC/PayByFinance/Model/Sessionobserver.php CHANGED
@@ -8,21 +8,23 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
18
  /**
19
  * Hitachi Session Observer
20
  *
 
 
21
  * @category HC
22
  * @package PayByFinance
23
- * @author Healthy Websites <support@healthywebsites.co.uk>
24
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
25
- * @link http://www.healthywebsites.co.uk/
26
  */
27
  class HC_PayByFinance_Model_Sessionobserver
28
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
18
  /**
19
  * Hitachi Session Observer
20
  *
21
+ * PHP version >= 5.4.*
22
+ *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Model_Sessionobserver
30
  {
app/code/local/HC/PayByFinance/controllers/Adminhtml/Paybyfinance/RedirectController.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Adminhtml_Paybyfinance_RedirectController
30
  extends Mage_Adminhtml_Controller_Action
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Adminhtml_Paybyfinance_RedirectController
30
  extends Mage_Adminhtml_Controller_Action
app/code/local/HC/PayByFinance/controllers/Adminhtml/Paybyfinance/ServiceController.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_Adminhtml_Paybyfinance_ServiceController
30
  extends Mage_Adminhtml_Controller_Action
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_Adminhtml_Paybyfinance_ServiceController
30
  extends Mage_Adminhtml_Controller_Action
app/code/local/HC/PayByFinance/controllers/CheckoutController.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_CheckoutController extends Mage_Core_Controller_Front_Action
30
  {
@@ -124,6 +124,14 @@ class HC_PayByFinance_CheckoutController extends Mage_Core_Controller_Front_Acti
124
  );
125
  $productCount++;
126
  }
 
 
 
 
 
 
 
 
127
 
128
  $post->setQuoteData(
129
  array_merge(
@@ -157,7 +165,8 @@ class HC_PayByFinance_CheckoutController extends Mage_Core_Controller_Front_Acti
157
  'postcode' => $address->getPostcode(),
158
  'email' => $order->getCustomerEmail(),
159
  ),
160
- $productsInForm
 
161
  )
162
  );
163
 
@@ -193,6 +202,7 @@ class HC_PayByFinance_CheckoutController extends Mage_Core_Controller_Front_Acti
193
  $coHelper = Mage::helper('paybyfinance/checkout');
194
  $helper = Mage::helper('paybyfinance');
195
  $helper->log("Response: \n" . $helper->arrayDump($parameters), 'post');
 
196
 
197
  if (array_key_exists('ro', $parameters)) {
198
  $order = Mage::getModel('sales/order')->load($parameters['ro'], 'increment_id');
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_CheckoutController extends Mage_Core_Controller_Front_Action
30
  {
124
  );
125
  $productCount++;
126
  }
127
+ $deferredServicesProperties = array();
128
+ if (HC_PayByFinance_Model_Config_Source_Type::isDeferredType(
129
+ $service->getType()
130
+ )
131
+ ) {
132
+ $deferredServicesProperties['cdperiod'] = $service->getDeferTerm();
133
+ }
134
+
135
 
136
  $post->setQuoteData(
137
  array_merge(
165
  'postcode' => $address->getPostcode(),
166
  'email' => $order->getCustomerEmail(),
167
  ),
168
+ $productsInForm,
169
+ $deferredServicesProperties
170
  )
171
  );
172
 
202
  $coHelper = Mage::helper('paybyfinance/checkout');
203
  $helper = Mage::helper('paybyfinance');
204
  $helper->log("Response: \n" . $helper->arrayDump($parameters), 'post');
205
+ $order = null;
206
 
207
  if (array_key_exists('ro', $parameters)) {
208
  $order = Mage::getModel('sales/order')->load($parameters['ro'], 'increment_id');
app/code/local/HC/PayByFinance/controllers/NotificationController.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_NotificationController extends Mage_Core_Controller_Front_Action
30
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_NotificationController extends Mage_Core_Controller_Front_Action
30
  {
app/code/local/HC/PayByFinance/controllers/SelectorController.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_SelectorController extends Mage_Core_Controller_Front_Action
30
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_SelectorController extends Mage_Core_Controller_Front_Action
30
  {
app/code/local/HC/PayByFinance/controllers/SessionController.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_SessionController extends Mage_Core_Controller_Front_Action
30
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_SessionController extends Mage_Core_Controller_Front_Action
30
  {
app/code/local/HC/PayByFinance/controllers/StatusController.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -22,9 +22,9 @@
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
- * @author Healthy Websites <support@healthywebsites.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
- * @link http://www.healthywebsites.co.uk/
28
  */
29
  class HC_PayByFinance_StatusController extends Mage_Core_Controller_Front_Action
30
  {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
22
  *
23
  * @category HC
24
  * @package PayByFinance
25
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
26
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
27
+ * @link http://www.cohesiondigital.co.uk/
28
  */
29
  class HC_PayByFinance_StatusController extends Mage_Core_Controller_Front_Action
30
  {
app/code/local/HC/PayByFinance/etc/config.xml CHANGED
@@ -10,6 +10,11 @@
10
  <paybyfinance>
11
  <class>HC_PayByFinance_Block</class>
12
  </paybyfinance>
 
 
 
 
 
13
  </blocks>
14
 
15
  <helpers>
@@ -238,6 +243,46 @@
238
  </paybyfinance_status_referred>
239
  </observers>
240
  </paybyfinance_status_controller_referred>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  </events>
242
  <template>
243
  <email>
@@ -263,7 +308,19 @@
263
  </hc_paybyfinance_general_referred_email_guest>
264
  </email>
265
  </template>
266
-
 
 
 
 
 
 
 
 
 
 
 
 
267
  </global>
268
 
269
  <frontend>
10
  <paybyfinance>
11
  <class>HC_PayByFinance_Block</class>
12
  </paybyfinance>
13
+ <googleanalytics>
14
+ <rewrite>
15
+ <ga>HC_PayByFinance_Block_GoogleAnalytics_Ga</ga>
16
+ </rewrite>
17
+ </googleanalytics>
18
  </blocks>
19
 
20
  <helpers>
243
  </paybyfinance_status_referred>
244
  </observers>
245
  </paybyfinance_status_controller_referred>
246
+ <!-- Sagepay OrderStatus Initiator -->
247
+ <sales_order_payment_place_end>
248
+ <observers>
249
+ <hc_sagepay_orderstatus_initiator>
250
+ <class>paybyfinance/sagepayorderstatusobserver</class>
251
+ <method>salesOrderPaymentPlaceEnd</method>
252
+ </hc_sagepay_orderstatus_initiator>
253
+ </observers>
254
+ </sales_order_payment_place_end>
255
+ <sagepaysuite_get_configvalue_order_status>
256
+ <observers>
257
+ <hc_sagepaysuite_get_configvalue_order_status>
258
+ <type>singleton</type>
259
+ <class>paybyfinance/sagepayorderstatusobserver</class>
260
+ <method>sagepaysuiteGetConfigvalueOrderStatus</method>
261
+ </hc_sagepaysuite_get_configvalue_order_status>
262
+ </observers>
263
+ </sagepaysuite_get_configvalue_order_status>
264
+ <!-- /Sagepay OrderStatus Initiator -->
265
+
266
+ <!-- Sagepay PreAuth -->
267
+ <sagepaysuite_get_configvalue_payment_action>
268
+ <observers>
269
+ <hc_sagepaypreauth>
270
+ <type>singleton</type>
271
+ <class>paybyfinance/sagepaypreauthobserver</class>
272
+ <method>getPaymentAction</method>
273
+ </hc_sagepaypreauth>
274
+ </observers>
275
+ </sagepaysuite_get_configvalue_payment_action>
276
+ <sales_order_save_after>
277
+ <observers>
278
+ <hc_sagepaypreauth>
279
+ <type>singleton</type>
280
+ <class>paybyfinance/sagepaypreauthobserver</class>
281
+ <method>orderSaveAfter</method>
282
+ </hc_sagepaypreauth>
283
+ </observers>
284
+ </sales_order_save_after>
285
+ <!-- /Sagepay PreAuth -->
286
  </events>
287
  <template>
288
  <email>
308
  </hc_paybyfinance_general_referred_email_guest>
309
  </email>
310
  </template>
311
+ <pdf>
312
+ <totals>
313
+ <financeamount>
314
+ <title>Finance Amount</title>
315
+ <source_field>finance_amount</source_field>
316
+ <model>paybyfinance/sales_pdf_financeamount</model>
317
+ <amount_prefix>-</amount_prefix>
318
+ <font_size>7</font_size>
319
+ <display_zero>0</display_zero>
320
+ <sort_order>650</sort_order>
321
+ </financeamount>
322
+ </totals>
323
+ </pdf>
324
  </global>
325
 
326
  <frontend>
app/code/local/HC/PayByFinance/etc/system.xml CHANGED
@@ -163,6 +163,24 @@
163
  <show_in_website>1</show_in_website>
164
  <show_in_store>1</show_in_store>
165
  </declined_email_guest>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  </fields>
167
  </general>
168
  <order_status>
@@ -350,5 +368,24 @@
350
  </account>
351
  </groups>
352
  </hc_paybyfinance>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  </sections>
354
  </config>
163
  <show_in_website>1</show_in_website>
164
  <show_in_store>1</show_in_store>
165
  </declined_email_guest>
166
+ <sagepay_status_initiator>
167
+ <label>Enable Sagepay new orders custom status</label>
168
+ <frontend_type>select</frontend_type>
169
+ <source_model>adminhtml/system_config_source_yesno</source_model>
170
+ <sort_order>15</sort_order>
171
+ <show_in_default>1</show_in_default>
172
+ <show_in_website>1</show_in_website>
173
+ <show_in_store>1</show_in_store>
174
+ </sagepay_status_initiator>
175
+ <sagepay_preauth>
176
+ <label>Enable Sagepay preauth module</label>
177
+ <frontend_type>select</frontend_type>
178
+ <source_model>adminhtml/system_config_source_yesno</source_model>
179
+ <sort_order>16</sort_order>
180
+ <show_in_default>1</show_in_default>
181
+ <show_in_website>1</show_in_website>
182
+ <show_in_store>1</show_in_store>
183
+ </sagepay_preauth>
184
  </fields>
185
  </general>
186
  <order_status>
368
  </account>
369
  </groups>
370
  </hc_paybyfinance>
371
+
372
+ <sagepaysuite>
373
+ <groups>
374
+ <sagepayserver>
375
+ <fields>
376
+ <order_status_financed translate="label">
377
+ <label>New Order Status when Financed</label>
378
+ <frontend_type>select</frontend_type>
379
+ <config_path>payment/sagepayserver/order_status_financed</config_path>
380
+ <source_model>adminhtml/system_config_source_order_status</source_model>
381
+ <sort_order>30</sort_order>
382
+ <show_in_default>1</show_in_default>
383
+ <show_in_website>1</show_in_website>
384
+ <show_in_store>1</show_in_store>
385
+ </order_status_financed>
386
+ </fields>
387
+ </sagepayserver>
388
+ </groups>
389
+ </sagepaysuite>
390
  </sections>
391
  </config>
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-install-2.0.3.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.0-1.0.1.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.1-1.0.2.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.3-1.0.4.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.4-1.0.5.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.5-1.0.6.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.6-1.0.7.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-1.0.7-2.0.0.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-2.0.0-2.0.1.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-2.0.1-2.0.2.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/code/local/HC/PayByFinance/sql/paybyfinance_setup/mysql4-upgrade-2.0.2-2.0.3.php CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
  // @codingStandardsIgnoreFile
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
  // @codingStandardsIgnoreFile
app/design/frontend/base/default/template/paybyfinance/form.phtml CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
app/design/frontend/base/default/template/paybyfinance/selector.phtml CHANGED
@@ -8,10 +8,10 @@
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
- * @author Healthy Websites <support@healthywebsites.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
- * @link http://www.healthywebsites.co.uk/
15
  *
16
  */
17
 
@@ -64,7 +64,7 @@ $_secure = $this->getRequest()->isSecure();
64
  <div id="pbf-input-type-wrapper">
65
  </div>
66
 
67
- <p>I would like to pay over <span id="pbf-term-months" class="calculated"></span> months</p>
68
 
69
  <div id="pbf-input-term-wrapper">
70
  </div>
@@ -194,6 +194,8 @@ $_secure = $this->getRequest()->isSecure();
194
  $('pbf-deposit').update(value + "% = £" + currencyFormat(deposit));
195
  $('pbf-totalcredit').update("£" + currencyFormat(credit));
196
  $('pbf-term').update(service.term);
 
 
197
  $('pbf-term-months').update(service.term);
198
  $('pbf-monthly-payment').update('£' + currencyFormat(monthly));
199
  $('pbf-interestpayable').update('£' + currencyFormat(interestpayable));
@@ -458,7 +460,7 @@ $_secure = $this->getRequest()->isSecure();
458
  '<div id="pbf-types-slider" class="healthy-slider"> <div class="slider-marker"></div> <div class="slider-pointer"></div> </div>' +
459
  '<ul id="pbf-types-ruler" class="healthy-ruler">';
460
  for (index = 0; index < pbf_selector_data.types.length; ++index) {
461
- inputType += '<li style="width: '+(100/pbf_selector_data.types.length)+'%" onclick="javascript:pbf_type('+index+');" class="ruler ruler-'+index+'">'+selector_data.types[index].name+'</li>';
462
  };
463
  inputType += '</ul></div>';
464
  } else if (pbf_selector_data.types.length == 2) {
8
  *
9
  * @category HC
10
  * @package PayByFinance
11
+ * @author Cohesion Digital <support@cohesiondigital.co.uk>
12
  * @copyright 2014 Hitachi Capital
13
  * @license http://www.gnu.org/copyleft/gpl.html GPL License
14
+ * @link http://www.cohesiondigital.co.uk/
15
  *
16
  */
17
 
64
  <div id="pbf-input-type-wrapper">
65
  </div>
66
 
67
+ <p>I would like to pay over <span id="pbf-term-months" class="calculated"></span> months<span id="pbf-buy-now-pay-later-defered-part">, with the first payment deferred for <span id="pbf-defer-term-months" class="calculated"></span> months</span></p>
68
 
69
  <div id="pbf-input-term-wrapper">
70
  </div>
194
  $('pbf-deposit').update(value + "% = £" + currencyFormat(deposit));
195
  $('pbf-totalcredit').update("£" + currencyFormat(credit));
196
  $('pbf-term').update(service.term);
197
+ $('pbf-defer-term-months').update(service.defer_term);
198
+ (service.defer_term != 0) ? $('pbf-buy-now-pay-later-defered-part').show() : $('pbf-buy-now-pay-later-defered-part').hide();
199
  $('pbf-term-months').update(service.term);
200
  $('pbf-monthly-payment').update('£' + currencyFormat(monthly));
201
  $('pbf-interestpayable').update('£' + currencyFormat(interestpayable));
460
  '<div id="pbf-types-slider" class="healthy-slider"> <div class="slider-marker"></div> <div class="slider-pointer"></div> </div>' +
461
  '<ul id="pbf-types-ruler" class="healthy-ruler">';
462
  for (index = 0; index < pbf_selector_data.types.length; ++index) {
463
+ inputType += '<li style="width: '+(100/pbf_selector_data.types.length)+'%" onclick="javascript:pbf_type('+index+');" class="ruler ruler-'+index+'">'+pbf_selector_data.types[index].name+'</li>';
464
  };
465
  inputType += '</ul></div>';
466
  } else if (pbf_selector_data.types.length == 2) {
package.xml CHANGED
@@ -1,21 +1,24 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HC_PayByFinance</name>
4
- <version>2.0.3.1</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.healthywebsites.co.uk/license.html">Healthy Websites</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Hitachi Capital PaybyFinance</summary>
10
  <description>Hitachi Capital PaybyFinance</description>
11
  <notes>Change Log:&#xD;
12
- * HC-314 Add Order Number to Accepted Handback page when order has been referred and latter eSigned&#xD;
13
- * HC-318 PayPal Express totals issue&#xD;
14
- * HC-327 Text change on declined handback page</notes>
15
- <authors><author><name>Sandor Czettner</name><user>MAG000003395</user><email>support@healthywebsites.co.uk</email></author><author><name>Alistair Macneil</name><user>MAG000006529</user><email>support@healthywebsites.co.uk</email></author></authors>
16
- <date>2016-04-28</date>
17
- <time>13:46:25</time>
18
- <contents><target name="magelocal"><dir><dir name="HC"><dir name="PayByFinance"><dir name="Block"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="Redirect.php" hash="46d17d14a08b88ce3984c76cacb0e49b"/><dir name="Service"><dir name="Edit"><file name="Form.php" hash="795e6da10c09c6cdb0eb2b0efd12e411"/><dir name="Tab"><file name="Form.php" hash="0ed11d49291ab6e557e22d89f59cb8fc"/></dir><file name="Tabs.php" hash="6bae46296191ce6117cf451b33845632"/></dir><file name="Edit.php" hash="e2b8f8e008230c1422affde245deeece"/><file name="Grid.php" hash="74fb7091efc51541ba1a2e6c59ab6058"/></dir><file name="Service.php" hash="47c7ad1303dc525e3739e85d79916615"/></dir><file name="Version.php" hash="aef3da3ef0706887b6859b7752664059"/></dir><dir name="Checkout"><file name="Redirect.php" hash="3072817fc35701741a607735a258de49"/></dir><dir name="Product"><dir name="List"><file name="Finance.php" hash="d542ae3b6181d0d1fe7643a4466ecd71"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="2a21d61db9d09bc92f6c4e3f81e871e6"/></dir></dir><file name="Selector.php" hash="47a94d617091cd464be682b71700219f"/><file name="Status.php" hash="ae4550929cb48e2981f7840a345894b6"/></dir><dir name="Helper"><file name="Cart.php" hash="5239ec52b11e526c2a15f05326a9b37d"/><file name="Checkout.php" hash="49ea2ce9e12044122e83b9b8f43fea4c"/><file name="Data.php" hash="d807ff374018f6068227b907c8c6b5c1"/><file name="Notification.php" hash="98fde6b0ea89ba9c7930e3cabc34b38e"/><file name="Order.php" hash="2c4ba55568bec241db242b57a1f8b065"/></dir><dir name="Model"><file name="Calculator.php" hash="ae4d4769df38fea763035794cf5b8a40"/><dir name="Config"><dir name="Source"><dir name="Catalog"><dir name="Product"><file name="Finance.php" hash="6f56646346c6121b6aaccc423cfd330a"/><file name="Type.php" hash="bd01a8bb27db5be6121597a2eaaaa0cf"/></dir></dir><dir name="Cms"><file name="Block.php" hash="4d54ff32ae233accceade52ad4005574"/></dir><file name="Connectionmode.php" hash="bc52be78a5078dbfe2938873157cb31e"/><dir name="Notification"><file name="Status.php" hash="4511641cddc47b4db8ed5333304a1439"/></dir><file name="Type.php" hash="becda2eb287dc0bc9c5f969a4e1950b1"/></dir></dir><file name="Log.php" hash="4437d6a3f4952c52e0a67e970e4c8eef"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="085a5f4eb72fd3b29fe75a772214cfc2"/></dir><file name="Log.php" hash="a0bfe9246e61ff3aa3e3d6ed1960efc9"/><dir name="Service"><file name="Collection.php" hash="411e207c9d735b6e37c762961cf3bbd0"/></dir><file name="Service.php" hash="8b2e4a231760d07e27d40e4145489f61"/></dir><file name="Observer.php" hash="ed2d106fe31e744a205196eaa8bb7592"/><dir name="Paypal"><dir name="Api"><file name="Nvp.php" hash="950cb493ce6e1900f5544f508aab197f"/></dir><dir name="Hostedpro"><file name="Request.php" hash="07ac676c417b5e4602ae2ebc26427341"/></dir></dir><dir name="PaypalUk"><dir name="Api"><file name="Nvp.php" hash="c092fa84000a556a82ca6f4760af3846"/></dir></dir><dir name="Post"><file name="Abstract.php" hash="7cb555e3a22a1118a02c595b3e01b458"/><file name="Custom.php" hash="998ccd20956707a1d45bc30742226b16"/><file name="Live.php" hash="1ddf37b095e27247f02fdd21dded1e54"/><file name="Simulation.php" hash="2ce0770deb178de4f8961f5ade1ee61b"/><file name="Test.php" hash="840b56e78f0d71093922c0c4f1d2c805"/><file name="Unittest.php" hash="c22d91e13e7d302e006256d6c3248eb4"/></dir><file name="Post.php" hash="6d2af5168eb4ba208f286cadbd1de564"/><dir name="Resource"><file name="Setup.php" hash="154dffaca0a1715a08753b90c4731743"/></dir><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Financeamount.php" hash="068793f1e6aaf92f4da8c86e67a9515a"/></dir><dir name="Invoice"><file name="Financeamount.php" hash="0da6166c8d1340280f07064098993134"/></dir></dir><dir name="Quote"><file name="Financeamount.php" hash="2c11b5a46af769119d9037b5e76c36a9"/><file name="Totalcost.php" hash="fa08aacf2d0bf2945510aad2f7625758"/></dir></dir><file name="Service.php" hash="e1e0eff256c0c40ac297addf68fd3973"/><file name="Session.php" hash="6f109c5c5de35251c3d6ed68a9f3c0af"/><file name="Sessionobserver.php" hash="344cb8f8c76bc8632b51642e7e966c6b"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="RedirectController.php" hash="eb7d2255806e7ecf25c39057a4dee247"/><file name="ServiceController.php" hash="fa635b03cd56a48e1a6e381b452f9a95"/></dir></dir><file name="CheckoutController.php" hash="6417f5a1228ccb5dd63c75a51399491d"/><file name="NotificationController.php" hash="33cfa5afd08fd578ed34c3499971ed02"/><file name="SelectorController.php" hash="8c0f18485af6df6dd2743852adcac7cd"/><file name="SessionController.php" hash="2e4f3431884d71ecce27f6a7288e7141"/><file name="StatusController.php" hash="8ab4af6e411f0cbeb010a63d963baffd"/></dir><dir name="etc"><file name="adminhtml.xml" hash="216df222a5f5d9fdcf29c238cfd78bd5"/><file name="config.xml" hash="e0b8d8284127075b618bbc682c1605af"/><file name="system.xml" hash="ecaac3113b022066daa6ed947097b9d1"/></dir><dir name="sql"><dir name="paybyfinance_setup"><dir name="html"><file name="abandoned.html" hash="424f900dbddc267f7dac72e67752df25"/><file name="accepted.html" hash="3cd819649eeb88b108cfbd87d6bb5048"/><file name="declined.html" hash="ca4beeaacc626209d9884a2ed8adb6d0"/><file name="error.html" hash="4a448b052f101b2648dfe84423ad1313"/><file name="page-finance-options.html" hash="d9f090c84559caf2311cabced715b668"/><file name="referred.html" hash="1c143c51776357bcad9e27aff6e6b9b8"/></dir><file name="mysql4-install-2.0.3.php" hash="2daf803d3f4314bae8dc29180f0a1d15"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="bdd5aab92d29e9299856d306edaf5db4"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="77716f98afa803990b4799b9982ac1f0"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="212c52fe9f57f61cf523a403af291d40"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="63dd633ac9d5865a11b86a7a0142cb9e"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="b2ea39f14943faf5a9f28d832e5d4163"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="3b06173409d691611fa01bebdfb9f63a"/><file name="mysql4-upgrade-1.0.7-2.0.0.php" hash="8f4d3a81ad0b5270cb74d7bacb92d0a3"/><file name="mysql4-upgrade-2.0.0-2.0.1.php" hash="f67d2f936ac8eafa6844160148dc467b"/><file name="mysql4-upgrade-2.0.1-2.0.2.php" hash="c963e63fad7f14e59fbf8989cfcef88f"/><file name="mysql4-upgrade-2.0.2-2.0.3.php" hash="25f49f06e861e4b8cedbf3256c09c3d8"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="paybyfinance"><dir><dir name="catalog"><dir name="product"><dir name="list"><file name="finance.phtml" hash="fc9c4b43b09338aa33ba034b31508869"/></dir></dir></dir><dir name="sales"><dir name="order"><file name="totals.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir><file name="form.phtml" hash="6f583d5629e39fe564d4b86535242c7a"/><file name="selector-no.phtml" hash="b54c570f68254a2e879464a0b761c7db"/><file name="selector.phtml" hash="7a7107b302cf8eafe1714efb05f09e56"/><file name="status.phtml" hash="9e02cb668c470d72612bccc09e34c51a"/></dir><dir name="checkout"><dir name="cart"><file name="totals-pbf.phtml" hash="f14878e618aa3c8943f3728128aadaa6"/></dir><dir name="onepage"><dir name="review"><file name="info-pbf.phtml" hash="e4c7c70c798f1956ae7aaa5c09114fab"/><file name="totals-pbf.phtml" hash="f26e488359433c3814a1cd416006869a"/></dir></dir><file name="cart-pbf.phtml" hash="9f6b1873ed02e5e2ae1966e3e5a1910d"/></dir></dir><dir name="layout"><file name="paybyfinance.xml" hash="f541883d7e115794fcde3b0a4ac1bb3d"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="paybyfinance.xml" hash="21e409f98bd00b6de93a09610dabdbdd"/></dir><dir name="template"><dir name="paybyfinance"><file name="history.phtml" hash="31fbbbb8477717175da3de1e9fe98f54"/><file name="redirect.phtml" hash="90e7aa306768f5aac337300848c04e6a"/><file name="version.phtml" hash="09a8f416156d853ecc47b24a15744563"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="paybyfinance"><file name="checkout.js" hash="6930043a719765833f6d64de1216b7ad"/><file name="functions.js" hash="98c27381b3f7eaeaa845271dbe763f05"/><file name="slider.js" hash="16d83f4f0faa449276c926d2afac75fb"/></dir></dir><dir name="css"><file name="paybyfinance.css" hash="25d02dc5cf228662c30d908d7c2f1356"/><file name="paybyfinance-ie8.css" hash="a6be9c7af8b95300bc62e4fe9ef252ac"/></dir><dir name="images"><dir name="paybyfinance"><file name="bullet.png" hash="ea2baab34b2eb7d0aacb7a67d5b080f1"/><file name="pointer-toggle.png" hash="e661d42aed7a5562f75828312c7a635a"/><file name="pointer.png" hash="68c58b28d6ebd77d415f8666c301a199"/><file name="progress.png" hash="6d46a109cc9e38a663678918142d89f2"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="HC_PayByFinance.xml" hash="58a12daf6bb6aeb8b94471bf605514e5"/></dir></dir></target><target name="mageweb"><dir><dir name="js"><dir name="paybyfinance"><file name="config-edit.js" hash="81817d23afdf99d10b01072d2471ff65"/><file name="service.js" hash="7e1fe3ffe2d4b95eeb5b27c8d07b23f1"/></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><dir name="template"><dir name="email"><dir name="paybyfinance"><file name="order_declined.html" hash="9172511234c33a8e4e78b581064ed1b3"/><file name="order_declined_guest.html" hash="081da356703cf09ce13a86dfce1ab00b"/><file name="order_referred.html" hash="91468313c16e7d8b821d90a954ecaedb"/><file name="order_referred_guest.html" hash="b0c08ecba679a99ad23064649fb6e48d"/></dir></dir></dir></dir></dir></target></contents>
 
 
 
19
  <compatible/>
20
- <dependencies><required><php><min>5.4.45</min><max>7.0.5</max></php></required></dependencies>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>HC_PayByFinance</name>
4
+ <version>2.0.3.2</version>
5
  <stability>stable</stability>
6
+ <license uri="http://www.cohesiondigital.co.uk/license.html">Cohesion Digital</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Hitachi Capital PaybyFinance</summary>
10
  <description>Hitachi Capital PaybyFinance</description>
11
  <notes>Change Log:&#xD;
12
+ * HC-316 PBF Widget Displays For Non-Eligible Products&#xD;
13
+ * HC-345 - Adding Google analytics override - sending grand total + financed amount to GA&#xD;
14
+ * HC-349 SagePay status initiator&#xD;
15
+ * HC-444 Financed amount added to invoice PDF&#xD;
16
+ * HC-443 Adding new service types 25, 36 refactored&#xD;
17
+ * HC-448 rounding issues fixed</notes>
18
+ <authors><author><name>Sandor Czettner</name><user>MAG000003395</user><email>support@cohesiondigital.co.uk</email></author><author><name>Alistair Macneil</name><user>MAG000006529</user><email>support@cohesiondigital.co.uk</email></author></authors>
19
+ <date>2016-08-24</date>
20
+ <time>13:26:47</time>
21
+ <contents><target name="magelocal"><dir><dir name="HC"><dir name="PayByFinance"><dir name="Block"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="Redirect.php" hash="b1a5a3282c17ff6b693346fffc42afbb"/><dir name="Service"><dir name="Edit"><file name="Form.php" hash="9c217d9723cccb39fa599424027d40f0"/><dir name="Tab"><file name="Form.php" hash="2b6a9e88fef570d5316adb3d92bff462"/></dir><file name="Tabs.php" hash="8d1c62bfa212b4d1670599e25449b112"/></dir><file name="Edit.php" hash="7c2216bd809b703b2823f0b38949e4d0"/><file name="Grid.php" hash="1c88aefe5409ec49c8a9a1229ff3e5f6"/></dir><file name="Service.php" hash="13fc20c6ca7d4e2f136086700f6bca85"/></dir><file name="Version.php" hash="1e7c02fd2eb594a731ede278abfcbdbe"/></dir><dir name="Checkout"><file name="Redirect.php" hash="a1e7a9fff08b4843a95c7cd3811746ec"/></dir><dir name="GoogleAnalytics"><file name="Ga.php" hash="4ec9f0261559c47972b3a1b07db301af"/></dir><dir name="Product"><dir name="List"><file name="Finance.php" hash="7bf4a6a47e278f1ea0bd0d148e52040a"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="846e2cbee5f5c2106fa635bc3af5151a"/></dir></dir><file name="Selector.php" hash="670c5b4dba5f4a7d4e55fca9d7be55bb"/><file name="Status.php" hash="9a6b5acb2773cf9eefe01eff2cc65b08"/></dir><dir name="Helper"><file name="Cart.php" hash="ab80a789969c53421442e3104c9ced3a"/><file name="Checkout.php" hash="d7e514d70e300738cae7f54ee6ca5da6"/><file name="Data.php" hash="6f018fc2f3bafa7bb99d963129327c83"/><file name="Notification.php" hash="286fcaa4a79f53acbb0f78589f95ea72"/><file name="Order.php" hash="4b294819840ab1bbef3f5469b8deac55"/></dir><dir name="Model"><file name="Calculator.php" hash="d5745f6ca22367bb9cb59bfd74c9e340"/><dir name="Config"><dir name="Source"><dir name="Catalog"><dir name="Product"><file name="Finance.php" hash="a2e1bfb4bacc16a2d1813cdaf67118ca"/><file name="Type.php" hash="95ebea7de54ef5caf05bc8f8535a86c4"/></dir></dir><dir name="Cms"><file name="Block.php" hash="2276b4b94773469b57c42fd355772666"/></dir><file name="Connectionmode.php" hash="a02a3f398069cf0227a4bf90c8aa6a1b"/><dir name="Notification"><file name="Status.php" hash="6a2033c6223f3e4b544646e92d3f7f21"/></dir><file name="Type.php" hash="aa6535b3c8a3fbd7af9e2d0191cf591c"/></dir></dir><file name="Log.php" hash="3f0a884ccb9b13b82d83690edfe4daa3"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="28946dde732dabe2c8cffe9ba948a79b"/></dir><file name="Log.php" hash="d05d1d95c0d8e2dad48ef0234d877844"/><dir name="Service"><file name="Collection.php" hash="95bc7c6832c807f45a3ad49c891dd61a"/></dir><file name="Service.php" hash="2f66d8f5bbc15065df0e5fe7760e2175"/></dir><file name="Observer.php" hash="2f3e3ffb8a8ffaeafcbff7d0baeefbcb"/><dir name="Paypal"><dir name="Api"><file name="Nvp.php" hash="e307da78b7755ee2b71ef89649f40ae0"/></dir><dir name="Hostedpro"><file name="Request.php" hash="356e602372e486f330364bd3aa102746"/></dir></dir><dir name="PaypalUk"><dir name="Api"><file name="Nvp.php" hash="b63aaa54fbd3ecf7a30b3db81d41ee53"/></dir></dir><dir name="Post"><file name="Abstract.php" hash="0a123f79e8d1c1f27790d409d8b6682e"/><file name="Custom.php" hash="a2b21633bd01d33d9e9616fc6bc2d223"/><file name="Live.php" hash="7ed8e80ca96e53659458adb00938e46c"/><file name="Simulation.php" hash="eae556a5a59d74e0368a05768ccb944d"/><file name="Test.php" hash="0db4044ae854f523a5c4f1202ed6f165"/><file name="Unittest.php" hash="772145018592848e056a555fdeeacdae"/></dir><file name="Post.php" hash="2f481a71a8e4cbb9aa5d73cdd513ec4c"/><dir name="Resource"><file name="Setup.php" hash="4dbb9a07366ad69523865f51956efcb6"/></dir><file name="Sagepayorderstatusobserver.php" hash="a9d54ecbeb5ef71c0bb918c8fdb35f17"/><file name="Sagepaypreauthobserver.php" hash="eaa3b9c77f3821ac1c90787f927f5e25"/><dir name="Sales"><dir name="Order"><dir name="Creditmemo"><file name="Financeamount.php" hash="c49db1b930b78fa3928b2e7a70d1b355"/></dir><dir name="Invoice"><file name="Financeamount.php" hash="9a56f44465d76558fc729bdad8b97d3d"/></dir></dir><dir name="Pdf"><file name="Financeamount.php" hash="f74ff339b26d935340f3db88e41b230c"/></dir><dir name="Quote"><file name="Financeamount.php" hash="5164b3b7b63bc0f827bccacbc5b8dbfc"/><file name="Totalcost.php" hash="ef8e0846f5ec1074db593b84e8f2d113"/></dir></dir><file name="Service.php" hash="4da5316f9e4c61d6e9355d9c75ce852f"/><file name="Session.php" hash="7777988357a7bef6740d3dfd54d24b7d"/><file name="Sessionobserver.php" hash="09b8393d916ab0fb9f9729d2b8cb0d14"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Paybyfinance"><file name="RedirectController.php" hash="311b1e97e6d9ee0c163748d577c3ca0f"/><file name="ServiceController.php" hash="51114686983b9354b5f6dde2f08d7242"/></dir></dir><file name="CheckoutController.php" hash="e91a9189e4f2e5aeb049d030f67fff7f"/><file name="NotificationController.php" hash="5a55000d2b3907938cd2e5a5a09139bf"/><file name="SelectorController.php" hash="60ac94f197c3d371821bf26faa01665b"/><file name="SessionController.php" hash="9e10f8ccfe4a44c7df656dd3be0a7905"/><file name="StatusController.php" hash="a67d6acd7ef820aff069417deabe2779"/></dir><dir name="etc"><file name="adminhtml.xml" hash="216df222a5f5d9fdcf29c238cfd78bd5"/><file name="config.xml" hash="4c468f64fab27c49742e3304d5103884"/><file name="system.xml" hash="1c1c4b6c3e47544b95c34529065eb16d"/></dir><dir name="sql"><dir name="paybyfinance_setup"><dir name="html"><file name="abandoned.html" hash="424f900dbddc267f7dac72e67752df25"/><file name="accepted.html" hash="3cd819649eeb88b108cfbd87d6bb5048"/><file name="declined.html" hash="ca4beeaacc626209d9884a2ed8adb6d0"/><file name="error.html" hash="4a448b052f101b2648dfe84423ad1313"/><file name="page-finance-options.html" hash="d9f090c84559caf2311cabced715b668"/><file name="referred.html" hash="1c143c51776357bcad9e27aff6e6b9b8"/></dir><file name="mysql4-install-2.0.3.php" hash="b01b14d96ed60b0bb02e90878d413a18"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="abc677821714cfc594756f28c923024c"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="7dce9b7e8f4546e7ae648db0dd839076"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="dedd19c542e499d41cbd396e932ced4d"/><file name="mysql4-upgrade-1.0.4-1.0.5.php" hash="48f066bd17de65403b3d2c84123abe67"/><file name="mysql4-upgrade-1.0.5-1.0.6.php" hash="6e50fbb54fc11db7a2daf6162ce25117"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="fd6af4ef0e098c51f617ac0ca085c738"/><file name="mysql4-upgrade-1.0.7-2.0.0.php" hash="9a89d49d50768f895d782cc4c815b5c9"/><file name="mysql4-upgrade-2.0.0-2.0.1.php" hash="6396a705f6bc25a6c2c2637eb7fee1c1"/><file name="mysql4-upgrade-2.0.1-2.0.2.php" hash="4c0ba4904b9ff656f31466fcbdd7f186"/><file name="mysql4-upgrade-2.0.2-2.0.3.php" hash="5876324f8e06f4b458ac0256bc94d8c5"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="paybyfinance"><dir><dir name="catalog"><dir name="product"><dir name="list"><file name="finance.phtml" hash="fc9c4b43b09338aa33ba034b31508869"/></dir></dir></dir><dir name="sales"><dir name="order"><file name="totals.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir><file name="form.phtml" hash="6f078931f66302a6a0a566c7a4055c05"/><file name="selector-no.phtml" hash="b54c570f68254a2e879464a0b761c7db"/><file name="selector.phtml" hash="5d61200bd80ffc1b1cd8f1195717bb11"/><file name="status.phtml" hash="9e02cb668c470d72612bccc09e34c51a"/></dir><dir name="checkout"><dir name="cart"><file name="totals-pbf.phtml" hash="f14878e618aa3c8943f3728128aadaa6"/></dir><dir name="onepage"><dir name="review"><file name="info-pbf.phtml" hash="e4c7c70c798f1956ae7aaa5c09114fab"/><file name="totals-pbf.phtml" hash="f26e488359433c3814a1cd416006869a"/></dir></dir><file name="cart-pbf.phtml" hash="9f6b1873ed02e5e2ae1966e3e5a1910d"/></dir></dir><dir name="layout"><file name="paybyfinance.xml" hash="f541883d7e115794fcde3b0a4ac1bb3d"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="paybyfinance.xml" hash="21e409f98bd00b6de93a09610dabdbdd"/></dir><dir name="template"><dir name="paybyfinance"><file name="history.phtml" hash="31fbbbb8477717175da3de1e9fe98f54"/><file name="redirect.phtml" hash="90e7aa306768f5aac337300848c04e6a"/><file name="version.phtml" hash="09a8f416156d853ecc47b24a15744563"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="paybyfinance"><file name="checkout.js" hash="6930043a719765833f6d64de1216b7ad"/><file name="functions.js" hash="98c27381b3f7eaeaa845271dbe763f05"/><file name="slider.js" hash="16d83f4f0faa449276c926d2afac75fb"/></dir></dir><dir name="css"><file name="paybyfinance.css" hash="25d02dc5cf228662c30d908d7c2f1356"/><file name="paybyfinance-ie8.css" hash="a6be9c7af8b95300bc62e4fe9ef252ac"/></dir><dir name="images"><dir name="paybyfinance"><file name="bullet.png" hash="ea2baab34b2eb7d0aacb7a67d5b080f1"/><file name="pointer-toggle.png" hash="e661d42aed7a5562f75828312c7a635a"/><file name="pointer.png" hash="68c58b28d6ebd77d415f8666c301a199"/><file name="progress.png" hash="6d46a109cc9e38a663678918142d89f2"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="HC_PayByFinance.xml" hash="58a12daf6bb6aeb8b94471bf605514e5"/></dir></dir></target><target name="mageweb"><dir><dir name="js"><dir name="paybyfinance"><file name="config-edit.js" hash="81817d23afdf99d10b01072d2471ff65"/><file name="service.js" hash="7e1fe3ffe2d4b95eeb5b27c8d07b23f1"/></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_US"><dir name="template"><dir name="email"><dir name="paybyfinance"><file name="order_declined.html" hash="9172511234c33a8e4e78b581064ed1b3"/><file name="order_declined_guest.html" hash="081da356703cf09ce13a86dfce1ab00b"/><file name="order_referred.html" hash="91468313c16e7d8b821d90a954ecaedb"/><file name="order_referred_guest.html" hash="b0c08ecba679a99ad23064649fb6e48d"/></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
+ <dependencies><required><php><min>5.6.24</min><max>7.0.9</max></php></required></dependencies>
24
  </package>